From: Andrea Amorese
Date: Fri, 10 Sep 2021 14:49:08 +0000 (+0200)
Subject: Built motion from commit c220d7c5.|2.5.34
X-Git-Url: http://repos.xcallymotion.com/base/%22./banner.jpg/%22my-avatar.png//%22?a=commitdiff_plain;h=be419dbe21ee6e455c781db38e570bdb1f2bbacb;p=motion2.git
Built motion from commit c220d7c5.|2.5.34
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 6378689..822953c 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-09-10T14:24:25.812Z",
+ "time": "2021-09-10T14:37:38.822Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 0468723..e34b4b2 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-10T14:24:25.812Z",
+ "time": "2021-09-10T14:37:38.822Z",
"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 d12b1d9..acb1ac5 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 _0x1dcc=['action','contactManager','integration','motionbar','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL'];(function(_0x24ec05,_0x5cd9c6){var _0x25c518=function(_0x212040){while(--_0x212040){_0x24ec05['push'](_0x24ec05['shift']());}};_0x25c518(++_0x5cd9c6);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x1d0a4d,_0x4247ff){_0x1d0a4d=_0x1d0a4d-0x0;var _0x19ac91=_0x1dcc[_0x1d0a4d];return _0x19ac91;};'use strict';var Sequelize=require(_0xc1dc('0x0'));module[_0xc1dc('0x1')]={'name':{'type':Sequelize[_0xc1dc('0x2')],'get':function(_0x151f37){return this['getDataValue'](_0xc1dc('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xc1dc('0x4'),_0xc1dc('0x5'),_0xc1dc('0x6'),'jscripty','urlForward',_0xc1dc('0x7'),_0xc1dc('0x8'),_0xc1dc('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xc1dc('0xa')},'data1':{'type':Sequelize[_0xc1dc('0xb')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xc1dc('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xc1dc('0xb')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xc1dc('0xb')](0x1000),'comments':_0xc1dc('0xc')},'data5':{'type':Sequelize[_0xc1dc('0xb')](0x1000),'comments':_0xc1dc('0xd')},'data6':{'type':Sequelize[_0xc1dc('0xb')],'comments':_0xc1dc('0xe')},'data7':{'type':Sequelize[_0xc1dc('0xf')],'comments':_0xc1dc('0x10')}};
\ No newline at end of file
+var _0x84e7=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth]'];(function(_0xcad9e7,_0x255d6f){var _0x170a86=function(_0x38bc38){while(--_0x38bc38){_0xcad9e7['push'](_0xcad9e7['shift']());}};_0x170a86(++_0x255d6f);}(_0x84e7,0x122));var _0x784e=function(_0x122ef8,_0x3a0c24){_0x122ef8=_0x122ef8-0x0;var _0xe8424f=_0x84e7[_0x122ef8];return _0xe8424f;};'use strict';var Sequelize=require('sequelize');module[_0x784e('0x0')]={'name':{'type':Sequelize[_0x784e('0x1')],'get':function(_0x5861e2){return this[_0x784e('0x2')](_0x784e('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x784e('0x4'),_0x784e('0x5'),_0x784e('0x6'),_0x784e('0x7'),_0x784e('0x8'),_0x784e('0x9'),'bot',_0x784e('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x784e('0xb')},'data1':{'type':Sequelize[_0x784e('0xc')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x784e('0xc')](0x1000),'comment':_0x784e('0xd')},'data3':{'type':Sequelize[_0x784e('0xc')](0x1000),'comment':_0x784e('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x784e('0xc')](0x1000),'comments':_0x784e('0xf')},'data6':{'type':Sequelize[_0x784e('0xc')],'comments':_0x784e('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0x784e('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index d9e4a8c..86447a6 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 _0xc81d=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x2c5e42,_0x9b8c6a){var _0x840fde=function(_0x169c4e){while(--_0x169c4e){_0x2c5e42['push'](_0x2c5e42['shift']());}};_0x840fde(++_0x9b8c6a);}(_0xc81d,0x1e4));var _0xdc81=function(_0x4e16c9,_0x541601){_0x4e16c9=_0x4e16c9-0x0;var _0xd423e5=_0xc81d[_0x4e16c9];return _0xd423e5;};'use strict';var emlformat=require(_0xdc81('0x0'));var rimraf=require(_0xdc81('0x1'));var zipdir=require(_0xdc81('0x2'));var jsonpatch=require(_0xdc81('0x3'));var rp=require(_0xdc81('0x4'));var moment=require(_0xdc81('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdc81('0x6'));var sox=require(_0xdc81('0x7'));var csv=require(_0xdc81('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc81('0x9'));var squel=require(_0xdc81('0xa'));var crypto=require(_0xdc81('0xb'));var jsforce=require(_0xdc81('0xc'));var deskjs=require(_0xdc81('0xd'));var toCsv=require(_0xdc81('0x8'));var querystring=require(_0xdc81('0xe'));var Papa=require(_0xdc81('0xf'));var Redis=require(_0xdc81('0x10'));var authService=require(_0xdc81('0x11'));var qs=require(_0xdc81('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdc81('0x13'));var logger=require(_0xdc81('0x14'))(_0xdc81('0x15'));var utils=require('../../config/utils');var config=require(_0xdc81('0x16'));var licenseUtil=require(_0xdc81('0x17'));var db=require(_0xdc81('0x18'))['db'];function respondWithStatusCode(_0x543ac8,_0x25d878){_0x25d878=_0x25d878||0xcc;return function(_0xda27b){if(_0xda27b){return _0x543ac8[_0xdc81('0x19')](_0x25d878);}return _0x543ac8['status'](_0x25d878)['end']();};}function respondWithResult(_0x40e515,_0x103ec1){_0x103ec1=_0x103ec1||0xc8;return function(_0x794799){if(_0x794799){return _0x40e515[_0xdc81('0x1a')](_0x103ec1)[_0xdc81('0x1b')](_0x794799);}};}function respondWithFilteredResult(_0x37381a,_0x570176){return function(_0x4888b8){if(_0x4888b8){var _0x3209fa=typeof _0x570176['offset']==='undefined'&&typeof _0x570176['limit']==='undefined';var _0x3c8b82=_0x4888b8[_0xdc81('0x1c')];var _0x29d017=_0x3209fa?0x0:_0x570176[_0xdc81('0x1d')];var _0x5fdf1=_0x3209fa?_0x4888b8[_0xdc81('0x1c')]:_0x570176[_0xdc81('0x1d')]+_0x570176['limit'];var _0x45610a;if(_0x5fdf1>=_0x3c8b82){_0x5fdf1=_0x3c8b82;_0x45610a=0xc8;}else{_0x45610a=0xce;}_0x37381a[_0xdc81('0x1a')](_0x45610a);return _0x37381a[_0xdc81('0x1e')](_0xdc81('0x1f'),_0x29d017+'-'+_0x5fdf1+'/'+_0x3c8b82)['json'](_0x4888b8);}return null;};}function patchUpdates(_0x4f914e){return function(_0x3fccfc){try{jsonpatch[_0xdc81('0x20')](_0x3fccfc,_0x4f914e,!![]);}catch(_0x5cb9e5){return BPromise['reject'](_0x5cb9e5);}return _0x3fccfc[_0xdc81('0x21')]();};}function saveUpdates(_0x3724b,_0x3b3a7c){return function(_0x2e0833){if(_0x2e0833){return _0x2e0833[_0xdc81('0x22')](_0x3724b)['then'](function(_0x785990){return _0x785990;});}return null;};}function removeEntity(_0x3179eb,_0x121492){return function(_0x28fd35){if(_0x28fd35){return _0x28fd35[_0xdc81('0x23')]()[_0xdc81('0x24')](function(){_0x3179eb[_0xdc81('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51462a,_0x3b600f){return function(_0xb021df){if(!_0xb021df){_0x51462a[_0xdc81('0x19')](0x194);}return _0xb021df;};}function handleError(_0x492b28,_0x36d503){_0x36d503=_0x36d503||0x1f4;return function(_0x540375){logger[_0xdc81('0x25')](_0x540375[_0xdc81('0x26')]);if(_0x540375[_0xdc81('0x27')]){delete _0x540375[_0xdc81('0x27')];}_0x492b28[_0xdc81('0x1a')](_0x36d503)[_0xdc81('0x28')](_0x540375);};}exports[_0xdc81('0x22')]=function(_0x5a52e0,_0x3815a8){if(_0x5a52e0[_0xdc81('0x29')]['id']){delete _0x5a52e0[_0xdc81('0x29')]['id'];}return db[_0xdc81('0x2a')][_0xdc81('0x2b')]({'where':{'id':_0x5a52e0[_0xdc81('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3815a8,null))['then'](saveUpdates(_0x5a52e0[_0xdc81('0x29')],null))[_0xdc81('0x24')](respondWithResult(_0x3815a8,null))[_0xdc81('0x2d')](handleError(_0x3815a8,null));};exports[_0xdc81('0x23')]=function(_0xa76d20,_0x200b5e){return db[_0xdc81('0x2a')][_0xdc81('0x2b')]({'where':{'id':_0xa76d20[_0xdc81('0x2c')]['id']}})['then'](handleEntityNotFound(_0x200b5e,null))[_0xdc81('0x24')](removeEntity(_0x200b5e,null))[_0xdc81('0x2d')](handleError(_0x200b5e,null));};
\ No newline at end of file
+var _0xb3dc=['set','Content-Range','apply','save','update','destroy','then','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x78f3c6,_0x3def49){var _0xce4ed3=function(_0x33d1a7){while(--_0x33d1a7){_0x78f3c6['push'](_0x78f3c6['shift']());}};_0xce4ed3(++_0x3def49);}(_0xb3dc,0x197));var _0xcb3d=function(_0x39e4b6,_0x418f43){_0x39e4b6=_0x39e4b6-0x0;var _0x2a710c=_0xb3dc[_0x39e4b6];return _0x2a710c;};'use strict';var emlformat=require(_0xcb3d('0x0'));var rimraf=require(_0xcb3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb3d('0x2'));var rp=require('request-promise');var moment=require(_0xcb3d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcb3d('0x4'));var util=require(_0xcb3d('0x5'));var path=require('path');var sox=require(_0xcb3d('0x6'));var csv=require(_0xcb3d('0x7'));var ejs=require(_0xcb3d('0x8'));var fs=require('fs');var fs_extra=require(_0xcb3d('0x9'));var _=require('lodash');var squel=require(_0xcb3d('0xa'));var crypto=require(_0xcb3d('0xb'));var jsforce=require(_0xcb3d('0xc'));var deskjs=require(_0xcb3d('0xd'));var toCsv=require(_0xcb3d('0x7'));var querystring=require(_0xcb3d('0xe'));var Papa=require(_0xcb3d('0xf'));var Redis=require(_0xcb3d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcb3d('0x11'));var as=require(_0xcb3d('0x12'));var hardwareService=require(_0xcb3d('0x13'));var logger=require(_0xcb3d('0x14'))(_0xcb3d('0x15'));var utils=require(_0xcb3d('0x16'));var config=require(_0xcb3d('0x17'));var licenseUtil=require(_0xcb3d('0x18'));var db=require(_0xcb3d('0x19'))['db'];function respondWithStatusCode(_0x443b46,_0x100bbd){_0x100bbd=_0x100bbd||0xcc;return function(_0x1f6f54){if(_0x1f6f54){return _0x443b46[_0xcb3d('0x1a')](_0x100bbd);}return _0x443b46[_0xcb3d('0x1b')](_0x100bbd)[_0xcb3d('0x1c')]();};}function respondWithResult(_0x3b7412,_0x538677){_0x538677=_0x538677||0xc8;return function(_0xe8a4df){if(_0xe8a4df){return _0x3b7412[_0xcb3d('0x1b')](_0x538677)[_0xcb3d('0x1d')](_0xe8a4df);}};}function respondWithFilteredResult(_0x36bb61,_0x552fe7){return function(_0x983c8){if(_0x983c8){var _0x4d1182=typeof _0x552fe7[_0xcb3d('0x1e')]===_0xcb3d('0x1f')&&typeof _0x552fe7[_0xcb3d('0x20')]===_0xcb3d('0x1f');var _0x481a16=_0x983c8[_0xcb3d('0x21')];var _0x343724=_0x4d1182?0x0:_0x552fe7[_0xcb3d('0x1e')];var _0x410470=_0x4d1182?_0x983c8[_0xcb3d('0x21')]:_0x552fe7['offset']+_0x552fe7[_0xcb3d('0x20')];var _0x10e5ca;if(_0x410470>=_0x481a16){_0x410470=_0x481a16;_0x10e5ca=0xc8;}else{_0x10e5ca=0xce;}_0x36bb61[_0xcb3d('0x1b')](_0x10e5ca);return _0x36bb61[_0xcb3d('0x22')](_0xcb3d('0x23'),_0x343724+'-'+_0x410470+'/'+_0x481a16)[_0xcb3d('0x1d')](_0x983c8);}return null;};}function patchUpdates(_0x22f196){return function(_0x36eb5c){try{jsonpatch[_0xcb3d('0x24')](_0x36eb5c,_0x22f196,!![]);}catch(_0x1ecca1){return BPromise['reject'](_0x1ecca1);}return _0x36eb5c[_0xcb3d('0x25')]();};}function saveUpdates(_0x38fe8d,_0x2e2d29){return function(_0x27bbc0){if(_0x27bbc0){return _0x27bbc0[_0xcb3d('0x26')](_0x38fe8d)['then'](function(_0x110ed6){return _0x110ed6;});}return null;};}function removeEntity(_0x285ed2,_0x31bafd){return function(_0x2dcfb3){if(_0x2dcfb3){return _0x2dcfb3[_0xcb3d('0x27')]()[_0xcb3d('0x28')](function(){_0x285ed2['status'](0xcc)[_0xcb3d('0x1c')]();});}};}function handleEntityNotFound(_0x1274fa,_0x4bec68){return function(_0x4c1968){if(!_0x4c1968){_0x1274fa[_0xcb3d('0x1a')](0x194);}return _0x4c1968;};}function handleError(_0x179be2,_0x17aa95){_0x17aa95=_0x17aa95||0x1f4;return function(_0x3e3cb2){logger['error'](_0x3e3cb2[_0xcb3d('0x29')]);if(_0x3e3cb2[_0xcb3d('0x2a')]){delete _0x3e3cb2[_0xcb3d('0x2a')];}_0x179be2['status'](_0x17aa95)[_0xcb3d('0x2b')](_0x3e3cb2);};}exports[_0xcb3d('0x26')]=function(_0x448871,_0x759b00){if(_0x448871[_0xcb3d('0x2c')]['id']){delete _0x448871[_0xcb3d('0x2c')]['id'];}return db[_0xcb3d('0x2d')][_0xcb3d('0x2e')]({'where':{'id':_0x448871[_0xcb3d('0x2f')]['id']}})['then'](handleEntityNotFound(_0x759b00,null))[_0xcb3d('0x28')](saveUpdates(_0x448871[_0xcb3d('0x2c')],null))[_0xcb3d('0x28')](respondWithResult(_0x759b00,null))[_0xcb3d('0x30')](handleError(_0x759b00,null));};exports[_0xcb3d('0x27')]=function(_0x5ca28f,_0x54a02a){return db[_0xcb3d('0x2d')][_0xcb3d('0x2e')]({'where':{'id':_0x5ca28f[_0xcb3d('0x2f')]['id']}})[_0xcb3d('0x28')](handleEntityNotFound(_0x54a02a,null))[_0xcb3d('0x28')](removeEntity(_0x54a02a,null))[_0xcb3d('0x30')](handleError(_0x54a02a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 6449657..6210733 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 _0x24aa=['Action','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x11df98,_0x55313e){var _0x3d313a=function(_0xd50dc7){while(--_0xd50dc7){_0x11df98['push'](_0x11df98['shift']());}};_0x3d313a(++_0x55313e);}(_0x24aa,0x91));var _0xa24a=function(_0x3262bf,_0x4fb17d){_0x3262bf=_0x3262bf-0x0;var _0x20da0a=_0x24aa[_0x3262bf];return _0x20da0a;};'use strict';var _=require(_0xa24a('0x0'));var util=require(_0xa24a('0x1'));var logger=require(_0xa24a('0x2'))('api');var moment=require(_0xa24a('0x3'));var BPromise=require(_0xa24a('0x4'));var rp=require(_0xa24a('0x5'));var fs=require('fs');var path=require(_0xa24a('0x6'));var rimraf=require(_0xa24a('0x7'));var config=require(_0xa24a('0x8'));var attributes=require(_0xa24a('0x9'));module['exports']=function(_0x3d1fd3,_0x428ef5){return _0x3d1fd3[_0xa24a('0xa')](_0xa24a('0xb'),attributes,{'tableName':_0xa24a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a48=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','lodash'];(function(_0x810f5a,_0x5ec240){var _0x20caf3=function(_0x4f8c15){while(--_0x4f8c15){_0x810f5a['push'](_0x810f5a['shift']());}};_0x20caf3(++_0x5ec240);}(_0x9a48,0xa4));var _0x89a4=function(_0x13bea0,_0x210a0c){_0x13bea0=_0x13bea0-0x0;var _0x3f12df=_0x9a48[_0x13bea0];return _0x3f12df;};'use strict';var _=require(_0x89a4('0x0'));var util=require(_0x89a4('0x1'));var logger=require('../../config/logger')(_0x89a4('0x2'));var moment=require(_0x89a4('0x3'));var BPromise=require(_0x89a4('0x4'));var rp=require(_0x89a4('0x5'));var fs=require('fs');var path=require(_0x89a4('0x6'));var rimraf=require(_0x89a4('0x7'));var config=require(_0x89a4('0x8'));var attributes=require(_0x89a4('0x9'));module[_0x89a4('0xa')]=function(_0xd39f4d,_0x47be90){return _0xd39f4d['define']('Action',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 16ffbad..50ebbf2 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 _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x241fc7,_0x56c119){var _0xb751c1=function(_0x44d2a6){while(--_0x44d2a6){_0x241fc7['push'](_0x241fc7['shift']());}};_0xb751c1(++_0x56c119);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3003fc,_0x5ac5de){_0x3003fc=_0x3003fc-0x0;var _0x22cb43=_0x7fbe[_0x3003fc];return _0x22cb43;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x137c8e,_0x298b3){_0x137c8e=_0x137c8e-0x0;var _0x21cc69=_0x7a54[_0x137c8e];return _0x21cc69;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 546ae1f..ddd7900 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 _0x0093=['./action.controller','put','isAuthenticated','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0093,0x1d7));var _0x3009=function(_0x157ace,_0x184c29){_0x157ace=_0x157ace-0x0;var _0x4f28e1=_0x0093[_0x157ace];return _0x4f28e1;};'use strict';var multer=require(_0x3009('0x0'));var util=require(_0x3009('0x1'));var path=require(_0x3009('0x2'));var timeout=require(_0x3009('0x3'));var express=require(_0x3009('0x4'));var router=express[_0x3009('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3009('0x6'));var interaction=require(_0x3009('0x7'));var config=require(_0x3009('0x8'));var controller=require(_0x3009('0x9'));router[_0x3009('0xa')]('/:id',auth[_0x3009('0xb')](),controller['update']);router[_0x3009('0xc')](_0x3009('0xd'),auth[_0x3009('0xb')](),controller[_0x3009('0xe')]);module[_0x3009('0xf')]=router;
\ No newline at end of file
+var _0x7eb5=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','delete','/:id','isAuthenticated'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0x7eb5,0x13d));var _0x57eb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7eb5[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x57eb('0x0'));var path=require(_0x57eb('0x1'));var timeout=require(_0x57eb('0x2'));var express=require(_0x57eb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x57eb('0x4'));var interaction=require(_0x57eb('0x5'));var config=require(_0x57eb('0x6'));var controller=require(_0x57eb('0x7'));router[_0x57eb('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x57eb('0x9')]);router[_0x57eb('0xa')](_0x57eb('0xb'),auth[_0x57eb('0xc')](),controller[_0x57eb('0xd')]);module[_0x57eb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index be7c7b3..a14e024 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0x52e4a0,_0x332127){var _0x582129=function(_0x59bf39){while(--_0x59bf39){_0x52e4a0['push'](_0x52e4a0['shift']());}};_0x582129(++_0x332127);}(_0x326f,0xd1));var _0xf326=function(_0xeff039,_0x49aab8){_0xeff039=_0xeff039-0x0;var _0xbe4501=_0x326f[_0xeff039];return _0xbe4501;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x86e1f5,_0x54a397){var _0x5f200d=function(_0xdb27e){while(--_0xdb27e){_0x86e1f5['push'](_0x86e1f5['shift']());}};_0x5f200d(++_0x54a397);}(_0xeda8,0x104));var _0x8eda=function(_0x15de75,_0x387e8f){_0x15de75=_0x15de75-0x0;var _0x26c368=_0xeda8[_0x15de75];return _0x26c368;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 03341d5..e6eb66a 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 _0xf234=['operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','keyBy','DESC','parse','clone','output','web','fullPath','%s-%s.%s','randomstring','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','right_join','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules'];(function(_0x9af134,_0x24ec94){var _0xf6dd82=function(_0x18e82c){while(--_0x18e82c){_0x9af134['push'](_0x9af134['shift']());}};_0xf6dd82(++_0x24ec94);}(_0xf234,0xeb));var _0x4f23=function(_0x425c62,_0x41eb91){_0x425c62=_0x425c62-0x0;var _0x20b356=_0xf234[_0x425c62];return _0x20b356;};'use strict';var emlformat=require(_0x4f23('0x0'));var rimraf=require(_0x4f23('0x1'));var zipdir=require(_0x4f23('0x2'));var jsonpatch=require(_0x4f23('0x3'));var rp=require(_0x4f23('0x4'));var moment=require(_0x4f23('0x5'));var BPromise=require(_0x4f23('0x6'));var Mustache=require(_0x4f23('0x7'));var util=require(_0x4f23('0x8'));var path=require(_0x4f23('0x9'));var sox=require(_0x4f23('0xa'));var csv=require(_0x4f23('0xb'));var ejs=require(_0x4f23('0xc'));var fs=require('fs');var fs_extra=require(_0x4f23('0xd'));var _=require('lodash');var squel=require(_0x4f23('0xe'));var crypto=require('crypto');var jsforce=require(_0x4f23('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4f23('0xb'));var querystring=require(_0x4f23('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4f23('0x11'));var qs=require(_0x4f23('0x12'));var as=require(_0x4f23('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f23('0x14'))(_0x4f23('0x15'));var utils=require('../../config/utils');var config=require(_0x4f23('0x16'));var licenseUtil=require(_0x4f23('0x17'));var db=require(_0x4f23('0x18'))['db'];var dbH=require(_0x4f23('0x18'))[_0x4f23('0x19')];function respondWithStatusCode(_0x51048f,_0x1f56de){_0x1f56de=_0x1f56de||0xcc;return function(_0x275c59){if(_0x275c59){return _0x51048f[_0x4f23('0x1a')](_0x1f56de);}return _0x51048f[_0x4f23('0x1b')](_0x1f56de)[_0x4f23('0x1c')]();};}function respondWithResult(_0x247fa9,_0x2c369b){_0x2c369b=_0x2c369b||0xc8;return function(_0x331245){if(_0x331245){return _0x247fa9['status'](_0x2c369b)[_0x4f23('0x1d')](_0x331245);}};}function respondWithFilteredResult(_0x171201,_0x467402){return function(_0x56913e){if(_0x56913e){var _0x3e19b4=typeof _0x467402[_0x4f23('0x1e')]===_0x4f23('0x1f')&&typeof _0x467402[_0x4f23('0x20')]===_0x4f23('0x1f');var _0x5b8b04=_0x56913e['count'];var _0x37c929=_0x3e19b4?0x0:_0x467402[_0x4f23('0x1e')];var _0xba4da8=_0x3e19b4?_0x56913e['count']:_0x467402[_0x4f23('0x1e')]+_0x467402[_0x4f23('0x20')];var _0x11a9cd;if(_0xba4da8>=_0x5b8b04){_0xba4da8=_0x5b8b04;_0x11a9cd=0xc8;}else{_0x11a9cd=0xce;}_0x171201[_0x4f23('0x1b')](_0x11a9cd);return _0x171201['set'](_0x4f23('0x21'),_0x37c929+'-'+_0xba4da8+'/'+_0x5b8b04)[_0x4f23('0x1d')](_0x56913e);}return null;};}function patchUpdates(_0x53b353){return function(_0x41294c){try{jsonpatch[_0x4f23('0x22')](_0x41294c,_0x53b353,!![]);}catch(_0x4931c4){return BPromise[_0x4f23('0x23')](_0x4931c4);}return _0x41294c[_0x4f23('0x24')]();};}function saveUpdates(_0x11ce9d,_0x2cae36){return function(_0x83e567){if(_0x83e567){return _0x83e567['update'](_0x11ce9d)['then'](function(_0xe3742){return _0xe3742;});}return null;};}function removeEntity(_0x233fd9,_0x59fba5){return function(_0x33f55b){if(_0x33f55b){return _0x33f55b[_0x4f23('0x25')]()[_0x4f23('0x26')](function(){var _0xfe1368=_0x33f55b[_0x4f23('0x27')]({'plain':!![]});var _0x31531b=_0x4f23('0x28');return db[_0x4f23('0x29')]['destroy']({'where':{'type':_0x31531b,'resourceId':_0xfe1368['id']}})['then'](function(){return _0x33f55b;});})[_0x4f23('0x26')](function(){_0x233fd9[_0x4f23('0x1b')](0xcc)[_0x4f23('0x1c')]();});}};}function handleEntityNotFound(_0x4c95b0,_0x34d7e0){return function(_0x4e89ab){if(!_0x4e89ab){_0x4c95b0['sendStatus'](0x194);}return _0x4e89ab;};}function handleError(_0x52769a,_0x2d3d68){_0x2d3d68=_0x2d3d68||0x1f4;return function(_0x3550bc){logger[_0x4f23('0x2a')](_0x3550bc[_0x4f23('0x2b')]);if(_0x3550bc['name']){delete _0x3550bc[_0x4f23('0x2c')];}_0x52769a['status'](_0x2d3d68)[_0x4f23('0x2d')](_0x3550bc);};}exports[_0x4f23('0x2e')]=function(_0xf7fd17,_0x32fa99){var _0x57ad9b={},_0x2d57d4={},_0x2bad9d={'count':0x0,'rows':[]};var _0x21dbc3=_['map'](db[_0x4f23('0x2f')][_0x4f23('0x30')],function(_0x12994d){return{'name':_0x12994d['fieldName'],'type':_0x12994d[_0x4f23('0x31')][_0x4f23('0x32')]};});_0x2d57d4[_0x4f23('0x33')]=_[_0x4f23('0x34')](_0x21dbc3,_0x4f23('0x2c'));_0x2d57d4['query']=_[_0x4f23('0x35')](_0xf7fd17[_0x4f23('0x36')]);_0x2d57d4[_0x4f23('0x37')]=_[_0x4f23('0x38')](_0x2d57d4[_0x4f23('0x33')],_0x2d57d4['query']);_0x57ad9b[_0x4f23('0x39')]=_[_0x4f23('0x38')](_0x2d57d4[_0x4f23('0x33')],qs[_0x4f23('0x3a')](_0xf7fd17[_0x4f23('0x36')][_0x4f23('0x3a')]));_0x57ad9b[_0x4f23('0x39')]=_0x57ad9b['attributes'][_0x4f23('0x3b')]?_0x57ad9b[_0x4f23('0x39')]:_0x2d57d4[_0x4f23('0x33')];if(!_0xf7fd17['query']['hasOwnProperty'](_0x4f23('0x3c'))){_0x57ad9b[_0x4f23('0x20')]=qs[_0x4f23('0x20')](_0xf7fd17[_0x4f23('0x36')][_0x4f23('0x20')]);_0x57ad9b['offset']=qs[_0x4f23('0x1e')](_0xf7fd17[_0x4f23('0x36')]['offset']);}_0x57ad9b[_0x4f23('0x3d')]=qs['sort'](_0xf7fd17[_0x4f23('0x36')][_0x4f23('0x3e')]);_0x57ad9b[_0x4f23('0x3f')]=qs['filters'](_[_0x4f23('0x40')](_0xf7fd17[_0x4f23('0x36')],_0x2d57d4[_0x4f23('0x37')]),_0x21dbc3);if(_0xf7fd17[_0x4f23('0x36')][_0x4f23('0x41')]){_0x57ad9b[_0x4f23('0x3f')]=_[_0x4f23('0x42')](_0x57ad9b[_0x4f23('0x3f')],{'$or':_[_0x4f23('0x34')](_0x21dbc3,function(_0x394288){if(_0x394288[_0x4f23('0x31')]!=='VIRTUAL'){var _0x171812={};_0x171812[_0x394288[_0x4f23('0x2c')]]={'$like':'%'+_0xf7fd17[_0x4f23('0x36')][_0x4f23('0x41')]+'%'};return _0x171812;}})});}_0x57ad9b=_[_0x4f23('0x42')]({},_0x57ad9b,_0xf7fd17[_0x4f23('0x43')]);var _0x225cc2={'where':_0x57ad9b['where']};return db['AnalyticCustomReport'][_0x4f23('0x44')](_0x225cc2)[_0x4f23('0x26')](function(_0x263adc){_0x2bad9d['count']=_0x263adc;if(_0xf7fd17['query']['includeAll']){_0x57ad9b[_0x4f23('0x45')]=[{'all':!![]}];}return db[_0x4f23('0x2f')][_0x4f23('0x46')](_0x57ad9b);})[_0x4f23('0x26')](function(_0x1f5fb9){_0x2bad9d[_0x4f23('0x47')]=_0x1f5fb9;return _0x2bad9d;})[_0x4f23('0x26')](respondWithFilteredResult(_0x32fa99,_0x57ad9b))[_0x4f23('0x48')](handleError(_0x32fa99,null));};exports[_0x4f23('0x49')]=function(_0x2a07f4,_0x4b1c0f){var _0x18ec57={'raw':![],'where':{'id':_0x2a07f4[_0x4f23('0x4a')]['id']}},_0x402f67={};_0x402f67['model']=_[_0x4f23('0x35')](db[_0x4f23('0x2f')][_0x4f23('0x30')]);_0x402f67['query']=_['keys'](_0x2a07f4[_0x4f23('0x36')]);_0x402f67['filters']=_[_0x4f23('0x38')](_0x402f67[_0x4f23('0x33')],_0x402f67[_0x4f23('0x36')]);_0x18ec57['attributes']=_['intersection'](_0x402f67[_0x4f23('0x33')],qs[_0x4f23('0x3a')](_0x2a07f4[_0x4f23('0x36')][_0x4f23('0x3a')]));_0x18ec57[_0x4f23('0x39')]=_0x18ec57[_0x4f23('0x39')][_0x4f23('0x3b')]?_0x18ec57[_0x4f23('0x39')]:_0x402f67[_0x4f23('0x33')];if(_0x2a07f4[_0x4f23('0x36')][_0x4f23('0x4b')]){_0x18ec57['include']=[{'all':!![]}];}_0x18ec57=_[_0x4f23('0x42')]({},_0x18ec57,_0x2a07f4[_0x4f23('0x43')]);return db[_0x4f23('0x2f')]['find'](_0x18ec57)[_0x4f23('0x26')](handleEntityNotFound(_0x4b1c0f,null))['then'](respondWithResult(_0x4b1c0f,null))[_0x4f23('0x48')](handleError(_0x4b1c0f,null));};exports[_0x4f23('0x4c')]=function(_0x5d0230,_0x2a7718){return db['AnalyticCustomReport'][_0x4f23('0x4c')](_0x5d0230['body'],{})[_0x4f23('0x26')](function(_0x3c4412){var _0x3a0f1d=_0x5d0230[_0x4f23('0x4d')][_0x4f23('0x27')]({'plain':!![]});if(!_0x3a0f1d)throw new Error(_0x4f23('0x4e'));if(_0x3a0f1d['role']===_0x4f23('0x4d')){var _0x5a2b0d=_0x3c4412[_0x4f23('0x27')]({'plain':!![]});var _0x7f1acc='Reports';return db['UserProfileSection'][_0x4f23('0x4f')]({'where':{'name':_0x7f1acc,'userProfileId':_0x3a0f1d[_0x4f23('0x50')]},'raw':!![]})['then'](function(_0x20ea8e){if(_0x20ea8e&&_0x20ea8e['autoAssociation']===0x0){return db[_0x4f23('0x29')][_0x4f23('0x4c')]({'name':_0x5a2b0d[_0x4f23('0x2c')],'resourceId':_0x5a2b0d['id'],'type':_0x4f23('0x28'),'sectionId':_0x20ea8e['id']},{})[_0x4f23('0x26')](function(){return _0x3c4412;});}else{return _0x3c4412;}})['catch'](function(_0x5a735b){logger[_0x4f23('0x2a')](_0x4f23('0x51'),_0x5a735b);throw _0x5a735b;});}return _0x3c4412;})[_0x4f23('0x26')](respondWithResult(_0x2a7718,0xc9))['catch'](handleError(_0x2a7718,null));};exports[_0x4f23('0x52')]=function(_0x344455,_0x4f12ee){if(_0x344455[_0x4f23('0x53')]['id']){delete _0x344455[_0x4f23('0x53')]['id'];}return db[_0x4f23('0x2f')][_0x4f23('0x4f')]({'where':{'id':_0x344455[_0x4f23('0x4a')]['id']}})[_0x4f23('0x26')](handleEntityNotFound(_0x4f12ee,null))[_0x4f23('0x26')](saveUpdates(_0x344455[_0x4f23('0x53')],null))[_0x4f23('0x26')](respondWithResult(_0x4f12ee,null))[_0x4f23('0x48')](handleError(_0x4f12ee,null));};exports[_0x4f23('0x25')]=function(_0x668da0,_0x288981){return db[_0x4f23('0x2f')]['find']({'where':{'id':_0x668da0[_0x4f23('0x4a')]['id']}})[_0x4f23('0x26')](handleEntityNotFound(_0x288981,null))[_0x4f23('0x26')](removeEntity(_0x288981,null))[_0x4f23('0x48')](handleError(_0x288981,null));};exports[_0x4f23('0x54')]=function(_0x214075,_0x4aad93){var _0x263e93=0xa;var _0x24a102=[_0x4f23('0x55'),_0x4f23('0x56'),'right_join','cross_join'];var _0x14dcbb={'SUM':_0x4f23('0x57'),'COUNT':_0x4f23('0x58'),'COUNT DISTINCT':_0x4f23('0x59'),'MAX':_0x4f23('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x4f23('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f23('0x5c')};var _0x30fb9a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24829e=function(_0x52cfa9){return!_[_0x4f23('0x5d')](['IS\x20NULL',_0x4f23('0x5e'),_0x4f23('0x5f'),'IS\x20NOT\x20EMPTY'],_0x52cfa9);};var _0x43d518=function(_0x555ed4){if(!_0x555ed4||!_0x555ed4[_0x4f23('0x60')][_0x4f23('0x3b')]){return'';}for(var _0x372dda='(',_0x58b1d7=0x0;_0x58b1d7<_0x555ed4[_0x4f23('0x60')][_0x4f23('0x3b')];_0x58b1d7+=0x1){_0x58b1d7>0x0&&(_0x372dda+='\x20'+_0x555ed4[_0x4f23('0x61')]+'\x20');_0x372dda+=_0x555ed4[_0x4f23('0x60')][_0x58b1d7][_0x4f23('0x62')]?_0x43d518(_0x555ed4[_0x4f23('0x60')][_0x58b1d7][_0x4f23('0x62')]):_0x555ed4[_0x4f23('0x60')][_0x58b1d7][_0x4f23('0x63')]+'\x20'+_0x555ed4[_0x4f23('0x60')][_0x58b1d7][_0x4f23('0x64')]+(_0x24829e(_0x555ed4[_0x4f23('0x60')][_0x58b1d7][_0x4f23('0x64')])?'\x20'+_0x555ed4[_0x4f23('0x60')][_0x58b1d7][_0x4f23('0x65')]:'');}return _0x372dda+')';};var _0x380d63={'where':{'id':_0x214075[_0x4f23('0x4a')]['id']}},_0x385116,_0x470601,_0x20588b,_0x114131,_0x26c429;_0x380d63=_['merge']({},_0x380d63,_0x214075[_0x4f23('0x43')]);return db[_0x4f23('0x2f')][_0x4f23('0x4f')](_0x380d63)['then'](function(_0x173439){if(_0x173439){_0x385116=_0x173439;return _0x173439[_0x4f23('0x66')]();}return null;})[_0x4f23('0x26')](function(_0x14f60b){if(_0x14f60b){if(!_0x14f60b[_0x4f23('0x3b')]){throw new db[(_0x4f23('0x67'))][(_0x4f23('0x68'))](_0x4f23('0x69'),0x193);}_0x470601=_0x14f60b;return db[_0x4f23('0x6a')][_0x4f23('0x46')]({'raw':!![]});}return null;})[_0x4f23('0x26')](function(_0x2ce6c5){if(_0x2ce6c5){_0x20588b=_['keyBy'](_0x2ce6c5,'id');var _0x26acd5;var _0x11b3ca=squel[_0x4f23('0x6b')]();_0x11b3ca[_0x4f23('0x6c')](_0x385116[_0x4f23('0x6d')]);for(var _0x2f20ce=0x0;_0x2f20ce<_0x470601['length'];_0x2f20ce+=0x1){_0x26acd5=_0x470601[_0x2f20ce]['MetricId']?_0x20588b[_0x470601[_0x2f20ce][_0x4f23('0x6e')]][_0x4f23('0x6f')]:_0x470601[_0x2f20ce][_0x4f23('0x63')];_0x26acd5=_0x470601[_0x2f20ce][_0x4f23('0x70')]?_[_0x4f23('0x71')](_0x14dcbb[_0x470601[_0x2f20ce][_0x4f23('0x70')]],'%s',_0x26acd5):_0x26acd5;_0x26acd5=_0x470601[_0x2f20ce][_0x4f23('0x72')]?_[_0x4f23('0x71')](_0x30fb9a[_0x470601[_0x2f20ce][_0x4f23('0x72')]],'%s',_0x26acd5):_0x26acd5;if(_0x470601[_0x2f20ce][_0x4f23('0x73')]){_0x11b3ca[_0x4f23('0x62')](_0x26acd5);}_0x470601[_0x2f20ce][_0x4f23('0x74')]&&_0x11b3ca[_0x4f23('0x3d')](_0x26acd5,_0x470601[_0x2f20ce][_0x4f23('0x74')]==='DESC'?![]:!![]);_0x11b3ca[_0x4f23('0x63')](_0x26acd5,_0x470601[_0x2f20ce][_0x4f23('0x75')]||_0x26acd5);}if(_0x385116[_0x4f23('0x76')]){_0x385116['joins']=JSON['parse'](_0x385116[_0x4f23('0x76')]);for(var _0x46c700=0x0;_0x46c700<_0x385116[_0x4f23('0x76')][_0x4f23('0x3b')];_0x46c700+=0x1){if(_0x385116['joins'][_0x46c700][_0x4f23('0x31')]&&_[_0x4f23('0x5d')](_0x24a102,_0x385116['joins'][_0x46c700][_0x4f23('0x31')])&&_0x385116['joins'][_0x46c700]['parentKey']&&_0x385116[_0x4f23('0x76')][_0x46c700][_0x4f23('0x77')]&&_0x385116[_0x4f23('0x76')][_0x46c700][_0x4f23('0x78')]){_0x11b3ca[_0x385116[_0x4f23('0x76')][_0x46c700]['type']](_0x385116[_0x4f23('0x76')][_0x46c700]['foreignTable'],null,util[_0x4f23('0x72')](_0x4f23('0x79'),_0x385116[_0x4f23('0x6d')],_0x385116[_0x4f23('0x76')][_0x46c700][_0x4f23('0x7a')],_0x385116['joins'][_0x46c700]['foreignTable'],_0x385116[_0x4f23('0x76')][_0x46c700][_0x4f23('0x78')]));}}}if(_0x385116['conditions']){_0x385116[_0x4f23('0x7b')]=JSON['parse'](_0x385116[_0x4f23('0x7b')]);_0x11b3ca[_0x4f23('0x3f')](_0x43d518(_0x385116[_0x4f23('0x7b')]['group']));}_0x26c429=_0x11b3ca['clone']();_0x11b3ca[_0x4f23('0x20')](_0x263e93);_0x11b3ca[_0x4f23('0x1e')](0x0);logger['debug'](_0x4f23('0x7c'),_0x11b3ca[_0x4f23('0x7d')]());return dbH['sequelize'][_0x4f23('0x36')](_0x11b3ca[_0x4f23('0x7d')](),{'type':dbH[_0x4f23('0x7e')][_0x4f23('0x7f')][_0x4f23('0x80')]});}})[_0x4f23('0x26')](respondWithResult(_0x4aad93,null))[_0x4f23('0x48')](handleError(_0x4aad93,null));};function runReport(_0x394633,_0x2b3c7d,_0x5caac6){var _0x327c65=_0x2b3c7d['name'];var _0x5591bb=0xa;var _0x391baf=[_0x4f23('0x55'),_0x4f23('0x56'),'right_join','cross_join'];var _0x3bafd2={'SUM':_0x4f23('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f23('0x59'),'MAX':_0x4f23('0x5a'),'MIN':_0x4f23('0x81'),'AVG':_0x4f23('0x82'),'GROUP_CONCAT':_0x4f23('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f9e85={'SEC_TO_TIME':_0x4f23('0x83'),'DATE':_0x4f23('0x84'),'HOUR':_0x4f23('0x85'),'ROUND':_0x4f23('0x86'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x48a5fc=function(_0x3913e3){return!_['includes']([_0x4f23('0x87'),_0x4f23('0x5e'),_0x4f23('0x5f'),_0x4f23('0x88')],_0x3913e3);};var _0x23048a=function(_0x5b5c56){if(!_0x5b5c56||!_0x5b5c56[_0x4f23('0x60')][_0x4f23('0x3b')]){return'';}for(var _0x494896='(',_0xe7b273=0x0;_0xe7b273<_0x5b5c56[_0x4f23('0x60')]['length'];_0xe7b273+=0x1){_0xe7b273>0x0&&(_0x494896+='\x20'+_0x5b5c56[_0x4f23('0x61')]+'\x20');_0x494896+=_0x5b5c56[_0x4f23('0x60')][_0xe7b273][_0x4f23('0x62')]?_0x23048a(_0x5b5c56['rules'][_0xe7b273][_0x4f23('0x62')]):_0x5b5c56['rules'][_0xe7b273][_0x4f23('0x63')]+'\x20'+_0x5b5c56[_0x4f23('0x60')][_0xe7b273][_0x4f23('0x64')]+(_0x48a5fc(_0x5b5c56[_0x4f23('0x60')][_0xe7b273][_0x4f23('0x64')])?'\x20'+_0x5b5c56[_0x4f23('0x60')][_0xe7b273][_0x4f23('0x65')]:'');}return _0x494896+')';};var _0x156ff8={'where':{'id':_0x394633['id']}},_0x57023d,_0x4439e2,_0x16c203,_0x2ce1af,_0xd22fc9;_0x156ff8=_[_0x4f23('0x42')]({},_0x156ff8,_0x5caac6);return db[_0x4f23('0x2f')]['find'](_0x156ff8)[_0x4f23('0x26')](function(_0x41e004){if(_0x41e004){_0x57023d=_0x41e004;return _0x41e004[_0x4f23('0x66')]();}return null;})[_0x4f23('0x26')](function(_0xc2caf2){if(_0xc2caf2){if(!_0xc2caf2[_0x4f23('0x3b')]){throw new db[(_0x4f23('0x67'))]['ValidationErrorItem'](_0x4f23('0x69'),0x193);}_0x4439e2=_0xc2caf2;return db['AnalyticMetric'][_0x4f23('0x46')]({'raw':!![]});}return null;})['then'](function(_0x21157a){if(_0x21157a){_0x16c203=_[_0x4f23('0x89')](_0x21157a,'id');var _0x5b8c43;var _0x2a01d3=squel[_0x4f23('0x6b')]();_0x2a01d3[_0x4f23('0x6c')](_0x57023d[_0x4f23('0x6d')]);for(var _0x538c85=0x0;_0x538c85<_0x4439e2[_0x4f23('0x3b')];_0x538c85+=0x1){_0x5b8c43=_0x4439e2[_0x538c85][_0x4f23('0x6e')]?_0x16c203[_0x4439e2[_0x538c85][_0x4f23('0x6e')]][_0x4f23('0x6f')]:_0x4439e2[_0x538c85][_0x4f23('0x63')];_0x5b8c43=_0x4439e2[_0x538c85]['function']?_[_0x4f23('0x71')](_0x3bafd2[_0x4439e2[_0x538c85][_0x4f23('0x70')]],'%s',_0x5b8c43):_0x5b8c43;_0x5b8c43=_0x4439e2[_0x538c85][_0x4f23('0x72')]?_[_0x4f23('0x71')](_0x1f9e85[_0x4439e2[_0x538c85][_0x4f23('0x72')]],'%s',_0x5b8c43):_0x5b8c43;if(_0x4439e2[_0x538c85]['groupBy']){_0x2a01d3[_0x4f23('0x62')](_0x5b8c43);}_0x4439e2[_0x538c85][_0x4f23('0x74')]&&_0x2a01d3[_0x4f23('0x3d')](_0x5b8c43,_0x4439e2[_0x538c85]['orderBy']===_0x4f23('0x8a')?![]:!![]);_0x2a01d3[_0x4f23('0x63')](_0x5b8c43,_0x4439e2[_0x538c85][_0x4f23('0x75')]||_0x5b8c43);}if(_0x57023d[_0x4f23('0x76')]){_0x57023d['joins']=JSON['parse'](_0x57023d['joins']);for(var _0x1f33a2=0x0;_0x1f33a2<_0x57023d['joins'][_0x4f23('0x3b')];_0x1f33a2+=0x1){if(_0x57023d[_0x4f23('0x76')][_0x1f33a2]['type']&&_[_0x4f23('0x5d')](_0x391baf,_0x57023d['joins'][_0x1f33a2]['type'])&&_0x57023d[_0x4f23('0x76')][_0x1f33a2][_0x4f23('0x7a')]&&_0x57023d[_0x4f23('0x76')][_0x1f33a2][_0x4f23('0x77')]&&_0x57023d[_0x4f23('0x76')][_0x1f33a2][_0x4f23('0x78')]){_0x2a01d3[_0x57023d['joins'][_0x1f33a2][_0x4f23('0x31')]](_0x57023d[_0x4f23('0x76')][_0x1f33a2][_0x4f23('0x77')],null,util[_0x4f23('0x72')](_0x4f23('0x79'),_0x57023d[_0x4f23('0x6d')],_0x57023d[_0x4f23('0x76')][_0x1f33a2][_0x4f23('0x7a')],_0x57023d['joins'][_0x1f33a2][_0x4f23('0x77')],_0x57023d['joins'][_0x1f33a2][_0x4f23('0x78')]));}}}if(_0x57023d['conditions']){_0x57023d[_0x4f23('0x7b')]=JSON[_0x4f23('0x8b')](_0x57023d[_0x4f23('0x7b')]);_0x2a01d3[_0x4f23('0x3f')](_0x23048a(_0x57023d[_0x4f23('0x7b')]['group']));}_0xd22fc9=_0x2a01d3[_0x4f23('0x8c')]();_0x2a01d3['limit'](_0x5591bb);_0x2a01d3[_0x4f23('0x1e')](0x0);return;}})['then'](function(){if(_0x2b3c7d[_0x4f23('0x8d')]===_0x4f23('0x8e')){return null;}var _0x45355f=_[_0x4f23('0x42')](_0x2b3c7d,{'name':_0x2b3c7d[_0x4f23('0x8f')]||_0x2b3c7d['name']||_0x57023d['name'],'basename':_0x327c65,'savename':util[_0x4f23('0x72')](_0x4f23('0x90'),_0x2b3c7d[_0x4f23('0x2c')]||_0x57023d[_0x4f23('0x2c')],require(_0x4f23('0x91'))['generate'](0x4),_0x2b3c7d[_0x4f23('0x8d')]||'csv'),'reportId':_0x57023d['id'],'reportType':'custom'});return db[_0x4f23('0x92')][_0x4f23('0x4c')](_0x45355f,{'raw':!![]});})[_0x4f23('0x26')](function(_0x8572a){if(_0x57023d[_0x4f23('0x6d')]==='cdr'){_0xd22fc9[_0x4f23('0x3f')](_0x57023d['table']+_0x4f23('0x93'),_0x2b3c7d[_0x4f23('0x94')],_0x2b3c7d[_0x4f23('0x95')]);}else{_0xd22fc9[_0x4f23('0x3f')](_0x57023d['table']+_0x4f23('0x96'),_0x2b3c7d['startDate'],_0x2b3c7d[_0x4f23('0x95')]);}if(_0x8572a){logger[_0x4f23('0x97')](_0x4f23('0x98'),_0xd22fc9[_0x4f23('0x7d')]());require(_0x4f23('0x99'))[_0x4f23('0x9a')](path[_0x4f23('0x55')](__dirname,_0x4f23('0x9b'),_0x8572a['output']),[_0x8572a['id'],_0xd22fc9[_0x4f23('0x7d')](),path['join'](__dirname,_0x4f23('0x9c'),_0x8572a[_0x4f23('0x9d')]),_0x327c65]);return _0x8572a;}else{var _0x5ab78b=squel['select']();_0x5ab78b[_0x4f23('0x6c')]('('+_0xd22fc9[_0x4f23('0x7d')]()+')',_0x4f23('0x9e'));_0x5ab78b[_0x4f23('0x63')](_0x4f23('0x9f'),'count');_0xd22fc9[_0x4f23('0x20')](_0x2b3c7d[_0x4f23('0x20')]||_0x5591bb);_0xd22fc9[_0x4f23('0x1e')](_0x2b3c7d[_0x4f23('0x1e')]||0x0);return dbH[_0x4f23('0x7e')]['query'](_0x5ab78b[_0x4f23('0x7d')](),{'type':dbH['sequelize']['QueryTypes'][_0x4f23('0x80')]})[_0x4f23('0x26')](function(_0x25c889){if(!_0x25c889[_0x4f23('0x3b')]){_0x2ce1af=0x0;}else{_0x2ce1af=_0x25c889[0x0][_0x4f23('0x44')]||0x0;}return dbH[_0x4f23('0x7e')][_0x4f23('0x36')](_0xd22fc9[_0x4f23('0x7d')](),{'type':dbH[_0x4f23('0x7e')][_0x4f23('0x7f')][_0x4f23('0x80')]});})['then'](function(_0x120502){return{'rows':_0x120502||[],'count':_0x2ce1af};});}});}exports[_0x4f23('0xa0')]=function(_0x5d36c4,_0x2a0b66){return runReport(_0x5d36c4['params'],_0x5d36c4[_0x4f23('0x36')],_0x5d36c4[_0x4f23('0x43')])[_0x4f23('0x26')](respondWithResult(_0x2a0b66,null))['catch'](handleError(_0x2a0b66,null));};exports[_0x4f23('0xa1')]=runReport;exports[_0x4f23('0x36')]=function(_0x4c5d87,_0x326f12){var _0x2f4daf=0xa;var _0x16b406=[_0x4f23('0x55'),_0x4f23('0x56'),_0x4f23('0xa2'),_0x4f23('0xa3')];var _0x14e361={'SUM':_0x4f23('0x57'),'COUNT':_0x4f23('0x58'),'COUNT DISTINCT':_0x4f23('0x59'),'MAX':_0x4f23('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x4f23('0x5b'),'GROUP_CONCAT ASC':_0x4f23('0xa4'),'GROUP_CONCAT DESC':_0x4f23('0x5c')};var _0x15ff62={'SEC_TO_TIME':_0x4f23('0x83'),'DATE':_0x4f23('0x84'),'HOUR':_0x4f23('0x85'),'ROUND':_0x4f23('0x86'),'UNIX_TIMESTAMP':_0x4f23('0xa5')};var _0x170dbc=function(_0x3be7b2){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x4f23('0x5f'),_0x4f23('0x88')],_0x3be7b2);};var _0x2a812d=function(_0x4c3531){if(!_0x4c3531||!_0x4c3531['rules'][_0x4f23('0x3b')]){return'';}for(var _0x3f41f3='(',_0x1b1bff=0x0;_0x1b1bff<_0x4c3531[_0x4f23('0x60')]['length'];_0x1b1bff+=0x1){_0x1b1bff>0x0&&(_0x3f41f3+='\x20'+_0x4c3531['operator']+'\x20');_0x3f41f3+=_0x4c3531[_0x4f23('0x60')][_0x1b1bff][_0x4f23('0x62')]?_0x2a812d(_0x4c3531[_0x4f23('0x60')][_0x1b1bff][_0x4f23('0x62')]):_0x4c3531[_0x4f23('0x60')][_0x1b1bff]['field']+'\x20'+_0x4c3531[_0x4f23('0x60')][_0x1b1bff]['condition']+(_0x170dbc(_0x4c3531['rules'][_0x1b1bff][_0x4f23('0x64')])?'\x20'+_0x4c3531[_0x4f23('0x60')][_0x1b1bff][_0x4f23('0x65')]:'');}return _0x3f41f3+')';};var _0xb61aec={'where':{'id':_0x4c5d87[_0x4f23('0x4a')]['id']}},_0x314851,_0x2ca4ae,_0x41c083,_0x1d0e8d,_0x5dbd83;_0xb61aec=_[_0x4f23('0x42')]({},_0xb61aec,_0x4c5d87[_0x4f23('0x43')]);return db[_0x4f23('0x2f')][_0x4f23('0x4f')](_0xb61aec)[_0x4f23('0x26')](function(_0x313545){if(_0x313545){_0x314851=_0x313545;return _0x313545[_0x4f23('0x66')]();}return null;})[_0x4f23('0x26')](function(_0x1e3bae){if(_0x1e3bae){if(!_0x1e3bae[_0x4f23('0x3b')]){throw new db[(_0x4f23('0x67'))][(_0x4f23('0x68'))](_0x4f23('0x69'),0x193);}_0x2ca4ae=_0x1e3bae;return db[_0x4f23('0x6a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3f166a){if(_0x3f166a){_0x41c083=_[_0x4f23('0x89')](_0x3f166a,'id');var _0x368123;var _0x4ed6f2=squel['select']();_0x4ed6f2[_0x4f23('0x6c')](_0x314851[_0x4f23('0x6d')]);for(var _0x4d1404=0x0;_0x4d1404<_0x2ca4ae[_0x4f23('0x3b')];_0x4d1404+=0x1){_0x368123=_0x2ca4ae[_0x4d1404][_0x4f23('0x6e')]?_0x41c083[_0x2ca4ae[_0x4d1404][_0x4f23('0x6e')]][_0x4f23('0x6f')]:_0x2ca4ae[_0x4d1404][_0x4f23('0x63')];_0x368123=_0x2ca4ae[_0x4d1404]['function']?_[_0x4f23('0x71')](_0x14e361[_0x2ca4ae[_0x4d1404][_0x4f23('0x70')]],'%s',_0x368123):_0x368123;_0x368123=_0x2ca4ae[_0x4d1404][_0x4f23('0x72')]?_[_0x4f23('0x71')](_0x15ff62[_0x2ca4ae[_0x4d1404][_0x4f23('0x72')]],'%s',_0x368123):_0x368123;if(_0x2ca4ae[_0x4d1404][_0x4f23('0x73')]){_0x4ed6f2[_0x4f23('0x62')](_0x368123);}_0x2ca4ae[_0x4d1404][_0x4f23('0x74')]&&_0x4ed6f2[_0x4f23('0x3d')](_0x368123,_0x2ca4ae[_0x4d1404]['orderBy']===_0x4f23('0x8a')?![]:!![]);_0x4ed6f2[_0x4f23('0x63')](_0x368123,_0x2ca4ae[_0x4d1404][_0x4f23('0x75')]||_0x368123);}if(_0x314851[_0x4f23('0x76')]){_0x314851['joins']=JSON[_0x4f23('0x8b')](_0x314851[_0x4f23('0x76')]);for(var _0x211a11=0x0;_0x211a11<_0x314851[_0x4f23('0x76')][_0x4f23('0x3b')];_0x211a11+=0x1){if(_0x314851[_0x4f23('0x76')][_0x211a11][_0x4f23('0x31')]&&_[_0x4f23('0x5d')](_0x16b406,_0x314851[_0x4f23('0x76')][_0x211a11][_0x4f23('0x31')])&&_0x314851[_0x4f23('0x76')][_0x211a11][_0x4f23('0x7a')]&&_0x314851['joins'][_0x211a11][_0x4f23('0x77')]&&_0x314851[_0x4f23('0x76')][_0x211a11][_0x4f23('0x78')]){_0x4ed6f2[_0x314851[_0x4f23('0x76')][_0x211a11][_0x4f23('0x31')]](_0x314851['joins'][_0x211a11][_0x4f23('0x77')],null,util[_0x4f23('0x72')](_0x4f23('0x79'),_0x314851['table'],_0x314851[_0x4f23('0x76')][_0x211a11][_0x4f23('0x7a')],_0x314851[_0x4f23('0x76')][_0x211a11]['foreignTable'],_0x314851[_0x4f23('0x76')][_0x211a11]['foreignKey']));}}}if(_0x314851[_0x4f23('0x7b')]){_0x314851['conditions']=JSON['parse'](_0x314851[_0x4f23('0x7b')]);_0x4ed6f2[_0x4f23('0x3f')](_0x2a812d(_0x314851[_0x4f23('0x7b')][_0x4f23('0x62')]));}_0x5dbd83=_0x4ed6f2[_0x4f23('0x8c')]();_0x4ed6f2[_0x4f23('0x20')](_0x2f4daf);_0x4ed6f2[_0x4f23('0x1e')](0x0);logger['debug'](_0x4f23('0x7c'),_0x4ed6f2[_0x4f23('0x7d')]());return dbH[_0x4f23('0x7e')][_0x4f23('0x36')](_0x4ed6f2[_0x4f23('0x7d')](),{'type':dbH[_0x4f23('0x7e')][_0x4f23('0x7f')][_0x4f23('0x80')]});}})[_0x4f23('0x26')](function(){return{'sql':_0x5dbd83['toString']()};})[_0x4f23('0x26')](respondWithResult(_0x326f12,null))['catch'](handleError(_0x326f12,null));};
\ No newline at end of file
+var _0x6aa1=['hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','findAll','catch','keys','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','field','function','format','replace','orderBy','order','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','debug','toString','sequelize','SELECT','join','MAX(%s)','MIN(%s)','HOUR(%s)','ROUND(%s)','Sequelize','select','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','QueryTypes','run','runReport','right_join','IS\x20EMPTY','Limited\x20Query:','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','update','then','destroy','CustomReports','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x6aa1,0x1b5));var _0x16aa=function(_0x398ec3,_0x403e6c){_0x398ec3=_0x398ec3-0x0;var _0x231f76=_0x6aa1[_0x398ec3];return _0x231f76;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x16aa('0x0'));var jsonpatch=require(_0x16aa('0x1'));var rp=require(_0x16aa('0x2'));var moment=require(_0x16aa('0x3'));var BPromise=require(_0x16aa('0x4'));var Mustache=require('mustache');var util=require(_0x16aa('0x5'));var path=require(_0x16aa('0x6'));var sox=require(_0x16aa('0x7'));var csv=require(_0x16aa('0x8'));var ejs=require(_0x16aa('0x9'));var fs=require('fs');var fs_extra=require(_0x16aa('0xa'));var _=require(_0x16aa('0xb'));var squel=require(_0x16aa('0xc'));var crypto=require(_0x16aa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16aa('0x8'));var querystring=require('querystring');var Papa=require(_0x16aa('0xe'));var Redis=require(_0x16aa('0xf'));var authService=require(_0x16aa('0x10'));var qs=require(_0x16aa('0x11'));var as=require(_0x16aa('0x12'));var hardwareService=require(_0x16aa('0x13'));var logger=require(_0x16aa('0x14'))('api');var utils=require(_0x16aa('0x15'));var config=require(_0x16aa('0x16'));var licenseUtil=require(_0x16aa('0x17'));var db=require(_0x16aa('0x18'))['db'];var dbH=require(_0x16aa('0x18'))[_0x16aa('0x19')];function respondWithStatusCode(_0x4e56b1,_0x560232){_0x560232=_0x560232||0xcc;return function(_0x477d82){if(_0x477d82){return _0x4e56b1[_0x16aa('0x1a')](_0x560232);}return _0x4e56b1['status'](_0x560232)[_0x16aa('0x1b')]();};}function respondWithResult(_0xe108fd,_0x309eb0){_0x309eb0=_0x309eb0||0xc8;return function(_0x10affb){if(_0x10affb){return _0xe108fd['status'](_0x309eb0)[_0x16aa('0x1c')](_0x10affb);}};}function respondWithFilteredResult(_0x58dd9a,_0x478849){return function(_0xc116f9){if(_0xc116f9){var _0x42f25a=typeof _0x478849[_0x16aa('0x1d')]===_0x16aa('0x1e')&&typeof _0x478849[_0x16aa('0x1f')]===_0x16aa('0x1e');var _0x358d53=_0xc116f9[_0x16aa('0x20')];var _0x3ec33d=_0x42f25a?0x0:_0x478849[_0x16aa('0x1d')];var _0x3030a8=_0x42f25a?_0xc116f9[_0x16aa('0x20')]:_0x478849[_0x16aa('0x1d')]+_0x478849[_0x16aa('0x1f')];var _0x47ea62;if(_0x3030a8>=_0x358d53){_0x3030a8=_0x358d53;_0x47ea62=0xc8;}else{_0x47ea62=0xce;}_0x58dd9a[_0x16aa('0x21')](_0x47ea62);return _0x58dd9a[_0x16aa('0x22')](_0x16aa('0x23'),_0x3ec33d+'-'+_0x3030a8+'/'+_0x358d53)[_0x16aa('0x1c')](_0xc116f9);}return null;};}function patchUpdates(_0x38a70e){return function(_0x33c2d4){try{jsonpatch['apply'](_0x33c2d4,_0x38a70e,!![]);}catch(_0x13f1ed){return BPromise[_0x16aa('0x24')](_0x13f1ed);}return _0x33c2d4['save']();};}function saveUpdates(_0x3ddeb6,_0x3de799){return function(_0x1d318f){if(_0x1d318f){return _0x1d318f[_0x16aa('0x25')](_0x3ddeb6)[_0x16aa('0x26')](function(_0x3c12a5){return _0x3c12a5;});}return null;};}function removeEntity(_0x21482c,_0xeb22fa){return function(_0x5e6721){if(_0x5e6721){return _0x5e6721[_0x16aa('0x27')]()[_0x16aa('0x26')](function(){var _0x4c2b92=_0x5e6721['get']({'plain':!![]});var _0x117d52=_0x16aa('0x28');return db[_0x16aa('0x29')][_0x16aa('0x27')]({'where':{'type':_0x117d52,'resourceId':_0x4c2b92['id']}})[_0x16aa('0x26')](function(){return _0x5e6721;});})['then'](function(){_0x21482c['status'](0xcc)[_0x16aa('0x1b')]();});}};}function handleEntityNotFound(_0x377137,_0xd80f7f){return function(_0xc88796){if(!_0xc88796){_0x377137[_0x16aa('0x1a')](0x194);}return _0xc88796;};}function handleError(_0x26a018,_0x295605){_0x295605=_0x295605||0x1f4;return function(_0x48c4ba){logger['error'](_0x48c4ba[_0x16aa('0x2a')]);if(_0x48c4ba[_0x16aa('0x2b')]){delete _0x48c4ba[_0x16aa('0x2b')];}_0x26a018[_0x16aa('0x21')](_0x295605)[_0x16aa('0x2c')](_0x48c4ba);};}exports[_0x16aa('0x2d')]=function(_0x434195,_0x25c593){var _0x3619b8={},_0x736806={},_0x2c3398={'count':0x0,'rows':[]};var _0x4f944f=_[_0x16aa('0x2e')](db[_0x16aa('0x2f')][_0x16aa('0x30')],function(_0x1329e4){return{'name':_0x1329e4[_0x16aa('0x31')],'type':_0x1329e4[_0x16aa('0x32')][_0x16aa('0x33')]};});_0x736806['model']=_[_0x16aa('0x2e')](_0x4f944f,_0x16aa('0x2b'));_0x736806[_0x16aa('0x34')]=_['keys'](_0x434195[_0x16aa('0x34')]);_0x736806['filters']=_[_0x16aa('0x35')](_0x736806[_0x16aa('0x36')],_0x736806[_0x16aa('0x34')]);_0x3619b8[_0x16aa('0x37')]=_[_0x16aa('0x35')](_0x736806['model'],qs[_0x16aa('0x38')](_0x434195[_0x16aa('0x34')][_0x16aa('0x38')]));_0x3619b8[_0x16aa('0x37')]=_0x3619b8['attributes'][_0x16aa('0x39')]?_0x3619b8['attributes']:_0x736806[_0x16aa('0x36')];if(!_0x434195[_0x16aa('0x34')][_0x16aa('0x3a')](_0x16aa('0x3b'))){_0x3619b8[_0x16aa('0x1f')]=qs['limit'](_0x434195[_0x16aa('0x34')][_0x16aa('0x1f')]);_0x3619b8['offset']=qs[_0x16aa('0x1d')](_0x434195[_0x16aa('0x34')][_0x16aa('0x1d')]);}_0x3619b8['order']=qs['sort'](_0x434195[_0x16aa('0x34')][_0x16aa('0x3c')]);_0x3619b8[_0x16aa('0x3d')]=qs['filters'](_[_0x16aa('0x3e')](_0x434195[_0x16aa('0x34')],_0x736806[_0x16aa('0x3f')]),_0x4f944f);if(_0x434195[_0x16aa('0x34')][_0x16aa('0x40')]){_0x3619b8['where']=_['merge'](_0x3619b8[_0x16aa('0x3d')],{'$or':_[_0x16aa('0x2e')](_0x4f944f,function(_0x554afa){if(_0x554afa[_0x16aa('0x32')]!=='VIRTUAL'){var _0xc4ebb4={};_0xc4ebb4[_0x554afa[_0x16aa('0x2b')]]={'$like':'%'+_0x434195['query'][_0x16aa('0x40')]+'%'};return _0xc4ebb4;}})});}_0x3619b8=_[_0x16aa('0x41')]({},_0x3619b8,_0x434195['options']);var _0x18de36={'where':_0x3619b8['where']};return db[_0x16aa('0x2f')][_0x16aa('0x20')](_0x18de36)[_0x16aa('0x26')](function(_0x2210a9){_0x2c3398[_0x16aa('0x20')]=_0x2210a9;if(_0x434195['query'][_0x16aa('0x42')]){_0x3619b8[_0x16aa('0x43')]=[{'all':!![]}];}return db[_0x16aa('0x2f')][_0x16aa('0x44')](_0x3619b8);})[_0x16aa('0x26')](function(_0x31abe2){_0x2c3398['rows']=_0x31abe2;return _0x2c3398;})[_0x16aa('0x26')](respondWithFilteredResult(_0x25c593,_0x3619b8))[_0x16aa('0x45')](handleError(_0x25c593,null));};exports['show']=function(_0x5c480e,_0x4485b8){var _0x1dcc12={'raw':![],'where':{'id':_0x5c480e['params']['id']}},_0x2590fa={};_0x2590fa[_0x16aa('0x36')]=_[_0x16aa('0x46')](db['AnalyticCustomReport'][_0x16aa('0x30')]);_0x2590fa[_0x16aa('0x34')]=_[_0x16aa('0x46')](_0x5c480e['query']);_0x2590fa['filters']=_['intersection'](_0x2590fa[_0x16aa('0x36')],_0x2590fa['query']);_0x1dcc12['attributes']=_[_0x16aa('0x35')](_0x2590fa[_0x16aa('0x36')],qs[_0x16aa('0x38')](_0x5c480e['query'][_0x16aa('0x38')]));_0x1dcc12['attributes']=_0x1dcc12[_0x16aa('0x37')][_0x16aa('0x39')]?_0x1dcc12[_0x16aa('0x37')]:_0x2590fa[_0x16aa('0x36')];if(_0x5c480e['query'][_0x16aa('0x42')]){_0x1dcc12[_0x16aa('0x43')]=[{'all':!![]}];}_0x1dcc12=_[_0x16aa('0x41')]({},_0x1dcc12,_0x5c480e['options']);return db[_0x16aa('0x2f')][_0x16aa('0x47')](_0x1dcc12)[_0x16aa('0x26')](handleEntityNotFound(_0x4485b8,null))['then'](respondWithResult(_0x4485b8,null))[_0x16aa('0x45')](handleError(_0x4485b8,null));};exports[_0x16aa('0x48')]=function(_0x22625c,_0x24b728){return db[_0x16aa('0x2f')][_0x16aa('0x48')](_0x22625c[_0x16aa('0x49')],{})['then'](function(_0x530eae){var _0x82a2c3=_0x22625c[_0x16aa('0x4a')][_0x16aa('0x4b')]({'plain':!![]});if(!_0x82a2c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x82a2c3[_0x16aa('0x4c')]===_0x16aa('0x4a')){var _0x362176=_0x530eae[_0x16aa('0x4b')]({'plain':!![]});var _0x2232a9='Reports';return db[_0x16aa('0x4d')]['find']({'where':{'name':_0x2232a9,'userProfileId':_0x82a2c3[_0x16aa('0x4e')]},'raw':!![]})[_0x16aa('0x26')](function(_0x13791d){if(_0x13791d&&_0x13791d[_0x16aa('0x4f')]===0x0){return db[_0x16aa('0x29')][_0x16aa('0x48')]({'name':_0x362176[_0x16aa('0x2b')],'resourceId':_0x362176['id'],'type':_0x16aa('0x28'),'sectionId':_0x13791d['id']},{})['then'](function(){return _0x530eae;});}else{return _0x530eae;}})[_0x16aa('0x45')](function(_0x356d5f){logger[_0x16aa('0x50')](_0x16aa('0x51'),_0x356d5f);throw _0x356d5f;});}return _0x530eae;})[_0x16aa('0x26')](respondWithResult(_0x24b728,0xc9))[_0x16aa('0x45')](handleError(_0x24b728,null));};exports['update']=function(_0x505adb,_0x27eb5f){if(_0x505adb[_0x16aa('0x49')]['id']){delete _0x505adb['body']['id'];}return db[_0x16aa('0x2f')]['find']({'where':{'id':_0x505adb[_0x16aa('0x52')]['id']}})[_0x16aa('0x26')](handleEntityNotFound(_0x27eb5f,null))[_0x16aa('0x26')](saveUpdates(_0x505adb[_0x16aa('0x49')],null))['then'](respondWithResult(_0x27eb5f,null))[_0x16aa('0x45')](handleError(_0x27eb5f,null));};exports[_0x16aa('0x27')]=function(_0xbc2553,_0x1eab03){return db['AnalyticCustomReport'][_0x16aa('0x47')]({'where':{'id':_0xbc2553['params']['id']}})[_0x16aa('0x26')](handleEntityNotFound(_0x1eab03,null))[_0x16aa('0x26')](removeEntity(_0x1eab03,null))[_0x16aa('0x45')](handleError(_0x1eab03,null));};exports[_0x16aa('0x53')]=function(_0x366b99,_0x592dfa){var _0xf27b5c=0xa;var _0x58bf07=['join',_0x16aa('0x54'),'right_join',_0x16aa('0x55')];var _0x2d8726={'SUM':_0x16aa('0x56'),'COUNT':_0x16aa('0x57'),'COUNT DISTINCT':_0x16aa('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x16aa('0x59'),'GROUP_CONCAT':_0x16aa('0x5a'),'GROUP_CONCAT ASC':_0x16aa('0x5b'),'GROUP_CONCAT DESC':_0x16aa('0x5c')};var _0x5bf947={'SEC_TO_TIME':_0x16aa('0x5d'),'DATE':_0x16aa('0x5e'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x16aa('0x5f')};var _0x4acbe7=function(_0x673a6c){return!_[_0x16aa('0x60')](['IS\x20NULL',_0x16aa('0x61'),'IS\x20EMPTY',_0x16aa('0x62')],_0x673a6c);};var _0x300b4e=function(_0x2dc3d6){if(!_0x2dc3d6||!_0x2dc3d6[_0x16aa('0x63')][_0x16aa('0x39')]){return'';}for(var _0x397083='(',_0x256e7c=0x0;_0x256e7c<_0x2dc3d6['rules'][_0x16aa('0x39')];_0x256e7c+=0x1){_0x256e7c>0x0&&(_0x397083+='\x20'+_0x2dc3d6[_0x16aa('0x64')]+'\x20');_0x397083+=_0x2dc3d6[_0x16aa('0x63')][_0x256e7c][_0x16aa('0x65')]?_0x300b4e(_0x2dc3d6[_0x16aa('0x63')][_0x256e7c][_0x16aa('0x65')]):_0x2dc3d6[_0x16aa('0x63')][_0x256e7c]['field']+'\x20'+_0x2dc3d6[_0x16aa('0x63')][_0x256e7c]['condition']+(_0x4acbe7(_0x2dc3d6[_0x16aa('0x63')][_0x256e7c][_0x16aa('0x66')])?'\x20'+_0x2dc3d6[_0x16aa('0x63')][_0x256e7c][_0x16aa('0x67')]:'');}return _0x397083+')';};var _0x14c3e6={'where':{'id':_0x366b99[_0x16aa('0x52')]['id']}},_0x3a9ba6,_0x2d3d31,_0x6d66e8,_0x1f7ae1,_0x993ef8;_0x14c3e6=_['merge']({},_0x14c3e6,_0x366b99[_0x16aa('0x68')]);return db[_0x16aa('0x2f')][_0x16aa('0x47')](_0x14c3e6)[_0x16aa('0x26')](function(_0x3828d7){if(_0x3828d7){_0x3a9ba6=_0x3828d7;return _0x3828d7[_0x16aa('0x69')]();}return null;})[_0x16aa('0x26')](function(_0x45e20b){if(_0x45e20b){if(!_0x45e20b[_0x16aa('0x39')]){throw new db['Sequelize'][(_0x16aa('0x6a'))](_0x16aa('0x6b'),0x193);}_0x2d3d31=_0x45e20b;return db[_0x16aa('0x6c')][_0x16aa('0x44')]({'raw':!![]});}return null;})[_0x16aa('0x26')](function(_0x503fe3){if(_0x503fe3){_0x6d66e8=_[_0x16aa('0x6d')](_0x503fe3,'id');var _0x1ddea5;var _0x4eb99f=squel['select']();_0x4eb99f[_0x16aa('0x6e')](_0x3a9ba6[_0x16aa('0x6f')]);for(var _0x5e508b=0x0;_0x5e508b<_0x2d3d31[_0x16aa('0x39')];_0x5e508b+=0x1){_0x1ddea5=_0x2d3d31[_0x5e508b][_0x16aa('0x70')]?_0x6d66e8[_0x2d3d31[_0x5e508b][_0x16aa('0x70')]][_0x16aa('0x71')]:_0x2d3d31[_0x5e508b][_0x16aa('0x72')];_0x1ddea5=_0x2d3d31[_0x5e508b][_0x16aa('0x73')]?_['replace'](_0x2d8726[_0x2d3d31[_0x5e508b]['function']],'%s',_0x1ddea5):_0x1ddea5;_0x1ddea5=_0x2d3d31[_0x5e508b][_0x16aa('0x74')]?_[_0x16aa('0x75')](_0x5bf947[_0x2d3d31[_0x5e508b][_0x16aa('0x74')]],'%s',_0x1ddea5):_0x1ddea5;if(_0x2d3d31[_0x5e508b]['groupBy']){_0x4eb99f[_0x16aa('0x65')](_0x1ddea5);}_0x2d3d31[_0x5e508b][_0x16aa('0x76')]&&_0x4eb99f[_0x16aa('0x77')](_0x1ddea5,_0x2d3d31[_0x5e508b][_0x16aa('0x76')]===_0x16aa('0x78')?![]:!![]);_0x4eb99f[_0x16aa('0x72')](_0x1ddea5,_0x2d3d31[_0x5e508b][_0x16aa('0x79')]||_0x1ddea5);}if(_0x3a9ba6[_0x16aa('0x7a')]){_0x3a9ba6[_0x16aa('0x7a')]=JSON[_0x16aa('0x7b')](_0x3a9ba6[_0x16aa('0x7a')]);for(var _0x1c30b4=0x0;_0x1c30b4<_0x3a9ba6['joins'][_0x16aa('0x39')];_0x1c30b4+=0x1){if(_0x3a9ba6[_0x16aa('0x7a')][_0x1c30b4][_0x16aa('0x32')]&&_['includes'](_0x58bf07,_0x3a9ba6['joins'][_0x1c30b4]['type'])&&_0x3a9ba6[_0x16aa('0x7a')][_0x1c30b4][_0x16aa('0x7c')]&&_0x3a9ba6[_0x16aa('0x7a')][_0x1c30b4]['foreignTable']&&_0x3a9ba6['joins'][_0x1c30b4][_0x16aa('0x7d')]){_0x4eb99f[_0x3a9ba6[_0x16aa('0x7a')][_0x1c30b4][_0x16aa('0x32')]](_0x3a9ba6[_0x16aa('0x7a')][_0x1c30b4][_0x16aa('0x7e')],null,util[_0x16aa('0x74')]('%s.%s\x20=\x20%s.%s',_0x3a9ba6[_0x16aa('0x6f')],_0x3a9ba6[_0x16aa('0x7a')][_0x1c30b4]['parentKey'],_0x3a9ba6[_0x16aa('0x7a')][_0x1c30b4][_0x16aa('0x7e')],_0x3a9ba6['joins'][_0x1c30b4][_0x16aa('0x7d')]));}}}if(_0x3a9ba6['conditions']){_0x3a9ba6[_0x16aa('0x7f')]=JSON['parse'](_0x3a9ba6[_0x16aa('0x7f')]);_0x4eb99f[_0x16aa('0x3d')](_0x300b4e(_0x3a9ba6[_0x16aa('0x7f')][_0x16aa('0x65')]));}_0x993ef8=_0x4eb99f[_0x16aa('0x80')]();_0x4eb99f['limit'](_0xf27b5c);_0x4eb99f['offset'](0x0);logger[_0x16aa('0x81')]('Limited\x20Query:',_0x4eb99f[_0x16aa('0x82')]());return dbH[_0x16aa('0x83')][_0x16aa('0x34')](_0x4eb99f[_0x16aa('0x82')](),{'type':dbH[_0x16aa('0x83')]['QueryTypes'][_0x16aa('0x84')]});}})['then'](respondWithResult(_0x592dfa,null))[_0x16aa('0x45')](handleError(_0x592dfa,null));};function runReport(_0x662c5d,_0xf657ec,_0x25b3d2){var _0x535edf=_0xf657ec[_0x16aa('0x2b')];var _0x41aa18=0xa;var _0x2d4c6e=[_0x16aa('0x85'),_0x16aa('0x54'),'right_join',_0x16aa('0x55')];var _0x7fced2={'SUM':'SUM(%s)','COUNT':_0x16aa('0x57'),'COUNT DISTINCT':_0x16aa('0x58'),'MAX':_0x16aa('0x86'),'MIN':_0x16aa('0x87'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x16aa('0x5a'),'GROUP_CONCAT ASC':_0x16aa('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x58b281={'SEC_TO_TIME':_0x16aa('0x5d'),'DATE':_0x16aa('0x5e'),'HOUR':_0x16aa('0x88'),'ROUND':_0x16aa('0x89'),'UNIX_TIMESTAMP':_0x16aa('0x5f')};var _0xdfdffa=function(_0x1e3f39){return!_[_0x16aa('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x16aa('0x62')],_0x1e3f39);};var _0x1d3d91=function(_0x1c1ff9){if(!_0x1c1ff9||!_0x1c1ff9[_0x16aa('0x63')][_0x16aa('0x39')]){return'';}for(var _0x4734a2='(',_0x23f3be=0x0;_0x23f3be<_0x1c1ff9['rules'][_0x16aa('0x39')];_0x23f3be+=0x1){_0x23f3be>0x0&&(_0x4734a2+='\x20'+_0x1c1ff9[_0x16aa('0x64')]+'\x20');_0x4734a2+=_0x1c1ff9[_0x16aa('0x63')][_0x23f3be][_0x16aa('0x65')]?_0x1d3d91(_0x1c1ff9[_0x16aa('0x63')][_0x23f3be]['group']):_0x1c1ff9[_0x16aa('0x63')][_0x23f3be]['field']+'\x20'+_0x1c1ff9[_0x16aa('0x63')][_0x23f3be][_0x16aa('0x66')]+(_0xdfdffa(_0x1c1ff9['rules'][_0x23f3be][_0x16aa('0x66')])?'\x20'+_0x1c1ff9[_0x16aa('0x63')][_0x23f3be][_0x16aa('0x67')]:'');}return _0x4734a2+')';};var _0xfa5333={'where':{'id':_0x662c5d['id']}},_0x31cc3e,_0x3175de,_0x5b9602,_0xe77735,_0x5d3b47;_0xfa5333=_['merge']({},_0xfa5333,_0x25b3d2);return db[_0x16aa('0x2f')][_0x16aa('0x47')](_0xfa5333)[_0x16aa('0x26')](function(_0x3cf14b){if(_0x3cf14b){_0x31cc3e=_0x3cf14b;return _0x3cf14b[_0x16aa('0x69')]();}return null;})[_0x16aa('0x26')](function(_0x28cf22){if(_0x28cf22){if(!_0x28cf22[_0x16aa('0x39')]){throw new db[(_0x16aa('0x8a'))]['ValidationErrorItem'](_0x16aa('0x6b'),0x193);}_0x3175de=_0x28cf22;return db[_0x16aa('0x6c')][_0x16aa('0x44')]({'raw':!![]});}return null;})['then'](function(_0x476329){if(_0x476329){_0x5b9602=_['keyBy'](_0x476329,'id');var _0x51364d;var _0x26c6a1=squel[_0x16aa('0x8b')]();_0x26c6a1[_0x16aa('0x6e')](_0x31cc3e[_0x16aa('0x6f')]);for(var _0x5a2563=0x0;_0x5a2563<_0x3175de[_0x16aa('0x39')];_0x5a2563+=0x1){_0x51364d=_0x3175de[_0x5a2563]['MetricId']?_0x5b9602[_0x3175de[_0x5a2563][_0x16aa('0x70')]][_0x16aa('0x71')]:_0x3175de[_0x5a2563][_0x16aa('0x72')];_0x51364d=_0x3175de[_0x5a2563]['function']?_['replace'](_0x7fced2[_0x3175de[_0x5a2563][_0x16aa('0x73')]],'%s',_0x51364d):_0x51364d;_0x51364d=_0x3175de[_0x5a2563]['format']?_['replace'](_0x58b281[_0x3175de[_0x5a2563][_0x16aa('0x74')]],'%s',_0x51364d):_0x51364d;if(_0x3175de[_0x5a2563][_0x16aa('0x8c')]){_0x26c6a1[_0x16aa('0x65')](_0x51364d);}_0x3175de[_0x5a2563][_0x16aa('0x76')]&&_0x26c6a1[_0x16aa('0x77')](_0x51364d,_0x3175de[_0x5a2563][_0x16aa('0x76')]===_0x16aa('0x78')?![]:!![]);_0x26c6a1[_0x16aa('0x72')](_0x51364d,_0x3175de[_0x5a2563][_0x16aa('0x79')]||_0x51364d);}if(_0x31cc3e[_0x16aa('0x7a')]){_0x31cc3e[_0x16aa('0x7a')]=JSON[_0x16aa('0x7b')](_0x31cc3e[_0x16aa('0x7a')]);for(var _0x598843=0x0;_0x598843<_0x31cc3e['joins'][_0x16aa('0x39')];_0x598843+=0x1){if(_0x31cc3e['joins'][_0x598843][_0x16aa('0x32')]&&_[_0x16aa('0x60')](_0x2d4c6e,_0x31cc3e[_0x16aa('0x7a')][_0x598843][_0x16aa('0x32')])&&_0x31cc3e[_0x16aa('0x7a')][_0x598843][_0x16aa('0x7c')]&&_0x31cc3e[_0x16aa('0x7a')][_0x598843][_0x16aa('0x7e')]&&_0x31cc3e[_0x16aa('0x7a')][_0x598843][_0x16aa('0x7d')]){_0x26c6a1[_0x31cc3e[_0x16aa('0x7a')][_0x598843][_0x16aa('0x32')]](_0x31cc3e[_0x16aa('0x7a')][_0x598843][_0x16aa('0x7e')],null,util[_0x16aa('0x74')](_0x16aa('0x8d'),_0x31cc3e['table'],_0x31cc3e['joins'][_0x598843]['parentKey'],_0x31cc3e[_0x16aa('0x7a')][_0x598843][_0x16aa('0x7e')],_0x31cc3e['joins'][_0x598843]['foreignKey']));}}}if(_0x31cc3e[_0x16aa('0x7f')]){_0x31cc3e[_0x16aa('0x7f')]=JSON['parse'](_0x31cc3e[_0x16aa('0x7f')]);_0x26c6a1[_0x16aa('0x3d')](_0x1d3d91(_0x31cc3e['conditions']['group']));}_0x5d3b47=_0x26c6a1[_0x16aa('0x80')]();_0x26c6a1[_0x16aa('0x1f')](_0x41aa18);_0x26c6a1[_0x16aa('0x1d')](0x0);return;}})['then'](function(){if(_0xf657ec[_0x16aa('0x8e')]===_0x16aa('0x8f')){return null;}var _0x57e53d=_[_0x16aa('0x41')](_0xf657ec,{'name':_0xf657ec[_0x16aa('0x90')]||_0xf657ec['name']||_0x31cc3e['name'],'basename':_0x535edf,'savename':util[_0x16aa('0x74')]('%s-%s.%s',_0xf657ec[_0x16aa('0x2b')]||_0x31cc3e[_0x16aa('0x2b')],require('randomstring')['generate'](0x4),_0xf657ec[_0x16aa('0x8e')]||'csv'),'reportId':_0x31cc3e['id'],'reportType':_0x16aa('0x91')});return db[_0x16aa('0x92')][_0x16aa('0x48')](_0x57e53d,{'raw':!![]});})['then'](function(_0x40db63){if(_0x31cc3e[_0x16aa('0x6f')]===_0x16aa('0x93')){_0x5d3b47['where'](_0x31cc3e[_0x16aa('0x6f')]+_0x16aa('0x94'),_0xf657ec[_0x16aa('0x95')],_0xf657ec[_0x16aa('0x96')]);}else{_0x5d3b47[_0x16aa('0x3d')](_0x31cc3e['table']+_0x16aa('0x97'),_0xf657ec[_0x16aa('0x95')],_0xf657ec[_0x16aa('0x96')]);}if(_0x40db63){logger['info'](_0x16aa('0x98'),_0x5d3b47[_0x16aa('0x82')]());require(_0x16aa('0x99'))[_0x16aa('0x9a')](path[_0x16aa('0x85')](__dirname,_0x16aa('0x9b'),_0x40db63[_0x16aa('0x8e')]),[_0x40db63['id'],_0x5d3b47[_0x16aa('0x82')](),path[_0x16aa('0x85')](__dirname,_0x16aa('0x9c'),_0x40db63[_0x16aa('0x9d')]),_0x535edf]);return _0x40db63;}else{var _0x5e394a=squel[_0x16aa('0x8b')]();_0x5e394a['from']('('+_0x5d3b47[_0x16aa('0x82')]()+')','countTable');_0x5e394a[_0x16aa('0x72')](_0x16aa('0x9e'),_0x16aa('0x20'));_0x5d3b47[_0x16aa('0x1f')](_0xf657ec[_0x16aa('0x1f')]||_0x41aa18);_0x5d3b47[_0x16aa('0x1d')](_0xf657ec[_0x16aa('0x1d')]||0x0);return dbH[_0x16aa('0x83')][_0x16aa('0x34')](_0x5e394a[_0x16aa('0x82')](),{'type':dbH[_0x16aa('0x83')][_0x16aa('0x9f')][_0x16aa('0x84')]})[_0x16aa('0x26')](function(_0x3b2e68){if(!_0x3b2e68[_0x16aa('0x39')]){_0xe77735=0x0;}else{_0xe77735=_0x3b2e68[0x0]['count']||0x0;}return dbH[_0x16aa('0x83')][_0x16aa('0x34')](_0x5d3b47[_0x16aa('0x82')](),{'type':dbH[_0x16aa('0x83')][_0x16aa('0x9f')][_0x16aa('0x84')]});})['then'](function(_0x125f97){return{'rows':_0x125f97||[],'count':_0xe77735};});}});}exports[_0x16aa('0xa0')]=function(_0x1421c4,_0x31f2d6){return runReport(_0x1421c4['params'],_0x1421c4['query'],_0x1421c4['options'])['then'](respondWithResult(_0x31f2d6,null))[_0x16aa('0x45')](handleError(_0x31f2d6,null));};exports[_0x16aa('0xa1')]=runReport;exports[_0x16aa('0x34')]=function(_0x191261,_0x4a0d7a){var _0x4e128e=0xa;var _0x5f4f0b=[_0x16aa('0x85'),_0x16aa('0x54'),_0x16aa('0xa2'),_0x16aa('0x55')];var _0x209280={'SUM':_0x16aa('0x56'),'COUNT':_0x16aa('0x57'),'COUNT DISTINCT':_0x16aa('0x58'),'MAX':_0x16aa('0x86'),'MIN':'MIN(%s)','AVG':_0x16aa('0x59'),'GROUP_CONCAT':_0x16aa('0x5a'),'GROUP_CONCAT ASC':_0x16aa('0x5b'),'GROUP_CONCAT DESC':_0x16aa('0x5c')};var _0x81bef7={'SEC_TO_TIME':_0x16aa('0x5d'),'DATE':'DATE(%s)','HOUR':_0x16aa('0x88'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x16aa('0x5f')};var _0x550e8a=function(_0x464fc9){return!_[_0x16aa('0x60')](['IS\x20NULL',_0x16aa('0x61'),_0x16aa('0xa3'),_0x16aa('0x62')],_0x464fc9);};var _0x512608=function(_0x13c8f4){if(!_0x13c8f4||!_0x13c8f4[_0x16aa('0x63')][_0x16aa('0x39')]){return'';}for(var _0x40e6c9='(',_0x48c7c5=0x0;_0x48c7c5<_0x13c8f4[_0x16aa('0x63')][_0x16aa('0x39')];_0x48c7c5+=0x1){_0x48c7c5>0x0&&(_0x40e6c9+='\x20'+_0x13c8f4['operator']+'\x20');_0x40e6c9+=_0x13c8f4['rules'][_0x48c7c5][_0x16aa('0x65')]?_0x512608(_0x13c8f4[_0x16aa('0x63')][_0x48c7c5][_0x16aa('0x65')]):_0x13c8f4[_0x16aa('0x63')][_0x48c7c5]['field']+'\x20'+_0x13c8f4[_0x16aa('0x63')][_0x48c7c5][_0x16aa('0x66')]+(_0x550e8a(_0x13c8f4['rules'][_0x48c7c5][_0x16aa('0x66')])?'\x20'+_0x13c8f4[_0x16aa('0x63')][_0x48c7c5][_0x16aa('0x67')]:'');}return _0x40e6c9+')';};var _0x5dfb69={'where':{'id':_0x191261[_0x16aa('0x52')]['id']}},_0x22ce77,_0x327b40,_0x31aa85,_0x3d2ac4,_0x52b8d9;_0x5dfb69=_[_0x16aa('0x41')]({},_0x5dfb69,_0x191261['options']);return db[_0x16aa('0x2f')][_0x16aa('0x47')](_0x5dfb69)[_0x16aa('0x26')](function(_0x805e59){if(_0x805e59){_0x22ce77=_0x805e59;return _0x805e59[_0x16aa('0x69')]();}return null;})[_0x16aa('0x26')](function(_0x537eb1){if(_0x537eb1){if(!_0x537eb1[_0x16aa('0x39')]){throw new db[(_0x16aa('0x8a'))]['ValidationErrorItem'](_0x16aa('0x6b'),0x193);}_0x327b40=_0x537eb1;return db['AnalyticMetric'][_0x16aa('0x44')]({'raw':!![]});}return null;})['then'](function(_0x5959e0){if(_0x5959e0){_0x31aa85=_['keyBy'](_0x5959e0,'id');var _0x1b0e12;var _0x1b174e=squel['select']();_0x1b174e[_0x16aa('0x6e')](_0x22ce77[_0x16aa('0x6f')]);for(var _0x4f1ecb=0x0;_0x4f1ecb<_0x327b40[_0x16aa('0x39')];_0x4f1ecb+=0x1){_0x1b0e12=_0x327b40[_0x4f1ecb]['MetricId']?_0x31aa85[_0x327b40[_0x4f1ecb][_0x16aa('0x70')]][_0x16aa('0x71')]:_0x327b40[_0x4f1ecb][_0x16aa('0x72')];_0x1b0e12=_0x327b40[_0x4f1ecb][_0x16aa('0x73')]?_[_0x16aa('0x75')](_0x209280[_0x327b40[_0x4f1ecb]['function']],'%s',_0x1b0e12):_0x1b0e12;_0x1b0e12=_0x327b40[_0x4f1ecb][_0x16aa('0x74')]?_[_0x16aa('0x75')](_0x81bef7[_0x327b40[_0x4f1ecb]['format']],'%s',_0x1b0e12):_0x1b0e12;if(_0x327b40[_0x4f1ecb][_0x16aa('0x8c')]){_0x1b174e[_0x16aa('0x65')](_0x1b0e12);}_0x327b40[_0x4f1ecb][_0x16aa('0x76')]&&_0x1b174e['order'](_0x1b0e12,_0x327b40[_0x4f1ecb][_0x16aa('0x76')]===_0x16aa('0x78')?![]:!![]);_0x1b174e[_0x16aa('0x72')](_0x1b0e12,_0x327b40[_0x4f1ecb][_0x16aa('0x79')]||_0x1b0e12);}if(_0x22ce77[_0x16aa('0x7a')]){_0x22ce77[_0x16aa('0x7a')]=JSON[_0x16aa('0x7b')](_0x22ce77[_0x16aa('0x7a')]);for(var _0x249573=0x0;_0x249573<_0x22ce77[_0x16aa('0x7a')]['length'];_0x249573+=0x1){if(_0x22ce77[_0x16aa('0x7a')][_0x249573][_0x16aa('0x32')]&&_[_0x16aa('0x60')](_0x5f4f0b,_0x22ce77[_0x16aa('0x7a')][_0x249573][_0x16aa('0x32')])&&_0x22ce77[_0x16aa('0x7a')][_0x249573][_0x16aa('0x7c')]&&_0x22ce77[_0x16aa('0x7a')][_0x249573][_0x16aa('0x7e')]&&_0x22ce77['joins'][_0x249573][_0x16aa('0x7d')]){_0x1b174e[_0x22ce77[_0x16aa('0x7a')][_0x249573]['type']](_0x22ce77[_0x16aa('0x7a')][_0x249573][_0x16aa('0x7e')],null,util[_0x16aa('0x74')](_0x16aa('0x8d'),_0x22ce77[_0x16aa('0x6f')],_0x22ce77[_0x16aa('0x7a')][_0x249573][_0x16aa('0x7c')],_0x22ce77['joins'][_0x249573][_0x16aa('0x7e')],_0x22ce77[_0x16aa('0x7a')][_0x249573][_0x16aa('0x7d')]));}}}if(_0x22ce77[_0x16aa('0x7f')]){_0x22ce77[_0x16aa('0x7f')]=JSON[_0x16aa('0x7b')](_0x22ce77['conditions']);_0x1b174e[_0x16aa('0x3d')](_0x512608(_0x22ce77['conditions']['group']));}_0x52b8d9=_0x1b174e[_0x16aa('0x80')]();_0x1b174e[_0x16aa('0x1f')](_0x4e128e);_0x1b174e[_0x16aa('0x1d')](0x0);logger['debug'](_0x16aa('0xa4'),_0x1b174e['toString']());return dbH['sequelize']['query'](_0x1b174e[_0x16aa('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0x16aa('0x84')]});}})[_0x16aa('0x26')](function(){return{'sql':_0x52b8d9['toString']()};})[_0x16aa('0x26')](respondWithResult(_0x4a0d7a,null))['catch'](handleError(_0x4a0d7a,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 458d590..700d9cf 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 _0xe6ee=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','../../config/logger','api','request-promise'];(function(_0x169fcd,_0x421ad8){var _0x38e1b3=function(_0x392f91){while(--_0x392f91){_0x169fcd['push'](_0x169fcd['shift']());}};_0x38e1b3(++_0x421ad8);}(_0xe6ee,0x8c));var _0xee6e=function(_0x3152a2,_0x79816c){_0x3152a2=_0x3152a2-0x0;var _0x169e23=_0xe6ee[_0x3152a2];return _0x169e23;};'use strict';var _=require(_0xee6e('0x0'));var util=require('util');var logger=require(_0xee6e('0x1'))(_0xee6e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xee6e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xee6e('0x4'));var attributes=require(_0xee6e('0x5'));module[_0xee6e('0x6')]=function(_0x348ee5,_0x389527){return _0x348ee5[_0xee6e('0x7')](_0xee6e('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec36=['./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x173f6a,_0x2ddc18){var _0x29ae30=function(_0x598c40){while(--_0x598c40){_0x173f6a['push'](_0x173f6a['shift']());}};_0x29ae30(++_0x2ddc18);}(_0xec36,0xbe));var _0x6ec3=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xec36[_0x15ea09];return _0x3e9c78;};'use strict';var _=require(_0x6ec3('0x0'));var util=require(_0x6ec3('0x1'));var logger=require('../../config/logger')(_0x6ec3('0x2'));var moment=require(_0x6ec3('0x3'));var BPromise=require(_0x6ec3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ec3('0x5'));var rimraf=require(_0x6ec3('0x6'));var config=require(_0x6ec3('0x7'));var attributes=require(_0x6ec3('0x8'));module['exports']=function(_0x1bc03b,_0x228c77){return _0x1bc03b[_0x6ec3('0x9')](_0x6ec3('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index c6823d9..18b136c 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 _0xeace=['code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dcfeb,_0x25c8a2){var _0x3827d0=function(_0x5637ba){while(--_0x5637ba){_0x3dcfeb['push'](_0x3dcfeb['shift']());}};_0x3827d0(++_0x25c8a2);}(_0xeace,0x123));var _0xeeac=function(_0x49a3ea,_0x575ad0){_0x49a3ea=_0x49a3ea-0x0;var _0x36be5e=_0xeace[_0x49a3ea];return _0x36be5e;};'use strict';var _=require(_0xeeac('0x0'));var util=require(_0xeeac('0x1'));var moment=require(_0xeeac('0x2'));var BPromise=require(_0xeeac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeeac('0x4'));var db=require(_0xeeac('0x5'))['db'];var utils=require(_0xeeac('0x6'));var logger=require('../../config/logger')(_0xeeac('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x54621a,_0x486ff1,_0x28cc45){return new BPromise(function(_0x44651e,_0x1bb891){return client[_0xeeac('0x8')](_0x54621a,_0x28cc45)[_0xeeac('0x9')](function(_0x5c0c63){logger[_0xeeac('0xa')](_0xeeac('0xb'),_0x486ff1,_0xeeac('0xc'));logger['debug'](_0xeeac('0xd'),_0x486ff1,_0xeeac('0xc'),JSON['stringify'](_0x5c0c63));if(_0x5c0c63['error']){if(_0x5c0c63[_0xeeac('0xe')][_0xeeac('0xf')]===0x1f4){logger[_0xeeac('0xe')](_0xeeac('0xb'),_0x486ff1,_0x5c0c63[_0xeeac('0xe')]['message']);return _0x1bb891(_0x5c0c63[_0xeeac('0xe')][_0xeeac('0x10')]);}logger[_0xeeac('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x486ff1,_0x5c0c63['error'][_0xeeac('0x10')]);return _0x44651e(_0x5c0c63[_0xeeac('0xe')]['message']);}else{logger[_0xeeac('0xa')](_0xeeac('0xb'),_0x486ff1,'request\x20sent');_0x44651e(_0x5c0c63[_0xeeac('0x11')][_0xeeac('0x10')]);}})['catch'](function(_0xf00418){logger[_0xeeac('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x486ff1,_0xf00418);_0x1bb891(_0xf00418);});});}
\ No newline at end of file
+var _0x33b2=['jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x33b2,0xf9));var _0x233b=function(_0x5a5365,_0x4a3c7f){_0x5a5365=_0x5a5365-0x0;var _0x2b1919=_0x33b2[_0x5a5365];return _0x2b1919;};'use strict';var _=require(_0x233b('0x0'));var util=require(_0x233b('0x1'));var moment=require(_0x233b('0x2'));var BPromise=require(_0x233b('0x3'));var rs=require(_0x233b('0x4'));var fs=require('fs');var Redis=require(_0x233b('0x5'));var db=require(_0x233b('0x6'))['db'];var utils=require(_0x233b('0x7'));var logger=require(_0x233b('0x8'))(_0x233b('0x9'));var config=require(_0x233b('0xa'));var jayson=require(_0x233b('0xb'));var client=jayson[_0x233b('0xc')][_0x233b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1bd51d,_0x40f2a8,_0x524942){return new BPromise(function(_0x4d858b,_0x2d1fcf){return client['request'](_0x1bd51d,_0x524942)[_0x233b('0xe')](function(_0x479c61){logger[_0x233b('0xf')](_0x233b('0x10'),_0x40f2a8,_0x233b('0x11'));logger[_0x233b('0x12')](_0x233b('0x13'),_0x40f2a8,_0x233b('0x11'),JSON[_0x233b('0x14')](_0x479c61));if(_0x479c61[_0x233b('0x15')]){if(_0x479c61['error'][_0x233b('0x16')]===0x1f4){logger[_0x233b('0x15')](_0x233b('0x10'),_0x40f2a8,_0x479c61[_0x233b('0x15')][_0x233b('0x17')]);return _0x2d1fcf(_0x479c61[_0x233b('0x15')][_0x233b('0x17')]);}logger[_0x233b('0x15')](_0x233b('0x10'),_0x40f2a8,_0x479c61[_0x233b('0x15')][_0x233b('0x17')]);return _0x4d858b(_0x479c61[_0x233b('0x15')][_0x233b('0x17')]);}else{logger[_0x233b('0xf')](_0x233b('0x10'),_0x40f2a8,_0x233b('0x11'));_0x4d858b(_0x479c61[_0x233b('0x18')]['message']);}})[_0x233b('0x19')](function(_0x175bdd){logger[_0x233b('0x15')](_0x233b('0x10'),_0x40f2a8,_0x175bdd);_0x2d1fcf(_0x175bdd);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 9397d71..7e20764 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 _0xebdb=['show','preview','/:id/run','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xebdb,0x16e));var _0xbebd=function(_0x39d1dc,_0x1dc490){_0x39d1dc=_0x39d1dc-0x0;var _0xaaaafa=_0xebdb[_0x39d1dc];return _0xaaaafa;};'use strict';var multer=require(_0xbebd('0x0'));var util=require('util');var path=require(_0xbebd('0x1'));var timeout=require(_0xbebd('0x2'));var express=require(_0xbebd('0x3'));var router=express[_0xbebd('0x4')]();var fs_extra=require(_0xbebd('0x5'));var auth=require(_0xbebd('0x6'));var interaction=require(_0xbebd('0x7'));var config=require('../../config/environment');var controller=require(_0xbebd('0x8'));router[_0xbebd('0x9')]('/',auth[_0xbebd('0xa')](),controller[_0xbebd('0xb')]);router[_0xbebd('0x9')]('/:id',auth[_0xbebd('0xa')](),controller[_0xbebd('0xc')]);router[_0xbebd('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xbebd('0xd')]);router[_0xbebd('0x9')](_0xbebd('0xe'),auth[_0xbebd('0xa')](),controller['run']);router[_0xbebd('0x9')]('/:id/query',auth[_0xbebd('0xa')](),controller['query']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbebd('0xf')](_0xbebd('0x10'),auth[_0xbebd('0xa')](),controller[_0xbebd('0x11')]);router[_0xbebd('0x12')]('/:id',auth[_0xbebd('0xa')](),controller[_0xbebd('0x13')]);module[_0xbebd('0x14')]=router;
\ No newline at end of file
+var _0x1b9e=['show','/:id/preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','isAuthenticated','index','get','/:id'];(function(_0xaa5d82,_0xef3d68){var _0x191e26=function(_0x38772c){while(--_0x38772c){_0xaa5d82['push'](_0xaa5d82['shift']());}};_0x191e26(++_0xef3d68);}(_0x1b9e,0x1c4));var _0xe1b9=function(_0x8e8abb,_0x4ccb05){_0x8e8abb=_0x8e8abb-0x0;var _0x9dfe92=_0x1b9e[_0x8e8abb];return _0x9dfe92;};'use strict';var multer=require('multer');var util=require(_0xe1b9('0x0'));var path=require('path');var timeout=require(_0xe1b9('0x1'));var express=require(_0xe1b9('0x2'));var router=express[_0xe1b9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xe1b9('0x4')](),controller[_0xe1b9('0x5')]);router[_0xe1b9('0x6')](_0xe1b9('0x7'),auth[_0xe1b9('0x4')](),controller[_0xe1b9('0x8')]);router[_0xe1b9('0x6')](_0xe1b9('0x9'),auth['isAuthenticated'](),controller['preview']);router[_0xe1b9('0x6')](_0xe1b9('0xa'),auth[_0xe1b9('0x4')](),controller[_0xe1b9('0xb')]);router[_0xe1b9('0x6')](_0xe1b9('0xc'),auth['isAuthenticated'](),controller['query']);router[_0xe1b9('0xd')]('/',auth['isAuthenticated'](),controller[_0xe1b9('0xe')]);router[_0xe1b9('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe1b9('0x10')]);router[_0xe1b9('0x11')](_0xe1b9('0x7'),auth['isAuthenticated'](),controller[_0xe1b9('0x12')]);module[_0xe1b9('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 27ec420..e36db95 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 _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x7f03ae,_0x38b1aa){var _0x538b5e=function(_0x2c69b9){while(--_0x2c69b9){_0x7f03ae['push'](_0x7f03ae['shift']());}};_0x538b5e(++_0x38b1aa);}(_0xe14b,0x93));var _0xbe14=function(_0x319b5b,_0x5f2557){_0x319b5b=_0x319b5b-0x0;var _0x7e5198=_0xe14b[_0x319b5b];return _0x7e5198;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
+var _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0xf8d2c5,_0x5daed5){var _0x407c3f=function(_0x333556){while(--_0x333556){_0xf8d2c5['push'](_0xf8d2c5['shift']());}};_0x407c3f(++_0x5daed5);}(_0x5d17,0x114));var _0x75d1=function(_0x32b312,_0x4e3f0f){_0x32b312=_0x32b312-0x0;var _0x313368=_0x5d17[_0x32b312];return _0x313368;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 934443c..3324b7d 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 _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x4c1c26,_0xffeca){var _0x44969b=function(_0x515ebd){while(--_0x515ebd){_0x4c1c26['push'](_0x4c1c26['shift']());}};_0x44969b(++_0xffeca);}(_0x4975,0x86));var _0x5497=function(_0x3f1086,_0x1f798c){_0x3f1086=_0x3f1086-0x0;var _0x59792f=_0x4975[_0x3f1086];return _0x59792f;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
+var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x26638c,_0x3188d1){var _0x1546bb=function(_0x375b76){while(--_0x375b76){_0x26638c['push'](_0x26638c['shift']());}};_0x1546bb(++_0x3188d1);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5a83c97..fcf823c 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 _0x4812=['rimraf','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','../../config/logger','api','moment'];(function(_0x27663f,_0x1f04e8){var _0xb0d3e0=function(_0x28a80c){while(--_0x28a80c){_0x27663f['push'](_0x27663f['shift']());}};_0xb0d3e0(++_0x1f04e8);}(_0x4812,0xd4));var _0x2481=function(_0x4f4c39,_0x4340c7){_0x4f4c39=_0x4f4c39-0x0;var _0x5cd7bb=_0x4812[_0x4f4c39];return _0x5cd7bb;};'use strict';var _=require(_0x2481('0x0'));var util=require('util');var logger=require(_0x2481('0x1'))(_0x2481('0x2'));var moment=require(_0x2481('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2481('0x4'));var config=require('../../config/environment');var attributes=require(_0x2481('0x5'));module[_0x2481('0x6')]=function(_0x2c6138,_0x3cd28e){return _0x2c6138[_0x2481('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0x2481('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6196=['./analyticDefaultReport.attributes','exports','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4702d7,_0xa6908e){var _0x1433a3=function(_0x2b7e94){while(--_0x2b7e94){_0x4702d7['push'](_0x4702d7['shift']());}};_0x1433a3(++_0xa6908e);}(_0x6196,0xc9));var _0x6619=function(_0x44337,_0x490928){_0x44337=_0x44337-0x0;var _0x360e9f=_0x6196[_0x44337];return _0x360e9f;};'use strict';var _=require('lodash');var util=require(_0x6619('0x0'));var logger=require(_0x6619('0x1'))(_0x6619('0x2'));var moment=require('moment');var BPromise=require(_0x6619('0x3'));var rp=require(_0x6619('0x4'));var fs=require('fs');var path=require(_0x6619('0x5'));var rimraf=require(_0x6619('0x6'));var config=require(_0x6619('0x7'));var attributes=require(_0x6619('0x8'));module[_0x6619('0x9')]=function(_0x156662,_0x1ab21a){return _0x156662[_0x6619('0xa')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index c7b2ec7..1def249 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 _0x5dd4=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x28be07,_0x5add82){var _0x583c6a=function(_0x5040a5){while(--_0x5040a5){_0x28be07['push'](_0x28be07['shift']());}};_0x583c6a(++_0x5add82);}(_0x5dd4,0x66));var _0x45dd=function(_0x331dc2,_0x310a33){_0x331dc2=_0x331dc2-0x0;var _0x27d4c8=_0x5dd4[_0x331dc2];return _0x27d4c8;};'use strict';var _=require(_0x45dd('0x0'));var util=require('util');var moment=require(_0x45dd('0x1'));var BPromise=require(_0x45dd('0x2'));var rs=require(_0x45dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45dd('0x4'))['db'];var utils=require(_0x45dd('0x5'));var logger=require('../../config/logger')(_0x45dd('0x6'));var config=require(_0x45dd('0x7'));var jayson=require(_0x45dd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x435dd8,_0x375558,_0xf33777){return new BPromise(function(_0x1c5681,_0x4353b9){return client[_0x45dd('0x9')](_0x435dd8,_0xf33777)[_0x45dd('0xa')](function(_0x51b9b3){logger[_0x45dd('0xb')](_0x45dd('0xc'),_0x375558,_0x45dd('0xd'));logger['debug'](_0x45dd('0xe'),_0x375558,_0x45dd('0xd'),JSON[_0x45dd('0xf')](_0x51b9b3));if(_0x51b9b3[_0x45dd('0x10')]){if(_0x51b9b3['error']['code']===0x1f4){logger['error'](_0x45dd('0xc'),_0x375558,_0x51b9b3['error'][_0x45dd('0x11')]);return _0x4353b9(_0x51b9b3[_0x45dd('0x10')][_0x45dd('0x11')]);}logger[_0x45dd('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x375558,_0x51b9b3[_0x45dd('0x10')][_0x45dd('0x11')]);return _0x1c5681(_0x51b9b3[_0x45dd('0x10')][_0x45dd('0x11')]);}else{logger[_0x45dd('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x375558,'request\x20sent');_0x1c5681(_0x51b9b3[_0x45dd('0x12')][_0x45dd('0x11')]);}})[_0x45dd('0x13')](function(_0x521458){logger[_0x45dd('0x10')](_0x45dd('0xc'),_0x375558,_0x521458);_0x4353b9(_0x521458);});});}
\ No newline at end of file
+var _0x49fd=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3a186d,_0x329748){var _0x2abd02=function(_0x38a1d6){while(--_0x38a1d6){_0x3a186d['push'](_0x3a186d['shift']());}};_0x2abd02(++_0x329748);}(_0x49fd,0x1a5));var _0xd49f=function(_0x1a829e,_0x25602f){_0x1a829e=_0x1a829e-0x0;var _0x11177b=_0x49fd[_0x1a829e];return _0x11177b;};'use strict';var _=require(_0xd49f('0x0'));var util=require(_0xd49f('0x1'));var moment=require(_0xd49f('0x2'));var BPromise=require(_0xd49f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd49f('0x4'));var db=require(_0xd49f('0x5'))['db'];var utils=require(_0xd49f('0x6'));var logger=require('../../config/logger')(_0xd49f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd49f('0x8'));var client=jayson[_0xd49f('0x9')][_0xd49f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a51a7,_0x11725b,_0x7d6d0f){return new BPromise(function(_0x140273,_0x13ea7a){return client[_0xd49f('0xb')](_0x3a51a7,_0x7d6d0f)[_0xd49f('0xc')](function(_0x303e02){logger[_0xd49f('0xd')](_0xd49f('0xe'),_0x11725b,_0xd49f('0xf'));logger['debug'](_0xd49f('0x10'),_0x11725b,_0xd49f('0xf'),JSON['stringify'](_0x303e02));if(_0x303e02[_0xd49f('0x11')]){if(_0x303e02[_0xd49f('0x11')][_0xd49f('0x12')]===0x1f4){logger[_0xd49f('0x11')](_0xd49f('0xe'),_0x11725b,_0x303e02['error'][_0xd49f('0x13')]);return _0x13ea7a(_0x303e02[_0xd49f('0x11')][_0xd49f('0x13')]);}logger['error'](_0xd49f('0xe'),_0x11725b,_0x303e02[_0xd49f('0x11')][_0xd49f('0x13')]);return _0x140273(_0x303e02[_0xd49f('0x11')]['message']);}else{logger[_0xd49f('0xd')](_0xd49f('0xe'),_0x11725b,'request\x20sent');_0x140273(_0x303e02[_0xd49f('0x14')]['message']);}})[_0xd49f('0x15')](function(_0x57428a){logger[_0xd49f('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x11725b,_0x57428a);_0x13ea7a(_0x57428a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 9be67ac..42fbe17 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 _0xe45e=['run','/:id/query','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','index','isAuthenticated','show','preview'];(function(_0x196257,_0x256195){var _0x30d5c7=function(_0x100531){while(--_0x100531){_0x196257['push'](_0x196257['shift']());}};_0x30d5c7(++_0x256195);}(_0xe45e,0x1c0));var _0xee45=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0xe45e[_0x471448];return _0x38190b;};'use strict';var multer=require(_0xee45('0x0'));var util=require(_0xee45('0x1'));var path=require(_0xee45('0x2'));var timeout=require(_0xee45('0x3'));var express=require('express');var router=express[_0xee45('0x4')]();var fs_extra=require(_0xee45('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee45('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xee45('0x7')]('/',auth['isAuthenticated'](),controller[_0xee45('0x8')]);router[_0xee45('0x7')]('/:id',auth[_0xee45('0x9')](),controller[_0xee45('0xa')]);router['get']('/:id/preview',auth[_0xee45('0x9')](),controller[_0xee45('0xb')]);router[_0xee45('0x7')]('/:id/run',auth[_0xee45('0x9')](),controller[_0xee45('0xc')]);router[_0xee45('0x7')](_0xee45('0xd'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xee45('0x9')](),controller[_0xee45('0xe')]);router[_0xee45('0xf')](_0xee45('0x10'),auth[_0xee45('0x9')](),controller['update']);router[_0xee45('0x11')](_0xee45('0x10'),auth[_0xee45('0x9')](),controller[_0xee45('0x12')]);module[_0xee45('0x13')]=router;
\ No newline at end of file
+var _0xc066=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','index','get','/:id/preview','preview','/:id/run','run','isAuthenticated','query','post','create','/:id','update','exports','util','path','connect-timeout'];(function(_0x5dc22d,_0x2389d7){var _0x1fa851=function(_0x53d50d){while(--_0x53d50d){_0x5dc22d['push'](_0x5dc22d['shift']());}};_0x1fa851(++_0x2389d7);}(_0xc066,0x19f));var _0x6c06=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc066[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x6c06('0x0'));var path=require(_0x6c06('0x1'));var timeout=require(_0x6c06('0x2'));var express=require(_0x6c06('0x3'));var router=express[_0x6c06('0x4')]();var fs_extra=require(_0x6c06('0x5'));var auth=require(_0x6c06('0x6'));var interaction=require(_0x6c06('0x7'));var config=require('../../config/environment');var controller=require(_0x6c06('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6c06('0x9')]);router[_0x6c06('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6c06('0xa')](_0x6c06('0xb'),auth['isAuthenticated'](),controller[_0x6c06('0xc')]);router[_0x6c06('0xa')](_0x6c06('0xd'),auth['isAuthenticated'](),controller[_0x6c06('0xe')]);router[_0x6c06('0xa')]('/:id/query',auth[_0x6c06('0xf')](),controller[_0x6c06('0x10')]);router[_0x6c06('0x11')]('/',auth[_0x6c06('0xf')](),controller[_0x6c06('0x12')]);router['put'](_0x6c06('0x13'),auth[_0x6c06('0xf')](),controller[_0x6c06('0x14')]);router['delete']('/:id',auth[_0x6c06('0xf')](),controller['destroy']);module[_0x6c06('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 917e9c7..4cb861a 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 _0xafea=['Loading','manual','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','xlsx'];(function(_0xce9195,_0x1963e1){var _0x530fe6=function(_0x1b8055){while(--_0x1b8055){_0xce9195['push'](_0xce9195['shift']());}};_0x530fe6(++_0x1963e1);}(_0xafea,0x14e));var _0xaafe=function(_0x2db2c3,_0x2bad83){_0x2db2c3=_0x2db2c3-0x0;var _0x5c1c29=_0xafea[_0x2db2c3];return _0x5c1c29;};'use strict';var Sequelize=require(_0xaafe('0x0'));var moment=require(_0xaafe('0x1'));module['exports']={'name':{'type':Sequelize[_0xaafe('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xaafe('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xaafe('0x3')](_0xaafe('0x4'),'pdf',_0xaafe('0x5')),'allowNull':![],'defaultValue':_0xaafe('0x4')},'savename':{'type':Sequelize[_0xaafe('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xaafe('0x2')],'defaultValue':_0xaafe('0x6')},'type':{'type':Sequelize[_0xaafe('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xaafe('0x7')},'reportId':{'type':Sequelize[_0xaafe('0x8')](0xb)[_0xaafe('0x9')]},'reportType':{'type':Sequelize[_0xaafe('0x2')]}};
\ No newline at end of file
+var _0xc7f7=['csv','DATE','Loading','manual','INTEGER','sequelize','moment','STRING','ENUM','xlsx'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xc7f7,0x9b));var _0x7c7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7f7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7c7f('0x0'));var moment=require(_0x7c7f('0x1'));module['exports']={'name':{'type':Sequelize[_0x7c7f('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x7c7f('0x3')]('csv','pdf',_0x7c7f('0x4')),'allowNull':![],'defaultValue':_0x7c7f('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7c7f('0x6')]},'status':{'type':Sequelize[_0x7c7f('0x2')],'defaultValue':_0x7c7f('0x7')},'type':{'type':Sequelize[_0x7c7f('0x3')](_0x7c7f('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x7c7f('0x9')](0xb)['UNSIGNED']},'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 b350554..cc10165 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 _0x9237=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','output','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','AnalyticExtractedReport','fieldName','type','map','query','keys','filters','intersection','model'];(function(_0xdd7126,_0xf0bc57){var _0x50ee37=function(_0x6b85fb){while(--_0x6b85fb){_0xdd7126['push'](_0xdd7126['shift']());}};_0x50ee37(++_0xf0bc57);}(_0x9237,0x1a0));var _0x7923=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0x9237[_0x5bc5fe];return _0x298ea7;};'use strict';var emlformat=require(_0x7923('0x0'));var rimraf=require(_0x7923('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7923('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7923('0x3'));var Mustache=require(_0x7923('0x4'));var util=require(_0x7923('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x7923('0x6'));var ejs=require(_0x7923('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7923('0x8'));var squel=require(_0x7923('0x9'));var crypto=require(_0x7923('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7923('0xb'));var Redis=require(_0x7923('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7923('0xd'));var as=require(_0x7923('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7923('0xf'));var utils=require(_0x7923('0x10'));var config=require(_0x7923('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x7923('0x12'))['db'];function respondWithStatusCode(_0x20c946,_0x5a2175){_0x5a2175=_0x5a2175||0xcc;return function(_0xee510e){if(_0xee510e){return _0x20c946[_0x7923('0x13')](_0x5a2175);}return _0x20c946[_0x7923('0x14')](_0x5a2175)[_0x7923('0x15')]();};}function respondWithResult(_0x5b5e51,_0x451e07){_0x451e07=_0x451e07||0xc8;return function(_0x5eca16){if(_0x5eca16){return _0x5b5e51[_0x7923('0x14')](_0x451e07)[_0x7923('0x16')](_0x5eca16);}};}function respondWithFilteredResult(_0x1e3a68,_0x255da7){return function(_0x24dc2f){if(_0x24dc2f){var _0x1eb5b3=typeof _0x255da7[_0x7923('0x17')]===_0x7923('0x18')&&typeof _0x255da7[_0x7923('0x19')]===_0x7923('0x18');var _0x2d803d=_0x24dc2f['count'];var _0x42fa6f=_0x1eb5b3?0x0:_0x255da7['offset'];var _0x3dd08c=_0x1eb5b3?_0x24dc2f[_0x7923('0x1a')]:_0x255da7[_0x7923('0x17')]+_0x255da7[_0x7923('0x19')];var _0x104e45;if(_0x3dd08c>=_0x2d803d){_0x3dd08c=_0x2d803d;_0x104e45=0xc8;}else{_0x104e45=0xce;}_0x1e3a68[_0x7923('0x14')](_0x104e45);return _0x1e3a68[_0x7923('0x1b')](_0x7923('0x1c'),_0x42fa6f+'-'+_0x3dd08c+'/'+_0x2d803d)['json'](_0x24dc2f);}return null;};}function patchUpdates(_0x5b567f){return function(_0x338998){try{jsonpatch[_0x7923('0x1d')](_0x338998,_0x5b567f,!![]);}catch(_0x486317){return BPromise['reject'](_0x486317);}return _0x338998[_0x7923('0x1e')]();};}function saveUpdates(_0x493acb,_0x357c18){return function(_0x44e337){if(_0x44e337){return _0x44e337[_0x7923('0x1f')](_0x493acb)[_0x7923('0x20')](function(_0x2d2fbd){return _0x2d2fbd;});}return null;};}function removeEntity(_0x22c4e4,_0x5537d6){return function(_0x4698c0){if(_0x4698c0){return _0x4698c0[_0x7923('0x21')]()['then'](function(){var _0x3fac7d=_0x4698c0[_0x7923('0x22')]({'plain':!![]});var _0xe007c9=_0x7923('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0xe007c9,'resourceId':_0x3fac7d['id']}})[_0x7923('0x20')](function(){return _0x4698c0;});})[_0x7923('0x20')](function(){_0x22c4e4[_0x7923('0x14')](0xcc)[_0x7923('0x15')]();});}};}function handleEntityNotFound(_0x2ee865,_0x30f88f){return function(_0x1570b2){if(!_0x1570b2){_0x2ee865['sendStatus'](0x194);}return _0x1570b2;};}function handleError(_0x4e5a97,_0x50433b){_0x50433b=_0x50433b||0x1f4;return function(_0x56ba05){logger[_0x7923('0x24')](_0x56ba05[_0x7923('0x25')]);if(_0x56ba05[_0x7923('0x26')]){delete _0x56ba05[_0x7923('0x26')];}_0x4e5a97[_0x7923('0x14')](_0x50433b)[_0x7923('0x27')](_0x56ba05);};}exports['index']=function(_0x22396c,_0x4024da){var _0x5a885a={},_0x5dc72a={},_0x52240d={'count':0x0,'rows':[]};var _0x54f0ef=_['map'](db[_0x7923('0x28')]['rawAttributes'],function(_0x10f7cf){return{'name':_0x10f7cf[_0x7923('0x29')],'type':_0x10f7cf[_0x7923('0x2a')]['key']};});_0x5dc72a['model']=_[_0x7923('0x2b')](_0x54f0ef,_0x7923('0x26'));_0x5dc72a[_0x7923('0x2c')]=_[_0x7923('0x2d')](_0x22396c['query']);_0x5dc72a[_0x7923('0x2e')]=_[_0x7923('0x2f')](_0x5dc72a[_0x7923('0x30')],_0x5dc72a[_0x7923('0x2c')]);_0x5a885a[_0x7923('0x31')]=_[_0x7923('0x2f')](_0x5dc72a['model'],qs[_0x7923('0x32')](_0x22396c[_0x7923('0x2c')][_0x7923('0x32')]));_0x5a885a[_0x7923('0x31')]=_0x5a885a['attributes'][_0x7923('0x33')]?_0x5a885a[_0x7923('0x31')]:_0x5dc72a[_0x7923('0x30')];if(!_0x22396c[_0x7923('0x2c')][_0x7923('0x34')](_0x7923('0x35'))){_0x5a885a['limit']=qs[_0x7923('0x19')](_0x22396c[_0x7923('0x2c')][_0x7923('0x19')]);_0x5a885a['offset']=qs[_0x7923('0x17')](_0x22396c[_0x7923('0x2c')][_0x7923('0x17')]);}_0x5a885a[_0x7923('0x36')]=qs[_0x7923('0x37')](_0x22396c['query']['sort']);_0x5a885a[_0x7923('0x38')]=qs[_0x7923('0x2e')](_['pick'](_0x22396c[_0x7923('0x2c')],_0x5dc72a['filters']),_0x54f0ef);if(_0x22396c[_0x7923('0x2c')][_0x7923('0x39')]){_0x5a885a[_0x7923('0x38')]=_[_0x7923('0x3a')](_0x5a885a[_0x7923('0x38')],{'$or':_['map'](_0x54f0ef,function(_0x5c095a){if(_0x5c095a[_0x7923('0x2a')]!==_0x7923('0x3b')){var _0x59e627={};_0x59e627[_0x5c095a[_0x7923('0x26')]]={'$like':'%'+_0x22396c[_0x7923('0x2c')][_0x7923('0x39')]+'%'};return _0x59e627;}})});}_0x5a885a=_[_0x7923('0x3a')]({},_0x5a885a,_0x22396c['options']);var _0x18563e={'where':_0x5a885a['where']};return db['AnalyticExtractedReport'][_0x7923('0x1a')](_0x18563e)[_0x7923('0x20')](function(_0x154458){_0x52240d[_0x7923('0x1a')]=_0x154458;if(_0x22396c['query'][_0x7923('0x3c')]){_0x5a885a[_0x7923('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x7923('0x3e')](_0x5a885a);})[_0x7923('0x20')](function(_0x22a9ea){_0x52240d['rows']=_0x22a9ea;return _0x52240d;})[_0x7923('0x20')](respondWithFilteredResult(_0x4024da,_0x5a885a))[_0x7923('0x3f')](handleError(_0x4024da,null));};exports[_0x7923('0x40')]=function(_0x426cde,_0x2760f4){var _0xcf1beb={'raw':!![],'where':{'id':_0x426cde['params']['id']}},_0x3e37e5={};_0x3e37e5['model']=_['keys'](db['AnalyticExtractedReport'][_0x7923('0x41')]);_0x3e37e5['query']=_[_0x7923('0x2d')](_0x426cde[_0x7923('0x2c')]);_0x3e37e5[_0x7923('0x2e')]=_[_0x7923('0x2f')](_0x3e37e5[_0x7923('0x30')],_0x3e37e5[_0x7923('0x2c')]);_0xcf1beb[_0x7923('0x31')]=_[_0x7923('0x2f')](_0x3e37e5[_0x7923('0x30')],qs[_0x7923('0x32')](_0x426cde[_0x7923('0x2c')][_0x7923('0x32')]));_0xcf1beb[_0x7923('0x31')]=_0xcf1beb[_0x7923('0x31')]['length']?_0xcf1beb['attributes']:_0x3e37e5[_0x7923('0x30')];if(_0x426cde[_0x7923('0x2c')][_0x7923('0x3c')]){_0xcf1beb[_0x7923('0x3d')]=[{'all':!![]}];}_0xcf1beb=_[_0x7923('0x3a')]({},_0xcf1beb,_0x426cde[_0x7923('0x42')]);return db[_0x7923('0x28')][_0x7923('0x43')](_0xcf1beb)[_0x7923('0x20')](handleEntityNotFound(_0x2760f4,null))[_0x7923('0x20')](respondWithResult(_0x2760f4,null))[_0x7923('0x3f')](handleError(_0x2760f4,null));};exports[_0x7923('0x44')]=function(_0x5d776b,_0x44c022){return db[_0x7923('0x28')]['create'](_0x5d776b[_0x7923('0x45')],{})[_0x7923('0x20')](function(_0x186465){var _0x363dbd=_0x5d776b['user']['get']({'plain':!![]});if(!_0x363dbd)throw new Error(_0x7923('0x46'));if(_0x363dbd[_0x7923('0x47')]===_0x7923('0x48')){var _0x4edb05=_0x186465[_0x7923('0x22')]({'plain':!![]});var _0x43e24f=_0x7923('0x23');return db[_0x7923('0x49')][_0x7923('0x43')]({'where':{'name':_0x43e24f,'userProfileId':_0x363dbd[_0x7923('0x4a')]},'raw':!![]})[_0x7923('0x20')](function(_0x242065){if(_0x242065&&_0x242065[_0x7923('0x4b')]===0x0){return db[_0x7923('0x4c')][_0x7923('0x44')]({'name':_0x4edb05['name'],'resourceId':_0x4edb05['id'],'type':_0x242065[_0x7923('0x26')],'sectionId':_0x242065['id']},{})['then'](function(){return _0x186465;});}else{return _0x186465;}})['catch'](function(_0x1059fe){logger[_0x7923('0x24')](_0x7923('0x4d'),_0x1059fe);throw _0x1059fe;});}return _0x186465;})[_0x7923('0x20')](respondWithResult(_0x44c022,0xc9))[_0x7923('0x3f')](handleError(_0x44c022,null));};exports[_0x7923('0x1f')]=function(_0x11bb46,_0x36425b){if(_0x11bb46[_0x7923('0x45')]['id']){delete _0x11bb46['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x11bb46[_0x7923('0x4e')]['id']}})[_0x7923('0x20')](handleEntityNotFound(_0x36425b,null))['then'](saveUpdates(_0x11bb46[_0x7923('0x45')],null))['then'](respondWithResult(_0x36425b,null))['catch'](handleError(_0x36425b,null));};exports[_0x7923('0x21')]=function(_0x309d96,_0x199acd){return db[_0x7923('0x28')][_0x7923('0x43')]({'where':{'id':_0x309d96['params']['id']}})[_0x7923('0x20')](handleEntityNotFound(_0x199acd,null))['then'](removeEntity(_0x199acd,null))[_0x7923('0x3f')](handleError(_0x199acd,null));};exports[_0x7923('0x4f')]=function(_0x2f6232,_0x1d4a5e,_0x38e71b){return db[_0x7923('0x28')][_0x7923('0x43')]({'where':{'id':_0x2f6232[_0x7923('0x4e')]['id']},'attributes':[_0x7923('0x26'),_0x7923('0x50'),'savename',_0x7923('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x1d4a5e,null))['then'](function(_0x466476){if(_0x466476){if(!fs['existsSync'](path[_0x7923('0x52')](config['root'],_0x7923('0x53'),_0x466476[_0x7923('0x54')]))){throw new db[(_0x7923('0x55'))][(_0x7923('0x56'))](_0x7923('0x57'));}if(_0x2f6232['query'][_0x7923('0x58')]){return _0x1d4a5e['sendStatus'](0xc8);}return _0x1d4a5e[_0x7923('0x4f')](path['join'](config[_0x7923('0x59')],_0x7923('0x53'),_0x466476[_0x7923('0x54')]),util[_0x7923('0x5a')](_0x7923('0x5b'),_0x466476[_0x7923('0x50')]||_0x466476['name'],_0x466476[_0x7923('0x51')][_0x7923('0x5c')]()));}})['catch'](handleError(_0x1d4a5e,null));};
\ No newline at end of file
+var _0x4cc8=['request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s'];(function(_0x27781b,_0x2e4f6b){var _0x55c433=function(_0x44f56c){while(--_0x44f56c){_0x27781b['push'](_0x27781b['shift']());}};_0x55c433(++_0x2e4f6b);}(_0x4cc8,0x174));var _0x84cc=function(_0x3255a5,_0x1b25e7){_0x3255a5=_0x3255a5-0x0;var _0x3e5f00=_0x4cc8[_0x3255a5];return _0x3e5f00;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x84cc('0x0'));var moment=require('moment');var BPromise=require(_0x84cc('0x1'));var Mustache=require(_0x84cc('0x2'));var util=require('util');var path=require(_0x84cc('0x3'));var sox=require(_0x84cc('0x4'));var csv=require(_0x84cc('0x5'));var ejs=require(_0x84cc('0x6'));var fs=require('fs');var fs_extra=require(_0x84cc('0x7'));var _=require(_0x84cc('0x8'));var squel=require('squel');var crypto=require(_0x84cc('0x9'));var jsforce=require(_0x84cc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x84cc('0x5'));var querystring=require('querystring');var Papa=require(_0x84cc('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x84cc('0xc'));var as=require(_0x84cc('0xd'));var hardwareService=require(_0x84cc('0xe'));var logger=require(_0x84cc('0xf'))(_0x84cc('0x10'));var utils=require(_0x84cc('0x11'));var config=require(_0x84cc('0x12'));var licenseUtil=require(_0x84cc('0x13'));var db=require(_0x84cc('0x14'))['db'];function respondWithStatusCode(_0x7062a4,_0x26a93c){_0x26a93c=_0x26a93c||0xcc;return function(_0x20decf){if(_0x20decf){return _0x7062a4[_0x84cc('0x15')](_0x26a93c);}return _0x7062a4['status'](_0x26a93c)[_0x84cc('0x16')]();};}function respondWithResult(_0x94c3b5,_0x4f3afe){_0x4f3afe=_0x4f3afe||0xc8;return function(_0x1d571b){if(_0x1d571b){return _0x94c3b5[_0x84cc('0x17')](_0x4f3afe)[_0x84cc('0x18')](_0x1d571b);}};}function respondWithFilteredResult(_0x10e5df,_0x3dc96e){return function(_0x141245){if(_0x141245){var _0x4636ad=typeof _0x3dc96e[_0x84cc('0x19')]===_0x84cc('0x1a')&&typeof _0x3dc96e['limit']===_0x84cc('0x1a');var _0x46f3b0=_0x141245[_0x84cc('0x1b')];var _0x1fc94a=_0x4636ad?0x0:_0x3dc96e[_0x84cc('0x19')];var _0x56454f=_0x4636ad?_0x141245[_0x84cc('0x1b')]:_0x3dc96e[_0x84cc('0x19')]+_0x3dc96e[_0x84cc('0x1c')];var _0x51d943;if(_0x56454f>=_0x46f3b0){_0x56454f=_0x46f3b0;_0x51d943=0xc8;}else{_0x51d943=0xce;}_0x10e5df['status'](_0x51d943);return _0x10e5df[_0x84cc('0x1d')](_0x84cc('0x1e'),_0x1fc94a+'-'+_0x56454f+'/'+_0x46f3b0)[_0x84cc('0x18')](_0x141245);}return null;};}function patchUpdates(_0x42f926){return function(_0x4e94c3){try{jsonpatch[_0x84cc('0x1f')](_0x4e94c3,_0x42f926,!![]);}catch(_0x3895c1){return BPromise[_0x84cc('0x20')](_0x3895c1);}return _0x4e94c3[_0x84cc('0x21')]();};}function saveUpdates(_0xbd3c50,_0xa60340){return function(_0x105d94){if(_0x105d94){return _0x105d94[_0x84cc('0x22')](_0xbd3c50)[_0x84cc('0x23')](function(_0x4fb109){return _0x4fb109;});}return null;};}function removeEntity(_0x10d4cf,_0x3438d9){return function(_0x2ba428){if(_0x2ba428){return _0x2ba428['destroy']()[_0x84cc('0x23')](function(){var _0x28f690=_0x2ba428[_0x84cc('0x24')]({'plain':!![]});var _0x1b2a91=_0x84cc('0x25');return db[_0x84cc('0x26')][_0x84cc('0x27')]({'where':{'type':_0x1b2a91,'resourceId':_0x28f690['id']}})[_0x84cc('0x23')](function(){return _0x2ba428;});})[_0x84cc('0x23')](function(){_0x10d4cf['status'](0xcc)[_0x84cc('0x16')]();});}};}function handleEntityNotFound(_0x2edc53,_0x319cfa){return function(_0xbb371c){if(!_0xbb371c){_0x2edc53[_0x84cc('0x15')](0x194);}return _0xbb371c;};}function handleError(_0x583e75,_0x2655fd){_0x2655fd=_0x2655fd||0x1f4;return function(_0x2a5856){logger[_0x84cc('0x28')](_0x2a5856['stack']);if(_0x2a5856[_0x84cc('0x29')]){delete _0x2a5856[_0x84cc('0x29')];}_0x583e75['status'](_0x2655fd)[_0x84cc('0x2a')](_0x2a5856);};}exports[_0x84cc('0x2b')]=function(_0x2a2457,_0x43b774){var _0xb4bc29={},_0x351f67={},_0x29844e={'count':0x0,'rows':[]};var _0x49e506=_['map'](db[_0x84cc('0x2c')][_0x84cc('0x2d')],function(_0x4c0c2f){return{'name':_0x4c0c2f[_0x84cc('0x2e')],'type':_0x4c0c2f[_0x84cc('0x2f')][_0x84cc('0x30')]};});_0x351f67['model']=_['map'](_0x49e506,_0x84cc('0x29'));_0x351f67['query']=_['keys'](_0x2a2457[_0x84cc('0x31')]);_0x351f67[_0x84cc('0x32')]=_[_0x84cc('0x33')](_0x351f67[_0x84cc('0x34')],_0x351f67[_0x84cc('0x31')]);_0xb4bc29[_0x84cc('0x35')]=_['intersection'](_0x351f67[_0x84cc('0x34')],qs['fields'](_0x2a2457[_0x84cc('0x31')][_0x84cc('0x36')]));_0xb4bc29[_0x84cc('0x35')]=_0xb4bc29[_0x84cc('0x35')][_0x84cc('0x37')]?_0xb4bc29[_0x84cc('0x35')]:_0x351f67[_0x84cc('0x34')];if(!_0x2a2457[_0x84cc('0x31')][_0x84cc('0x38')]('nolimit')){_0xb4bc29[_0x84cc('0x1c')]=qs[_0x84cc('0x1c')](_0x2a2457[_0x84cc('0x31')][_0x84cc('0x1c')]);_0xb4bc29['offset']=qs[_0x84cc('0x19')](_0x2a2457['query'][_0x84cc('0x19')]);}_0xb4bc29['order']=qs['sort'](_0x2a2457['query'][_0x84cc('0x39')]);_0xb4bc29[_0x84cc('0x3a')]=qs[_0x84cc('0x32')](_[_0x84cc('0x3b')](_0x2a2457[_0x84cc('0x31')],_0x351f67[_0x84cc('0x32')]),_0x49e506);if(_0x2a2457[_0x84cc('0x31')][_0x84cc('0x3c')]){_0xb4bc29[_0x84cc('0x3a')]=_[_0x84cc('0x3d')](_0xb4bc29['where'],{'$or':_[_0x84cc('0x3e')](_0x49e506,function(_0x571b0e){if(_0x571b0e[_0x84cc('0x2f')]!==_0x84cc('0x3f')){var _0x562aef={};_0x562aef[_0x571b0e[_0x84cc('0x29')]]={'$like':'%'+_0x2a2457['query'][_0x84cc('0x3c')]+'%'};return _0x562aef;}})});}_0xb4bc29=_[_0x84cc('0x3d')]({},_0xb4bc29,_0x2a2457[_0x84cc('0x40')]);var _0x187e2e={'where':_0xb4bc29[_0x84cc('0x3a')]};return db[_0x84cc('0x2c')][_0x84cc('0x1b')](_0x187e2e)['then'](function(_0x4d3129){_0x29844e[_0x84cc('0x1b')]=_0x4d3129;if(_0x2a2457[_0x84cc('0x31')]['includeAll']){_0xb4bc29[_0x84cc('0x41')]=[{'all':!![]}];}return db[_0x84cc('0x2c')]['findAll'](_0xb4bc29);})[_0x84cc('0x23')](function(_0x5ac369){_0x29844e[_0x84cc('0x42')]=_0x5ac369;return _0x29844e;})[_0x84cc('0x23')](respondWithFilteredResult(_0x43b774,_0xb4bc29))[_0x84cc('0x43')](handleError(_0x43b774,null));};exports[_0x84cc('0x44')]=function(_0xac1f2b,_0x47bd71){var _0x1b066a={'raw':!![],'where':{'id':_0xac1f2b[_0x84cc('0x45')]['id']}},_0x456ea5={};_0x456ea5[_0x84cc('0x34')]=_['keys'](db['AnalyticExtractedReport']['rawAttributes']);_0x456ea5[_0x84cc('0x31')]=_['keys'](_0xac1f2b['query']);_0x456ea5[_0x84cc('0x32')]=_[_0x84cc('0x33')](_0x456ea5['model'],_0x456ea5[_0x84cc('0x31')]);_0x1b066a[_0x84cc('0x35')]=_[_0x84cc('0x33')](_0x456ea5[_0x84cc('0x34')],qs['fields'](_0xac1f2b['query'][_0x84cc('0x36')]));_0x1b066a[_0x84cc('0x35')]=_0x1b066a[_0x84cc('0x35')][_0x84cc('0x37')]?_0x1b066a[_0x84cc('0x35')]:_0x456ea5[_0x84cc('0x34')];if(_0xac1f2b[_0x84cc('0x31')][_0x84cc('0x46')]){_0x1b066a[_0x84cc('0x41')]=[{'all':!![]}];}_0x1b066a=_['merge']({},_0x1b066a,_0xac1f2b[_0x84cc('0x40')]);return db[_0x84cc('0x2c')][_0x84cc('0x47')](_0x1b066a)['then'](handleEntityNotFound(_0x47bd71,null))[_0x84cc('0x23')](respondWithResult(_0x47bd71,null))[_0x84cc('0x43')](handleError(_0x47bd71,null));};exports[_0x84cc('0x48')]=function(_0x13dc98,_0x4d8f61){return db[_0x84cc('0x2c')][_0x84cc('0x48')](_0x13dc98['body'],{})[_0x84cc('0x23')](function(_0x3bf7ca){var _0x4623db=_0x13dc98[_0x84cc('0x49')]['get']({'plain':!![]});if(!_0x4623db)throw new Error(_0x84cc('0x4a'));if(_0x4623db[_0x84cc('0x4b')]===_0x84cc('0x49')){var _0x5b7dea=_0x3bf7ca[_0x84cc('0x24')]({'plain':!![]});var _0x1b3f4a='ExtractedReports';return db[_0x84cc('0x4c')][_0x84cc('0x47')]({'where':{'name':_0x1b3f4a,'userProfileId':_0x4623db[_0x84cc('0x4d')]},'raw':!![]})[_0x84cc('0x23')](function(_0x77f014){if(_0x77f014&&_0x77f014[_0x84cc('0x4e')]===0x0){return db[_0x84cc('0x26')][_0x84cc('0x48')]({'name':_0x5b7dea[_0x84cc('0x29')],'resourceId':_0x5b7dea['id'],'type':_0x77f014[_0x84cc('0x29')],'sectionId':_0x77f014['id']},{})[_0x84cc('0x23')](function(){return _0x3bf7ca;});}else{return _0x3bf7ca;}})['catch'](function(_0x25cb9c){logger['error'](_0x84cc('0x4f'),_0x25cb9c);throw _0x25cb9c;});}return _0x3bf7ca;})[_0x84cc('0x23')](respondWithResult(_0x4d8f61,0xc9))[_0x84cc('0x43')](handleError(_0x4d8f61,null));};exports[_0x84cc('0x22')]=function(_0x62a0f0,_0x3f6674){if(_0x62a0f0['body']['id']){delete _0x62a0f0[_0x84cc('0x50')]['id'];}return db['AnalyticExtractedReport'][_0x84cc('0x47')]({'where':{'id':_0x62a0f0[_0x84cc('0x45')]['id']}})[_0x84cc('0x23')](handleEntityNotFound(_0x3f6674,null))[_0x84cc('0x23')](saveUpdates(_0x62a0f0[_0x84cc('0x50')],null))[_0x84cc('0x23')](respondWithResult(_0x3f6674,null))[_0x84cc('0x43')](handleError(_0x3f6674,null));};exports[_0x84cc('0x27')]=function(_0xd389ac,_0x58e985){return db['AnalyticExtractedReport'][_0x84cc('0x47')]({'where':{'id':_0xd389ac[_0x84cc('0x45')]['id']}})[_0x84cc('0x23')](handleEntityNotFound(_0x58e985,null))['then'](removeEntity(_0x58e985,null))['catch'](handleError(_0x58e985,null));};exports['download']=function(_0x362427,_0x4ae54e,_0x434852){return db[_0x84cc('0x2c')][_0x84cc('0x47')]({'where':{'id':_0x362427[_0x84cc('0x45')]['id']},'attributes':['name',_0x84cc('0x51'),_0x84cc('0x52'),_0x84cc('0x53')],'raw':!![]})[_0x84cc('0x23')](handleEntityNotFound(_0x4ae54e,null))['then'](function(_0x5877e5){if(_0x5877e5){if(!fs[_0x84cc('0x54')](path[_0x84cc('0x55')](config[_0x84cc('0x56')],_0x84cc('0x57'),_0x5877e5[_0x84cc('0x52')]))){throw new db[(_0x84cc('0x58'))]['ValidationError'](_0x84cc('0x59'));}if(_0x362427[_0x84cc('0x31')]['exists']){return _0x4ae54e[_0x84cc('0x15')](0xc8);}return _0x4ae54e[_0x84cc('0x5a')](path[_0x84cc('0x55')](config[_0x84cc('0x56')],_0x84cc('0x57'),_0x5877e5['savename']),util[_0x84cc('0x5b')](_0x84cc('0x5c'),_0x5877e5['basename']||_0x5877e5['name'],_0x5877e5[_0x84cc('0x53')]['toLowerCase']()));}})[_0x84cc('0x43')](handleError(_0x4ae54e,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index a83f17f..f827b95 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 _0xa53b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash'];(function(_0xd77b35,_0x5d0d78){var _0x27f5e4=function(_0x2f6e4e){while(--_0x2f6e4e){_0xd77b35['push'](_0xd77b35['shift']());}};_0x27f5e4(++_0x5d0d78);}(_0xa53b,0xb3));var _0xba53=function(_0x4d119a,_0x398de0){_0x4d119a=_0x4d119a-0x0;var _0x32d5fc=_0xa53b[_0x4d119a];return _0x32d5fc;};'use strict';var _=require(_0xba53('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba53('0x1'));var moment=require(_0xba53('0x2'));var BPromise=require(_0xba53('0x3'));var rp=require(_0xba53('0x4'));var fs=require('fs');var path=require(_0xba53('0x5'));var rimraf=require(_0xba53('0x6'));var config=require(_0xba53('0x7'));var attributes=require(_0xba53('0x8'));module[_0xba53('0x9')]=function(_0x1281a5,_0x489951){return _0x1281a5[_0xba53('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0xba53('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x981b=['./analyticExtractedReport.attributes','exports','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xb59fd9,_0x4c539){var _0x263983=function(_0x268b8a){while(--_0x268b8a){_0xb59fd9['push'](_0xb59fd9['shift']());}};_0x263983(++_0x4c539);}(_0x981b,0x6f));var _0xb981=function(_0x33841a,_0x4c70c6){_0x33841a=_0x33841a-0x0;var _0xa2b086=_0x981b[_0x33841a];return _0xa2b086;};'use strict';var _=require('lodash');var util=require(_0xb981('0x0'));var logger=require(_0xb981('0x1'))(_0xb981('0x2'));var moment=require(_0xb981('0x3'));var BPromise=require(_0xb981('0x4'));var rp=require(_0xb981('0x5'));var fs=require('fs');var path=require(_0xb981('0x6'));var rimraf=require(_0xb981('0x7'));var config=require(_0xb981('0x8'));var attributes=require(_0xb981('0x9'));module[_0xb981('0xa')]=function(_0x157177,_0x490b11){return _0x157177['define']('AnalyticExtractedReport',attributes,{'tableName':_0xb981('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 542e229..33faa5d 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 _0x6817=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x40d4e5,_0x1ebe2c){var _0x210d1a=function(_0x302f4e){while(--_0x302f4e){_0x40d4e5['push'](_0x40d4e5['shift']());}};_0x210d1a(++_0x1ebe2c);}(_0x6817,0xf8));var _0x7681=function(_0x384dc1,_0x3567d){_0x384dc1=_0x384dc1-0x0;var _0x4ae336=_0x6817[_0x384dc1];return _0x4ae336;};'use strict';var _=require(_0x7681('0x0'));var util=require(_0x7681('0x1'));var moment=require(_0x7681('0x2'));var BPromise=require(_0x7681('0x3'));var rs=require(_0x7681('0x4'));var fs=require('fs');var Redis=require(_0x7681('0x5'));var db=require(_0x7681('0x6'))['db'];var utils=require(_0x7681('0x7'));var logger=require(_0x7681('0x8'))(_0x7681('0x9'));var config=require(_0x7681('0xa'));var jayson=require(_0x7681('0xb'));var client=jayson[_0x7681('0xc')][_0x7681('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x54c74f,_0x1413ec,_0x4bdc51){return new BPromise(function(_0x4a1b66,_0x83649f){return client[_0x7681('0xe')](_0x54c74f,_0x4bdc51)['then'](function(_0x1b251f){logger[_0x7681('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1413ec,_0x7681('0x10'));logger[_0x7681('0x11')](_0x7681('0x12'),_0x1413ec,_0x7681('0x10'),JSON['stringify'](_0x1b251f));if(_0x1b251f[_0x7681('0x13')]){if(_0x1b251f['error']['code']===0x1f4){logger[_0x7681('0x13')](_0x7681('0x14'),_0x1413ec,_0x1b251f[_0x7681('0x13')][_0x7681('0x15')]);return _0x83649f(_0x1b251f[_0x7681('0x13')]['message']);}logger[_0x7681('0x13')](_0x7681('0x14'),_0x1413ec,_0x1b251f['error']['message']);return _0x4a1b66(_0x1b251f[_0x7681('0x13')][_0x7681('0x15')]);}else{logger[_0x7681('0xf')](_0x7681('0x14'),_0x1413ec,_0x7681('0x10'));_0x4a1b66(_0x1b251f[_0x7681('0x16')][_0x7681('0x15')]);}})[_0x7681('0x17')](function(_0x31057a){logger[_0x7681('0x13')](_0x7681('0x14'),_0x1413ec,_0x31057a);_0x83649f(_0x31057a);});});}
\ No newline at end of file
+var _0x3b44=['lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch'];(function(_0x435f7c,_0x3c50e5){var _0x11be96=function(_0x4b91e3){while(--_0x4b91e3){_0x435f7c['push'](_0x435f7c['shift']());}};_0x11be96(++_0x3c50e5);}(_0x3b44,0xa0));var _0x43b4=function(_0x3663c2,_0x1be306){_0x3663c2=_0x3663c2-0x0;var _0x26b1e6=_0x3b44[_0x3663c2];return _0x26b1e6;};'use strict';var _=require(_0x43b4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43b4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43b4('0x2'))['db'];var utils=require(_0x43b4('0x3'));var logger=require(_0x43b4('0x4'))(_0x43b4('0x5'));var config=require(_0x43b4('0x6'));var jayson=require(_0x43b4('0x7'));var client=jayson['client'][_0x43b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a279a,_0x1e461f,_0x413dd5){return new BPromise(function(_0x4b4341,_0x25c3c8){return client['request'](_0x3a279a,_0x413dd5)[_0x43b4('0x9')](function(_0x2a95bb){logger[_0x43b4('0xa')](_0x43b4('0xb'),_0x1e461f,'request\x20sent');logger[_0x43b4('0xc')](_0x43b4('0xd'),_0x1e461f,'request\x20sent',JSON[_0x43b4('0xe')](_0x2a95bb));if(_0x2a95bb[_0x43b4('0xf')]){if(_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x10')]===0x1f4){logger['error'](_0x43b4('0xb'),_0x1e461f,_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x11')]);return _0x25c3c8(_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x11')]);}logger[_0x43b4('0xf')](_0x43b4('0xb'),_0x1e461f,_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x11')]);return _0x4b4341(_0x2a95bb[_0x43b4('0xf')][_0x43b4('0x11')]);}else{logger['info'](_0x43b4('0xb'),_0x1e461f,_0x43b4('0x12'));_0x4b4341(_0x2a95bb['result']['message']);}})[_0x43b4('0x13')](function(_0x3a5462){logger[_0x43b4('0xf')](_0x43b4('0xb'),_0x1e461f,_0x3a5462);_0x25c3c8(_0x3a5462);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 4e5ad8a..9fb9032 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 _0x0317=['/:id','show','/:id/download','create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get'];(function(_0x454ae0,_0x253c6b){var _0x2ce06f=function(_0xd023dc){while(--_0xd023dc){_0x454ae0['push'](_0x454ae0['shift']());}};_0x2ce06f(++_0x253c6b);}(_0x0317,0x94));var _0x7031=function(_0x48bc0d,_0x30becd){_0x48bc0d=_0x48bc0d-0x0;var _0x35f641=_0x0317[_0x48bc0d];return _0x35f641;};'use strict';var multer=require(_0x7031('0x0'));var util=require(_0x7031('0x1'));var path=require('path');var timeout=require(_0x7031('0x2'));var express=require(_0x7031('0x3'));var router=express['Router']();var fs_extra=require(_0x7031('0x4'));var auth=require(_0x7031('0x5'));var interaction=require(_0x7031('0x6'));var config=require(_0x7031('0x7'));var controller=require(_0x7031('0x8'));router['get']('/',auth[_0x7031('0x9')](),controller[_0x7031('0xa')]);router[_0x7031('0xb')](_0x7031('0xc'),auth[_0x7031('0x9')](),controller[_0x7031('0xd')]);router[_0x7031('0xb')](_0x7031('0xe'),auth[_0x7031('0x9')](),controller['download']);router['post']('/',auth[_0x7031('0x9')](),controller[_0x7031('0xf')]);router[_0x7031('0x10')](_0x7031('0xc'),auth[_0x7031('0x9')](),controller[_0x7031('0x11')]);router[_0x7031('0x12')](_0x7031('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7031('0x13')]=router;
\ No newline at end of file
+var _0xdf09=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/download','download','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x5952f1,_0x36d54f){var _0x3fba63=function(_0x5e8bd5){while(--_0x5e8bd5){_0x5952f1['push'](_0x5952f1['shift']());}};_0x3fba63(++_0x36d54f);}(_0xdf09,0xae));var _0x9df0=function(_0x432430,_0x67a2e8){_0x432430=_0x432430-0x0;var _0x414d68=_0xdf09[_0x432430];return _0x414d68;};'use strict';var multer=require(_0x9df0('0x0'));var util=require(_0x9df0('0x1'));var path=require(_0x9df0('0x2'));var timeout=require(_0x9df0('0x3'));var express=require(_0x9df0('0x4'));var router=express[_0x9df0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9df0('0x6'));var interaction=require(_0x9df0('0x7'));var config=require(_0x9df0('0x8'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9df0('0x9')](_0x9df0('0xa'),auth[_0x9df0('0xb')](),controller[_0x9df0('0xc')]);router[_0x9df0('0x9')](_0x9df0('0xd'),auth[_0x9df0('0xb')](),controller[_0x9df0('0xe')]);router[_0x9df0('0xf')]('/',auth['isAuthenticated'](),controller[_0x9df0('0x10')]);router['put'](_0x9df0('0xa'),auth[_0x9df0('0xb')](),controller[_0x9df0('0x11')]);router[_0x9df0('0x12')](_0x9df0('0xa'),auth[_0x9df0('0xb')](),controller[_0x9df0('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 2306a51..c99ef10 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 _0x0ff6=['TEXT','STRING','BOOLEAN','exports'];(function(_0x5f017a,_0xf097bb){var _0x537a38=function(_0x15a617){while(--_0x15a617){_0x5f017a['push'](_0x5f017a['shift']());}};_0x537a38(++_0xf097bb);}(_0x0ff6,0x15f));var _0x60ff=function(_0x3e5803,_0x24bdcc){_0x3e5803=_0x3e5803-0x0;var _0x2b62d3=_0x0ff6[_0x3e5803];return _0x2b62d3;};'use strict';var Sequelize=require('sequelize');module[_0x60ff('0x0')]={'field':{'type':Sequelize[_0x60ff('0x1')]},'alias':{'type':Sequelize[_0x60ff('0x2')]},'function':{'type':Sequelize[_0x60ff('0x2')]},'format':{'type':Sequelize[_0x60ff('0x2')]},'groupBy':{'type':Sequelize[_0x60ff('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x60ff('0x2')]},'custom':{'type':Sequelize[_0x60ff('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0cb6=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x2228c4,_0x13c30a){var _0x1f67fb=function(_0x337ffe){while(--_0x337ffe){_0x2228c4['push'](_0x2228c4['shift']());}};_0x1f67fb(++_0x13c30a);}(_0x0cb6,0x1c3));var _0x60cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cb6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x60cb('0x0'));module[_0x60cb('0x1')]={'field':{'type':Sequelize[_0x60cb('0x2')]},'alias':{'type':Sequelize[_0x60cb('0x3')]},'function':{'type':Sequelize[_0x60cb('0x3')]},'format':{'type':Sequelize[_0x60cb('0x3')]},'groupBy':{'type':Sequelize[_0x60cb('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x60cb('0x3')]},'custom':{'type':Sequelize[_0x60cb('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 6c32f20..7d5094e 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 _0xd9d1=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','create','body','catch','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x41df9f,_0xee067c){var _0x57fe79=function(_0x3a6871){while(--_0x3a6871){_0x41df9f['push'](_0x41df9f['shift']());}};_0x57fe79(++_0xee067c);}(_0xd9d1,0x1ec));var _0x1d9d=function(_0x5d33db,_0x455ebe){_0x5d33db=_0x5d33db-0x0;var _0x149db2=_0xd9d1[_0x5d33db];return _0x149db2;};'use strict';var emlformat=require(_0x1d9d('0x0'));var rimraf=require(_0x1d9d('0x1'));var zipdir=require(_0x1d9d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d9d('0x3'));var BPromise=require(_0x1d9d('0x4'));var Mustache=require(_0x1d9d('0x5'));var util=require(_0x1d9d('0x6'));var path=require(_0x1d9d('0x7'));var sox=require('sox');var csv=require(_0x1d9d('0x8'));var ejs=require(_0x1d9d('0x9'));var fs=require('fs');var fs_extra=require(_0x1d9d('0xa'));var _=require(_0x1d9d('0xb'));var squel=require(_0x1d9d('0xc'));var crypto=require(_0x1d9d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d9d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1d9d('0xf'));var Papa=require(_0x1d9d('0x10'));var Redis=require(_0x1d9d('0x11'));var authService=require(_0x1d9d('0x12'));var qs=require(_0x1d9d('0x13'));var as=require(_0x1d9d('0x14'));var hardwareService=require(_0x1d9d('0x15'));var logger=require('../../config/logger')(_0x1d9d('0x16'));var utils=require(_0x1d9d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1d9d('0x18'));var db=require(_0x1d9d('0x19'))['db'];function respondWithStatusCode(_0xfda175,_0x571504){_0x571504=_0x571504||0xcc;return function(_0x24a018){if(_0x24a018){return _0xfda175[_0x1d9d('0x1a')](_0x571504);}return _0xfda175[_0x1d9d('0x1b')](_0x571504)[_0x1d9d('0x1c')]();};}function respondWithResult(_0x37b61b,_0x15a05d){_0x15a05d=_0x15a05d||0xc8;return function(_0x5bc755){if(_0x5bc755){return _0x37b61b['status'](_0x15a05d)[_0x1d9d('0x1d')](_0x5bc755);}};}function respondWithFilteredResult(_0x5747f5,_0x4fa4aa){return function(_0x54da8a){if(_0x54da8a){var _0x58979e=typeof _0x4fa4aa[_0x1d9d('0x1e')]===_0x1d9d('0x1f')&&typeof _0x4fa4aa[_0x1d9d('0x20')]===_0x1d9d('0x1f');var _0x1fe8e9=_0x54da8a[_0x1d9d('0x21')];var _0x6924b0=_0x58979e?0x0:_0x4fa4aa[_0x1d9d('0x1e')];var _0x11c3d8=_0x58979e?_0x54da8a['count']:_0x4fa4aa[_0x1d9d('0x1e')]+_0x4fa4aa[_0x1d9d('0x20')];var _0x247f99;if(_0x11c3d8>=_0x1fe8e9){_0x11c3d8=_0x1fe8e9;_0x247f99=0xc8;}else{_0x247f99=0xce;}_0x5747f5['status'](_0x247f99);return _0x5747f5['set'](_0x1d9d('0x22'),_0x6924b0+'-'+_0x11c3d8+'/'+_0x1fe8e9)['json'](_0x54da8a);}return null;};}function patchUpdates(_0x4d4bba){return function(_0x840041){try{jsonpatch[_0x1d9d('0x23')](_0x840041,_0x4d4bba,!![]);}catch(_0x49c586){return BPromise['reject'](_0x49c586);}return _0x840041[_0x1d9d('0x24')]();};}function saveUpdates(_0x25061d,_0x2b6db8){return function(_0x49b2d5){if(_0x49b2d5){return _0x49b2d5[_0x1d9d('0x25')](_0x25061d)[_0x1d9d('0x26')](function(_0x5d1a87){return _0x5d1a87;});}return null;};}function removeEntity(_0xaf040d,_0x5eb37e){return function(_0x157f1d){if(_0x157f1d){return _0x157f1d[_0x1d9d('0x27')]()['then'](function(){_0xaf040d['status'](0xcc)[_0x1d9d('0x1c')]();});}};}function handleEntityNotFound(_0xfca9e1,_0x366837){return function(_0x17b9a1){if(!_0x17b9a1){_0xfca9e1[_0x1d9d('0x1a')](0x194);}return _0x17b9a1;};}function handleError(_0x2edac0,_0x2372f4){_0x2372f4=_0x2372f4||0x1f4;return function(_0x122cb7){logger[_0x1d9d('0x28')](_0x122cb7[_0x1d9d('0x29')]);if(_0x122cb7['name']){delete _0x122cb7[_0x1d9d('0x2a')];}_0x2edac0[_0x1d9d('0x1b')](_0x2372f4)[_0x1d9d('0x2b')](_0x122cb7);};}exports['index']=function(_0x312248,_0x493547){var _0x4432da={},_0x2b7a64={},_0x16bcd5={'count':0x0,'rows':[]};var _0x26adfa=_[_0x1d9d('0x2c')](db[_0x1d9d('0x2d')][_0x1d9d('0x2e')],function(_0x3e17d7){return{'name':_0x3e17d7[_0x1d9d('0x2f')],'type':_0x3e17d7['type'][_0x1d9d('0x30')]};});_0x2b7a64['model']=_[_0x1d9d('0x2c')](_0x26adfa,_0x1d9d('0x2a'));_0x2b7a64[_0x1d9d('0x31')]=_[_0x1d9d('0x32')](_0x312248[_0x1d9d('0x31')]);_0x2b7a64[_0x1d9d('0x33')]=_[_0x1d9d('0x34')](_0x2b7a64[_0x1d9d('0x35')],_0x2b7a64[_0x1d9d('0x31')]);_0x4432da[_0x1d9d('0x36')]=_['intersection'](_0x2b7a64[_0x1d9d('0x35')],qs['fields'](_0x312248[_0x1d9d('0x31')][_0x1d9d('0x37')]));_0x4432da[_0x1d9d('0x36')]=_0x4432da[_0x1d9d('0x36')][_0x1d9d('0x38')]?_0x4432da[_0x1d9d('0x36')]:_0x2b7a64[_0x1d9d('0x35')];if(!_0x312248['query'][_0x1d9d('0x39')](_0x1d9d('0x3a'))){_0x4432da[_0x1d9d('0x20')]=qs[_0x1d9d('0x20')](_0x312248[_0x1d9d('0x31')][_0x1d9d('0x20')]);_0x4432da[_0x1d9d('0x1e')]=qs['offset'](_0x312248[_0x1d9d('0x31')][_0x1d9d('0x1e')]);}_0x4432da['order']=qs[_0x1d9d('0x3b')](_0x312248[_0x1d9d('0x31')]['sort']);_0x4432da[_0x1d9d('0x3c')]=qs['filters'](_[_0x1d9d('0x3d')](_0x312248['query'],_0x2b7a64[_0x1d9d('0x33')]),_0x26adfa);if(_0x312248[_0x1d9d('0x31')]['filter']){_0x4432da['where']=_[_0x1d9d('0x3e')](_0x4432da[_0x1d9d('0x3c')],{'$or':_[_0x1d9d('0x2c')](_0x26adfa,function(_0x2452f0){if(_0x2452f0[_0x1d9d('0x3f')]!==_0x1d9d('0x40')){var _0x428171={};_0x428171[_0x2452f0[_0x1d9d('0x2a')]]={'$like':'%'+_0x312248['query'][_0x1d9d('0x41')]+'%'};return _0x428171;}})});}_0x4432da=_[_0x1d9d('0x3e')]({},_0x4432da,_0x312248[_0x1d9d('0x42')]);var _0xf77a79={'where':_0x4432da['where']};return db[_0x1d9d('0x2d')]['count'](_0xf77a79)[_0x1d9d('0x26')](function(_0xbaa444){_0x16bcd5[_0x1d9d('0x21')]=_0xbaa444;if(_0x312248[_0x1d9d('0x31')][_0x1d9d('0x43')]){_0x4432da['include']=[{'all':!![]}];}return db[_0x1d9d('0x2d')][_0x1d9d('0x44')](_0x4432da);})['then'](function(_0x3ed6fb){_0x16bcd5[_0x1d9d('0x45')]=_0x3ed6fb;return _0x16bcd5;})[_0x1d9d('0x26')](respondWithFilteredResult(_0x493547,_0x4432da))['catch'](handleError(_0x493547,null));};exports[_0x1d9d('0x46')]=function(_0x5ac060,_0x4d09d1){var _0x14b69a={'raw':![],'where':{'id':_0x5ac060[_0x1d9d('0x47')]['id']}},_0x92f5f1={};_0x92f5f1[_0x1d9d('0x35')]=_[_0x1d9d('0x32')](db[_0x1d9d('0x2d')][_0x1d9d('0x2e')]);_0x92f5f1[_0x1d9d('0x31')]=_[_0x1d9d('0x32')](_0x5ac060[_0x1d9d('0x31')]);_0x92f5f1[_0x1d9d('0x33')]=_['intersection'](_0x92f5f1[_0x1d9d('0x35')],_0x92f5f1[_0x1d9d('0x31')]);_0x14b69a[_0x1d9d('0x36')]=_[_0x1d9d('0x34')](_0x92f5f1['model'],qs[_0x1d9d('0x37')](_0x5ac060[_0x1d9d('0x31')][_0x1d9d('0x37')]));_0x14b69a['attributes']=_0x14b69a[_0x1d9d('0x36')][_0x1d9d('0x38')]?_0x14b69a[_0x1d9d('0x36')]:_0x92f5f1[_0x1d9d('0x35')];if(_0x5ac060[_0x1d9d('0x31')][_0x1d9d('0x43')]){_0x14b69a[_0x1d9d('0x48')]=[{'all':!![]}];}_0x14b69a=_['merge']({},_0x14b69a,_0x5ac060['options']);return db[_0x1d9d('0x2d')][_0x1d9d('0x49')](_0x14b69a)[_0x1d9d('0x26')](handleEntityNotFound(_0x4d09d1,null))['then'](respondWithResult(_0x4d09d1,null))['catch'](handleError(_0x4d09d1,null));};exports[_0x1d9d('0x4a')]=function(_0x482885,_0x512b05){return db[_0x1d9d('0x2d')]['create'](_0x482885[_0x1d9d('0x4b')],{})['then'](respondWithResult(_0x512b05,0xc9))[_0x1d9d('0x4c')](handleError(_0x512b05,null));};exports[_0x1d9d('0x4d')]=function(_0x464ea5,_0x4c3e05){return db['AnalyticFieldReport']['bulkCreate'](_0x464ea5[_0x1d9d('0x4b')],{'raw':![],'individualHooks':!![]})[_0x1d9d('0x26')](respondWithResult(_0x4c3e05,0xc9))[_0x1d9d('0x4c')](handleError(_0x4c3e05,null));};exports[_0x1d9d('0x25')]=function(_0x342f22,_0x317cdf){if(_0x342f22['body']['id']){delete _0x342f22[_0x1d9d('0x4b')]['id'];}return db[_0x1d9d('0x2d')][_0x1d9d('0x49')]({'where':{'id':_0x342f22[_0x1d9d('0x47')]['id']}})[_0x1d9d('0x26')](handleEntityNotFound(_0x317cdf,null))[_0x1d9d('0x26')](saveUpdates(_0x342f22[_0x1d9d('0x4b')],null))[_0x1d9d('0x26')](respondWithResult(_0x317cdf,null))['catch'](handleError(_0x317cdf,null));};exports[_0x1d9d('0x27')]=function(_0x42cf76,_0x5ccc76){return db[_0x1d9d('0x2d')]['find']({'where':{'id':_0x42cf76['params']['id']}})[_0x1d9d('0x26')](handleEntityNotFound(_0x5ccc76,null))[_0x1d9d('0x26')](removeEntity(_0x5ccc76,null))['catch'](handleError(_0x5ccc76,null));};exports[_0x1d9d('0x4e')]=function(_0x202522,_0x3da8b7){return db[_0x1d9d('0x2d')][_0x1d9d('0x27')]({'where':{'id':_0x202522[_0x1d9d('0x31')][_0x1d9d('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x1d9d('0x26')](respondWithResult(_0x3da8b7,0xcc))[_0x1d9d('0x4c')](handleError(_0x3da8b7,null));};exports[_0x1d9d('0x50')]=function(_0x5ed99b,_0x45256d,_0x41b921){return db[_0x1d9d('0x51')][_0x1d9d('0x52')]({'where':{'id':_0x5ed99b[_0x1d9d('0x47')]['id']}})[_0x1d9d('0x26')](handleEntityNotFound(_0x45256d,null))[_0x1d9d('0x26')](function(_0x6c0bec){if(_0x6c0bec){return db[_0x1d9d('0x53')][_0x1d9d('0x54')](function(_0x3df8d5){return db[_0x1d9d('0x2d')]['destroy']({'where':{'CustomReportId':_0x5ed99b[_0x1d9d('0x47')]['id']},'transaction':_0x3df8d5})[_0x1d9d('0x26')](function(_0x11daf6){var _0x3c0cc3=_[_0x1d9d('0x2c')](_0x5ed99b[_0x1d9d('0x4b')],function(_0x425e35){delete _0x425e35['id'];_0x425e35['CustomReportId']=_0x5ed99b[_0x1d9d('0x47')]['id'];return _0x425e35;});return db[_0x1d9d('0x2d')]['bulkCreate'](_0x3c0cc3,{'transaction':_0x3df8d5});});})['then'](function(){return db[_0x1d9d('0x2d')]['findAll']({'where':{'CustomReportId':_0x5ed99b[_0x1d9d('0x47')]['id']}});});}})['then'](respondWithResult(_0x45256d,null))['catch'](handleError(_0x45256d,null));};
\ No newline at end of file
+var _0xe58e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','stack','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','bulkCreate','find','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe58e,0x100));var _0xee58=function(_0x4c9b04,_0xe5027d){_0x4c9b04=_0x4c9b04-0x0;var _0x252d2a=_0xe58e[_0x4c9b04];return _0x252d2a;};'use strict';var emlformat=require(_0xee58('0x0'));var rimraf=require(_0xee58('0x1'));var zipdir=require(_0xee58('0x2'));var jsonpatch=require(_0xee58('0x3'));var rp=require(_0xee58('0x4'));var moment=require(_0xee58('0x5'));var BPromise=require(_0xee58('0x6'));var Mustache=require(_0xee58('0x7'));var util=require(_0xee58('0x8'));var path=require(_0xee58('0x9'));var sox=require(_0xee58('0xa'));var csv=require(_0xee58('0xb'));var ejs=require(_0xee58('0xc'));var fs=require('fs');var fs_extra=require(_0xee58('0xd'));var _=require(_0xee58('0xe'));var squel=require(_0xee58('0xf'));var crypto=require('crypto');var jsforce=require(_0xee58('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xee58('0xb'));var querystring=require(_0xee58('0x11'));var Papa=require(_0xee58('0x12'));var Redis=require(_0xee58('0x13'));var authService=require(_0xee58('0x14'));var qs=require(_0xee58('0x15'));var as=require(_0xee58('0x16'));var hardwareService=require(_0xee58('0x17'));var logger=require('../../config/logger')(_0xee58('0x18'));var utils=require(_0xee58('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee58('0x1a'))['db'];function respondWithStatusCode(_0x3c2045,_0x2f2c44){_0x2f2c44=_0x2f2c44||0xcc;return function(_0x421ff9){if(_0x421ff9){return _0x3c2045[_0xee58('0x1b')](_0x2f2c44);}return _0x3c2045[_0xee58('0x1c')](_0x2f2c44)[_0xee58('0x1d')]();};}function respondWithResult(_0x588327,_0x23c7af){_0x23c7af=_0x23c7af||0xc8;return function(_0x2c8aba){if(_0x2c8aba){return _0x588327['status'](_0x23c7af)['json'](_0x2c8aba);}};}function respondWithFilteredResult(_0x40a24f,_0x279551){return function(_0x3c0f8e){if(_0x3c0f8e){var _0x50fffe=typeof _0x279551[_0xee58('0x1e')]===_0xee58('0x1f')&&typeof _0x279551[_0xee58('0x20')]===_0xee58('0x1f');var _0x341c1d=_0x3c0f8e[_0xee58('0x21')];var _0x492354=_0x50fffe?0x0:_0x279551['offset'];var _0x466e70=_0x50fffe?_0x3c0f8e['count']:_0x279551[_0xee58('0x1e')]+_0x279551['limit'];var _0x1da573;if(_0x466e70>=_0x341c1d){_0x466e70=_0x341c1d;_0x1da573=0xc8;}else{_0x1da573=0xce;}_0x40a24f['status'](_0x1da573);return _0x40a24f[_0xee58('0x22')]('Content-Range',_0x492354+'-'+_0x466e70+'/'+_0x341c1d)[_0xee58('0x23')](_0x3c0f8e);}return null;};}function patchUpdates(_0x58c3a0){return function(_0x551f1d){try{jsonpatch[_0xee58('0x24')](_0x551f1d,_0x58c3a0,!![]);}catch(_0x2eeb5d){return BPromise[_0xee58('0x25')](_0x2eeb5d);}return _0x551f1d[_0xee58('0x26')]();};}function saveUpdates(_0x15b724,_0x3f20a3){return function(_0x2e34ec){if(_0x2e34ec){return _0x2e34ec[_0xee58('0x27')](_0x15b724)[_0xee58('0x28')](function(_0xe34d20){return _0xe34d20;});}return null;};}function removeEntity(_0x2f7d1c,_0x5a6f28){return function(_0x45fe2a){if(_0x45fe2a){return _0x45fe2a[_0xee58('0x29')]()[_0xee58('0x28')](function(){_0x2f7d1c[_0xee58('0x1c')](0xcc)[_0xee58('0x1d')]();});}};}function handleEntityNotFound(_0x170823,_0x45a930){return function(_0x1d2846){if(!_0x1d2846){_0x170823[_0xee58('0x1b')](0x194);}return _0x1d2846;};}function handleError(_0x12c9ac,_0x275453){_0x275453=_0x275453||0x1f4;return function(_0x34eea1){logger['error'](_0x34eea1[_0xee58('0x2a')]);if(_0x34eea1['name']){delete _0x34eea1['name'];}_0x12c9ac[_0xee58('0x1c')](_0x275453)[_0xee58('0x2b')](_0x34eea1);};}exports[_0xee58('0x2c')]=function(_0x41aa7c,_0x1ed6b1){var _0x3d3e33={},_0x331899={},_0x50c675={'count':0x0,'rows':[]};var _0x4de011=_[_0xee58('0x2d')](db[_0xee58('0x2e')][_0xee58('0x2f')],function(_0x15d7bb){return{'name':_0x15d7bb[_0xee58('0x30')],'type':_0x15d7bb[_0xee58('0x31')][_0xee58('0x32')]};});_0x331899[_0xee58('0x33')]=_[_0xee58('0x2d')](_0x4de011,_0xee58('0x34'));_0x331899[_0xee58('0x35')]=_['keys'](_0x41aa7c[_0xee58('0x35')]);_0x331899[_0xee58('0x36')]=_[_0xee58('0x37')](_0x331899[_0xee58('0x33')],_0x331899[_0xee58('0x35')]);_0x3d3e33['attributes']=_['intersection'](_0x331899[_0xee58('0x33')],qs[_0xee58('0x38')](_0x41aa7c['query']['fields']));_0x3d3e33[_0xee58('0x39')]=_0x3d3e33['attributes'][_0xee58('0x3a')]?_0x3d3e33[_0xee58('0x39')]:_0x331899[_0xee58('0x33')];if(!_0x41aa7c[_0xee58('0x35')][_0xee58('0x3b')](_0xee58('0x3c'))){_0x3d3e33['limit']=qs[_0xee58('0x20')](_0x41aa7c[_0xee58('0x35')][_0xee58('0x20')]);_0x3d3e33[_0xee58('0x1e')]=qs[_0xee58('0x1e')](_0x41aa7c[_0xee58('0x35')][_0xee58('0x1e')]);}_0x3d3e33[_0xee58('0x3d')]=qs['sort'](_0x41aa7c[_0xee58('0x35')]['sort']);_0x3d3e33['where']=qs[_0xee58('0x36')](_[_0xee58('0x3e')](_0x41aa7c[_0xee58('0x35')],_0x331899[_0xee58('0x36')]),_0x4de011);if(_0x41aa7c[_0xee58('0x35')]['filter']){_0x3d3e33[_0xee58('0x3f')]=_[_0xee58('0x40')](_0x3d3e33[_0xee58('0x3f')],{'$or':_[_0xee58('0x2d')](_0x4de011,function(_0x50c8b8){if(_0x50c8b8[_0xee58('0x31')]!==_0xee58('0x41')){var _0x3f8ba6={};_0x3f8ba6[_0x50c8b8['name']]={'$like':'%'+_0x41aa7c['query'][_0xee58('0x42')]+'%'};return _0x3f8ba6;}})});}_0x3d3e33=_['merge']({},_0x3d3e33,_0x41aa7c[_0xee58('0x43')]);var _0x35104f={'where':_0x3d3e33[_0xee58('0x3f')]};return db[_0xee58('0x2e')]['count'](_0x35104f)[_0xee58('0x28')](function(_0xcef11b){_0x50c675[_0xee58('0x21')]=_0xcef11b;if(_0x41aa7c['query']['includeAll']){_0x3d3e33[_0xee58('0x44')]=[{'all':!![]}];}return db[_0xee58('0x2e')][_0xee58('0x45')](_0x3d3e33);})[_0xee58('0x28')](function(_0x52fcd2){_0x50c675[_0xee58('0x46')]=_0x52fcd2;return _0x50c675;})[_0xee58('0x28')](respondWithFilteredResult(_0x1ed6b1,_0x3d3e33))[_0xee58('0x47')](handleError(_0x1ed6b1,null));};exports[_0xee58('0x48')]=function(_0xc09047,_0xc02b1a){var _0x23dd53={'raw':![],'where':{'id':_0xc09047[_0xee58('0x49')]['id']}},_0x535435={};_0x535435[_0xee58('0x33')]=_[_0xee58('0x4a')](db[_0xee58('0x2e')]['rawAttributes']);_0x535435[_0xee58('0x35')]=_[_0xee58('0x4a')](_0xc09047['query']);_0x535435[_0xee58('0x36')]=_['intersection'](_0x535435[_0xee58('0x33')],_0x535435[_0xee58('0x35')]);_0x23dd53[_0xee58('0x39')]=_['intersection'](_0x535435['model'],qs[_0xee58('0x38')](_0xc09047[_0xee58('0x35')]['fields']));_0x23dd53[_0xee58('0x39')]=_0x23dd53[_0xee58('0x39')][_0xee58('0x3a')]?_0x23dd53['attributes']:_0x535435[_0xee58('0x33')];if(_0xc09047[_0xee58('0x35')][_0xee58('0x4b')]){_0x23dd53[_0xee58('0x44')]=[{'all':!![]}];}_0x23dd53=_['merge']({},_0x23dd53,_0xc09047[_0xee58('0x43')]);return db[_0xee58('0x2e')]['find'](_0x23dd53)[_0xee58('0x28')](handleEntityNotFound(_0xc02b1a,null))['then'](respondWithResult(_0xc02b1a,null))[_0xee58('0x47')](handleError(_0xc02b1a,null));};exports[_0xee58('0x4c')]=function(_0x250719,_0x13f7b2){return db[_0xee58('0x2e')][_0xee58('0x4c')](_0x250719[_0xee58('0x4d')],{})[_0xee58('0x28')](respondWithResult(_0x13f7b2,0xc9))[_0xee58('0x47')](handleError(_0x13f7b2,null));};exports['bulkCreate']=function(_0x376e59,_0x297b81){return db[_0xee58('0x2e')][_0xee58('0x4e')](_0x376e59[_0xee58('0x4d')],{'raw':![],'individualHooks':!![]})[_0xee58('0x28')](respondWithResult(_0x297b81,0xc9))[_0xee58('0x47')](handleError(_0x297b81,null));};exports[_0xee58('0x27')]=function(_0x293a4b,_0x294d27){if(_0x293a4b[_0xee58('0x4d')]['id']){delete _0x293a4b[_0xee58('0x4d')]['id'];}return db[_0xee58('0x2e')]['find']({'where':{'id':_0x293a4b[_0xee58('0x49')]['id']}})[_0xee58('0x28')](handleEntityNotFound(_0x294d27,null))[_0xee58('0x28')](saveUpdates(_0x293a4b[_0xee58('0x4d')],null))[_0xee58('0x28')](respondWithResult(_0x294d27,null))[_0xee58('0x47')](handleError(_0x294d27,null));};exports[_0xee58('0x29')]=function(_0x1bf9cf,_0x38ba43){return db[_0xee58('0x2e')][_0xee58('0x4f')]({'where':{'id':_0x1bf9cf[_0xee58('0x49')]['id']}})[_0xee58('0x28')](handleEntityNotFound(_0x38ba43,null))[_0xee58('0x28')](removeEntity(_0x38ba43,null))[_0xee58('0x47')](handleError(_0x38ba43,null));};exports['bulkDestroy']=function(_0x4f8f84,_0xcc6325){return db['AnalyticFieldReport'][_0xee58('0x29')]({'where':{'id':_0x4f8f84[_0xee58('0x35')][_0xee58('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xee58('0x28')](respondWithResult(_0xcc6325,0xcc))[_0xee58('0x47')](handleError(_0xcc6325,null));};exports['addFields']=function(_0x3ec882,_0x50ab8f,_0x57271f){return db[_0xee58('0x51')][_0xee58('0x52')]({'where':{'id':_0x3ec882[_0xee58('0x49')]['id']}})[_0xee58('0x28')](handleEntityNotFound(_0x50ab8f,null))[_0xee58('0x28')](function(_0x4973c6){if(_0x4973c6){return db[_0xee58('0x53')][_0xee58('0x54')](function(_0x4db651){return db[_0xee58('0x2e')][_0xee58('0x29')]({'where':{'CustomReportId':_0x3ec882[_0xee58('0x49')]['id']},'transaction':_0x4db651})[_0xee58('0x28')](function(_0x578686){var _0x1d2d53=_[_0xee58('0x2d')](_0x3ec882['body'],function(_0x524ac9){delete _0x524ac9['id'];_0x524ac9[_0xee58('0x55')]=_0x3ec882[_0xee58('0x49')]['id'];return _0x524ac9;});return db[_0xee58('0x2e')][_0xee58('0x4e')](_0x1d2d53,{'transaction':_0x4db651});});})[_0xee58('0x28')](function(){return db[_0xee58('0x2e')][_0xee58('0x45')]({'where':{'CustomReportId':_0x3ec882[_0xee58('0x49')]['id']}});});}})['then'](respondWithResult(_0x50ab8f,null))[_0xee58('0x47')](handleError(_0x50ab8f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index b49ee07..2135300 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 _0xe050=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','util','../../config/logger','api'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xe050,0x97));var _0x0e05=function(_0x3d27b7,_0x6002f4){_0x3d27b7=_0x3d27b7-0x0;var _0x4173e4=_0xe050[_0x3d27b7];return _0x4173e4;};'use strict';var _=require('lodash');var util=require(_0x0e05('0x0'));var logger=require(_0x0e05('0x1'))(_0x0e05('0x2'));var moment=require(_0x0e05('0x3'));var BPromise=require(_0x0e05('0x4'));var rp=require(_0x0e05('0x5'));var fs=require('fs');var path=require(_0x0e05('0x6'));var rimraf=require(_0x0e05('0x7'));var config=require(_0x0e05('0x8'));var attributes=require(_0x0e05('0x9'));module[_0x0e05('0xa')]=function(_0x2ab82e,_0x5c7b8c){return _0x2ab82e['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x736c=['bluebird','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api'];(function(_0x53a646,_0x565225){var _0x43a099=function(_0x7c585d){while(--_0x7c585d){_0x53a646['push'](_0x53a646['shift']());}};_0x43a099(++_0x565225);}(_0x736c,0xb0));var _0xc736=function(_0x5a435c,_0x455012){_0x5a435c=_0x5a435c-0x0;var _0x31a14f=_0x736c[_0x5a435c];return _0x31a14f;};'use strict';var _=require(_0xc736('0x0'));var util=require(_0xc736('0x1'));var logger=require(_0xc736('0x2'))(_0xc736('0x3'));var moment=require('moment');var BPromise=require(_0xc736('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc736('0x5'));var attributes=require(_0xc736('0x6'));module[_0xc736('0x7')]=function(_0x46bc05,_0x470b0f){return _0x46bc05['define'](_0xc736('0x8'),attributes,{'tableName':_0xc736('0x9'),'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 c344be4..d91c2b5 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 _0x4997=['../../config/utils','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','AnalyticFieldReport,\x20%s,\x20%s','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x4997,0xb8));var _0x7499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4997[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7499('0x0'));var util=require(_0x7499('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7499('0x2'));var fs=require('fs');var Redis=require(_0x7499('0x3'));var db=require(_0x7499('0x4'))['db'];var utils=require(_0x7499('0x5'));var logger=require('../../config/logger')(_0x7499('0x6'));var config=require(_0x7499('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7499('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x341bce,_0x3fb424,_0x242e70){return new BPromise(function(_0x163d5e,_0xf1ca2d){return client[_0x7499('0x9')](_0x341bce,_0x242e70)[_0x7499('0xa')](function(_0x5f0653){logger[_0x7499('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3fb424,_0x7499('0xc'));logger[_0x7499('0xd')](_0x7499('0xe'),_0x3fb424,_0x7499('0xc'),JSON[_0x7499('0xf')](_0x5f0653));if(_0x5f0653[_0x7499('0x10')]){if(_0x5f0653['error'][_0x7499('0x11')]===0x1f4){logger[_0x7499('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3fb424,_0x5f0653[_0x7499('0x10')][_0x7499('0x12')]);return _0xf1ca2d(_0x5f0653['error'][_0x7499('0x12')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3fb424,_0x5f0653[_0x7499('0x10')][_0x7499('0x12')]);return _0x163d5e(_0x5f0653[_0x7499('0x10')][_0x7499('0x12')]);}else{logger[_0x7499('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3fb424,_0x7499('0xc'));_0x163d5e(_0x5f0653[_0x7499('0x13')]['message']);}})['catch'](function(_0x2e8253){logger[_0x7499('0x10')](_0x7499('0x14'),_0x3fb424,_0x2e8253);_0xf1ca2d(_0x2e8253);});});}
\ No newline at end of file
+var _0xae7d=['jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xae7d,0x74));var _0xdae7=function(_0x288a8d,_0x567238){_0x288a8d=_0x288a8d-0x0;var _0x12ba10=_0xae7d[_0x288a8d];return _0x12ba10;};'use strict';var _=require(_0xdae7('0x0'));var util=require('util');var moment=require(_0xdae7('0x1'));var BPromise=require(_0xdae7('0x2'));var rs=require(_0xdae7('0x3'));var fs=require('fs');var Redis=require(_0xdae7('0x4'));var db=require(_0xdae7('0x5'))['db'];var utils=require(_0xdae7('0x6'));var logger=require(_0xdae7('0x7'))(_0xdae7('0x8'));var config=require('../../config/environment');var jayson=require(_0xdae7('0x9'));var client=jayson[_0xdae7('0xa')][_0xdae7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40d1b7,_0x58cad5,_0x5c4ed0){return new BPromise(function(_0xd7eda6,_0x1fd251){return client[_0xdae7('0xc')](_0x40d1b7,_0x5c4ed0)[_0xdae7('0xd')](function(_0x41c896){logger[_0xdae7('0xe')](_0xdae7('0xf'),_0x58cad5,_0xdae7('0x10'));logger[_0xdae7('0x11')](_0xdae7('0x12'),_0x58cad5,_0xdae7('0x10'),JSON[_0xdae7('0x13')](_0x41c896));if(_0x41c896[_0xdae7('0x14')]){if(_0x41c896[_0xdae7('0x14')][_0xdae7('0x15')]===0x1f4){logger['error'](_0xdae7('0xf'),_0x58cad5,_0x41c896[_0xdae7('0x14')]['message']);return _0x1fd251(_0x41c896[_0xdae7('0x14')][_0xdae7('0x16')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x58cad5,_0x41c896[_0xdae7('0x14')]['message']);return _0xd7eda6(_0x41c896[_0xdae7('0x14')]['message']);}else{logger[_0xdae7('0xe')](_0xdae7('0xf'),_0x58cad5,_0xdae7('0x10'));_0xd7eda6(_0x41c896[_0xdae7('0x17')][_0xdae7('0x16')]);}})[_0xdae7('0x18')](function(_0x236b02){logger['error'](_0xdae7('0xf'),_0x58cad5,_0x236b02);_0x1fd251(_0x236b02);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b6fa9f2..b854f2e 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x3d0718,_0x4312ff){var _0x88c32b=function(_0x8d22c3){while(--_0x8d22c3){_0x3d0718['push'](_0x3d0718['shift']());}};_0x88c32b(++_0x4312ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x43494f,_0x8565ca){var _0x18093f=function(_0x16ff8d){while(--_0x16ff8d){_0x43494f['push'](_0x43494f['shift']());}};_0x18093f(++_0x8565ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 331be66..49060b8 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 _0x47fd=['TEXT','sequelize','exports','STRING','name'];(function(_0x473766,_0x46ead9){var _0x4d1e5a=function(_0x58b056){while(--_0x58b056){_0x473766['push'](_0x473766['shift']());}};_0x4d1e5a(++_0x46ead9);}(_0x47fd,0x13c));var _0xd47f=function(_0x348a50,_0xe211f1){_0x348a50=_0x348a50-0x0;var _0x29beb2=_0x47fd[_0x348a50];return _0x29beb2;};'use strict';var Sequelize=require(_0xd47f('0x0'));module[_0xd47f('0x1')]={'name':{'type':Sequelize[_0xd47f('0x2')],'allowNull':![],'unique':_0xd47f('0x3')},'table':{'type':Sequelize[_0xd47f('0x2')]},'metric':{'type':Sequelize[_0xd47f('0x4')]},'description':{'type':Sequelize[_0xd47f('0x2')]}};
\ No newline at end of file
+var _0xc36d=['sequelize','exports','STRING','name','TEXT'];(function(_0x2ba735,_0x5998b5){var _0x378aa9=function(_0x3f5d9c){while(--_0x3f5d9c){_0x2ba735['push'](_0x2ba735['shift']());}};_0x378aa9(++_0x5998b5);}(_0xc36d,0x7d));var _0xdc36=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc36d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xdc36('0x0'));module[_0xdc36('0x1')]={'name':{'type':Sequelize[_0xdc36('0x2')],'allowNull':![],'unique':_0xdc36('0x3')},'table':{'type':Sequelize[_0xdc36('0x2')]},'metric':{'type':Sequelize[_0xdc36('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 829c5d7..4387ac4 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x84ab,0x12f));var _0xb84a=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x84ab[_0x296754];return _0x1d9f1d;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));};
\ No newline at end of file
+var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x262001,_0x29fe90){var _0x16b4bf=function(_0x498d4c){while(--_0x498d4c){_0x262001['push'](_0x262001['shift']());}};_0x16b4bf(++_0x29fe90);}(_0x9a19,0x114));var _0x99a1=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x9a19[_0x478414];return _0x5eb6b9;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index b192ad1..ddf2224 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 _0x1115=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','AnalyticMetric','analytics_metrics','util','../../config/logger'];(function(_0x5edfcf,_0x2004eb){var _0x52e1ca=function(_0x1d9997){while(--_0x1d9997){_0x5edfcf['push'](_0x5edfcf['shift']());}};_0x52e1ca(++_0x2004eb);}(_0x1115,0x1b6));var _0x5111=function(_0x1fdbe8,_0x57b9e4){_0x1fdbe8=_0x1fdbe8-0x0;var _0x2b4f22=_0x1115[_0x1fdbe8];return _0x2b4f22;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var logger=require(_0x5111('0x1'))(_0x5111('0x2'));var moment=require(_0x5111('0x3'));var BPromise=require(_0x5111('0x4'));var rp=require(_0x5111('0x5'));var fs=require('fs');var path=require(_0x5111('0x6'));var rimraf=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x467c3a,_0x115ba7){return _0x467c3a['define'](_0x5111('0x9'),attributes,{'tableName':_0x5111('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2484=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x465af5,_0xc4b5c8){var _0x15c530=function(_0x2a10af){while(--_0x2a10af){_0x465af5['push'](_0x465af5['shift']());}};_0x15c530(++_0xc4b5c8);}(_0x2484,0x178));var _0x4248=function(_0x4fac58,_0x213b99){_0x4fac58=_0x4fac58-0x0;var _0x10e5d1=_0x2484[_0x4fac58];return _0x10e5d1;};'use strict';var _=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var logger=require('../../config/logger')(_0x4248('0x2'));var moment=require(_0x4248('0x3'));var BPromise=require(_0x4248('0x4'));var rp=require(_0x4248('0x5'));var fs=require('fs');var path=require(_0x4248('0x6'));var rimraf=require(_0x4248('0x7'));var config=require(_0x4248('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x4248('0x9')]=function(_0x2d220,_0x43e730){return _0x2d220[_0x4248('0xa')](_0x4248('0xb'),attributes,{'tableName':_0x4248('0xc'),'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 7d1ada6..16beda2 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 _0xa425=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x65e304,_0x151944){var _0x4c376f=function(_0x316f5f){while(--_0x316f5f){_0x65e304['push'](_0x65e304['shift']());}};_0x4c376f(++_0x151944);}(_0xa425,0x1af));var _0x5a42=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa425[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x5a42('0x0'));var util=require('util');var moment=require(_0x5a42('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a42('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a42('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a42('0x4'))(_0x5a42('0x5'));var config=require(_0x5a42('0x6'));var jayson=require(_0x5a42('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e1f06,_0x1cc3bc,_0x3bfe0a){return new BPromise(function(_0x3d10e2,_0x1e1772){return client[_0x5a42('0x8')](_0x1e1f06,_0x3bfe0a)[_0x5a42('0x9')](function(_0x3f0cc8){logger[_0x5a42('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x1cc3bc,_0x5a42('0xb'));logger[_0x5a42('0xc')](_0x5a42('0xd'),_0x1cc3bc,_0x5a42('0xb'),JSON['stringify'](_0x3f0cc8));if(_0x3f0cc8[_0x5a42('0xe')]){if(_0x3f0cc8[_0x5a42('0xe')]['code']===0x1f4){logger[_0x5a42('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x1cc3bc,_0x3f0cc8['error']['message']);return _0x1e1772(_0x3f0cc8[_0x5a42('0xe')][_0x5a42('0xf')]);}logger[_0x5a42('0xe')](_0x5a42('0x10'),_0x1cc3bc,_0x3f0cc8[_0x5a42('0xe')][_0x5a42('0xf')]);return _0x3d10e2(_0x3f0cc8['error'][_0x5a42('0xf')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x1cc3bc,_0x5a42('0xb'));_0x3d10e2(_0x3f0cc8[_0x5a42('0x11')][_0x5a42('0xf')]);}})[_0x5a42('0x12')](function(_0x1aa304){logger[_0x5a42('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x1cc3bc,_0x1aa304);_0x1e1772(_0x1aa304);});});}
\ No newline at end of file
+var _0xa868=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xa868,0x66));var _0x8a86=function(_0x592416,_0x2c75e9){_0x592416=_0x592416-0x0;var _0x3005fa=_0xa868[_0x592416];return _0x3005fa;};'use strict';var _=require(_0x8a86('0x0'));var util=require(_0x8a86('0x1'));var moment=require(_0x8a86('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a86('0x3'));var fs=require('fs');var Redis=require(_0x8a86('0x4'));var db=require(_0x8a86('0x5'))['db'];var utils=require(_0x8a86('0x6'));var logger=require(_0x8a86('0x7'))(_0x8a86('0x8'));var config=require(_0x8a86('0x9'));var jayson=require(_0x8a86('0xa'));var client=jayson[_0x8a86('0xb')][_0x8a86('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd2b8c4,_0x332acb,_0x2be4d9){return new BPromise(function(_0x52ee3a,_0x5d813d){return client['request'](_0xd2b8c4,_0x2be4d9)[_0x8a86('0xd')](function(_0x3cde04){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x332acb,_0x8a86('0xe'));logger[_0x8a86('0xf')](_0x8a86('0x10'),_0x332acb,_0x8a86('0xe'),JSON[_0x8a86('0x11')](_0x3cde04));if(_0x3cde04['error']){if(_0x3cde04[_0x8a86('0x12')][_0x8a86('0x13')]===0x1f4){logger[_0x8a86('0x12')](_0x8a86('0x14'),_0x332acb,_0x3cde04['error']['message']);return _0x5d813d(_0x3cde04[_0x8a86('0x12')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x332acb,_0x3cde04[_0x8a86('0x12')][_0x8a86('0x15')]);return _0x52ee3a(_0x3cde04[_0x8a86('0x12')]['message']);}else{logger[_0x8a86('0x16')](_0x8a86('0x14'),_0x332acb,_0x8a86('0xe'));_0x52ee3a(_0x3cde04[_0x8a86('0x17')][_0x8a86('0x15')]);}})[_0x8a86('0x18')](function(_0x5a7be8){logger[_0x8a86('0x12')](_0x8a86('0x14'),_0x332acb,_0x5a7be8);_0x5d813d(_0x5a7be8);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 9b40bdc..4b0eaab 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 _0x0dec=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x215cbe,_0x24c464){var _0x20f281=function(_0x1ec394){while(--_0x1ec394){_0x215cbe['push'](_0x215cbe['shift']());}};_0x20f281(++_0x24c464);}(_0x0dec,0x11c));var _0xc0de=function(_0x153f67,_0x59061c){_0x153f67=_0x153f67-0x0;var _0x1f0c4f=_0x0dec[_0x153f67];return _0x1f0c4f;};'use strict';var multer=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var path=require(_0xc0de('0x2'));var timeout=require(_0xc0de('0x3'));var express=require('express');var router=express[_0xc0de('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0de('0x5'));var config=require(_0xc0de('0x6'));var controller=require(_0xc0de('0x7'));router[_0xc0de('0x8')]('/',auth[_0xc0de('0x9')](),controller[_0xc0de('0xa')]);router[_0xc0de('0x8')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0xc')]);router[_0xc0de('0xd')]('/',auth[_0xc0de('0x9')](),controller[_0xc0de('0xe')]);router[_0xc0de('0xf')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0x10')]);router[_0xc0de('0x11')](_0xc0de('0xb'),auth[_0xc0de('0x9')](),controller[_0xc0de('0x12')]);module[_0xc0de('0x13')]=router;
\ No newline at end of file
+var _0xbcba=['put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x5e4d4d,_0x5a5aa6){var _0x40cbd6=function(_0x53c522){while(--_0x53c522){_0x5e4d4d['push'](_0x5e4d4d['shift']());}};_0x40cbd6(++_0x5a5aa6);}(_0xbcba,0x6d));var _0xabcb=function(_0x95ec49,_0x100ec9){_0x95ec49=_0x95ec49-0x0;var _0x5a241b=_0xbcba[_0x95ec49];return _0x5a241b;};'use strict';var multer=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var path=require('path');var timeout=require(_0xabcb('0x2'));var express=require(_0xabcb('0x3'));var router=express[_0xabcb('0x4')]();var fs_extra=require(_0xabcb('0x5'));var auth=require(_0xabcb('0x6'));var interaction=require(_0xabcb('0x7'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xabcb('0x8')]('/',auth[_0xabcb('0x9')](),controller['index']);router['get'](_0xabcb('0xa'),auth[_0xabcb('0x9')](),controller['show']);router['post']('/',auth[_0xabcb('0x9')](),controller['create']);router[_0xabcb('0xb')](_0xabcb('0xa'),auth[_0xabcb('0x9')](),controller[_0xabcb('0xc')]);router['delete'](_0xabcb('0xa'),auth[_0xabcb('0x9')](),controller[_0xabcb('0xd')]);module[_0xabcb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index ff1a4cf..ba25826 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 _0x2fca=['sequelize'];(function(_0x3a2010,_0x182353){var _0x171d95=function(_0x64f22a){while(--_0x64f22a){_0x3a2010['push'](_0x3a2010['shift']());}};_0x171d95(++_0x182353);}(_0x2fca,0x17a));var _0xa2fc=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2fca[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xa2fc('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xbdc3=['exports','TEXT','sequelize'];(function(_0xee93d,_0xbfc866){var _0x3093d4=function(_0x5e6679){while(--_0x5e6679){_0xee93d['push'](_0xee93d['shift']());}};_0x3093d4(++_0xbfc866);}(_0xbdc3,0x1af));var _0x3bdc=function(_0x53a66b,_0x57b7df){_0x53a66b=_0x53a66b-0x0;var _0x3920e4=_0xbdc3[_0x53a66b];return _0x3920e4;};'use strict';var Sequelize=require(_0x3bdc('0x0'));module[_0x3bdc('0x1')]={'tree':{'type':Sequelize[_0x3bdc('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index fa0d9c8..041314b 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 _0x6430=['includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','params','AnalyticTreeReport','length'];(function(_0x3657e0,_0x1e57f9){var _0x39c002=function(_0x1bb873){while(--_0x1bb873){_0x3657e0['push'](_0x3657e0['shift']());}};_0x39c002(++_0x1e57f9);}(_0x6430,0xe3));var _0x0643=function(_0x41bcfa,_0x33c2f8){_0x41bcfa=_0x41bcfa-0x0;var _0x1ca030=_0x6430[_0x41bcfa];return _0x1ca030;};'use strict';var emlformat=require(_0x0643('0x0'));var rimraf=require(_0x0643('0x1'));var zipdir=require(_0x0643('0x2'));var jsonpatch=require(_0x0643('0x3'));var rp=require(_0x0643('0x4'));var moment=require(_0x0643('0x5'));var BPromise=require(_0x0643('0x6'));var Mustache=require(_0x0643('0x7'));var util=require(_0x0643('0x8'));var path=require('path');var sox=require(_0x0643('0x9'));var csv=require(_0x0643('0xa'));var ejs=require(_0x0643('0xb'));var fs=require('fs');var fs_extra=require(_0x0643('0xc'));var _=require(_0x0643('0xd'));var squel=require(_0x0643('0xe'));var crypto=require(_0x0643('0xf'));var jsforce=require(_0x0643('0x10'));var deskjs=require(_0x0643('0x11'));var toCsv=require(_0x0643('0xa'));var querystring=require(_0x0643('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0643('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0643('0x14'));var utils=require('../../config/utils');var config=require(_0x0643('0x15'));var licenseUtil=require(_0x0643('0x16'));var db=require(_0x0643('0x17'))['db'];function respondWithStatusCode(_0x3c65b3,_0x22048f){_0x22048f=_0x22048f||0xcc;return function(_0x1a959c){if(_0x1a959c){return _0x3c65b3[_0x0643('0x18')](_0x22048f);}return _0x3c65b3[_0x0643('0x19')](_0x22048f)['end']();};}function respondWithResult(_0x58f218,_0x36d539){_0x36d539=_0x36d539||0xc8;return function(_0x5cc46c){if(_0x5cc46c){return _0x58f218[_0x0643('0x19')](_0x36d539)['json'](_0x5cc46c);}};}function respondWithFilteredResult(_0x1fef6c,_0x331060){return function(_0x45f3c9){if(_0x45f3c9){var _0x14d436=typeof _0x331060[_0x0643('0x1a')]==='undefined'&&typeof _0x331060[_0x0643('0x1b')]===_0x0643('0x1c');var _0x270c3a=_0x45f3c9[_0x0643('0x1d')];var _0x1a7f9f=_0x14d436?0x0:_0x331060[_0x0643('0x1a')];var _0x2d246a=_0x14d436?_0x45f3c9['count']:_0x331060[_0x0643('0x1a')]+_0x331060['limit'];var _0x455406;if(_0x2d246a>=_0x270c3a){_0x2d246a=_0x270c3a;_0x455406=0xc8;}else{_0x455406=0xce;}_0x1fef6c[_0x0643('0x19')](_0x455406);return _0x1fef6c['set'](_0x0643('0x1e'),_0x1a7f9f+'-'+_0x2d246a+'/'+_0x270c3a)[_0x0643('0x1f')](_0x45f3c9);}return null;};}function patchUpdates(_0x2b2861){return function(_0x55c0bd){try{jsonpatch[_0x0643('0x20')](_0x55c0bd,_0x2b2861,!![]);}catch(_0x5d5d36){return BPromise[_0x0643('0x21')](_0x5d5d36);}return _0x55c0bd[_0x0643('0x22')]();};}function saveUpdates(_0x3aa050,_0x95c38a){return function(_0x24404b){if(_0x24404b){return _0x24404b['update'](_0x3aa050)[_0x0643('0x23')](function(_0x151540){return _0x151540;});}return null;};}function removeEntity(_0x3c525e,_0x3e3e8a){return function(_0x14966d){if(_0x14966d){return _0x14966d[_0x0643('0x24')]()[_0x0643('0x23')](function(){_0x3c525e[_0x0643('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a880,_0x1a0888){return function(_0x4e97a2){if(!_0x4e97a2){_0x23a880['sendStatus'](0x194);}return _0x4e97a2;};}function handleError(_0x461d9b,_0x2a672c){_0x2a672c=_0x2a672c||0x1f4;return function(_0x4eea45){logger['error'](_0x4eea45[_0x0643('0x25')]);if(_0x4eea45[_0x0643('0x26')]){delete _0x4eea45[_0x0643('0x26')];}_0x461d9b[_0x0643('0x19')](_0x2a672c)[_0x0643('0x27')](_0x4eea45);};}exports[_0x0643('0x28')]=function(_0x5df0b2,_0x1ebd99){var _0x1b0d59={},_0x4857af={},_0x1dc267={'count':0x0,'rows':[]};var _0xa75d34=_[_0x0643('0x29')](db['AnalyticTreeReport'][_0x0643('0x2a')],function(_0x5020c7){return{'name':_0x5020c7['fieldName'],'type':_0x5020c7['type'][_0x0643('0x2b')]};});_0x4857af[_0x0643('0x2c')]=_['map'](_0xa75d34,_0x0643('0x26'));_0x4857af[_0x0643('0x2d')]=_[_0x0643('0x2e')](_0x5df0b2[_0x0643('0x2d')]);_0x4857af[_0x0643('0x2f')]=_[_0x0643('0x30')](_0x4857af['model'],_0x4857af[_0x0643('0x2d')]);_0x1b0d59['attributes']=_['intersection'](_0x4857af[_0x0643('0x2c')],qs['fields'](_0x5df0b2[_0x0643('0x2d')][_0x0643('0x31')]));_0x1b0d59[_0x0643('0x32')]=_0x1b0d59[_0x0643('0x32')]['length']?_0x1b0d59['attributes']:_0x4857af['model'];if(!_0x5df0b2['query'][_0x0643('0x33')](_0x0643('0x34'))){_0x1b0d59[_0x0643('0x1b')]=qs[_0x0643('0x1b')](_0x5df0b2[_0x0643('0x2d')]['limit']);_0x1b0d59[_0x0643('0x1a')]=qs['offset'](_0x5df0b2[_0x0643('0x2d')][_0x0643('0x1a')]);}_0x1b0d59[_0x0643('0x35')]=qs['sort'](_0x5df0b2['query'][_0x0643('0x36')]);_0x1b0d59['where']=qs['filters'](_[_0x0643('0x37')](_0x5df0b2[_0x0643('0x2d')],_0x4857af[_0x0643('0x2f')]),_0xa75d34);if(_0x5df0b2[_0x0643('0x2d')]['filter']){_0x1b0d59[_0x0643('0x38')]=_[_0x0643('0x39')](_0x1b0d59[_0x0643('0x38')],{'$or':_['map'](_0xa75d34,function(_0x307bc8){if(_0x307bc8[_0x0643('0x3a')]!==_0x0643('0x3b')){var _0x539eb6={};_0x539eb6[_0x307bc8[_0x0643('0x26')]]={'$like':'%'+_0x5df0b2[_0x0643('0x2d')][_0x0643('0x3c')]+'%'};return _0x539eb6;}})});}_0x1b0d59=_[_0x0643('0x39')]({},_0x1b0d59,_0x5df0b2[_0x0643('0x3d')]);var _0x29701a={'where':_0x1b0d59[_0x0643('0x38')]};return db['AnalyticTreeReport']['count'](_0x29701a)[_0x0643('0x23')](function(_0x38f790){_0x1dc267[_0x0643('0x1d')]=_0x38f790;if(_0x5df0b2[_0x0643('0x2d')]['includeAll']){_0x1b0d59[_0x0643('0x3e')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0643('0x3f')](_0x1b0d59);})[_0x0643('0x23')](function(_0x24700d){_0x1dc267[_0x0643('0x40')]=_0x24700d;return _0x1dc267;})[_0x0643('0x23')](respondWithFilteredResult(_0x1ebd99,_0x1b0d59))[_0x0643('0x41')](handleError(_0x1ebd99,null));};exports['show']=function(_0x1bc566,_0x6cf0b4){var _0x1fa000={'raw':!![],'where':{'id':_0x1bc566[_0x0643('0x42')]['id']}},_0x16d9a1={};_0x16d9a1['model']=_[_0x0643('0x2e')](db[_0x0643('0x43')][_0x0643('0x2a')]);_0x16d9a1[_0x0643('0x2d')]=_[_0x0643('0x2e')](_0x1bc566[_0x0643('0x2d')]);_0x16d9a1['filters']=_[_0x0643('0x30')](_0x16d9a1['model'],_0x16d9a1[_0x0643('0x2d')]);_0x1fa000[_0x0643('0x32')]=_['intersection'](_0x16d9a1['model'],qs[_0x0643('0x31')](_0x1bc566['query'][_0x0643('0x31')]));_0x1fa000['attributes']=_0x1fa000[_0x0643('0x32')][_0x0643('0x44')]?_0x1fa000['attributes']:_0x16d9a1['model'];if(_0x1bc566[_0x0643('0x2d')][_0x0643('0x45')]){_0x1fa000[_0x0643('0x3e')]=[{'all':!![]}];}_0x1fa000=_[_0x0643('0x39')]({},_0x1fa000,_0x1bc566[_0x0643('0x3d')]);return db['AnalyticTreeReport'][_0x0643('0x46')](_0x1fa000)[_0x0643('0x23')](handleEntityNotFound(_0x6cf0b4,null))[_0x0643('0x23')](respondWithResult(_0x6cf0b4,null))[_0x0643('0x41')](handleError(_0x6cf0b4,null));};exports[_0x0643('0x47')]=function(_0xbba92c,_0x3f16bb){return db['AnalyticTreeReport'][_0x0643('0x47')](_0xbba92c[_0x0643('0x48')],{})[_0x0643('0x23')](respondWithResult(_0x3f16bb,0xc9))[_0x0643('0x41')](handleError(_0x3f16bb,null));};exports[_0x0643('0x49')]=function(_0x47fd83,_0x32b191){if(_0x47fd83['body']['id']){delete _0x47fd83[_0x0643('0x48')]['id'];}return db['AnalyticTreeReport'][_0x0643('0x46')]({'where':{'id':_0x47fd83[_0x0643('0x42')]['id']}})['then'](handleEntityNotFound(_0x32b191,null))[_0x0643('0x23')](saveUpdates(_0x47fd83['body'],null))[_0x0643('0x23')](respondWithResult(_0x32b191,null))[_0x0643('0x41')](handleError(_0x32b191,null));};exports[_0x0643('0x24')]=function(_0x16a75e,_0x3713fd){return db[_0x0643('0x43')][_0x0643('0x46')]({'where':{'id':_0x16a75e[_0x0643('0x42')]['id']}})[_0x0643('0x23')](handleEntityNotFound(_0x3713fd,null))[_0x0643('0x23')](removeEntity(_0x3713fd,null))[_0x0643('0x41')](handleError(_0x3713fd,null));};
\ No newline at end of file
+var _0x27c1=['error','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','name','options','findAll','rows','catch','show','length','includeAll','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x127783,_0x258715){var _0x14f298=function(_0x32090e){while(--_0x32090e){_0x127783['push'](_0x127783['shift']());}};_0x14f298(++_0x258715);}(_0x27c1,0x6e));var _0x127c=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x27c1[_0x82129b];return _0x2ae5dc;};'use strict';var emlformat=require(_0x127c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x127c('0x1'));var jsonpatch=require(_0x127c('0x2'));var rp=require(_0x127c('0x3'));var moment=require(_0x127c('0x4'));var BPromise=require(_0x127c('0x5'));var Mustache=require(_0x127c('0x6'));var util=require(_0x127c('0x7'));var path=require(_0x127c('0x8'));var sox=require('sox');var csv=require(_0x127c('0x9'));var ejs=require(_0x127c('0xa'));var fs=require('fs');var fs_extra=require(_0x127c('0xb'));var _=require(_0x127c('0xc'));var squel=require(_0x127c('0xd'));var crypto=require(_0x127c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x127c('0x9'));var querystring=require(_0x127c('0xf'));var Papa=require('papaparse');var Redis=require(_0x127c('0x10'));var authService=require(_0x127c('0x11'));var qs=require(_0x127c('0x12'));var as=require(_0x127c('0x13'));var hardwareService=require(_0x127c('0x14'));var logger=require(_0x127c('0x15'))('api');var utils=require(_0x127c('0x16'));var config=require(_0x127c('0x17'));var licenseUtil=require(_0x127c('0x18'));var db=require(_0x127c('0x19'))['db'];function respondWithStatusCode(_0x12bf26,_0x4aa98c){_0x4aa98c=_0x4aa98c||0xcc;return function(_0xb88418){if(_0xb88418){return _0x12bf26[_0x127c('0x1a')](_0x4aa98c);}return _0x12bf26[_0x127c('0x1b')](_0x4aa98c)[_0x127c('0x1c')]();};}function respondWithResult(_0x391425,_0x495a5c){_0x495a5c=_0x495a5c||0xc8;return function(_0x2f2c89){if(_0x2f2c89){return _0x391425[_0x127c('0x1b')](_0x495a5c)[_0x127c('0x1d')](_0x2f2c89);}};}function respondWithFilteredResult(_0x1c371e,_0x4689cc){return function(_0x13672f){if(_0x13672f){var _0x4aef5d=typeof _0x4689cc[_0x127c('0x1e')]==='undefined'&&typeof _0x4689cc[_0x127c('0x1f')]==='undefined';var _0x58f5e4=_0x13672f[_0x127c('0x20')];var _0x4d0f46=_0x4aef5d?0x0:_0x4689cc[_0x127c('0x1e')];var _0xb400c3=_0x4aef5d?_0x13672f['count']:_0x4689cc[_0x127c('0x1e')]+_0x4689cc['limit'];var _0x4071f9;if(_0xb400c3>=_0x58f5e4){_0xb400c3=_0x58f5e4;_0x4071f9=0xc8;}else{_0x4071f9=0xce;}_0x1c371e[_0x127c('0x1b')](_0x4071f9);return _0x1c371e['set'](_0x127c('0x21'),_0x4d0f46+'-'+_0xb400c3+'/'+_0x58f5e4)[_0x127c('0x1d')](_0x13672f);}return null;};}function patchUpdates(_0x78c715){return function(_0x59e4eb){try{jsonpatch[_0x127c('0x22')](_0x59e4eb,_0x78c715,!![]);}catch(_0x7725d2){return BPromise[_0x127c('0x23')](_0x7725d2);}return _0x59e4eb[_0x127c('0x24')]();};}function saveUpdates(_0x367f0c,_0x5bb030){return function(_0x13a9f5){if(_0x13a9f5){return _0x13a9f5[_0x127c('0x25')](_0x367f0c)[_0x127c('0x26')](function(_0x30562d){return _0x30562d;});}return null;};}function removeEntity(_0xdc81eb,_0x1291b8){return function(_0x2a1eb1){if(_0x2a1eb1){return _0x2a1eb1[_0x127c('0x27')]()[_0x127c('0x26')](function(){_0xdc81eb['status'](0xcc)[_0x127c('0x1c')]();});}};}function handleEntityNotFound(_0x8577d9,_0x12580a){return function(_0x20384c){if(!_0x20384c){_0x8577d9[_0x127c('0x1a')](0x194);}return _0x20384c;};}function handleError(_0x58b389,_0x2f9db7){_0x2f9db7=_0x2f9db7||0x1f4;return function(_0x12c590){logger[_0x127c('0x28')](_0x12c590['stack']);if(_0x12c590['name']){delete _0x12c590['name'];}_0x58b389[_0x127c('0x1b')](_0x2f9db7)[_0x127c('0x29')](_0x12c590);};}exports[_0x127c('0x2a')]=function(_0x24f632,_0x269993){var _0x1c3d19={},_0x4b0573={},_0x5d578d={'count':0x0,'rows':[]};var _0x4397ed=_[_0x127c('0x2b')](db[_0x127c('0x2c')][_0x127c('0x2d')],function(_0x59768e){return{'name':_0x59768e[_0x127c('0x2e')],'type':_0x59768e[_0x127c('0x2f')][_0x127c('0x30')]};});_0x4b0573['model']=_['map'](_0x4397ed,'name');_0x4b0573[_0x127c('0x31')]=_[_0x127c('0x32')](_0x24f632[_0x127c('0x31')]);_0x4b0573[_0x127c('0x33')]=_[_0x127c('0x34')](_0x4b0573[_0x127c('0x35')],_0x4b0573[_0x127c('0x31')]);_0x1c3d19[_0x127c('0x36')]=_[_0x127c('0x34')](_0x4b0573[_0x127c('0x35')],qs[_0x127c('0x37')](_0x24f632[_0x127c('0x31')][_0x127c('0x37')]));_0x1c3d19['attributes']=_0x1c3d19['attributes']['length']?_0x1c3d19[_0x127c('0x36')]:_0x4b0573[_0x127c('0x35')];if(!_0x24f632[_0x127c('0x31')][_0x127c('0x38')](_0x127c('0x39'))){_0x1c3d19[_0x127c('0x1f')]=qs[_0x127c('0x1f')](_0x24f632[_0x127c('0x31')][_0x127c('0x1f')]);_0x1c3d19[_0x127c('0x1e')]=qs['offset'](_0x24f632['query'][_0x127c('0x1e')]);}_0x1c3d19[_0x127c('0x3a')]=qs['sort'](_0x24f632['query']['sort']);_0x1c3d19[_0x127c('0x3b')]=qs[_0x127c('0x33')](_[_0x127c('0x3c')](_0x24f632['query'],_0x4b0573['filters']),_0x4397ed);if(_0x24f632[_0x127c('0x31')]['filter']){_0x1c3d19[_0x127c('0x3b')]=_[_0x127c('0x3d')](_0x1c3d19[_0x127c('0x3b')],{'$or':_[_0x127c('0x2b')](_0x4397ed,function(_0x513c58){if(_0x513c58[_0x127c('0x2f')]!==_0x127c('0x3e')){var _0x100a17={};_0x100a17[_0x513c58[_0x127c('0x3f')]]={'$like':'%'+_0x24f632['query']['filter']+'%'};return _0x100a17;}})});}_0x1c3d19=_[_0x127c('0x3d')]({},_0x1c3d19,_0x24f632[_0x127c('0x40')]);var _0x5d8c82={'where':_0x1c3d19['where']};return db[_0x127c('0x2c')]['count'](_0x5d8c82)[_0x127c('0x26')](function(_0x47027e){_0x5d578d[_0x127c('0x20')]=_0x47027e;if(_0x24f632[_0x127c('0x31')]['includeAll']){_0x1c3d19['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x127c('0x41')](_0x1c3d19);})['then'](function(_0x18afaa){_0x5d578d[_0x127c('0x42')]=_0x18afaa;return _0x5d578d;})['then'](respondWithFilteredResult(_0x269993,_0x1c3d19))[_0x127c('0x43')](handleError(_0x269993,null));};exports[_0x127c('0x44')]=function(_0x20101f,_0x2ea0a0){var _0x4fc8d7={'raw':!![],'where':{'id':_0x20101f['params']['id']}},_0x5b0cd2={};_0x5b0cd2[_0x127c('0x35')]=_['keys'](db['AnalyticTreeReport'][_0x127c('0x2d')]);_0x5b0cd2[_0x127c('0x31')]=_[_0x127c('0x32')](_0x20101f[_0x127c('0x31')]);_0x5b0cd2[_0x127c('0x33')]=_['intersection'](_0x5b0cd2['model'],_0x5b0cd2['query']);_0x4fc8d7[_0x127c('0x36')]=_[_0x127c('0x34')](_0x5b0cd2[_0x127c('0x35')],qs[_0x127c('0x37')](_0x20101f['query'][_0x127c('0x37')]));_0x4fc8d7[_0x127c('0x36')]=_0x4fc8d7[_0x127c('0x36')][_0x127c('0x45')]?_0x4fc8d7[_0x127c('0x36')]:_0x5b0cd2[_0x127c('0x35')];if(_0x20101f[_0x127c('0x31')][_0x127c('0x46')]){_0x4fc8d7[_0x127c('0x47')]=[{'all':!![]}];}_0x4fc8d7=_[_0x127c('0x3d')]({},_0x4fc8d7,_0x20101f[_0x127c('0x40')]);return db[_0x127c('0x2c')][_0x127c('0x48')](_0x4fc8d7)['then'](handleEntityNotFound(_0x2ea0a0,null))[_0x127c('0x26')](respondWithResult(_0x2ea0a0,null))['catch'](handleError(_0x2ea0a0,null));};exports['create']=function(_0x555a63,_0x59d034){return db[_0x127c('0x2c')][_0x127c('0x49')](_0x555a63[_0x127c('0x4a')],{})['then'](respondWithResult(_0x59d034,0xc9))[_0x127c('0x43')](handleError(_0x59d034,null));};exports[_0x127c('0x25')]=function(_0x7f4d5b,_0xcc907f){if(_0x7f4d5b[_0x127c('0x4a')]['id']){delete _0x7f4d5b[_0x127c('0x4a')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x7f4d5b['params']['id']}})[_0x127c('0x26')](handleEntityNotFound(_0xcc907f,null))[_0x127c('0x26')](saveUpdates(_0x7f4d5b[_0x127c('0x4a')],null))[_0x127c('0x26')](respondWithResult(_0xcc907f,null))[_0x127c('0x43')](handleError(_0xcc907f,null));};exports['destroy']=function(_0x351125,_0x24b630){return db['AnalyticTreeReport'][_0x127c('0x48')]({'where':{'id':_0x351125['params']['id']}})[_0x127c('0x26')](handleEntityNotFound(_0x24b630,null))[_0x127c('0x26')](removeEntity(_0x24b630,null))[_0x127c('0x43')](handleError(_0x24b630,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index ce84575..96e2dbc 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 _0x5417=['rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x395512,_0x1e9614){var _0x556c2c=function(_0x7fddef){while(--_0x7fddef){_0x395512['push'](_0x395512['shift']());}};_0x556c2c(++_0x1e9614);}(_0x5417,0x10a));var _0x7541=function(_0x464086,_0x363367){_0x464086=_0x464086-0x0;var _0x4133c9=_0x5417[_0x464086];return _0x4133c9;};'use strict';var _=require(_0x7541('0x0'));var util=require(_0x7541('0x1'));var logger=require(_0x7541('0x2'))(_0x7541('0x3'));var moment=require(_0x7541('0x4'));var BPromise=require(_0x7541('0x5'));var rp=require(_0x7541('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7541('0x7'));var config=require(_0x7541('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x7541('0x9')]=function(_0x1f0fa5,_0x1b2a75){return _0x1f0fa5[_0x7541('0xa')](_0x7541('0xb'),attributes,{'tableName':_0x7541('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x95b3=['rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2a2754,_0x161884){var _0x12f580=function(_0x48a3e1){while(--_0x48a3e1){_0x2a2754['push'](_0x2a2754['shift']());}};_0x12f580(++_0x161884);}(_0x95b3,0x1e7));var _0x395b=function(_0x58d01d,_0x451014){_0x58d01d=_0x58d01d-0x0;var _0x456518=_0x95b3[_0x58d01d];return _0x456518;};'use strict';var _=require(_0x395b('0x0'));var util=require(_0x395b('0x1'));var logger=require(_0x395b('0x2'))(_0x395b('0x3'));var moment=require(_0x395b('0x4'));var BPromise=require('bluebird');var rp=require(_0x395b('0x5'));var fs=require('fs');var path=require(_0x395b('0x6'));var rimraf=require(_0x395b('0x7'));var config=require(_0x395b('0x8'));var attributes=require(_0x395b('0x9'));module['exports']=function(_0x4825a8,_0x2f2a48){return _0x4825a8[_0x395b('0xa')](_0x395b('0xb'),attributes,{'tableName':_0x395b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 233b04c..2d9e2cd 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x42ef3e,_0x2846f1){var _0x28075f=function(_0x3a018b){while(--_0x3a018b){_0x42ef3e['push'](_0x42ef3e['shift']());}};_0x28075f(++_0x2846f1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2647d0,_0x276837){var _0x361dfa=function(_0x3ed79d){while(--_0x3ed79d){_0x2647d0['push'](_0x2647d0['shift']());}};_0x361dfa(++_0x276837);}(_0x5f2f,0x73));var _0xf5f2=function(_0x197268,_0x16634c){_0x197268=_0x197268-0x0;var _0x4e61e7=_0x5f2f[_0x197268];return _0x4e61e7;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index a19d394..2936c7a 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 _0x8743=['show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0xe02e8b,_0x23ac2d){var _0x24ed50=function(_0x1f3188){while(--_0x1f3188){_0xe02e8b['push'](_0xe02e8b['shift']());}};_0x24ed50(++_0x23ac2d);}(_0x8743,0x6b));var _0x3874=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8743[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x3874('0x0'));var util=require('util');var path=require(_0x3874('0x1'));var timeout=require(_0x3874('0x2'));var express=require(_0x3874('0x3'));var router=express[_0x3874('0x4')]();var fs_extra=require(_0x3874('0x5'));var auth=require(_0x3874('0x6'));var interaction=require(_0x3874('0x7'));var config=require(_0x3874('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x3874('0x9')](),controller[_0x3874('0xa')]);router[_0x3874('0xb')](_0x3874('0xc'),auth[_0x3874('0x9')](),controller[_0x3874('0xd')]);router[_0x3874('0xe')]('/',auth[_0x3874('0x9')](),controller[_0x3874('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3874('0x10')]);router[_0x3874('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3874('0x12')]);module[_0x3874('0x13')]=router;
\ No newline at end of file
+var _0x3a10=['show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x44c0d2,_0x4e6b03){var _0x2e8743=function(_0x16f68d){while(--_0x16f68d){_0x44c0d2['push'](_0x44c0d2['shift']());}};_0x2e8743(++_0x4e6b03);}(_0x3a10,0x1ad));var _0x03a1=function(_0x2454e8,_0xe6f8c6){_0x2454e8=_0x2454e8-0x0;var _0x1593e3=_0x3a10[_0x2454e8];return _0x1593e3;};'use strict';var multer=require('multer');var util=require(_0x03a1('0x0'));var path=require(_0x03a1('0x1'));var timeout=require(_0x03a1('0x2'));var express=require(_0x03a1('0x3'));var router=express[_0x03a1('0x4')]();var fs_extra=require(_0x03a1('0x5'));var auth=require(_0x03a1('0x6'));var interaction=require(_0x03a1('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x03a1('0x8')]('/',auth[_0x03a1('0x9')](),controller[_0x03a1('0xa')]);router[_0x03a1('0x8')]('/:id',auth[_0x03a1('0x9')](),controller[_0x03a1('0xb')]);router[_0x03a1('0xc')]('/',auth[_0x03a1('0x9')](),controller[_0x03a1('0xd')]);router[_0x03a1('0xe')](_0x03a1('0xf'),auth[_0x03a1('0x9')](),controller[_0x03a1('0x10')]);router[_0x03a1('0x11')]('/:id',auth[_0x03a1('0x9')](),controller[_0x03a1('0x12')]);module[_0x03a1('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index c4155f7..059f895 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 _0xfc1e=['STRING'];(function(_0x425d5e,_0x3b9040){var _0x3cc67b=function(_0x121446){while(--_0x121446){_0x425d5e['push'](_0x425d5e['shift']());}};_0x3cc67b(++_0x3b9040);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0xfc1e[_0x1bb58c];return _0x277586;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xefc1('0x0')]},'type':{'type':Sequelize[_0xefc1('0x0')]}};
\ No newline at end of file
+var _0x5eb8=['STRING','exports'];(function(_0x3b62c2,_0x2e3236){var _0x274e6a=function(_0xed66){while(--_0xed66){_0x3b62c2['push'](_0x3b62c2['shift']());}};_0x274e6a(++_0x2e3236);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x5944e9,_0xf3da60){_0x5944e9=_0x5944e9-0x0;var _0x1098b8=_0x5eb8[_0x5944e9];return _0x1098b8;};'use strict';var Sequelize=require('sequelize');module[_0x85eb('0x0')]={'name':{'type':Sequelize[_0x85eb('0x1')]},'basename':{'type':Sequelize['STRING']},'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 ac69ff7..2c218db 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 _0x1298=['error','name','send','index','map','Attachment','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','options','get','omit','body','createdAt','updatedAt','create','find','originalname','basename','file','filename','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x4b548c,_0x142a2c){var _0x396394=function(_0x17e03a){while(--_0x17e03a){_0x4b548c['push'](_0x4b548c['shift']());}};_0x396394(++_0x142a2c);}(_0x1298,0x140));var _0x8129=function(_0x1f69c3,_0xd24681){_0x1f69c3=_0x1f69c3-0x0;var _0x4842fb=_0x1298[_0x1f69c3];return _0x4842fb;};'use strict';var emlformat=require(_0x8129('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8129('0x1'));var jsonpatch=require(_0x8129('0x2'));var rp=require(_0x8129('0x3'));var moment=require(_0x8129('0x4'));var BPromise=require(_0x8129('0x5'));var Mustache=require(_0x8129('0x6'));var util=require('util');var path=require(_0x8129('0x7'));var sox=require(_0x8129('0x8'));var csv=require(_0x8129('0x9'));var ejs=require(_0x8129('0xa'));var fs=require('fs');var fs_extra=require(_0x8129('0xb'));var _=require(_0x8129('0xc'));var squel=require(_0x8129('0xd'));var crypto=require(_0x8129('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8129('0x9'));var querystring=require(_0x8129('0xf'));var Papa=require('papaparse');var Redis=require(_0x8129('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8129('0x11'));var as=require(_0x8129('0x12'));var hardwareService=require(_0x8129('0x13'));var logger=require(_0x8129('0x14'))(_0x8129('0x15'));var utils=require('../../config/utils');var config=require(_0x8129('0x16'));var licenseUtil=require(_0x8129('0x17'));var db=require(_0x8129('0x18'))['db'];function respondWithStatusCode(_0x3607dd,_0x1d96bc){_0x1d96bc=_0x1d96bc||0xcc;return function(_0x2d1a44){if(_0x2d1a44){return _0x3607dd[_0x8129('0x19')](_0x1d96bc);}return _0x3607dd[_0x8129('0x1a')](_0x1d96bc)[_0x8129('0x1b')]();};}function respondWithResult(_0xa104a5,_0x50813f){_0x50813f=_0x50813f||0xc8;return function(_0x2c6d27){if(_0x2c6d27){return _0xa104a5['status'](_0x50813f)[_0x8129('0x1c')](_0x2c6d27);}};}function respondWithFilteredResult(_0x5ecfaa,_0x1953f2){return function(_0x9d09b6){if(_0x9d09b6){var _0x1981b6=typeof _0x1953f2[_0x8129('0x1d')]===_0x8129('0x1e')&&typeof _0x1953f2['limit']==='undefined';var _0x4248f3=_0x9d09b6[_0x8129('0x1f')];var _0x12e1a7=_0x1981b6?0x0:_0x1953f2[_0x8129('0x1d')];var _0x52ed9a=_0x1981b6?_0x9d09b6[_0x8129('0x1f')]:_0x1953f2['offset']+_0x1953f2[_0x8129('0x20')];var _0x3ea3a4;if(_0x52ed9a>=_0x4248f3){_0x52ed9a=_0x4248f3;_0x3ea3a4=0xc8;}else{_0x3ea3a4=0xce;}_0x5ecfaa[_0x8129('0x1a')](_0x3ea3a4);return _0x5ecfaa[_0x8129('0x21')](_0x8129('0x22'),_0x12e1a7+'-'+_0x52ed9a+'/'+_0x4248f3)['json'](_0x9d09b6);}return null;};}function patchUpdates(_0x20c142){return function(_0x3439ee){try{jsonpatch[_0x8129('0x23')](_0x3439ee,_0x20c142,!![]);}catch(_0xff04d7){return BPromise[_0x8129('0x24')](_0xff04d7);}return _0x3439ee['save']();};}function saveUpdates(_0x1a0389,_0x24c7da){return function(_0x26ee2c){if(_0x26ee2c){return _0x26ee2c[_0x8129('0x25')](_0x1a0389)[_0x8129('0x26')](function(_0x296701){return _0x296701;});}return null;};}function removeEntity(_0xe1ca26,_0x4a2f60){return function(_0x302727){if(_0x302727){return _0x302727[_0x8129('0x27')]()['then'](function(){_0xe1ca26[_0x8129('0x1a')](0xcc)[_0x8129('0x1b')]();});}};}function handleEntityNotFound(_0x52f50b,_0x32294e){return function(_0x1282c1){if(!_0x1282c1){_0x52f50b[_0x8129('0x19')](0x194);}return _0x1282c1;};}function handleError(_0x5454ef,_0x4f31b7){_0x4f31b7=_0x4f31b7||0x1f4;return function(_0x205e11){logger[_0x8129('0x28')](_0x205e11['stack']);if(_0x205e11['name']){delete _0x205e11[_0x8129('0x29')];}_0x5454ef[_0x8129('0x1a')](_0x4f31b7)[_0x8129('0x2a')](_0x205e11);};}exports[_0x8129('0x2b')]=function(_0x11b408,_0x20f2aa){var _0x30ea60={},_0x2cee84={},_0x4846ad={'count':0x0,'rows':[]};var _0x570158=_[_0x8129('0x2c')](db[_0x8129('0x2d')]['rawAttributes'],function(_0x5e898d){return{'name':_0x5e898d[_0x8129('0x2e')],'type':_0x5e898d[_0x8129('0x2f')][_0x8129('0x30')]};});_0x2cee84[_0x8129('0x31')]=_[_0x8129('0x2c')](_0x570158,_0x8129('0x29'));_0x2cee84['query']=_['keys'](_0x11b408[_0x8129('0x32')]);_0x2cee84['filters']=_[_0x8129('0x33')](_0x2cee84[_0x8129('0x31')],_0x2cee84[_0x8129('0x32')]);_0x30ea60[_0x8129('0x34')]=_[_0x8129('0x33')](_0x2cee84[_0x8129('0x31')],qs[_0x8129('0x35')](_0x11b408['query'][_0x8129('0x35')]));_0x30ea60['attributes']=_0x30ea60[_0x8129('0x34')][_0x8129('0x36')]?_0x30ea60[_0x8129('0x34')]:_0x2cee84[_0x8129('0x31')];if(!_0x11b408['query'][_0x8129('0x37')]('nolimit')){_0x30ea60[_0x8129('0x20')]=qs[_0x8129('0x20')](_0x11b408['query'][_0x8129('0x20')]);_0x30ea60[_0x8129('0x1d')]=qs[_0x8129('0x1d')](_0x11b408[_0x8129('0x32')][_0x8129('0x1d')]);}_0x30ea60['order']=qs[_0x8129('0x38')](_0x11b408['query'][_0x8129('0x38')]);_0x30ea60[_0x8129('0x39')]=qs['filters'](_[_0x8129('0x3a')](_0x11b408[_0x8129('0x32')],_0x2cee84[_0x8129('0x3b')]),_0x570158);if(_0x11b408['query'][_0x8129('0x3c')]){_0x30ea60['where']=_[_0x8129('0x3d')](_0x30ea60['where'],{'$or':_[_0x8129('0x2c')](_0x570158,function(_0x207b34){if(_0x207b34[_0x8129('0x2f')]!==_0x8129('0x3e')){var _0x5eeaa2={};_0x5eeaa2[_0x207b34['name']]={'$like':'%'+_0x11b408[_0x8129('0x32')][_0x8129('0x3c')]+'%'};return _0x5eeaa2;}})});}_0x30ea60=_[_0x8129('0x3d')]({},_0x30ea60,_0x11b408['options']);var _0x2710cb={'where':_0x30ea60[_0x8129('0x39')]};return db[_0x8129('0x2d')]['count'](_0x2710cb)['then'](function(_0x5630ad){_0x4846ad['count']=_0x5630ad;if(_0x11b408[_0x8129('0x32')][_0x8129('0x3f')]){_0x30ea60[_0x8129('0x40')]=[{'all':!![]}];}return db[_0x8129('0x2d')][_0x8129('0x41')](_0x30ea60);})[_0x8129('0x26')](function(_0x3b483c){_0x4846ad[_0x8129('0x42')]=_0x3b483c;return _0x4846ad;})[_0x8129('0x26')](respondWithFilteredResult(_0x20f2aa,_0x30ea60))[_0x8129('0x43')](handleError(_0x20f2aa,null));};exports[_0x8129('0x44')]=function(_0xe9a00d,_0x535f81){var _0x239f82={'raw':!![],'where':{'id':_0xe9a00d[_0x8129('0x45')]['id']}},_0x1c7116={};_0x1c7116[_0x8129('0x31')]=_['keys'](db['Attachment'][_0x8129('0x46')]);_0x1c7116[_0x8129('0x32')]=_[_0x8129('0x47')](_0xe9a00d[_0x8129('0x32')]);_0x1c7116['filters']=_['intersection'](_0x1c7116[_0x8129('0x31')],_0x1c7116[_0x8129('0x32')]);_0x239f82[_0x8129('0x34')]=_['intersection'](_0x1c7116[_0x8129('0x31')],qs[_0x8129('0x35')](_0xe9a00d[_0x8129('0x32')][_0x8129('0x35')]));_0x239f82[_0x8129('0x34')]=_0x239f82[_0x8129('0x34')][_0x8129('0x36')]?_0x239f82['attributes']:_0x1c7116[_0x8129('0x31')];if(_0xe9a00d['query'][_0x8129('0x3f')]){_0x239f82[_0x8129('0x40')]=[{'all':!![]}];}_0x239f82=_[_0x8129('0x3d')]({},_0x239f82,_0xe9a00d[_0x8129('0x48')]);return db[_0x8129('0x2d')]['find'](_0x239f82)[_0x8129('0x26')](handleEntityNotFound(_0x535f81,null))[_0x8129('0x26')](respondWithResult(_0x535f81,null))[_0x8129('0x43')](handleError(_0x535f81,null));};exports['clone']=function(_0x5d6ccc,_0x18ca1c){var _0x3a022e={'where':{'id':_0x5d6ccc[_0x8129('0x45')]['id']}},_0x270a3d={};_0x270a3d[_0x8129('0x31')]=_[_0x8129('0x47')](db[_0x8129('0x2d')][_0x8129('0x46')]);_0x3a022e[_0x8129('0x34')]=_[_0x8129('0x33')](_0x270a3d[_0x8129('0x31')],qs[_0x8129('0x35')](_0x5d6ccc['query']['fields']));_0x3a022e[_0x8129('0x34')]=_0x3a022e[_0x8129('0x34')][_0x8129('0x36')]?_0x3a022e[_0x8129('0x34')]:_0x270a3d['model'];if(_0x5d6ccc[_0x8129('0x32')][_0x8129('0x3f')]){_0x3a022e[_0x8129('0x40')]=[{'all':!![]}];}_0x3a022e=_[_0x8129('0x3d')]({},_0x3a022e,_0x5d6ccc[_0x8129('0x48')]);return db[_0x8129('0x2d')]['find'](_0x3a022e)[_0x8129('0x26')](handleEntityNotFound(_0x18ca1c,null))[_0x8129('0x26')](function(_0x5eebfb){if(_0x5eebfb){var _0x52592e=_0x5eebfb[_0x8129('0x49')]({'plain':!![]});_0x52592e=qs[_0x8129('0x4a')](_0x52592e,['id','createdAt','updatedAt']);_0x5d6ccc[_0x8129('0x4b')]=_[_0x8129('0x4a')](_0x5d6ccc[_0x8129('0x4b')],['id',_0x8129('0x4c'),_0x8129('0x4d')]);return db['Attachment'][_0x8129('0x4e')](_['merge'](_0x52592e,_0x5d6ccc[_0x8129('0x4b')]),{'include':_0x5d6ccc[_0x8129('0x32')][_0x8129('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x18ca1c,0xc9))[_0x8129('0x43')](handleError(_0x18ca1c,null));};exports[_0x8129('0x25')]=function(_0x356452,_0x2ff630){if(_0x356452['body']['id']){delete _0x356452[_0x8129('0x4b')]['id'];}return db[_0x8129('0x2d')]['find']({'where':{'id':_0x356452['params']['id']}})[_0x8129('0x26')](handleEntityNotFound(_0x2ff630,null))[_0x8129('0x26')](saveUpdates(_0x356452[_0x8129('0x4b')],null))[_0x8129('0x26')](respondWithResult(_0x2ff630,null))[_0x8129('0x43')](handleError(_0x2ff630,null));};exports['destroy']=function(_0x53d6f3,_0x4ddb7a){return db[_0x8129('0x2d')][_0x8129('0x4f')]({'where':{'id':_0x53d6f3['params']['id']}})[_0x8129('0x26')](handleEntityNotFound(_0x4ddb7a,null))[_0x8129('0x26')](removeEntity(_0x4ddb7a,null))[_0x8129('0x43')](handleError(_0x4ddb7a,null));};exports[_0x8129('0x4e')]=function(_0x32a736,_0x2ab224,_0x465739){_0x32a736[_0x8129('0x4b')][_0x8129('0x29')]=_0x32a736['file'][_0x8129('0x50')];_0x32a736['body'][_0x8129('0x51')]=_0x32a736[_0x8129('0x52')][_0x8129('0x53')];_0x32a736[_0x8129('0x4b')]['type']=_0x32a736[_0x8129('0x52')][_0x8129('0x54')];return db['Attachment'][_0x8129('0x4e')](_0x32a736['body'])[_0x8129('0x26')](respondWithResult(_0x2ab224,0xc9))[_0x8129('0x43')](handleError(_0x2ab224,null));};exports[_0x8129('0x55')]=function(_0xb22135,_0x51d82f,_0xf59e4c){return db[_0x8129('0x2d')]['findOne']({'where':{'id':_0xb22135[_0x8129('0x45')]['id']},'raw':!![]})[_0x8129('0x26')](handleEntityNotFound(_0x51d82f,null))[_0x8129('0x26')](function(_0x545a47){if(_0x545a47){var _0x3fa176=_0x545a47[_0x8129('0x56')]!==null;var _0x4da8ca=path['join'](config[_0x8129('0x57')],_0x8129('0x58'));if(_0x3fa176){_0x4da8ca=path[_0x8129('0x59')](_0x4da8ca,'offline-chat/');}var _0x21fb03=path[_0x8129('0x59')](_0x4da8ca,_0x545a47[_0x8129('0x51')]);return _0x51d82f['download'](_0x21fb03);}})[_0x8129('0x43')](handleError(_0x51d82f,null));};
\ No newline at end of file
+var _0x914f=['where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Attachment','rows','show','find','params','get','omit','createdAt','updatedAt','body','catch','create','file','basename','mimetype','findOne','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x3414dc,_0x1b9291){var _0x30e662=function(_0x577127){while(--_0x577127){_0x3414dc['push'](_0x3414dc['shift']());}};_0x30e662(++_0x1b9291);}(_0x914f,0xcd));var _0xf914=function(_0x1e9195,_0x50c32c){_0x1e9195=_0x1e9195-0x0;var _0x44a35d=_0x914f[_0x1e9195];return _0x44a35d;};'use strict';var emlformat=require(_0xf914('0x0'));var rimraf=require(_0xf914('0x1'));var zipdir=require(_0xf914('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf914('0x3'));var moment=require(_0xf914('0x4'));var BPromise=require(_0xf914('0x5'));var Mustache=require(_0xf914('0x6'));var util=require(_0xf914('0x7'));var path=require(_0xf914('0x8'));var sox=require(_0xf914('0x9'));var csv=require(_0xf914('0xa'));var ejs=require(_0xf914('0xb'));var fs=require('fs');var fs_extra=require(_0xf914('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf914('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf914('0xe'));var toCsv=require(_0xf914('0xa'));var querystring=require(_0xf914('0xf'));var Papa=require(_0xf914('0x10'));var Redis=require(_0xf914('0x11'));var authService=require(_0xf914('0x12'));var qs=require(_0xf914('0x13'));var as=require(_0xf914('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf914('0x15'))(_0xf914('0x16'));var utils=require(_0xf914('0x17'));var config=require(_0xf914('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf914('0x19'))['db'];function respondWithStatusCode(_0x8a7561,_0x43a6c0){_0x43a6c0=_0x43a6c0||0xcc;return function(_0x557370){if(_0x557370){return _0x8a7561[_0xf914('0x1a')](_0x43a6c0);}return _0x8a7561[_0xf914('0x1b')](_0x43a6c0)[_0xf914('0x1c')]();};}function respondWithResult(_0x7c2357,_0x290a84){_0x290a84=_0x290a84||0xc8;return function(_0x4961c5){if(_0x4961c5){return _0x7c2357[_0xf914('0x1b')](_0x290a84)[_0xf914('0x1d')](_0x4961c5);}};}function respondWithFilteredResult(_0x346a38,_0x539898){return function(_0x506e60){if(_0x506e60){var _0x1e6785=typeof _0x539898[_0xf914('0x1e')]==='undefined'&&typeof _0x539898[_0xf914('0x1f')]===_0xf914('0x20');var _0x530d56=_0x506e60[_0xf914('0x21')];var _0x143ec3=_0x1e6785?0x0:_0x539898['offset'];var _0xfdaf8e=_0x1e6785?_0x506e60[_0xf914('0x21')]:_0x539898[_0xf914('0x1e')]+_0x539898[_0xf914('0x1f')];var _0xb634cd;if(_0xfdaf8e>=_0x530d56){_0xfdaf8e=_0x530d56;_0xb634cd=0xc8;}else{_0xb634cd=0xce;}_0x346a38[_0xf914('0x1b')](_0xb634cd);return _0x346a38['set'](_0xf914('0x22'),_0x143ec3+'-'+_0xfdaf8e+'/'+_0x530d56)[_0xf914('0x1d')](_0x506e60);}return null;};}function patchUpdates(_0x3d6947){return function(_0xd67b4b){try{jsonpatch[_0xf914('0x23')](_0xd67b4b,_0x3d6947,!![]);}catch(_0xcb48f7){return BPromise[_0xf914('0x24')](_0xcb48f7);}return _0xd67b4b[_0xf914('0x25')]();};}function saveUpdates(_0x1f901e,_0x3a4e23){return function(_0x4ccfc4){if(_0x4ccfc4){return _0x4ccfc4[_0xf914('0x26')](_0x1f901e)['then'](function(_0x15d3df){return _0x15d3df;});}return null;};}function removeEntity(_0xaedfd0,_0x1b08be){return function(_0xaa0430){if(_0xaa0430){return _0xaa0430[_0xf914('0x27')]()[_0xf914('0x28')](function(){_0xaedfd0[_0xf914('0x1b')](0xcc)[_0xf914('0x1c')]();});}};}function handleEntityNotFound(_0x28ba62,_0x117aff){return function(_0x533adc){if(!_0x533adc){_0x28ba62[_0xf914('0x1a')](0x194);}return _0x533adc;};}function handleError(_0x2938e3,_0x41b3b5){_0x41b3b5=_0x41b3b5||0x1f4;return function(_0x45f2d7){logger[_0xf914('0x29')](_0x45f2d7[_0xf914('0x2a')]);if(_0x45f2d7[_0xf914('0x2b')]){delete _0x45f2d7['name'];}_0x2938e3['status'](_0x41b3b5)[_0xf914('0x2c')](_0x45f2d7);};}exports[_0xf914('0x2d')]=function(_0xb314a3,_0x1a3038){var _0x34ee1f={},_0x3ed82c={},_0x484285={'count':0x0,'rows':[]};var _0x9f6446=_[_0xf914('0x2e')](db['Attachment'][_0xf914('0x2f')],function(_0x32d27e){return{'name':_0x32d27e['fieldName'],'type':_0x32d27e['type'][_0xf914('0x30')]};});_0x3ed82c[_0xf914('0x31')]=_[_0xf914('0x2e')](_0x9f6446,'name');_0x3ed82c[_0xf914('0x32')]=_[_0xf914('0x33')](_0xb314a3[_0xf914('0x32')]);_0x3ed82c[_0xf914('0x34')]=_[_0xf914('0x35')](_0x3ed82c[_0xf914('0x31')],_0x3ed82c[_0xf914('0x32')]);_0x34ee1f[_0xf914('0x36')]=_['intersection'](_0x3ed82c['model'],qs[_0xf914('0x37')](_0xb314a3[_0xf914('0x32')][_0xf914('0x37')]));_0x34ee1f[_0xf914('0x36')]=_0x34ee1f[_0xf914('0x36')][_0xf914('0x38')]?_0x34ee1f[_0xf914('0x36')]:_0x3ed82c[_0xf914('0x31')];if(!_0xb314a3[_0xf914('0x32')][_0xf914('0x39')]('nolimit')){_0x34ee1f[_0xf914('0x1f')]=qs[_0xf914('0x1f')](_0xb314a3[_0xf914('0x32')][_0xf914('0x1f')]);_0x34ee1f[_0xf914('0x1e')]=qs[_0xf914('0x1e')](_0xb314a3['query'][_0xf914('0x1e')]);}_0x34ee1f['order']=qs[_0xf914('0x3a')](_0xb314a3['query'][_0xf914('0x3a')]);_0x34ee1f[_0xf914('0x3b')]=qs['filters'](_[_0xf914('0x3c')](_0xb314a3[_0xf914('0x32')],_0x3ed82c[_0xf914('0x34')]),_0x9f6446);if(_0xb314a3['query'][_0xf914('0x3d')]){_0x34ee1f['where']=_[_0xf914('0x3e')](_0x34ee1f[_0xf914('0x3b')],{'$or':_[_0xf914('0x2e')](_0x9f6446,function(_0x2ed91f){if(_0x2ed91f[_0xf914('0x3f')]!==_0xf914('0x40')){var _0x2c7f7f={};_0x2c7f7f[_0x2ed91f[_0xf914('0x2b')]]={'$like':'%'+_0xb314a3[_0xf914('0x32')]['filter']+'%'};return _0x2c7f7f;}})});}_0x34ee1f=_[_0xf914('0x3e')]({},_0x34ee1f,_0xb314a3[_0xf914('0x41')]);var _0x5dbaf7={'where':_0x34ee1f[_0xf914('0x3b')]};return db['Attachment']['count'](_0x5dbaf7)[_0xf914('0x28')](function(_0x5b8351){_0x484285['count']=_0x5b8351;if(_0xb314a3[_0xf914('0x32')][_0xf914('0x42')]){_0x34ee1f[_0xf914('0x43')]=[{'all':!![]}];}return db[_0xf914('0x44')]['findAll'](_0x34ee1f);})[_0xf914('0x28')](function(_0x41b0dd){_0x484285[_0xf914('0x45')]=_0x41b0dd;return _0x484285;})[_0xf914('0x28')](respondWithFilteredResult(_0x1a3038,_0x34ee1f))['catch'](handleError(_0x1a3038,null));};exports[_0xf914('0x46')]=function(_0x15c64b,_0x4fad4e){var _0x3fa744={'raw':!![],'where':{'id':_0x15c64b['params']['id']}},_0x4ff818={};_0x4ff818[_0xf914('0x31')]=_[_0xf914('0x33')](db[_0xf914('0x44')][_0xf914('0x2f')]);_0x4ff818[_0xf914('0x32')]=_['keys'](_0x15c64b['query']);_0x4ff818[_0xf914('0x34')]=_[_0xf914('0x35')](_0x4ff818[_0xf914('0x31')],_0x4ff818[_0xf914('0x32')]);_0x3fa744[_0xf914('0x36')]=_[_0xf914('0x35')](_0x4ff818['model'],qs[_0xf914('0x37')](_0x15c64b['query'][_0xf914('0x37')]));_0x3fa744['attributes']=_0x3fa744[_0xf914('0x36')]['length']?_0x3fa744[_0xf914('0x36')]:_0x4ff818[_0xf914('0x31')];if(_0x15c64b[_0xf914('0x32')][_0xf914('0x42')]){_0x3fa744['include']=[{'all':!![]}];}_0x3fa744=_[_0xf914('0x3e')]({},_0x3fa744,_0x15c64b[_0xf914('0x41')]);return db[_0xf914('0x44')][_0xf914('0x47')](_0x3fa744)[_0xf914('0x28')](handleEntityNotFound(_0x4fad4e,null))[_0xf914('0x28')](respondWithResult(_0x4fad4e,null))['catch'](handleError(_0x4fad4e,null));};exports['clone']=function(_0x3aa504,_0x371e95){var _0x341895={'where':{'id':_0x3aa504[_0xf914('0x48')]['id']}},_0x5e87e6={};_0x5e87e6['model']=_[_0xf914('0x33')](db[_0xf914('0x44')][_0xf914('0x2f')]);_0x341895[_0xf914('0x36')]=_[_0xf914('0x35')](_0x5e87e6[_0xf914('0x31')],qs[_0xf914('0x37')](_0x3aa504[_0xf914('0x32')][_0xf914('0x37')]));_0x341895[_0xf914('0x36')]=_0x341895['attributes']['length']?_0x341895[_0xf914('0x36')]:_0x5e87e6[_0xf914('0x31')];if(_0x3aa504[_0xf914('0x32')][_0xf914('0x42')]){_0x341895[_0xf914('0x43')]=[{'all':!![]}];}_0x341895=_[_0xf914('0x3e')]({},_0x341895,_0x3aa504['options']);return db['Attachment'][_0xf914('0x47')](_0x341895)[_0xf914('0x28')](handleEntityNotFound(_0x371e95,null))[_0xf914('0x28')](function(_0x2f9da2){if(_0x2f9da2){var _0x1b2d7e=_0x2f9da2[_0xf914('0x49')]({'plain':!![]});_0x1b2d7e=qs[_0xf914('0x4a')](_0x1b2d7e,['id',_0xf914('0x4b'),_0xf914('0x4c')]);_0x3aa504[_0xf914('0x4d')]=_[_0xf914('0x4a')](_0x3aa504[_0xf914('0x4d')],['id',_0xf914('0x4b'),_0xf914('0x4c')]);return db[_0xf914('0x44')]['create'](_[_0xf914('0x3e')](_0x1b2d7e,_0x3aa504[_0xf914('0x4d')]),{'include':_0x3aa504['query'][_0xf914('0x42')]?[{'all':!![]}]:undefined});}})[_0xf914('0x28')](respondWithResult(_0x371e95,0xc9))[_0xf914('0x4e')](handleError(_0x371e95,null));};exports[_0xf914('0x26')]=function(_0x568ca4,_0x55b289){if(_0x568ca4['body']['id']){delete _0x568ca4[_0xf914('0x4d')]['id'];}return db[_0xf914('0x44')][_0xf914('0x47')]({'where':{'id':_0x568ca4['params']['id']}})[_0xf914('0x28')](handleEntityNotFound(_0x55b289,null))[_0xf914('0x28')](saveUpdates(_0x568ca4[_0xf914('0x4d')],null))[_0xf914('0x28')](respondWithResult(_0x55b289,null))['catch'](handleError(_0x55b289,null));};exports[_0xf914('0x27')]=function(_0x54138f,_0x456a89){return db[_0xf914('0x44')]['find']({'where':{'id':_0x54138f['params']['id']}})['then'](handleEntityNotFound(_0x456a89,null))['then'](removeEntity(_0x456a89,null))[_0xf914('0x4e')](handleError(_0x456a89,null));};exports[_0xf914('0x4f')]=function(_0x385c29,_0x42a8c0,_0x133079){_0x385c29[_0xf914('0x4d')][_0xf914('0x2b')]=_0x385c29[_0xf914('0x50')]['originalname'];_0x385c29[_0xf914('0x4d')][_0xf914('0x51')]=_0x385c29[_0xf914('0x50')]['filename'];_0x385c29[_0xf914('0x4d')][_0xf914('0x3f')]=_0x385c29['file'][_0xf914('0x52')];return db[_0xf914('0x44')][_0xf914('0x4f')](_0x385c29[_0xf914('0x4d')])[_0xf914('0x28')](respondWithResult(_0x42a8c0,0xc9))[_0xf914('0x4e')](handleError(_0x42a8c0,null));};exports['download']=function(_0x38c801,_0x4d9ef7,_0x586fa2){return db[_0xf914('0x44')][_0xf914('0x53')]({'where':{'id':_0x38c801['params']['id']},'raw':!![]})[_0xf914('0x28')](handleEntityNotFound(_0x4d9ef7,null))[_0xf914('0x28')](function(_0x5779c8){if(_0x5779c8){var _0x3f4945=_0x5779c8[_0xf914('0x54')]!==null;var _0x3d478a=path['join'](config[_0xf914('0x55')],'server/files/attachments/');if(_0x3f4945){_0x3d478a=path[_0xf914('0x56')](_0x3d478a,_0xf914('0x57'));}var _0x87c47=path[_0xf914('0x56')](_0x3d478a,_0x5779c8[_0xf914('0x51')]);return _0x4d9ef7['download'](_0x87c47);}})[_0xf914('0x4e')](handleError(_0x4d9ef7,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 3e8553e..a4dc943 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 _0xd54d=['util','../../config/logger','api','rimraf','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x29be44,_0x4f38b5){var _0x54394e=function(_0x214df0){while(--_0x214df0){_0x29be44['push'](_0x29be44['shift']());}};_0x54394e(++_0x4f38b5);}(_0xd54d,0x10e));var _0xdd54=function(_0x4f7ee9,_0x5e2e09){_0x4f7ee9=_0x4f7ee9-0x0;var _0x2dff3a=_0xd54d[_0x4f7ee9];return _0x2dff3a;};'use strict';var _=require('lodash');var util=require(_0xdd54('0x0'));var logger=require(_0xdd54('0x1'))(_0xdd54('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdd54('0x3'));var config=require('../../config/environment');var attributes=require(_0xdd54('0x4'));module[_0xdd54('0x5')]=function(_0x37ac75,_0x246439){return _0x37ac75[_0xdd54('0x6')](_0xdd54('0x7'),attributes,{'tableName':_0xdd54('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf47=['rimraf','../../config/environment','./attachment.attributes','exports','attachments','util','../../config/logger','api','moment','request-promise'];(function(_0x32a76f,_0x503d94){var _0x4c9fa0=function(_0x3562c8){while(--_0x3562c8){_0x32a76f['push'](_0x32a76f['shift']());}};_0x4c9fa0(++_0x503d94);}(_0xdf47,0x69));var _0x7df4=function(_0x2e8965,_0x91c5b0){_0x2e8965=_0x2e8965-0x0;var _0x2224b4=_0xdf47[_0x2e8965];return _0x2224b4;};'use strict';var _=require('lodash');var util=require(_0x7df4('0x0'));var logger=require(_0x7df4('0x1'))(_0x7df4('0x2'));var moment=require(_0x7df4('0x3'));var BPromise=require('bluebird');var rp=require(_0x7df4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7df4('0x5'));var config=require(_0x7df4('0x6'));var attributes=require(_0x7df4('0x7'));module[_0x7df4('0x8')]=function(_0x261b00,_0x25b759){return _0x261b00['define']('Attachment',attributes,{'tableName':_0x7df4('0x9'),'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 04380ec..2fa0869 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 _0xa1fd=['jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateAttachment','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x2ceba7,_0x451ce4){_0x2ceba7=_0x2ceba7-0x0;var _0x5348eb=_0xa1fd[_0x2ceba7];return _0x5348eb;};'use strict';var _=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var moment=require(_0xda1f('0x2'));var BPromise=require(_0xda1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda1f('0x4'));var db=require(_0xda1f('0x5'))['db'];var utils=require(_0xda1f('0x6'));var logger=require(_0xda1f('0x7'))(_0xda1f('0x8'));var config=require('../../config/environment');var jayson=require(_0xda1f('0x9'));var client=jayson[_0xda1f('0xa')][_0xda1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x552ba4,_0x33502e,_0x46a29e){return new BPromise(function(_0x199a8d,_0x338463){return client[_0xda1f('0xc')](_0x552ba4,_0x46a29e)[_0xda1f('0xd')](function(_0x1493f8){logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,'request\x20sent');logger[_0xda1f('0x10')](_0xda1f('0x11'),_0x33502e,_0xda1f('0x12'),JSON[_0xda1f('0x13')](_0x1493f8));if(_0x1493f8['error']){if(_0x1493f8['error'][_0xda1f('0x14')]===0x1f4){logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x338463(_0x1493f8['error'][_0xda1f('0x16')]);}logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x199a8d(_0x1493f8[_0xda1f('0x15')]['message']);}else{logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,_0xda1f('0x12'));_0x199a8d(_0x1493f8[_0xda1f('0x17')]['message']);}})['catch'](function(_0x3020ea){logger['error'](_0xda1f('0xf'),_0x33502e,_0x3020ea);_0x338463(_0x3020ea);});});}exports[_0xda1f('0x18')]=function(_0x1e10af){var _0x59b7bf=this;return new Promise(function(_0xe81fc2,_0xe18a0a){return db['Attachment'][_0xda1f('0x19')](_0x1e10af[_0xda1f('0x1a')],{'raw':_0x1e10af['options']?_0x1e10af[_0xda1f('0x1b')][_0xda1f('0x1c')]===undefined?!![]:![]:!![]})[_0xda1f('0xd')](function(_0xe85e94){logger[_0xda1f('0xe')](_0xda1f('0x18'),_0x1e10af);logger[_0xda1f('0x10')](_0xda1f('0x18'),_0x1e10af,JSON[_0xda1f('0x13')](_0xe85e94));_0xe81fc2(_0xe85e94);})[_0xda1f('0x1d')](function(_0x1d510b){logger[_0xda1f('0x15')]('CreateAttachment',_0x1d510b[_0xda1f('0x16')],_0x1e10af);_0xe18a0a(_0x59b7bf['error'](0x1f4,_0x1d510b[_0xda1f('0x16')]));});});};
\ No newline at end of file
+var _0xb469=['options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','CreateAttachment','create','body'];(function(_0x533da3,_0x469556){var _0x2999bd=function(_0x2bb88d){while(--_0x2bb88d){_0x533da3['push'](_0x533da3['shift']());}};_0x2999bd(++_0x469556);}(_0xb469,0x13b));var _0x9b46=function(_0x4c2fee,_0x2e35a5){_0x4c2fee=_0x4c2fee-0x0;var _0x4f63ce=_0xb469[_0x4c2fee];return _0x4f63ce;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var BPromise=require(_0x9b46('0x3'));var rs=require(_0x9b46('0x4'));var fs=require('fs');var Redis=require(_0x9b46('0x5'));var db=require(_0x9b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b46('0x7'))(_0x9b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b46('0x9'));var client=jayson[_0x9b46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2dd3,_0x5bd834,_0x4c1ed9){return new BPromise(function(_0x34c0de,_0x545b6c){return client[_0x9b46('0xb')](_0x1b2dd3,_0x4c1ed9)[_0x9b46('0xc')](function(_0x43a112){logger['info'](_0x9b46('0xd'),_0x5bd834,'request\x20sent');logger[_0x9b46('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5bd834,_0x9b46('0xf'),JSON['stringify'](_0x43a112));if(_0x43a112[_0x9b46('0x10')]){if(_0x43a112[_0x9b46('0x10')]['code']===0x1f4){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112['error'][_0x9b46('0x11')]);return _0x545b6c(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);return _0x34c0de(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}else{logger[_0x9b46('0x12')](_0x9b46('0xd'),_0x5bd834,_0x9b46('0xf'));_0x34c0de(_0x43a112[_0x9b46('0x13')]['message']);}})['catch'](function(_0x52c1b8){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x52c1b8);_0x545b6c(_0x52c1b8);});});}exports[_0x9b46('0x14')]=function(_0x5c5cc9){var _0x5dd7bd=this;return new Promise(function(_0x3d9efa,_0x4ccfd0){return db['Attachment'][_0x9b46('0x15')](_0x5c5cc9[_0x9b46('0x16')],{'raw':_0x5c5cc9['options']?_0x5c5cc9[_0x9b46('0x17')][_0x9b46('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55aece){logger[_0x9b46('0x12')](_0x9b46('0x14'),_0x5c5cc9);logger[_0x9b46('0xe')]('CreateAttachment',_0x5c5cc9,JSON['stringify'](_0x55aece));_0x3d9efa(_0x55aece);})[_0x9b46('0x19')](function(_0x51d2ca){logger[_0x9b46('0x10')](_0x9b46('0x14'),_0x51d2ca['message'],_0x5c5cc9);_0x4ccfd0(_0x5dd7bd[_0x9b46('0x10')](0x1f4,_0x51d2ca['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 49ae633..8e363b9 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x262ed7,_0x3aa5ff){_0x262ed7=_0x262ed7-0x0;var _0x1fb031=_0xdb28[_0x262ed7];return _0x1fb031;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x35dd59,_0x5b540b){var _0xddfc18=function(_0xabadc9){while(--_0xabadc9){_0x35dd59['push'](_0x35dd59['shift']());}};_0xddfc18(++_0x5b540b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ae6ca,_0x42db9b){_0x4ae6ca=_0x4ae6ca-0x0;var _0x150b1b=_0x5f2f[_0x4ae6ca];return _0x150b1b;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('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 4043802..00a6364 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 _0x5cf1=['google','profile','email','callback','/login','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','blockDuration','User','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','then','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils'];(function(_0x5d5c0d,_0x4611b6){var _0x47549d=function(_0x5f4afb){while(--_0x5f4afb){_0x5d5c0d['push'](_0x5d5c0d['shift']());}};_0x47549d(++_0x4611b6);}(_0x5cf1,0x199));var _0x15cf=function(_0x4eab61,_0x1a6e6d){_0x4eab61=_0x4eab61-0x0;var _0x342426=_0x5cf1[_0x4eab61];return _0x342426;};'use strict';var _=require(_0x15cf('0x0'));var passport=require(_0x15cf('0x1'));var GoogleStrategy=require(_0x15cf('0x2'))['Strategy'];var moment=require(_0x15cf('0x3'));var db=require(_0x15cf('0x4'))['db'];var config=require(_0x15cf('0x5'));var signToken=require(_0x15cf('0x6'))[_0x15cf('0x7')];var utils=require(_0x15cf('0x8'));exports['login']=passport['authenticate'](_0x15cf('0x9'),{'failureRedirect':'/login','scope':[_0x15cf('0xa'),_0x15cf('0xb')],'session':![]});exports[_0x15cf('0xc')]=passport['authenticate'](_0x15cf('0x9'),{'failureRedirect':_0x15cf('0xd'),'session':![]});passport[_0x15cf('0xe')](new GoogleStrategy({'clientID':config['google']?config['google'][_0x15cf('0xf')]:'id','clientSecret':config[_0x15cf('0x9')]?config[_0x15cf('0x9')][_0x15cf('0x10')]:_0x15cf('0x11'),'callbackURL':config['google']?config[_0x15cf('0x9')][_0x15cf('0x12')]:''},function(_0x349685,_0x2b0e08,_0x13b9c1,_0x3029d){var _0x45a442,_0x3142c2;return db[_0x15cf('0x13')][_0x15cf('0x14')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x15cf('0x15')],'raw':!![]})['then'](function(_0x1d8249){_0x45a442=_0x1d8249;return db[_0x15cf('0x16')]['find']({'where':{'email':_[_0x15cf('0x17')](_0x13b9c1[_0x15cf('0x18')],_0x15cf('0x19')),'role':{'$or':[_0x15cf('0x1a'),_0x15cf('0x1b'),_0x15cf('0x1c')]}}});})['then'](function(_0xde9d49){_0x3142c2=_0xde9d49;if(_0x3142c2){if(_0x3142c2[_0x15cf('0x1d')]){return _0x3029d(_0x15cf('0x1e'));}else if(_0x45a442[_0x15cf('0x15')]>0x0){if(_0x3142c2[_0x15cf('0x1f')]){if(moment(_0x3142c2[_0x15cf('0x20')])[_0x15cf('0x21')](_0x45a442['blockDuration'],'minutes')>moment()){return _0x3029d(_0x15cf('0x1e'));}else{return utils[_0x15cf('0x22')](_0x3142c2,0x0,![],null)['then'](function(){return utils[_0x15cf('0x23')](_0x3142c2);})[_0x15cf('0x24')](function(){return _0x3029d(null,_0x3142c2);});}}else{return utils['getLicense'](_0x3142c2)['then'](function(){return _0x3029d(null,_0x3142c2);});}}else{return utils[_0x15cf('0x23')](_0x3142c2)[_0x15cf('0x24')](function(){return _0x3029d(null,_0x3142c2);});}}return _0x3029d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x15cf('0x25')](function(_0x3807fb){_0x3029d(_0x3807fb);});}));
\ No newline at end of file
+var _0x58c8=['../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','getLicense','passport','Strategy','../../mysqldb'];(function(_0x159a71,_0x140216){var _0x18f06a=function(_0x5452ce){while(--_0x5452ce){_0x159a71['push'](_0x159a71['shift']());}};_0x18f06a(++_0x140216);}(_0x58c8,0x1d9));var _0x858c=function(_0x2b230e,_0xcc1920){_0x2b230e=_0x2b230e-0x0;var _0x2d58c7=_0x58c8[_0x2b230e];return _0x2d58c7;};'use strict';var _=require('lodash');var passport=require(_0x858c('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x858c('0x1')];var moment=require('moment');var db=require(_0x858c('0x2'))['db'];var config=require(_0x858c('0x3'));var signToken=require(_0x858c('0x4'))[_0x858c('0x5')];var utils=require(_0x858c('0x6'));exports[_0x858c('0x7')]=passport[_0x858c('0x8')](_0x858c('0x9'),{'failureRedirect':_0x858c('0xa'),'scope':[_0x858c('0xb'),'email'],'session':![]});exports['callback']=passport[_0x858c('0x8')](_0x858c('0x9'),{'failureRedirect':_0x858c('0xa'),'session':![]});passport[_0x858c('0xc')](new GoogleStrategy({'clientID':config[_0x858c('0x9')]?config['google'][_0x858c('0xd')]:'id','clientSecret':config['google']?config[_0x858c('0x9')][_0x858c('0xe')]:'secret','callbackURL':config[_0x858c('0x9')]?config[_0x858c('0x9')][_0x858c('0xf')]:''},function(_0x592bee,_0x50253a,_0x2282aa,_0x3edc7f){var _0x59a9bc,_0x36e92b;return db[_0x858c('0x10')][_0x858c('0x11')]({'where':{'id':0x1},'attributes':[_0x858c('0x12'),_0x858c('0x13')],'raw':!![]})[_0x858c('0x14')](function(_0x2abc31){_0x59a9bc=_0x2abc31;return db[_0x858c('0x15')][_0x858c('0x16')]({'where':{'email':_[_0x858c('0x17')](_0x2282aa[_0x858c('0x18')],'value'),'role':{'$or':[_0x858c('0x19'),_0x858c('0x1a'),_0x858c('0x1b')]}}});})[_0x858c('0x14')](function(_0x14c941){_0x36e92b=_0x14c941;if(_0x36e92b){if(_0x36e92b[_0x858c('0x1c')]){return _0x3edc7f(_0x858c('0x1d'));}else if(_0x59a9bc[_0x858c('0x13')]>0x0){if(_0x36e92b['blocked']){if(moment(_0x36e92b[_0x858c('0x1e')])[_0x858c('0x1f')](_0x59a9bc[_0x858c('0x13')],_0x858c('0x20'))>moment()){return _0x3edc7f(_0x858c('0x1d'));}else{return utils['clearBlockUser'](_0x36e92b,0x0,![],null)['then'](function(){return utils[_0x858c('0x21')](_0x36e92b);})[_0x858c('0x14')](function(){return _0x3edc7f(null,_0x36e92b);});}}else{return utils[_0x858c('0x21')](_0x36e92b)[_0x858c('0x14')](function(){return _0x3edc7f(null,_0x36e92b);});}}else{return utils['getLicense'](_0x36e92b)[_0x858c('0x14')](function(){return _0x3edc7f(null,_0x36e92b);});}}return _0x3edc7f(_0x858c('0x1d'));})['catch'](function(_0x1d5d75){_0x3edc7f(_0x1d5d75);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index b1a6ec0..03378bf 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 _0xae16=['/callback','callback','setTokenCookie','exports','express','Router','../user/user.controller.js','login','get'];(function(_0x4b2b5a,_0x3f7555){var _0x47f812=function(_0x4de6ef){while(--_0x4de6ef){_0x4b2b5a['push'](_0x4b2b5a['shift']());}};_0x47f812(++_0x3f7555);}(_0xae16,0xee));var _0x6ae1=function(_0x50cafc,_0x4a691b){_0x50cafc=_0x50cafc-0x0;var _0x1990d2=_0xae16[_0x50cafc];return _0x1990d2;};'use strict';var express=require(_0x6ae1('0x0'));var passport=require('passport');var router=express[_0x6ae1('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x6ae1('0x2'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x6ae1('0x3')]);router[_0x6ae1('0x4')](_0x6ae1('0x5'),controller[_0x6ae1('0x6')],authService['isMiddleware'],userController[_0x6ae1('0x3')],authService[_0x6ae1('0x7')]);module[_0x6ae1('0x8')]=router;
\ No newline at end of file
+var _0x338d=['callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js','get','login','/callback'];(function(_0x1b2bd2,_0x491f68){var _0x34a271=function(_0x6036d){while(--_0x6036d){_0x1b2bd2['push'](_0x1b2bd2['shift']());}};_0x34a271(++_0x491f68);}(_0x338d,0x162));var _0xd338=function(_0x295d0f,_0x1675d0){_0x295d0f=_0x295d0f-0x0;var _0x1a2e2a=_0x338d[_0x295d0f];return _0x1a2e2a;};'use strict';var express=require('express');var passport=require(_0xd338('0x0'));var router=express['Router']();var controller=require(_0xd338('0x1'));var userController=require(_0xd338('0x2'));var authService=require('../../components/auth/service');router[_0xd338('0x3')]('/',controller[_0xd338('0x4')]);router[_0xd338('0x3')](_0xd338('0x5'),controller[_0xd338('0x6')],authService[_0xd338('0x7')],userController[_0xd338('0x4')],authService[_0xd338('0x8')]);module[_0xd338('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index a6ade50..9d1de9b 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 _0x41fc=['If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','password','use','util','passport','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','message','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','toLowerCase','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','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://'];(function(_0x462435,_0x428194){var _0x1bbfe7=function(_0xeb7e81){while(--_0xeb7e81){_0x462435['push'](_0x462435['shift']());}};_0x1bbfe7(++_0x428194);}(_0x41fc,0x1c6));var _0xc41f=function(_0xb26cca,_0x7d38ae){_0xb26cca=_0xb26cca-0x0;var _0x28f481=_0x41fc[_0xb26cca];return _0x28f481;};'use strict';var util=require(_0xc41f('0x0'));var passport=require(_0xc41f('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xc41f('0x2'));var _=require(_0xc41f('0x3'));var rs=require(_0xc41f('0x4'));var moment=require('moment');var db=require(_0xc41f('0x5'))['db'];var authService=require(_0xc41f('0x6'));var utils=require(_0xc41f('0x7'));var client=jayson['client'][_0xc41f('0x8')]({'port':0x232b});function localAuthenticate(_0x2c5489,_0x16cbdf,_0x3e9bbe,_0x373bd8){var _0x393fa2,_0x1cb648;return db[_0xc41f('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xc41f('0xa'),_0xc41f('0xb')],'raw':!![]})[_0xc41f('0xc')](function(_0x1ee603){_0x393fa2=_0x1ee603;return _0x2c5489[_0xc41f('0xd')]({'attributes':['id',_0xc41f('0xe'),'password',_0xc41f('0xf'),_0xc41f('0x10'),_0xc41f('0x11'),_0xc41f('0x12'),_0xc41f('0x13'),'loginAttempts'],'where':{'name':_0x16cbdf,'role':{'$or':[_0xc41f('0x14'),_0xc41f('0x15'),_0xc41f('0x16')]}}});})[_0xc41f('0xc')](function(_0x2cb5a9){if(!_0x2cb5a9||_0x2cb5a9&&_0x2cb5a9[_0xc41f('0xe')]!==_0x16cbdf){throw new Error(_0xc41f('0x17'));}else{_0x1cb648=_0x2cb5a9;return _0x1cb648;}})['then'](function(){_0x1cb648['authenticate'](_0x3e9bbe,function(_0x489169,_0x349fb7){var _0x22ef4e=_0x1cb648['loginAttempts']+0x1;if(_0x489169){return _0x373bd8(_0x489169);}else if(!_0x349fb7){if(_0x1cb648[_0xc41f('0x11')]){return _0x373bd8(null,![],{'message':_0xc41f('0x17')});}else if(_0x393fa2['allowedLoginAttempts']>0x0){if(_0x1cb648[_0xc41f('0x12')]){if(_0x393fa2[_0xc41f('0xb')]>0x0){if(moment(_0x1cb648[_0xc41f('0x13')])[_0xc41f('0x18')](_0x393fa2[_0xc41f('0xb')],_0xc41f('0x19'))>moment()){return _0x373bd8(null,![],{'message':_0xc41f('0x17')});}else{return utils['clearBlockUser'](_0x1cb648,_0x22ef4e,![],null)[_0xc41f('0xc')](function(){return _0x373bd8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x373bd8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x22ef4e>=_0x393fa2[_0xc41f('0xa')]){return utils[_0xc41f('0x1a')](_0x1cb648,0x0,!![],moment())[_0xc41f('0xc')](function(){return _0x373bd8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xc41f('0x1a')](_0x1cb648,_0x22ef4e,![],null)[_0xc41f('0xc')](function(){return _0x373bd8(null,![],{'message':_0xc41f('0x17')});});}}}else{return _0x373bd8(null,![],{'message':_0xc41f('0x17')});}}else{if(_0x1cb648[_0xc41f('0x11')]){return _0x373bd8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x393fa2[_0xc41f('0xa')]>0x0){if(_0x1cb648[_0xc41f('0x12')]){if(_0x393fa2['blockDuration']>0x0){if(moment(_0x1cb648[_0xc41f('0x13')])[_0xc41f('0x18')](_0x393fa2[_0xc41f('0xb')],'minutes')>moment()){return _0x373bd8(null,![],{'message':_0xc41f('0x17')});}else{return utils[_0xc41f('0x1a')](_0x1cb648,0x0,![],null)[_0xc41f('0xc')](function(){return utils[_0xc41f('0x1b')](_0x1cb648);})[_0xc41f('0xc')](function(){return _0x373bd8(null,_0x1cb648);});}}else{return _0x373bd8(null,![],{'message':_0xc41f('0x17')});}}else{return utils[_0xc41f('0x1a')](_0x1cb648,0x0,![],null)[_0xc41f('0xc')](function(){return utils[_0xc41f('0x1b')](_0x1cb648);})[_0xc41f('0xc')](function(){return _0x373bd8(null,_0x1cb648);})[_0xc41f('0x1c')](function(_0x23b0b1){return _0x373bd8(null,![],_0x23b0b1);});}}else{if(_0x1cb648[_0xc41f('0x12')]){return _0x373bd8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc41f('0x1b')](_0x1cb648)[_0xc41f('0xc')](function(){return _0x373bd8(null,_0x1cb648);});}}}});})[_0xc41f('0x1c')](function(_0x302abe){return _0x373bd8(null,![],_0x302abe);});}function sendServiceMail(_0x5591cd){return db[_0xc41f('0x1d')][_0xc41f('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xc41f('0xe'),'email'],'include':[{'model':db[_0xc41f('0x1f')],'as':_0xc41f('0x20')}]})[_0xc41f('0xc')](function(_0xd82afc){if(!_0xd82afc){throw new Error(_0xc41f('0x21'));}var _0x3bb2e9={'tls':{'rejectUnauthorized':![]}};if(_0xd82afc[_0xc41f('0x20')][_0xc41f('0x22')]){_0x3bb2e9[_0xc41f('0x22')]=_0xd82afc[_0xc41f('0x20')][_0xc41f('0x22')];}else{_0x3bb2e9['host']=_0xd82afc['Smtp'][_0xc41f('0x23')];_0x3bb2e9[_0xc41f('0x24')]=_0xd82afc[_0xc41f('0x20')]['port'];_0x3bb2e9[_0xc41f('0x25')]=_0xd82afc[_0xc41f('0x20')][_0xc41f('0x25')];}if(_0xd82afc[_0xc41f('0x20')][_0xc41f('0x26')]){_0x3bb2e9[_0xc41f('0x27')]={'user':_0xd82afc[_0xc41f('0x20')][_0xc41f('0x15')],'pass':_0xd82afc[_0xc41f('0x20')][_0xc41f('0x28')]};}var _0xecedc3={'account':_0x3bb2e9,'message':_[_0xc41f('0x29')]({'from':util['format'](_0xc41f('0x2a'),_0xd82afc[_0xc41f('0xe')],_0xd82afc[_0xc41f('0x2b')]||_0xd82afc[_0xc41f('0x20')]['user'])},_0x5591cd)};return client[_0xc41f('0x2c')](_0xc41f('0x2d'),_0xecedc3);})[_0xc41f('0xc')](function(_0xc3c384){if(_0xc3c384[_0xc41f('0x2e')]){throw new Error(util[_0xc41f('0x2f')](_0xc41f('0x30'),_0xc3c384[_0xc41f('0x2e')]['message']||JSON[_0xc41f('0x31')](_0xc3c384[_0xc41f('0x2e')])));}return!![];});}function handleError(_0x38270b,_0x3deaad,_0x342594){return _0x38270b[_0xc41f('0x32')](_0x3deaad||0x1f4)['send']({'message':_0x342594?_0x342594[_0xc41f('0x33')]||_0x342594:''});}exports[_0xc41f('0x34')]=function(_0x590bd2,_0x73aa0,_0x1fa333){passport[_0xc41f('0x35')](_0xc41f('0x36'),function(_0x47395c,_0x25905e,_0x102a43){var _0x461fef=_0x47395c||_0x102a43;if(_0x461fef){return handleError(_0x73aa0,0x191,_0x461fef);}if(!_0x25905e){return handleError(_0x73aa0,0x194,{'message':_0xc41f('0x37')});}else{var _0x331699={'payload':{'id':_0x25905e['id'],'role':_0x25905e[_0xc41f('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xc41f('0x38')](_0x331699)['then'](function(_0x12b5c4){_0x73aa0[_0xc41f('0x39')]({'id':_0x25905e['id'],'token':_0x12b5c4,'statusCall':'','isAlreadyLogged':_0x25905e[_0xc41f('0x3a')]});});}})(_0x590bd2,_0x73aa0,_0x1fa333);};exports[_0xc41f('0x3b')]=function(_0xe6dd32,_0x145bc8,_0x4991d8){if(!_0xe6dd32[_0xc41f('0x3c')][_0xc41f('0x2b')]){return handleError(_0x145bc8,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x853866=rs[_0xc41f('0x3d')]();_0xe6dd32[_0xc41f('0x3c')][_0xc41f('0x2b')]=_0xe6dd32['body'][_0xc41f('0x2b')][_0xc41f('0x3e')]()[_0xc41f('0x3f')]();var _0xeaf6b5;return db[_0xc41f('0x9')][_0xc41f('0xd')]({'where':{'id':0x1},'attributes':[_0xc41f('0xa'),_0xc41f('0xb')],'raw':!![]})['then'](function(_0x34e0df){_0xeaf6b5=_0x34e0df;return db[_0xc41f('0x40')]['find']({'where':{'email':_0xe6dd32['body'][_0xc41f('0x2b')]}});})[_0xc41f('0xc')](function(_0x405bee){if(!_0x405bee){throw new Error(_0xc41f('0x41'));}if(_0x405bee[_0xc41f('0x11')]){throw new Error(_0xc41f('0x42'));}if(_0x405bee['blocked']){if(moment(_0x405bee[_0xc41f('0x13')])[_0xc41f('0x18')](_0xeaf6b5['blockDuration'],_0xc41f('0x19'))>moment()){throw new Error(_0xc41f('0x43'));}else{_0x405bee[_0xc41f('0x12')]=![];_0x405bee['blockedAt']=null;}}_0x405bee[_0xc41f('0x44')]=_0x853866;_0x405bee[_0xc41f('0x45')]=Date[_0xc41f('0x46')]()+0x36ee80;return _0x405bee[_0xc41f('0x47')]();})[_0xc41f('0xc')](function(){return sendServiceMail({'to':_0xe6dd32[_0xc41f('0x3c')][_0xc41f('0x2b')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc41f('0x48')+_0xc41f('0x49')+_0xe6dd32['headers'][_0xc41f('0x23')]+'/reset/'+_0x853866+'\x0a\x0a'+_0xc41f('0x4a')});})[_0xc41f('0xc')](function(){_0x145bc8[_0xc41f('0x32')](0xc8)[_0xc41f('0x4b')]({'message':_0xc41f('0x4c')});})[_0xc41f('0x1c')](function(_0x1dd5c4){return handleError(_0x145bc8,0x1f4,_0x1dd5c4);});};exports[_0xc41f('0x4d')]=function(_0x193d9f,_0x56537d,_0x578f9c){return db['User']['find']({'where':{'resetPasswordToken':_0x193d9f[_0xc41f('0x4e')][_0xc41f('0x4f')],'resetPasswordExpires':{'$gt':Date[_0xc41f('0x46')]()}}})[_0xc41f('0xc')](function(_0x288f66){if(!_0x288f66){throw new Error(_0xc41f('0x50'));}return db['Setting'][_0xc41f('0xd')]({'attributes':['id','securePassword',_0xc41f('0x51'),_0xc41f('0x52')]})[_0xc41f('0xc')](function(_0x470303){if(_0x470303[_0xc41f('0x53')])authService['validatePasswordPattern'](_0x193d9f[_0xc41f('0x3c')]['password']);if(!_0x470303['enforcePasswordHistory']||!_0x288f66[_0xc41f('0x54')])return _0x288f66;authService[_0xc41f('0x55')](_0x193d9f[_0xc41f('0x3c')][_0xc41f('0x56')],_0x288f66['previousPasswords'],_0x470303[_0xc41f('0x52')]);return _0x288f66;})['then'](function(){_0x288f66[_0xc41f('0x56')]=_0x193d9f[_0xc41f('0x3c')][_0xc41f('0x56')];_0x288f66['resetPasswordToken']=null;_0x288f66['resetPasswordExpires']=null;return _0x288f66[_0xc41f('0x47')]();});})[_0xc41f('0xc')](function(){_0x56537d[_0xc41f('0x32')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xc41f('0x1c')](function(_0x56fbec){return handleError(_0x56537d,0x1f4,_0x56fbec);});};passport[_0xc41f('0x57')](new LocalStrategy({'usernameField':_0xc41f('0xe'),'passwordField':_0xc41f('0x56')},function(_0x256f48,_0x9e646a,_0x54713b){return localAuthenticate(db[_0xc41f('0x40')],_0x256f48,_0x9e646a,_0x54713b);}));
\ No newline at end of file
+var _0x9744=['authenticate','local','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','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','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','find','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','password','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','clearBlockUser','add','getLicense','catch','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','secure','authentication','auth','user','format','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','login'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9744,0x1ea));var _0x4974=function(_0x470ef2,_0x177892){_0x470ef2=_0x470ef2-0x0;var _0x53783a=_0x9744[_0x470ef2];return _0x53783a;};'use strict';var util=require(_0x4974('0x0'));var passport=require(_0x4974('0x1'));var LocalStrategy=require('passport-local')[_0x4974('0x2')];var jayson=require(_0x4974('0x3'));var _=require(_0x4974('0x4'));var rs=require(_0x4974('0x5'));var moment=require(_0x4974('0x6'));var db=require(_0x4974('0x7'))['db'];var authService=require(_0x4974('0x8'));var utils=require(_0x4974('0x9'));var client=jayson[_0x4974('0xa')][_0x4974('0xb')]({'port':0x232b});function localAuthenticate(_0x2ea83a,_0x29b8dd,_0x3b5e06,_0x896dd5){var _0x459d5c,_0x4b4931;return db[_0x4974('0xc')][_0x4974('0xd')]({'where':{'id':0x1},'attributes':[_0x4974('0xe'),_0x4974('0xf')],'raw':!![]})['then'](function(_0x24f795){_0x459d5c=_0x24f795;return _0x2ea83a[_0x4974('0xd')]({'attributes':['id',_0x4974('0x10'),'password','salt',_0x4974('0x11'),_0x4974('0x12'),_0x4974('0x13'),_0x4974('0x14'),_0x4974('0x15')],'where':{'name':_0x29b8dd,'role':{'$or':[_0x4974('0x16'),'user',_0x4974('0x17')]}}});})[_0x4974('0x18')](function(_0x45c8c6){if(!_0x45c8c6||_0x45c8c6&&_0x45c8c6[_0x4974('0x10')]!==_0x29b8dd){throw new Error(_0x4974('0x19'));}else{_0x4b4931=_0x45c8c6;return _0x4b4931;}})[_0x4974('0x18')](function(){_0x4b4931['authenticate'](_0x3b5e06,function(_0x374e7c,_0x4305ab){var _0x31a947=_0x4b4931[_0x4974('0x15')]+0x1;if(_0x374e7c){return _0x896dd5(_0x374e7c);}else if(!_0x4305ab){if(_0x4b4931[_0x4974('0x12')]){return _0x896dd5(null,![],{'message':_0x4974('0x19')});}else if(_0x459d5c[_0x4974('0xe')]>0x0){if(_0x4b4931[_0x4974('0x13')]){if(_0x459d5c['blockDuration']>0x0){if(moment(_0x4b4931['blockedAt'])['add'](_0x459d5c[_0x4974('0xf')],_0x4974('0x1a'))>moment()){return _0x896dd5(null,![],{'message':_0x4974('0x19')});}else{return utils[_0x4974('0x1b')](_0x4b4931,_0x31a947,![],null)[_0x4974('0x18')](function(){return _0x896dd5(null,![],{'message':_0x4974('0x19')});});}}else{return _0x896dd5(null,![],{'message':_0x4974('0x19')});}}else{if(_0x31a947>=_0x459d5c[_0x4974('0xe')]){return utils[_0x4974('0x1b')](_0x4b4931,0x0,!![],moment())[_0x4974('0x18')](function(){return _0x896dd5(null,![],{'message':_0x4974('0x19')});});}else{return utils[_0x4974('0x1b')](_0x4b4931,_0x31a947,![],null)[_0x4974('0x18')](function(){return _0x896dd5(null,![],{'message':_0x4974('0x19')});});}}}else{return _0x896dd5(null,![],{'message':_0x4974('0x19')});}}else{if(_0x4b4931[_0x4974('0x12')]){return _0x896dd5(null,![],{'message':_0x4974('0x19')});}else if(_0x459d5c[_0x4974('0xe')]>0x0){if(_0x4b4931[_0x4974('0x13')]){if(_0x459d5c[_0x4974('0xf')]>0x0){if(moment(_0x4b4931[_0x4974('0x14')])[_0x4974('0x1c')](_0x459d5c[_0x4974('0xf')],'minutes')>moment()){return _0x896dd5(null,![],{'message':_0x4974('0x19')});}else{return utils[_0x4974('0x1b')](_0x4b4931,0x0,![],null)[_0x4974('0x18')](function(){return utils['getLicense'](_0x4b4931);})['then'](function(){return _0x896dd5(null,_0x4b4931);});}}else{return _0x896dd5(null,![],{'message':_0x4974('0x19')});}}else{return utils[_0x4974('0x1b')](_0x4b4931,0x0,![],null)[_0x4974('0x18')](function(){return utils[_0x4974('0x1d')](_0x4b4931);})[_0x4974('0x18')](function(){return _0x896dd5(null,_0x4b4931);})['catch'](function(_0x1a6090){return _0x896dd5(null,![],_0x1a6090);});}}else{if(_0x4b4931['blocked']){return _0x896dd5(null,![],{'message':_0x4974('0x19')});}else{return utils[_0x4974('0x1d')](_0x4b4931)[_0x4974('0x18')](function(){return _0x896dd5(null,_0x4b4931);});}}}});})[_0x4974('0x1e')](function(_0x151892){return _0x896dd5(null,![],_0x151892);});}function sendServiceMail(_0x4722c1){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x4974('0x10'),_0x4974('0x1f')],'include':[{'model':db[_0x4974('0x20')],'as':'Smtp'}]})[_0x4974('0x18')](function(_0x4781e1){if(!_0x4781e1){throw new Error(_0x4974('0x21'));}var _0x95145b={'tls':{'rejectUnauthorized':![]}};if(_0x4781e1[_0x4974('0x22')][_0x4974('0x23')]){_0x95145b[_0x4974('0x23')]=_0x4781e1[_0x4974('0x22')]['service'];}else{_0x95145b[_0x4974('0x24')]=_0x4781e1[_0x4974('0x22')][_0x4974('0x24')];_0x95145b['port']=_0x4781e1[_0x4974('0x22')]['port'];_0x95145b[_0x4974('0x25')]=_0x4781e1[_0x4974('0x22')][_0x4974('0x25')];}if(_0x4781e1['Smtp'][_0x4974('0x26')]){_0x95145b[_0x4974('0x27')]={'user':_0x4781e1[_0x4974('0x22')][_0x4974('0x28')],'pass':_0x4781e1[_0x4974('0x22')]['pass']};}var _0x1cdae4={'account':_0x95145b,'message':_['merge']({'from':util[_0x4974('0x29')]('\x22%s\x22\x20<%s>',_0x4781e1[_0x4974('0x10')],_0x4781e1[_0x4974('0x1f')]||_0x4781e1[_0x4974('0x22')][_0x4974('0x28')])},_0x4722c1)};return client[_0x4974('0x2a')](_0x4974('0x2b'),_0x1cdae4);})['then'](function(_0x5bb3b6){if(_0x5bb3b6['error']){throw new Error(util[_0x4974('0x29')](_0x4974('0x2c'),_0x5bb3b6[_0x4974('0x2d')][_0x4974('0x2e')]||JSON[_0x4974('0x2f')](_0x5bb3b6['error'])));}return!![];});}function handleError(_0x22b812,_0x9aeb98,_0x20fd8a){return _0x22b812[_0x4974('0x30')](_0x9aeb98||0x1f4)['send']({'message':_0x20fd8a?_0x20fd8a[_0x4974('0x2e')]||_0x20fd8a:''});}exports[_0x4974('0x31')]=function(_0x3af75c,_0x3d6d4f,_0x163234){passport[_0x4974('0x32')](_0x4974('0x33'),function(_0x44b0d1,_0x5103f5,_0x3be12b){var _0x207a3b=_0x44b0d1||_0x3be12b;if(_0x207a3b){return handleError(_0x3d6d4f,0x191,_0x207a3b);}if(!_0x5103f5){return handleError(_0x3d6d4f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2ece99={'payload':{'id':_0x5103f5['id'],'role':_0x5103f5[_0x4974('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x4974('0x34')](_0x2ece99)[_0x4974('0x18')](function(_0x411bd2){_0x3d6d4f[_0x4974('0x35')]({'id':_0x5103f5['id'],'token':_0x411bd2,'statusCall':'','isAlreadyLogged':_0x5103f5[_0x4974('0x36')]});});}})(_0x3af75c,_0x3d6d4f,_0x163234);};exports[_0x4974('0x37')]=function(_0x12ed2e,_0x2f815e,_0x5c13e0){if(!_0x12ed2e[_0x4974('0x38')]['email']){return handleError(_0x2f815e,0x1f4,{'message':_0x4974('0x39')});}var _0x272e41=rs[_0x4974('0x3a')]();_0x12ed2e[_0x4974('0x38')]['email']=_0x12ed2e['body'][_0x4974('0x1f')][_0x4974('0x3b')]()[_0x4974('0x3c')]();var _0x13244a;return db[_0x4974('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x4974('0xe'),_0x4974('0xf')],'raw':!![]})[_0x4974('0x18')](function(_0x4ad15e){_0x13244a=_0x4ad15e;return db[_0x4974('0x3d')]['find']({'where':{'email':_0x12ed2e[_0x4974('0x38')][_0x4974('0x1f')]}});})['then'](function(_0x2a53ef){if(!_0x2a53ef){throw new Error(_0x4974('0x3e'));}if(_0x2a53ef[_0x4974('0x12')]){throw new Error(_0x4974('0x3f'));}if(_0x2a53ef[_0x4974('0x13')]){if(moment(_0x2a53ef[_0x4974('0x14')])['add'](_0x13244a[_0x4974('0xf')],'minutes')>moment()){throw new Error(_0x4974('0x40'));}else{_0x2a53ef[_0x4974('0x13')]=![];_0x2a53ef[_0x4974('0x14')]=null;}}_0x2a53ef[_0x4974('0x41')]=_0x272e41;_0x2a53ef[_0x4974('0x42')]=Date[_0x4974('0x43')]()+0x36ee80;return _0x2a53ef[_0x4974('0x44')]();})[_0x4974('0x18')](function(){return sendServiceMail({'to':_0x12ed2e['body'][_0x4974('0x1f')],'subject':_0x4974('0x45'),'text':_0x4974('0x46')+_0x4974('0x47')+_0x4974('0x48')+_0x12ed2e[_0x4974('0x49')]['host']+_0x4974('0x4a')+_0x272e41+'\x0a\x0a'+_0x4974('0x4b')});})[_0x4974('0x18')](function(){_0x2f815e[_0x4974('0x30')](0xc8)[_0x4974('0x4c')]({'message':_0x4974('0x4d')});})[_0x4974('0x1e')](function(_0x3190ca){return handleError(_0x2f815e,0x1f4,_0x3190ca);});};exports['reset']=function(_0x28453e,_0x40a50f,_0x511626){return db[_0x4974('0x3d')][_0x4974('0x4e')]({'where':{'resetPasswordToken':_0x28453e[_0x4974('0x4f')][_0x4974('0x50')],'resetPasswordExpires':{'$gt':Date[_0x4974('0x43')]()}}})[_0x4974('0x18')](function(_0x5975c6){if(!_0x5975c6){throw new Error(_0x4974('0x51'));}return db[_0x4974('0xc')]['findOne']({'attributes':['id',_0x4974('0x52'),_0x4974('0x53'),_0x4974('0x54')]})[_0x4974('0x18')](function(_0x1ac749){if(_0x1ac749[_0x4974('0x52')])authService[_0x4974('0x55')](_0x28453e[_0x4974('0x38')]['password']);if(!_0x1ac749[_0x4974('0x53')]||!_0x5975c6[_0x4974('0x56')])return _0x5975c6;authService[_0x4974('0x57')](_0x28453e[_0x4974('0x38')]['password'],_0x5975c6[_0x4974('0x56')],_0x1ac749[_0x4974('0x54')]);return _0x5975c6;})[_0x4974('0x18')](function(){_0x5975c6['password']=_0x28453e[_0x4974('0x38')]['password'];_0x5975c6['resetPasswordToken']=null;_0x5975c6['resetPasswordExpires']=null;return _0x5975c6[_0x4974('0x44')]();});})[_0x4974('0x18')](function(){_0x40a50f[_0x4974('0x30')](0xc8)[_0x4974('0x4c')]({'message':_0x4974('0x58')});})[_0x4974('0x1e')](function(_0x36f59f){return handleError(_0x40a50f,0x1f4,_0x36f59f);});};passport['use'](new LocalStrategy({'usernameField':_0x4974('0x10'),'passwordField':_0x4974('0x59')},function(_0x166302,_0x1d582d,_0x14a3d3){return localAuthenticate(db[_0x4974('0x3d')],_0x166302,_0x1d582d,_0x14a3d3);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a968d7a..a08d4b2 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 _0xfdd7=['login','post','/forgot','/reset/:token','reset','Router','./authLocal.controller'];(function(_0x263207,_0x38e050){var _0x15bbe8=function(_0x145d5e){while(--_0x145d5e){_0x263207['push'](_0x263207['shift']());}};_0x15bbe8(++_0x38e050);}(_0xfdd7,0x11d));var _0x7fdd=function(_0x24d08f,_0x53e96b){_0x24d08f=_0x24d08f-0x0;var _0x3c4318=_0xfdd7[_0x24d08f];return _0x3c4318;};'use strict';var express=require('express');var router=express[_0x7fdd('0x0')]();var controller=require(_0x7fdd('0x1'));router['post']('/',controller[_0x7fdd('0x2')]);router[_0x7fdd('0x3')](_0x7fdd('0x4'),controller['forgot']);router[_0x7fdd('0x3')](_0x7fdd('0x5'),controller[_0x7fdd('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x9c38=['/reset/:token','reset','Router','post','login','/forgot','forgot'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x9c38,0x183));var _0x89c3=function(_0x4655e2,_0x3b840a){_0x4655e2=_0x4655e2-0x0;var _0x5f291f=_0x9c38[_0x4655e2];return _0x5f291f;};'use strict';var express=require('express');var router=express[_0x89c3('0x0')]();var controller=require('./authLocal.controller');router[_0x89c3('0x1')]('/',controller[_0x89c3('0x2')]);router[_0x89c3('0x1')](_0x89c3('0x3'),controller[_0x89c3('0x4')]);router[_0x89c3('0x1')](_0x89c3('0x5'),controller[_0x89c3('0x6')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 226ee91..af391e4 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 _0x39d2=['exports','STRING','INTEGER','sequelize'];(function(_0x5c3f72,_0x54471d){var _0x926aee=function(_0x3b8170){while(--_0x3b8170){_0x5c3f72['push'](_0x5c3f72['shift']());}};_0x926aee(++_0x54471d);}(_0x39d2,0x16b));var _0x239d=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x39d2[_0x3f5dca];return _0x5b833a;};'use strict';var Sequelize=require(_0x239d('0x0'));module[_0x239d('0x1')]={'name':{'type':Sequelize[_0x239d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x239d('0x2')]},'description':{'type':Sequelize[_0x239d('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x239d('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa10e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4487bc,_0x1a3eed){var _0x4a0bd5=function(_0x4c86df){while(--_0x4c86df){_0x4487bc['push'](_0x4487bc['shift']());}};_0x4a0bd5(++_0x1a3eed);}(_0xa10e,0xb0));var _0xea10=function(_0x581dac,_0x449c99){_0x581dac=_0x581dac-0x0;var _0x17271b=_0xa10e[_0x581dac];return _0x17271b;};'use strict';var Sequelize=require(_0xea10('0x0'));module[_0xea10('0x1')]={'name':{'type':Sequelize[_0xea10('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xea10('0x2')]},'status':{'type':Sequelize[_0xea10('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index c04ec3c..e323fd3 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 _0x6766=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','create','body','find','addConditions','ids','getConditions','findOne','filter','addActions','getActions','Action','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6766,0x1e0));var _0x6676=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0x6766[_0x33d4a2];return _0x2c793f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6676('0x0'));var jsonpatch=require(_0x6676('0x1'));var rp=require('request-promise');var moment=require(_0x6676('0x2'));var BPromise=require(_0x6676('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6676('0x4'));var sox=require('sox');var csv=require(_0x6676('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6676('0x6'));var _=require(_0x6676('0x7'));var squel=require(_0x6676('0x8'));var crypto=require(_0x6676('0x9'));var jsforce=require(_0x6676('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6676('0x5'));var querystring=require(_0x6676('0xb'));var Papa=require(_0x6676('0xc'));var Redis=require(_0x6676('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6676('0xe'));var as=require(_0x6676('0xf'));var hardwareService=require(_0x6676('0x10'));var logger=require(_0x6676('0x11'))(_0x6676('0x12'));var utils=require(_0x6676('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6676('0x14'));var db=require(_0x6676('0x15'))['db'];function respondWithStatusCode(_0x33a710,_0x11c500){_0x11c500=_0x11c500||0xcc;return function(_0x289537){if(_0x289537){return _0x33a710[_0x6676('0x16')](_0x11c500);}return _0x33a710[_0x6676('0x17')](_0x11c500)[_0x6676('0x18')]();};}function respondWithResult(_0x2ea88d,_0x41f44d){_0x41f44d=_0x41f44d||0xc8;return function(_0x5df545){if(_0x5df545){return _0x2ea88d[_0x6676('0x17')](_0x41f44d)[_0x6676('0x19')](_0x5df545);}};}function respondWithFilteredResult(_0x3509df,_0x530264){return function(_0x5dcc09){if(_0x5dcc09){var _0x4d7344=typeof _0x530264[_0x6676('0x1a')]===_0x6676('0x1b')&&typeof _0x530264[_0x6676('0x1c')]===_0x6676('0x1b');var _0x343130=_0x5dcc09[_0x6676('0x1d')];var _0x9e9211=_0x4d7344?0x0:_0x530264['offset'];var _0x3ddc5e=_0x4d7344?_0x5dcc09[_0x6676('0x1d')]:_0x530264[_0x6676('0x1a')]+_0x530264[_0x6676('0x1c')];var _0x365f73;if(_0x3ddc5e>=_0x343130){_0x3ddc5e=_0x343130;_0x365f73=0xc8;}else{_0x365f73=0xce;}_0x3509df[_0x6676('0x17')](_0x365f73);return _0x3509df[_0x6676('0x1e')](_0x6676('0x1f'),_0x9e9211+'-'+_0x3ddc5e+'/'+_0x343130)[_0x6676('0x19')](_0x5dcc09);}return null;};}function patchUpdates(_0x4a42b8){return function(_0x536c80){try{jsonpatch[_0x6676('0x20')](_0x536c80,_0x4a42b8,!![]);}catch(_0x237f07){return BPromise[_0x6676('0x21')](_0x237f07);}return _0x536c80[_0x6676('0x22')]();};}function saveUpdates(_0x34b3b5,_0x47952d){return function(_0x5bcae9){if(_0x5bcae9){return _0x5bcae9[_0x6676('0x23')](_0x34b3b5)[_0x6676('0x24')](function(_0x4c879b){return _0x4c879b;});}return null;};}function removeEntity(_0x18e62d,_0x2489f0){return function(_0x3d5682){if(_0x3d5682){return _0x3d5682[_0x6676('0x25')]()['then'](function(){_0x18e62d[_0x6676('0x17')](0xcc)[_0x6676('0x18')]();});}};}function handleEntityNotFound(_0xcedd8e,_0x1f0f6b){return function(_0x2d94a2){if(!_0x2d94a2){_0xcedd8e[_0x6676('0x16')](0x194);}return _0x2d94a2;};}function handleError(_0xb04108,_0x5e7d74){_0x5e7d74=_0x5e7d74||0x1f4;return function(_0x4c66cd){logger['error'](_0x4c66cd[_0x6676('0x26')]);if(_0x4c66cd[_0x6676('0x27')]){delete _0x4c66cd['name'];}_0xb04108[_0x6676('0x17')](_0x5e7d74)[_0x6676('0x28')](_0x4c66cd);};}exports[_0x6676('0x29')]=function(_0x42ac16,_0x350bbb){var _0x4edbf3={},_0x5aaaf8={},_0x197644={'count':0x0,'rows':[]};var _0x3fda82=_[_0x6676('0x2a')](db[_0x6676('0x2b')][_0x6676('0x2c')],function(_0x2cc371){return{'name':_0x2cc371[_0x6676('0x2d')],'type':_0x2cc371[_0x6676('0x2e')]['key']};});_0x5aaaf8[_0x6676('0x2f')]=_[_0x6676('0x2a')](_0x3fda82,_0x6676('0x27'));_0x5aaaf8['query']=_[_0x6676('0x30')](_0x42ac16['query']);_0x5aaaf8[_0x6676('0x31')]=_[_0x6676('0x32')](_0x5aaaf8[_0x6676('0x2f')],_0x5aaaf8[_0x6676('0x33')]);_0x4edbf3[_0x6676('0x34')]=_['intersection'](_0x5aaaf8[_0x6676('0x2f')],qs[_0x6676('0x35')](_0x42ac16[_0x6676('0x33')]['fields']));_0x4edbf3[_0x6676('0x34')]=_0x4edbf3[_0x6676('0x34')]['length']?_0x4edbf3['attributes']:_0x5aaaf8[_0x6676('0x2f')];if(!_0x42ac16[_0x6676('0x33')][_0x6676('0x36')](_0x6676('0x37'))){_0x4edbf3[_0x6676('0x1c')]=qs[_0x6676('0x1c')](_0x42ac16[_0x6676('0x33')][_0x6676('0x1c')]);_0x4edbf3[_0x6676('0x1a')]=qs[_0x6676('0x1a')](_0x42ac16[_0x6676('0x33')]['offset']);}_0x4edbf3[_0x6676('0x38')]=qs[_0x6676('0x39')](_0x42ac16[_0x6676('0x33')][_0x6676('0x39')]);_0x4edbf3[_0x6676('0x3a')]=qs[_0x6676('0x31')](_[_0x6676('0x3b')](_0x42ac16['query'],_0x5aaaf8[_0x6676('0x31')]),_0x3fda82);if(_0x42ac16[_0x6676('0x33')]['filter']){_0x4edbf3[_0x6676('0x3a')]=_[_0x6676('0x3c')](_0x4edbf3['where'],{'$or':_['map'](_0x3fda82,function(_0xc52612){if(_0xc52612[_0x6676('0x2e')]!==_0x6676('0x3d')){var _0x25affb={};_0x25affb[_0xc52612[_0x6676('0x27')]]={'$like':'%'+_0x42ac16[_0x6676('0x33')]['filter']+'%'};return _0x25affb;}})});}_0x4edbf3=_[_0x6676('0x3c')]({},_0x4edbf3,_0x42ac16['options']);var _0x38edf1={'where':_0x4edbf3[_0x6676('0x3a')]};return db[_0x6676('0x2b')][_0x6676('0x1d')](_0x38edf1)['then'](function(_0x15ca48){_0x197644[_0x6676('0x1d')]=_0x15ca48;if(_0x42ac16[_0x6676('0x33')][_0x6676('0x3e')]){_0x4edbf3['include']=[{'all':!![]}];}return db[_0x6676('0x2b')][_0x6676('0x3f')](_0x4edbf3);})[_0x6676('0x24')](function(_0x51b443){_0x197644[_0x6676('0x40')]=_0x51b443;return _0x197644;})[_0x6676('0x24')](respondWithFilteredResult(_0x350bbb,_0x4edbf3))[_0x6676('0x41')](handleError(_0x350bbb,null));};exports[_0x6676('0x42')]=function(_0xe4fdb,_0x4852d2){var _0x221174={'raw':![],'where':{'id':_0xe4fdb[_0x6676('0x43')]['id']}},_0x238d89={};_0x238d89[_0x6676('0x2f')]=_[_0x6676('0x30')](db['Automation']['rawAttributes']);_0x238d89[_0x6676('0x33')]=_[_0x6676('0x30')](_0xe4fdb[_0x6676('0x33')]);_0x238d89[_0x6676('0x31')]=_[_0x6676('0x32')](_0x238d89[_0x6676('0x2f')],_0x238d89['query']);_0x221174[_0x6676('0x34')]=_[_0x6676('0x32')](_0x238d89[_0x6676('0x2f')],qs['fields'](_0xe4fdb[_0x6676('0x33')][_0x6676('0x35')]));_0x221174[_0x6676('0x34')]=_0x221174[_0x6676('0x34')][_0x6676('0x44')]?_0x221174[_0x6676('0x34')]:_0x238d89[_0x6676('0x2f')];if(_0xe4fdb[_0x6676('0x33')]['includeAll']){_0x221174[_0x6676('0x45')]=[{'all':!![]}];}_0x221174=_[_0x6676('0x3c')]({},_0x221174,_0xe4fdb[_0x6676('0x46')]);return db[_0x6676('0x2b')]['find'](_0x221174)[_0x6676('0x24')](handleEntityNotFound(_0x4852d2,null))[_0x6676('0x24')](respondWithResult(_0x4852d2,null))[_0x6676('0x41')](handleError(_0x4852d2,null));};exports[_0x6676('0x47')]=function(_0x30b973,_0x194bab){return db[_0x6676('0x2b')][_0x6676('0x47')](_0x30b973[_0x6676('0x48')],{})[_0x6676('0x24')](respondWithResult(_0x194bab,0xc9))[_0x6676('0x41')](handleError(_0x194bab,null));};exports[_0x6676('0x23')]=function(_0x3be767,_0x360e0a){if(_0x3be767[_0x6676('0x48')]['id']){delete _0x3be767[_0x6676('0x48')]['id'];}return db[_0x6676('0x2b')][_0x6676('0x49')]({'where':{'id':_0x3be767['params']['id']}})[_0x6676('0x24')](handleEntityNotFound(_0x360e0a,null))[_0x6676('0x24')](saveUpdates(_0x3be767[_0x6676('0x48')],null))[_0x6676('0x24')](respondWithResult(_0x360e0a,null))[_0x6676('0x41')](handleError(_0x360e0a,null));};exports[_0x6676('0x25')]=function(_0x310b2c,_0x20bc7b){return db['Automation'][_0x6676('0x49')]({'where':{'id':_0x310b2c['params']['id']}})[_0x6676('0x24')](handleEntityNotFound(_0x20bc7b,null))['then'](removeEntity(_0x20bc7b,null))[_0x6676('0x41')](handleError(_0x20bc7b,null));};exports[_0x6676('0x4a')]=function(_0x29b630,_0x16c832,_0x8b07a1){return db['Condition']['find']({'where':{'id':_0x29b630['params']['id']}})[_0x6676('0x24')](handleEntityNotFound(_0x16c832,null))['then'](function(_0x233d9a){if(_0x233d9a){return _0x233d9a[_0x6676('0x4a')](_0x29b630['body'][_0x6676('0x4b')],_['omit'](_0x29b630[_0x6676('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x16c832,null))[_0x6676('0x41')](handleError(_0x16c832,null));};exports[_0x6676('0x4c')]=function(_0x3b7780,_0x15627b,_0x5d6589){var _0x17438e={};var _0x205063={};var _0x5068f2;var _0xb480cb;return db[_0x6676('0x2b')][_0x6676('0x4d')]({'where':{'id':_0x3b7780[_0x6676('0x43')]['id']}})[_0x6676('0x24')](handleEntityNotFound(_0x15627b,null))[_0x6676('0x24')](function(_0x36bf73){if(_0x36bf73){_0x5068f2=_0x36bf73;_0x205063[_0x6676('0x2f')]=_['keys'](db['Condition'][_0x6676('0x2c')]);_0x205063[_0x6676('0x33')]=_[_0x6676('0x30')](_0x3b7780[_0x6676('0x33')]);_0x205063[_0x6676('0x31')]=_[_0x6676('0x32')](_0x205063[_0x6676('0x2f')],_0x205063[_0x6676('0x33')]);_0x17438e['attributes']=_[_0x6676('0x32')](_0x205063['model'],qs[_0x6676('0x35')](_0x3b7780[_0x6676('0x33')][_0x6676('0x35')]));_0x17438e[_0x6676('0x34')]=_0x17438e[_0x6676('0x34')][_0x6676('0x44')]?_0x17438e[_0x6676('0x34')]:_0x205063['model'];_0x17438e[_0x6676('0x38')]=qs['sort'](_0x3b7780['query'][_0x6676('0x39')]);_0x17438e['where']=qs[_0x6676('0x31')](_[_0x6676('0x3b')](_0x3b7780['query'],_0x205063[_0x6676('0x31')]));if(_0x3b7780[_0x6676('0x33')]['filter']){_0x17438e[_0x6676('0x3a')]=_[_0x6676('0x3c')](_0x17438e[_0x6676('0x3a')],{'$or':_[_0x6676('0x2a')](_0x17438e[_0x6676('0x34')],function(_0x2e30f9){var _0x37d81c={};_0x37d81c[_0x2e30f9]={'$like':'%'+_0x3b7780[_0x6676('0x33')][_0x6676('0x4e')]+'%'};return _0x37d81c;})});}_0x17438e=_['merge']({},_0x17438e,_0x3b7780[_0x6676('0x46')]);return _0x5068f2['getConditions'](_0x17438e);}})[_0x6676('0x24')](function(_0x39d932){if(_0x39d932){_0xb480cb=_0x39d932[_0x6676('0x44')];if(!_0x3b7780[_0x6676('0x33')][_0x6676('0x36')]('nolimit')){_0x17438e[_0x6676('0x1c')]=qs[_0x6676('0x1c')](_0x3b7780[_0x6676('0x33')]['limit']);_0x17438e['offset']=qs['offset'](_0x3b7780[_0x6676('0x33')][_0x6676('0x1a')]);}return _0x5068f2[_0x6676('0x4c')](_0x17438e);}})[_0x6676('0x24')](function(_0x237e95){if(_0x237e95){return _0x237e95?{'count':_0xb480cb,'rows':_0x237e95}:null;}})[_0x6676('0x24')](respondWithResult(_0x15627b,null))['catch'](handleError(_0x15627b,null));};exports[_0x6676('0x4f')]=function(_0x38af17,_0x19bc17,_0x5e9bc5){return db['Action'][_0x6676('0x49')]({'where':{'id':_0x38af17[_0x6676('0x43')]['id']}})[_0x6676('0x24')](handleEntityNotFound(_0x19bc17,null))[_0x6676('0x24')](function(_0x53a81d){if(_0x53a81d){return _0x53a81d[_0x6676('0x4f')](_0x38af17['body']['ids'],_['omit'](_0x38af17[_0x6676('0x48')],[_0x6676('0x4b'),'id'])||{});}})[_0x6676('0x24')](respondWithResult(_0x19bc17,null))[_0x6676('0x41')](handleError(_0x19bc17,null));};exports[_0x6676('0x50')]=function(_0x3e8d5e,_0x5371f5,_0x3de993){var _0x49bb64={};var _0xd643b9={};var _0x4231b2;var _0x2d1160;return db['Automation'][_0x6676('0x4d')]({'where':{'id':_0x3e8d5e[_0x6676('0x43')]['id']}})['then'](handleEntityNotFound(_0x5371f5,null))[_0x6676('0x24')](function(_0x3d4054){if(_0x3d4054){_0x4231b2=_0x3d4054;_0xd643b9[_0x6676('0x2f')]=_[_0x6676('0x30')](db[_0x6676('0x51')]['rawAttributes']);_0xd643b9[_0x6676('0x33')]=_['keys'](_0x3e8d5e[_0x6676('0x33')]);_0xd643b9[_0x6676('0x31')]=_[_0x6676('0x32')](_0xd643b9[_0x6676('0x2f')],_0xd643b9[_0x6676('0x33')]);_0x49bb64[_0x6676('0x34')]=_['intersection'](_0xd643b9[_0x6676('0x2f')],qs[_0x6676('0x35')](_0x3e8d5e[_0x6676('0x33')]['fields']));_0x49bb64[_0x6676('0x34')]=_0x49bb64[_0x6676('0x34')][_0x6676('0x44')]?_0x49bb64['attributes']:_0xd643b9[_0x6676('0x2f')];_0x49bb64['order']=qs[_0x6676('0x39')](_0x3e8d5e['query'][_0x6676('0x39')]);_0x49bb64[_0x6676('0x3a')]=qs['filters'](_[_0x6676('0x3b')](_0x3e8d5e[_0x6676('0x33')],_0xd643b9['filters']));if(_0x3e8d5e[_0x6676('0x33')][_0x6676('0x4e')]){_0x49bb64[_0x6676('0x3a')]=_['merge'](_0x49bb64[_0x6676('0x3a')],{'$or':_[_0x6676('0x2a')](_0x49bb64[_0x6676('0x34')],function(_0x188c9c){var _0x43aa45={};_0x43aa45[_0x188c9c]={'$like':'%'+_0x3e8d5e['query'][_0x6676('0x4e')]+'%'};return _0x43aa45;})});}_0x49bb64=_[_0x6676('0x3c')]({},_0x49bb64,_0x3e8d5e['options']);return _0x4231b2['getActions'](_0x49bb64);}})['then'](function(_0xe5da2c){if(_0xe5da2c){_0x2d1160=_0xe5da2c[_0x6676('0x44')];if(!_0x3e8d5e[_0x6676('0x33')]['hasOwnProperty'](_0x6676('0x37'))){_0x49bb64[_0x6676('0x1c')]=qs[_0x6676('0x1c')](_0x3e8d5e['query']['limit']);_0x49bb64[_0x6676('0x1a')]=qs[_0x6676('0x1a')](_0x3e8d5e[_0x6676('0x33')]['offset']);}return _0x4231b2[_0x6676('0x50')](_0x49bb64);}})[_0x6676('0x24')](function(_0x30892f){if(_0x30892f){return _0x30892f?{'count':_0x2d1160,'rows':_0x30892f}:null;}})[_0x6676('0x24')](respondWithResult(_0x5371f5,null))[_0x6676('0x41')](handleError(_0x5371f5,null));};
\ No newline at end of file
+var _0xa04f=['options','includeAll','include','Automation','findAll','rows','catch','show','keys','create','body','find','params','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL'];(function(_0x29e4a6,_0x5e4103){var _0x513b50=function(_0x5ebede){while(--_0x5ebede){_0x29e4a6['push'](_0x29e4a6['shift']());}};_0x513b50(++_0x5e4103);}(_0xa04f,0x173));var _0xfa04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa04f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfa04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa04('0x1'));var jsonpatch=require(_0xfa04('0x2'));var rp=require(_0xfa04('0x3'));var moment=require(_0xfa04('0x4'));var BPromise=require(_0xfa04('0x5'));var Mustache=require(_0xfa04('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfa04('0x7'));var ejs=require(_0xfa04('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa04('0x9'));var squel=require(_0xfa04('0xa'));var crypto=require(_0xfa04('0xb'));var jsforce=require(_0xfa04('0xc'));var deskjs=require(_0xfa04('0xd'));var toCsv=require(_0xfa04('0x7'));var querystring=require(_0xfa04('0xe'));var Papa=require(_0xfa04('0xf'));var Redis=require(_0xfa04('0x10'));var authService=require(_0xfa04('0x11'));var qs=require(_0xfa04('0x12'));var as=require(_0xfa04('0x13'));var hardwareService=require(_0xfa04('0x14'));var logger=require(_0xfa04('0x15'))('api');var utils=require(_0xfa04('0x16'));var config=require(_0xfa04('0x17'));var licenseUtil=require(_0xfa04('0x18'));var db=require(_0xfa04('0x19'))['db'];function respondWithStatusCode(_0x2ee88a,_0x1714a0){_0x1714a0=_0x1714a0||0xcc;return function(_0x490d3c){if(_0x490d3c){return _0x2ee88a['sendStatus'](_0x1714a0);}return _0x2ee88a[_0xfa04('0x1a')](_0x1714a0)[_0xfa04('0x1b')]();};}function respondWithResult(_0x5d4727,_0x449c92){_0x449c92=_0x449c92||0xc8;return function(_0x14d5e9){if(_0x14d5e9){return _0x5d4727[_0xfa04('0x1a')](_0x449c92)['json'](_0x14d5e9);}};}function respondWithFilteredResult(_0x26dccf,_0x18d50a){return function(_0x5921f9){if(_0x5921f9){var _0x323d22=typeof _0x18d50a[_0xfa04('0x1c')]==='undefined'&&typeof _0x18d50a[_0xfa04('0x1d')]===_0xfa04('0x1e');var _0xd38821=_0x5921f9[_0xfa04('0x1f')];var _0x1128b5=_0x323d22?0x0:_0x18d50a[_0xfa04('0x1c')];var _0x2695c2=_0x323d22?_0x5921f9[_0xfa04('0x1f')]:_0x18d50a[_0xfa04('0x1c')]+_0x18d50a[_0xfa04('0x1d')];var _0x323723;if(_0x2695c2>=_0xd38821){_0x2695c2=_0xd38821;_0x323723=0xc8;}else{_0x323723=0xce;}_0x26dccf[_0xfa04('0x1a')](_0x323723);return _0x26dccf[_0xfa04('0x20')](_0xfa04('0x21'),_0x1128b5+'-'+_0x2695c2+'/'+_0xd38821)[_0xfa04('0x22')](_0x5921f9);}return null;};}function patchUpdates(_0x19bede){return function(_0x411c93){try{jsonpatch[_0xfa04('0x23')](_0x411c93,_0x19bede,!![]);}catch(_0x5bdc1c){return BPromise['reject'](_0x5bdc1c);}return _0x411c93['save']();};}function saveUpdates(_0x46ae3f,_0x4bc310){return function(_0x118091){if(_0x118091){return _0x118091[_0xfa04('0x24')](_0x46ae3f)[_0xfa04('0x25')](function(_0x35fb26){return _0x35fb26;});}return null;};}function removeEntity(_0x5287f3,_0x5f5302){return function(_0x3c31d6){if(_0x3c31d6){return _0x3c31d6[_0xfa04('0x26')]()[_0xfa04('0x25')](function(){_0x5287f3[_0xfa04('0x1a')](0xcc)[_0xfa04('0x1b')]();});}};}function handleEntityNotFound(_0xff79c,_0x2227c9){return function(_0x260667){if(!_0x260667){_0xff79c[_0xfa04('0x27')](0x194);}return _0x260667;};}function handleError(_0x145f48,_0x44f533){_0x44f533=_0x44f533||0x1f4;return function(_0x375e15){logger[_0xfa04('0x28')](_0x375e15['stack']);if(_0x375e15[_0xfa04('0x29')]){delete _0x375e15[_0xfa04('0x29')];}_0x145f48['status'](_0x44f533)[_0xfa04('0x2a')](_0x375e15);};}exports[_0xfa04('0x2b')]=function(_0x12ab23,_0x1dec75){var _0x2a0e3c={},_0x14d6c1={},_0x1fafa6={'count':0x0,'rows':[]};var _0x3b7d9a=_[_0xfa04('0x2c')](db['Automation'][_0xfa04('0x2d')],function(_0x203f0a){return{'name':_0x203f0a[_0xfa04('0x2e')],'type':_0x203f0a['type'][_0xfa04('0x2f')]};});_0x14d6c1[_0xfa04('0x30')]=_[_0xfa04('0x2c')](_0x3b7d9a,_0xfa04('0x29'));_0x14d6c1[_0xfa04('0x31')]=_['keys'](_0x12ab23[_0xfa04('0x31')]);_0x14d6c1[_0xfa04('0x32')]=_['intersection'](_0x14d6c1[_0xfa04('0x30')],_0x14d6c1[_0xfa04('0x31')]);_0x2a0e3c[_0xfa04('0x33')]=_[_0xfa04('0x34')](_0x14d6c1[_0xfa04('0x30')],qs[_0xfa04('0x35')](_0x12ab23['query'][_0xfa04('0x35')]));_0x2a0e3c[_0xfa04('0x33')]=_0x2a0e3c[_0xfa04('0x33')][_0xfa04('0x36')]?_0x2a0e3c[_0xfa04('0x33')]:_0x14d6c1['model'];if(!_0x12ab23[_0xfa04('0x31')][_0xfa04('0x37')](_0xfa04('0x38'))){_0x2a0e3c[_0xfa04('0x1d')]=qs['limit'](_0x12ab23[_0xfa04('0x31')][_0xfa04('0x1d')]);_0x2a0e3c[_0xfa04('0x1c')]=qs[_0xfa04('0x1c')](_0x12ab23['query']['offset']);}_0x2a0e3c['order']=qs[_0xfa04('0x39')](_0x12ab23[_0xfa04('0x31')]['sort']);_0x2a0e3c['where']=qs['filters'](_[_0xfa04('0x3a')](_0x12ab23[_0xfa04('0x31')],_0x14d6c1[_0xfa04('0x32')]),_0x3b7d9a);if(_0x12ab23[_0xfa04('0x31')][_0xfa04('0x3b')]){_0x2a0e3c[_0xfa04('0x3c')]=_[_0xfa04('0x3d')](_0x2a0e3c['where'],{'$or':_['map'](_0x3b7d9a,function(_0x3e38cb){if(_0x3e38cb[_0xfa04('0x3e')]!==_0xfa04('0x3f')){var _0x3be9c9={};_0x3be9c9[_0x3e38cb['name']]={'$like':'%'+_0x12ab23[_0xfa04('0x31')][_0xfa04('0x3b')]+'%'};return _0x3be9c9;}})});}_0x2a0e3c=_[_0xfa04('0x3d')]({},_0x2a0e3c,_0x12ab23[_0xfa04('0x40')]);var _0x39b9a6={'where':_0x2a0e3c[_0xfa04('0x3c')]};return db['Automation'][_0xfa04('0x1f')](_0x39b9a6)['then'](function(_0x599725){_0x1fafa6[_0xfa04('0x1f')]=_0x599725;if(_0x12ab23['query'][_0xfa04('0x41')]){_0x2a0e3c[_0xfa04('0x42')]=[{'all':!![]}];}return db[_0xfa04('0x43')][_0xfa04('0x44')](_0x2a0e3c);})[_0xfa04('0x25')](function(_0x39d4e3){_0x1fafa6[_0xfa04('0x45')]=_0x39d4e3;return _0x1fafa6;})[_0xfa04('0x25')](respondWithFilteredResult(_0x1dec75,_0x2a0e3c))[_0xfa04('0x46')](handleError(_0x1dec75,null));};exports[_0xfa04('0x47')]=function(_0x241fc8,_0x11ec9d){var _0x19ef24={'raw':![],'where':{'id':_0x241fc8['params']['id']}},_0x4c4896={};_0x4c4896['model']=_[_0xfa04('0x48')](db[_0xfa04('0x43')]['rawAttributes']);_0x4c4896['query']=_[_0xfa04('0x48')](_0x241fc8[_0xfa04('0x31')]);_0x4c4896['filters']=_[_0xfa04('0x34')](_0x4c4896[_0xfa04('0x30')],_0x4c4896['query']);_0x19ef24['attributes']=_['intersection'](_0x4c4896[_0xfa04('0x30')],qs[_0xfa04('0x35')](_0x241fc8[_0xfa04('0x31')][_0xfa04('0x35')]));_0x19ef24[_0xfa04('0x33')]=_0x19ef24[_0xfa04('0x33')][_0xfa04('0x36')]?_0x19ef24[_0xfa04('0x33')]:_0x4c4896[_0xfa04('0x30')];if(_0x241fc8[_0xfa04('0x31')][_0xfa04('0x41')]){_0x19ef24[_0xfa04('0x42')]=[{'all':!![]}];}_0x19ef24=_[_0xfa04('0x3d')]({},_0x19ef24,_0x241fc8[_0xfa04('0x40')]);return db['Automation']['find'](_0x19ef24)[_0xfa04('0x25')](handleEntityNotFound(_0x11ec9d,null))[_0xfa04('0x25')](respondWithResult(_0x11ec9d,null))['catch'](handleError(_0x11ec9d,null));};exports[_0xfa04('0x49')]=function(_0x56048f,_0x43486a){return db[_0xfa04('0x43')][_0xfa04('0x49')](_0x56048f[_0xfa04('0x4a')],{})[_0xfa04('0x25')](respondWithResult(_0x43486a,0xc9))[_0xfa04('0x46')](handleError(_0x43486a,null));};exports[_0xfa04('0x24')]=function(_0x9c9788,_0x46c9f5){if(_0x9c9788[_0xfa04('0x4a')]['id']){delete _0x9c9788['body']['id'];}return db[_0xfa04('0x43')][_0xfa04('0x4b')]({'where':{'id':_0x9c9788[_0xfa04('0x4c')]['id']}})[_0xfa04('0x25')](handleEntityNotFound(_0x46c9f5,null))[_0xfa04('0x25')](saveUpdates(_0x9c9788[_0xfa04('0x4a')],null))[_0xfa04('0x25')](respondWithResult(_0x46c9f5,null))[_0xfa04('0x46')](handleError(_0x46c9f5,null));};exports[_0xfa04('0x26')]=function(_0x22e9c3,_0xf8d4e7){return db[_0xfa04('0x43')]['find']({'where':{'id':_0x22e9c3['params']['id']}})['then'](handleEntityNotFound(_0xf8d4e7,null))[_0xfa04('0x25')](removeEntity(_0xf8d4e7,null))[_0xfa04('0x46')](handleError(_0xf8d4e7,null));};exports[_0xfa04('0x4d')]=function(_0x5e3fa6,_0x16d008,_0x4d5ee3){return db[_0xfa04('0x4e')][_0xfa04('0x4b')]({'where':{'id':_0x5e3fa6['params']['id']}})[_0xfa04('0x25')](handleEntityNotFound(_0x16d008,null))[_0xfa04('0x25')](function(_0x36f23f){if(_0x36f23f){return _0x36f23f[_0xfa04('0x4d')](_0x5e3fa6[_0xfa04('0x4a')][_0xfa04('0x4f')],_[_0xfa04('0x50')](_0x5e3fa6[_0xfa04('0x4a')],[_0xfa04('0x4f'),'id'])||{});}})[_0xfa04('0x25')](respondWithResult(_0x16d008,null))[_0xfa04('0x46')](handleError(_0x16d008,null));};exports[_0xfa04('0x51')]=function(_0x39d673,_0x1722b9,_0x34b48d){var _0x5eeee9={};var _0x33845e={};var _0x532dc6;var _0x5bddc8;return db[_0xfa04('0x43')][_0xfa04('0x52')]({'where':{'id':_0x39d673[_0xfa04('0x4c')]['id']}})[_0xfa04('0x25')](handleEntityNotFound(_0x1722b9,null))[_0xfa04('0x25')](function(_0x56a337){if(_0x56a337){_0x532dc6=_0x56a337;_0x33845e[_0xfa04('0x30')]=_[_0xfa04('0x48')](db[_0xfa04('0x4e')]['rawAttributes']);_0x33845e['query']=_['keys'](_0x39d673[_0xfa04('0x31')]);_0x33845e[_0xfa04('0x32')]=_[_0xfa04('0x34')](_0x33845e[_0xfa04('0x30')],_0x33845e[_0xfa04('0x31')]);_0x5eeee9[_0xfa04('0x33')]=_[_0xfa04('0x34')](_0x33845e['model'],qs[_0xfa04('0x35')](_0x39d673[_0xfa04('0x31')][_0xfa04('0x35')]));_0x5eeee9['attributes']=_0x5eeee9[_0xfa04('0x33')][_0xfa04('0x36')]?_0x5eeee9['attributes']:_0x33845e['model'];_0x5eeee9['order']=qs[_0xfa04('0x39')](_0x39d673[_0xfa04('0x31')][_0xfa04('0x39')]);_0x5eeee9['where']=qs[_0xfa04('0x32')](_['pick'](_0x39d673[_0xfa04('0x31')],_0x33845e[_0xfa04('0x32')]));if(_0x39d673[_0xfa04('0x31')][_0xfa04('0x3b')]){_0x5eeee9[_0xfa04('0x3c')]=_['merge'](_0x5eeee9['where'],{'$or':_[_0xfa04('0x2c')](_0x5eeee9[_0xfa04('0x33')],function(_0x2674d7){var _0xec67eb={};_0xec67eb[_0x2674d7]={'$like':'%'+_0x39d673['query'][_0xfa04('0x3b')]+'%'};return _0xec67eb;})});}_0x5eeee9=_[_0xfa04('0x3d')]({},_0x5eeee9,_0x39d673[_0xfa04('0x40')]);return _0x532dc6['getConditions'](_0x5eeee9);}})['then'](function(_0x28f009){if(_0x28f009){_0x5bddc8=_0x28f009[_0xfa04('0x36')];if(!_0x39d673['query'][_0xfa04('0x37')](_0xfa04('0x38'))){_0x5eeee9[_0xfa04('0x1d')]=qs[_0xfa04('0x1d')](_0x39d673['query']['limit']);_0x5eeee9[_0xfa04('0x1c')]=qs[_0xfa04('0x1c')](_0x39d673[_0xfa04('0x31')]['offset']);}return _0x532dc6[_0xfa04('0x51')](_0x5eeee9);}})['then'](function(_0x376d10){if(_0x376d10){return _0x376d10?{'count':_0x5bddc8,'rows':_0x376d10}:null;}})[_0xfa04('0x25')](respondWithResult(_0x1722b9,null))[_0xfa04('0x46')](handleError(_0x1722b9,null));};exports[_0xfa04('0x53')]=function(_0x4d48a4,_0x350964,_0x5b3407){return db[_0xfa04('0x54')][_0xfa04('0x4b')]({'where':{'id':_0x4d48a4[_0xfa04('0x4c')]['id']}})['then'](handleEntityNotFound(_0x350964,null))[_0xfa04('0x25')](function(_0x24a6dd){if(_0x24a6dd){return _0x24a6dd[_0xfa04('0x53')](_0x4d48a4['body'][_0xfa04('0x4f')],_['omit'](_0x4d48a4[_0xfa04('0x4a')],[_0xfa04('0x4f'),'id'])||{});}})[_0xfa04('0x25')](respondWithResult(_0x350964,null))[_0xfa04('0x46')](handleError(_0x350964,null));};exports[_0xfa04('0x55')]=function(_0x4db5df,_0x30794d,_0x1a0cdb){var _0x36723d={};var _0x2bf803={};var _0x370d4d;var _0x1d1439;return db[_0xfa04('0x43')][_0xfa04('0x52')]({'where':{'id':_0x4db5df[_0xfa04('0x4c')]['id']}})[_0xfa04('0x25')](handleEntityNotFound(_0x30794d,null))[_0xfa04('0x25')](function(_0x3a2fde){if(_0x3a2fde){_0x370d4d=_0x3a2fde;_0x2bf803[_0xfa04('0x30')]=_['keys'](db[_0xfa04('0x54')][_0xfa04('0x2d')]);_0x2bf803['query']=_[_0xfa04('0x48')](_0x4db5df[_0xfa04('0x31')]);_0x2bf803[_0xfa04('0x32')]=_[_0xfa04('0x34')](_0x2bf803[_0xfa04('0x30')],_0x2bf803[_0xfa04('0x31')]);_0x36723d['attributes']=_[_0xfa04('0x34')](_0x2bf803[_0xfa04('0x30')],qs['fields'](_0x4db5df[_0xfa04('0x31')][_0xfa04('0x35')]));_0x36723d[_0xfa04('0x33')]=_0x36723d[_0xfa04('0x33')][_0xfa04('0x36')]?_0x36723d[_0xfa04('0x33')]:_0x2bf803[_0xfa04('0x30')];_0x36723d[_0xfa04('0x56')]=qs['sort'](_0x4db5df[_0xfa04('0x31')][_0xfa04('0x39')]);_0x36723d[_0xfa04('0x3c')]=qs[_0xfa04('0x32')](_[_0xfa04('0x3a')](_0x4db5df['query'],_0x2bf803[_0xfa04('0x32')]));if(_0x4db5df[_0xfa04('0x31')][_0xfa04('0x3b')]){_0x36723d[_0xfa04('0x3c')]=_[_0xfa04('0x3d')](_0x36723d['where'],{'$or':_[_0xfa04('0x2c')](_0x36723d[_0xfa04('0x33')],function(_0x58c152){var _0x5e7e8b={};_0x5e7e8b[_0x58c152]={'$like':'%'+_0x4db5df[_0xfa04('0x31')][_0xfa04('0x3b')]+'%'};return _0x5e7e8b;})});}_0x36723d=_[_0xfa04('0x3d')]({},_0x36723d,_0x4db5df[_0xfa04('0x40')]);return _0x370d4d['getActions'](_0x36723d);}})[_0xfa04('0x25')](function(_0x18905d){if(_0x18905d){_0x1d1439=_0x18905d['length'];if(!_0x4db5df[_0xfa04('0x31')][_0xfa04('0x37')](_0xfa04('0x38'))){_0x36723d[_0xfa04('0x1d')]=qs[_0xfa04('0x1d')](_0x4db5df['query']['limit']);_0x36723d[_0xfa04('0x1c')]=qs[_0xfa04('0x1c')](_0x4db5df[_0xfa04('0x31')][_0xfa04('0x1c')]);}return _0x370d4d[_0xfa04('0x55')](_0x36723d);}})[_0xfa04('0x25')](function(_0x2fb185){if(_0x2fb185){return _0x2fb185?{'count':_0x1d1439,'rows':_0x2fb185}:null;}})['then'](respondWithResult(_0x30794d,null))['catch'](handleError(_0x30794d,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 5feb8d9..1e91f45 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 _0x3bcd=['bluebird','request-promise','rimraf','../../config/environment','Automation','tools_automations','lodash','util','api','moment'];(function(_0x4c0101,_0x528dbe){var _0x2c731f=function(_0x311c84){while(--_0x311c84){_0x4c0101['push'](_0x4c0101['shift']());}};_0x2c731f(++_0x528dbe);}(_0x3bcd,0x13c));var _0xd3bc=function(_0x2a04,_0x434f07){_0x2a04=_0x2a04-0x0;var _0x2c7007=_0x3bcd[_0x2a04];return _0x2c7007;};'use strict';var _=require(_0xd3bc('0x0'));var util=require(_0xd3bc('0x1'));var logger=require('../../config/logger')(_0xd3bc('0x2'));var moment=require(_0xd3bc('0x3'));var BPromise=require(_0xd3bc('0x4'));var rp=require(_0xd3bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3bc('0x6'));var config=require(_0xd3bc('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x1e367c,_0x360bad){return _0x1e367c['define'](_0xd3bc('0x8'),attributes,{'tableName':_0xd3bc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25c3=['define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x2581b7,_0x102897){var _0xa925f1=function(_0xcc5fbc){while(--_0xcc5fbc){_0x2581b7['push'](_0x2581b7['shift']());}};_0xa925f1(++_0x102897);}(_0x25c3,0x85));var _0x325c=function(_0x53a558,_0x5b25cf){_0x53a558=_0x53a558-0x0;var _0x40481f=_0x25c3[_0x53a558];return _0x40481f;};'use strict';var _=require(_0x325c('0x0'));var util=require(_0x325c('0x1'));var logger=require(_0x325c('0x2'))(_0x325c('0x3'));var moment=require(_0x325c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x325c('0x5'));var rimraf=require('rimraf');var config=require(_0x325c('0x6'));var attributes=require('./automation.attributes');module['exports']=function(_0x261d83,_0x5958a6){return _0x261d83[_0x325c('0x7')](_0x325c('0x8'),attributes,{'tableName':_0x325c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index e2fbe7b..b983b15 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 _0xbc7a=['error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x17a71f,_0x5373a2){var _0x3bd012=function(_0x3db809){while(--_0x3db809){_0x17a71f['push'](_0x17a71f['shift']());}};_0x3bd012(++_0x5373a2);}(_0xbc7a,0xa4));var _0xabc7=function(_0xe67a7a,_0x52f187){_0xe67a7a=_0xe67a7a-0x0;var _0x1d096b=_0xbc7a[_0xe67a7a];return _0x1d096b;};'use strict';var _=require(_0xabc7('0x0'));var util=require(_0xabc7('0x1'));var moment=require(_0xabc7('0x2'));var BPromise=require('bluebird');var rs=require(_0xabc7('0x3'));var fs=require('fs');var Redis=require(_0xabc7('0x4'));var db=require(_0xabc7('0x5'))['db'];var utils=require(_0xabc7('0x6'));var logger=require(_0xabc7('0x7'))(_0xabc7('0x8'));var config=require('../../config/environment');var jayson=require(_0xabc7('0x9'));var client=jayson[_0xabc7('0xa')][_0xabc7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28396c,_0x54a7d4,_0x2536d1){return new BPromise(function(_0x5b6d13,_0x441642){return client['request'](_0x28396c,_0x2536d1)[_0xabc7('0xc')](function(_0x2d15b4){logger[_0xabc7('0xd')](_0xabc7('0xe'),_0x54a7d4,_0xabc7('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x54a7d4,_0xabc7('0xf'),JSON['stringify'](_0x2d15b4));if(_0x2d15b4[_0xabc7('0x10')]){if(_0x2d15b4[_0xabc7('0x10')][_0xabc7('0x11')]===0x1f4){logger['error'](_0xabc7('0xe'),_0x54a7d4,_0x2d15b4[_0xabc7('0x10')]['message']);return _0x441642(_0x2d15b4['error'][_0xabc7('0x12')]);}logger[_0xabc7('0x10')]('Automation,\x20%s,\x20%s',_0x54a7d4,_0x2d15b4[_0xabc7('0x10')]['message']);return _0x5b6d13(_0x2d15b4[_0xabc7('0x10')][_0xabc7('0x12')]);}else{logger[_0xabc7('0xd')](_0xabc7('0xe'),_0x54a7d4,'request\x20sent');_0x5b6d13(_0x2d15b4['result'][_0xabc7('0x12')]);}})[_0xabc7('0x13')](function(_0x4216a2){logger[_0xabc7('0x10')]('Automation,\x20%s,\x20%s',_0x54a7d4,_0x4216a2);_0x441642(_0x4216a2);});});}
\ No newline at end of file
+var _0xd027=['then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7d02('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d02('0x1'));var fs=require('fs');var Redis=require(_0x7d02('0x2'));var db=require(_0x7d02('0x3'))['db'];var utils=require(_0x7d02('0x4'));var logger=require(_0x7d02('0x5'))(_0x7d02('0x6'));var config=require(_0x7d02('0x7'));var jayson=require(_0x7d02('0x8'));var client=jayson['client'][_0x7d02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19a3b4,_0x2f59e2,_0x4442c5){return new BPromise(function(_0x10647b,_0x310426){return client[_0x7d02('0xa')](_0x19a3b4,_0x4442c5)[_0x7d02('0xb')](function(_0x10af16){logger[_0x7d02('0xc')](_0x7d02('0xd'),_0x2f59e2,_0x7d02('0xe'));logger[_0x7d02('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x2f59e2,_0x7d02('0xe'),JSON[_0x7d02('0x10')](_0x10af16));if(_0x10af16['error']){if(_0x10af16[_0x7d02('0x11')][_0x7d02('0x12')]===0x1f4){logger[_0x7d02('0x11')](_0x7d02('0xd'),_0x2f59e2,_0x10af16['error'][_0x7d02('0x13')]);return _0x310426(_0x10af16['error'][_0x7d02('0x13')]);}logger[_0x7d02('0x11')]('Automation,\x20%s,\x20%s',_0x2f59e2,_0x10af16[_0x7d02('0x11')][_0x7d02('0x13')]);return _0x10647b(_0x10af16['error'][_0x7d02('0x13')]);}else{logger[_0x7d02('0xc')](_0x7d02('0xd'),_0x2f59e2,'request\x20sent');_0x10647b(_0x10af16[_0x7d02('0x14')][_0x7d02('0x13')]);}})[_0x7d02('0x15')](function(_0x2017f0){logger[_0x7d02('0x11')](_0x7d02('0xd'),_0x2f59e2,_0x2017f0);_0x310426(_0x2017f0);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index c9b98a8..e758826 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 _0xabd8=['/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions'];(function(_0x35e9ad,_0x4c29a4){var _0x5b5e9c=function(_0x197fef){while(--_0x197fef){_0x35e9ad['push'](_0x35e9ad['shift']());}};_0x5b5e9c(++_0x4c29a4);}(_0xabd8,0x142));var _0x8abd=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0xabd8[_0x39cf70];return _0x580424;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8abd('0x0'));var express=require(_0x8abd('0x1'));var router=express[_0x8abd('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8abd('0x3'));var interaction=require(_0x8abd('0x4'));var config=require(_0x8abd('0x5'));var controller=require(_0x8abd('0x6'));router[_0x8abd('0x7')]('/',auth[_0x8abd('0x8')](),controller[_0x8abd('0x9')]);router[_0x8abd('0x7')](_0x8abd('0xa'),auth[_0x8abd('0x8')](),controller[_0x8abd('0xb')]);router[_0x8abd('0x7')](_0x8abd('0xc'),auth['isAuthenticated'](),controller[_0x8abd('0xd')]);router[_0x8abd('0x7')](_0x8abd('0xe'),auth[_0x8abd('0x8')](),controller[_0x8abd('0xf')]);router[_0x8abd('0x10')]('/',auth[_0x8abd('0x8')](),controller[_0x8abd('0x11')]);router[_0x8abd('0x10')](_0x8abd('0xc'),auth['isAuthenticated'](),controller[_0x8abd('0x12')]);router[_0x8abd('0x10')](_0x8abd('0xe'),auth['isAuthenticated'](),controller[_0x8abd('0x13')]);router[_0x8abd('0x14')](_0x8abd('0xa'),auth[_0x8abd('0x8')](),controller[_0x8abd('0x15')]);router[_0x8abd('0x16')](_0x8abd('0xa'),auth[_0x8abd('0x8')](),controller['destroy']);module[_0x8abd('0x17')]=router;
\ No newline at end of file
+var _0x8d19=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','put'];(function(_0x188edb,_0x19fed6){var _0x669a3d=function(_0x40b5d9){while(--_0x40b5d9){_0x188edb['push'](_0x188edb['shift']());}};_0x669a3d(++_0x19fed6);}(_0x8d19,0xd1));var _0x98d1=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x8d19[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require(_0x98d1('0x0'));var util=require(_0x98d1('0x1'));var path=require(_0x98d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x98d1('0x3'));var router=express[_0x98d1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x98d1('0x5'));var interaction=require(_0x98d1('0x6'));var config=require(_0x98d1('0x7'));var controller=require('./automation.controller');router['get']('/',auth[_0x98d1('0x8')](),controller[_0x98d1('0x9')]);router[_0x98d1('0xa')](_0x98d1('0xb'),auth[_0x98d1('0x8')](),controller[_0x98d1('0xc')]);router[_0x98d1('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x98d1('0xd')]);router[_0x98d1('0xa')](_0x98d1('0xe'),auth[_0x98d1('0x8')](),controller[_0x98d1('0xf')]);router[_0x98d1('0x10')]('/',auth['isAuthenticated'](),controller[_0x98d1('0x11')]);router[_0x98d1('0x10')](_0x98d1('0x12'),auth[_0x98d1('0x8')](),controller[_0x98d1('0x13')]);router[_0x98d1('0x10')]('/:id/actions',auth[_0x98d1('0x8')](),controller['addActions']);router[_0x98d1('0x14')]('/:id',auth[_0x98d1('0x8')](),controller['update']);router['delete'](_0x98d1('0xb'),auth['isAuthenticated'](),controller[_0x98d1('0x15')]);module[_0x98d1('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 2294fcc..72535a0 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 _0x2e25=['UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x344eb8,_0x12a8a5){var _0x3f197c=function(_0x21fa6e){while(--_0x21fa6e){_0x344eb8['push'](_0x344eb8['shift']());}};_0x3f197c(++_0x12a8a5);}(_0x2e25,0x8c));var _0x52e2=function(_0x42c3db,_0x4e6268){_0x42c3db=_0x42c3db-0x0;var _0x572868=_0x2e25[_0x42c3db];return _0x572868;};'use strict';var Sequelize=require(_0x52e2('0x0'));module[_0x52e2('0x1')]={'name':{'type':Sequelize[_0x52e2('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x52e2('0x3')](_0x52e2('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x52e2('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x52e2('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x52e2('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x52e2('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e2('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x52e2('0x5')](0x3)[_0x52e2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e2('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52e2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e2('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x52e2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e2('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x52e2('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x52e2('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x52e2('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e2('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x52e2('0x5')](0x3)[_0x52e2('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x52e2('0xe')},'dialTimezone':{'type':Sequelize[_0x52e2('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x52e2('0x2')],'defaultValue':_0x52e2('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x52e2('0x3')](_0x52e2('0x10'),'never',_0x52e2('0x11')),'defaultValue':_0x52e2('0x10')},'dialAMDActive':{'type':Sequelize[_0x52e2('0x12')],'defaultValue':0x0,'comment':_0x52e2('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x52e2('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x52e2('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x52e2('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x52e2('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x52e2('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x52e2('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x52e2('0x5')](0x9)[_0x52e2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x52e2('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x52e2('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x52e2('0x5')](0x9)[_0x52e2('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x52e2('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x52e2('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x52e2('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x52e2('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x52e2('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x52e2('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x52e2('0x3')](_0x52e2('0x1b'),_0x52e2('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x52e2('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x52e2('0x5')](0x3)[_0x52e2('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x52e2('0x1d')},'dialCutDigit':{'type':Sequelize[_0x52e2('0x5')](0x3)[_0x52e2('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x52e2('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e2('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x52e2('0x5')](0x5)[_0x52e2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e2('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x52e2('0x5')](0x3)[_0x52e2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e2('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x52e2('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e2('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x52e2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x52e2('0x5')](0x5)[_0x52e2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e2('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x52e2('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52e2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x52e2('0x5')](0x3)[_0x52e2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52e2('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x52e2('0x5')](0x5)[_0x52e2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52e2('0x24')}};
\ No newline at end of file
+var _0x787a=['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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#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)'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x787a,0x1ce));var _0xa787=function(_0x5c34b8,_0x2e1efe){_0x5c34b8=_0x5c34b8-0x0;var _0x56de7b=_0x787a[_0x5c34b8];return _0x56de7b;};'use strict';var Sequelize=require(_0xa787('0x0'));module['exports']={'name':{'type':Sequelize[_0xa787('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa787('0x2')](_0xa787('0x3')),'allowNull':![],'defaultValue':_0xa787('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa787('0x4')],'defaultValue':0x0,'comment':_0xa787('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa787('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa787('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa787('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa787('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa787('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa787('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa787('0x9')](0x5)[_0xa787('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa787('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa787('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa787('0x9')](0x5)[_0xa787('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa787('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)[_0xa787('0x7')],'defaultValue':0x3,'comment':_0xa787('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa787('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa787('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa787('0x10')},'dialTimezone':{'type':Sequelize[_0xa787('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa787('0x1')],'defaultValue':_0xa787('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xa787('0x2')](_0xa787('0x12'),_0xa787('0x13'),_0xa787('0x14')),'defaultValue':_0xa787('0x12')},'dialAMDActive':{'type':Sequelize[_0xa787('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xa787('0x9')](0x9)[_0xa787('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xa787('0x9')](0x9)[_0xa787('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa787('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa787('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa787('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa787('0x9')](0x9)[_0xa787('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa787('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xa787('0x9')](0x9)[_0xa787('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa787('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa787('0x9')](0x9)[_0xa787('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa787('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa787('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa787('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa787('0x9')](0x5)[_0xa787('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa787('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa787('0x9')](0x9)[_0xa787('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa787('0x2')]('DESC','ASC'),'defaultValue':_0xa787('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa787('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa787('0x1d')},'dialCutDigit':{'type':Sequelize[_0xa787('0x9')](0x3)[_0xa787('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa787('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)[_0xa787('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa787('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa787('0x9')](0x5)[_0xa787('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa787('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)[_0xa787('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa787('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xa787('0x9')](0x5)[_0xa787('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa787('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)[_0xa787('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa787('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)[_0xa787('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa787('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa787('0x9')](0x5)[_0xa787('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa787('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa787('0x9')](0x3)[_0xa787('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa787('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa787('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 2a9fb9f..4676184 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 _0xd17f=['phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','insert','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','save','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','keys','query','attributes','fields','hasOwnProperty','where','pick','filters','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','intersection','length','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','user','UserProfileSection','update','params','getHoppers','findOne','CmHopper','nolimit','order','sort','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','toString','NOW()','from','ListId\x20=\x20?','CmListId'];(function(_0x9848e7,_0xf2b1f0){var _0x537a1e=function(_0x270f0){while(--_0x270f0){_0x9848e7['push'](_0x9848e7['shift']());}};_0x537a1e(++_0xf2b1f0);}(_0xd17f,0x1a5));var _0xfd17=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xd17f[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xfd17('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd17('0x1'));var jsonpatch=require(_0xfd17('0x2'));var rp=require(_0xfd17('0x3'));var moment=require(_0xfd17('0x4'));var BPromise=require(_0xfd17('0x5'));var Mustache=require(_0xfd17('0x6'));var util=require(_0xfd17('0x7'));var path=require(_0xfd17('0x8'));var sox=require(_0xfd17('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd17('0xa'));var _=require(_0xfd17('0xb'));var squel=require(_0xfd17('0xc'));var crypto=require(_0xfd17('0xd'));var jsforce=require(_0xfd17('0xe'));var deskjs=require(_0xfd17('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfd17('0x10'));var Papa=require('papaparse');var Redis=require(_0xfd17('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfd17('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd17('0x13'));var logger=require(_0xfd17('0x14'))(_0xfd17('0x15'));var utils=require(_0xfd17('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfd17('0x17'));var db=require(_0xfd17('0x18'))['db'];function respondWithStatusCode(_0x5c7de7,_0x10371d){_0x10371d=_0x10371d||0xcc;return function(_0x38665e){if(_0x38665e){return _0x5c7de7[_0xfd17('0x19')](_0x10371d);}return _0x5c7de7[_0xfd17('0x1a')](_0x10371d)[_0xfd17('0x1b')]();};}function respondWithResult(_0x3fdd86,_0x42a53f){_0x42a53f=_0x42a53f||0xc8;return function(_0xaa0307){if(_0xaa0307){return _0x3fdd86['status'](_0x42a53f)[_0xfd17('0x1c')](_0xaa0307);}};}function respondWithFilteredResult(_0x18f752,_0x396052){return function(_0x19fa45){if(_0x19fa45){var _0xa3d2b6=typeof _0x396052[_0xfd17('0x1d')]===_0xfd17('0x1e')&&typeof _0x396052[_0xfd17('0x1f')]===_0xfd17('0x1e');var _0x39b283=_0x19fa45['count'];var _0x31f395=_0xa3d2b6?0x0:_0x396052[_0xfd17('0x1d')];var _0x497191=_0xa3d2b6?_0x19fa45['count']:_0x396052[_0xfd17('0x1d')]+_0x396052[_0xfd17('0x1f')];var _0x218513;if(_0x497191>=_0x39b283){_0x497191=_0x39b283;_0x218513=0xc8;}else{_0x218513=0xce;}_0x18f752['status'](_0x218513);return _0x18f752['set']('Content-Range',_0x31f395+'-'+_0x497191+'/'+_0x39b283)[_0xfd17('0x1c')](_0x19fa45);}return null;};}function patchUpdates(_0xdb0d0){return function(_0x36fa3d){try{jsonpatch['apply'](_0x36fa3d,_0xdb0d0,!![]);}catch(_0x2cd842){return BPromise['reject'](_0x2cd842);}return _0x36fa3d[_0xfd17('0x20')]();};}function saveUpdates(_0x4a08db,_0x4a4380){return function(_0x543e8a){if(_0x543e8a){return _0x543e8a['update'](_0x4a08db)[_0xfd17('0x21')](function(_0x3b88f7){return _0x3b88f7;});}return null;};}function removeEntity(_0x13d938,_0x38e2e7){return function(_0x583354){if(_0x583354){return _0x583354[_0xfd17('0x22')]()[_0xfd17('0x21')](function(){var _0x113f61=_0x583354[_0xfd17('0x23')]({'plain':!![]});var _0xad268c=_0xfd17('0x24');return db[_0xfd17('0x25')][_0xfd17('0x22')]({'where':{'type':_0xad268c,'resourceId':_0x113f61['id']}})[_0xfd17('0x21')](function(){return _0x583354;});})['then'](function(){_0x13d938[_0xfd17('0x1a')](0xcc)[_0xfd17('0x1b')]();});}};}function handleEntityNotFound(_0x2b48cf,_0x343f0f){return function(_0x5ad4c5){if(!_0x5ad4c5){_0x2b48cf[_0xfd17('0x19')](0x194);}return _0x5ad4c5;};}function handleError(_0x4b199d,_0x4f841b){_0x4f841b=_0x4f841b||0x1f4;return function(_0x41b7e7){logger['error'](_0x41b7e7[_0xfd17('0x26')]);if(_0x41b7e7['name']){delete _0x41b7e7[_0xfd17('0x27')];}_0x4b199d['status'](_0x4f841b)[_0xfd17('0x28')](_0x41b7e7);};}exports[_0xfd17('0x29')]=function(_0x22dff1,_0x56a1d4){var _0x36c339={},_0x393251={},_0x13eabe={'count':0x0,'rows':[]};var _0x174804=_[_0xfd17('0x2a')](db[_0xfd17('0x2b')][_0xfd17('0x2c')],function(_0x2067dc){return{'name':_0x2067dc['fieldName'],'type':_0x2067dc[_0xfd17('0x2d')][_0xfd17('0x2e')]};});_0x393251[_0xfd17('0x2f')]=_[_0xfd17('0x2a')](_0x174804,_0xfd17('0x27'));_0x393251['query']=_[_0xfd17('0x30')](_0x22dff1['query']);_0x393251['filters']=_['intersection'](_0x393251[_0xfd17('0x2f')],_0x393251[_0xfd17('0x31')]);_0x36c339[_0xfd17('0x32')]=_['intersection'](_0x393251['model'],qs[_0xfd17('0x33')](_0x22dff1[_0xfd17('0x31')][_0xfd17('0x33')]));_0x36c339[_0xfd17('0x32')]=_0x36c339['attributes']['length']?_0x36c339['attributes']:_0x393251['model'];if(!_0x22dff1['query'][_0xfd17('0x34')]('nolimit')){_0x36c339['limit']=qs['limit'](_0x22dff1[_0xfd17('0x31')]['limit']);_0x36c339['offset']=qs[_0xfd17('0x1d')](_0x22dff1['query'][_0xfd17('0x1d')]);}_0x36c339['order']=qs['sort'](_0x22dff1[_0xfd17('0x31')]['sort']);_0x36c339[_0xfd17('0x35')]=qs['filters'](_[_0xfd17('0x36')](_0x22dff1[_0xfd17('0x31')],_0x393251[_0xfd17('0x37')]),_0x174804);if(_0x22dff1['query'][_0xfd17('0x38')]){_0x36c339['where']=_[_0xfd17('0x39')](_0x36c339['where'],{'$or':_[_0xfd17('0x2a')](_0x174804,function(_0x26b155){if(_0x26b155[_0xfd17('0x2d')]!==_0xfd17('0x3a')){var _0x7ba6ca={};_0x7ba6ca[_0x26b155[_0xfd17('0x27')]]={'$like':'%'+_0x22dff1['query']['filter']+'%'};return _0x7ba6ca;}})});}_0x36c339=_[_0xfd17('0x39')]({},_0x36c339,_0x22dff1['options']);var _0x33da5c={'where':_0x36c339['where']};return db[_0xfd17('0x2b')][_0xfd17('0x3b')](_0x33da5c)['then'](function(_0x416044){_0x13eabe['count']=_0x416044;if(_0x22dff1['query'][_0xfd17('0x3c')]){_0x36c339['include']=[{'all':!![]}];}return db[_0xfd17('0x2b')][_0xfd17('0x3d')](_0x36c339);})[_0xfd17('0x21')](function(_0xeec59e){_0x13eabe[_0xfd17('0x3e')]=_0xeec59e;return _0x13eabe;})[_0xfd17('0x21')](respondWithFilteredResult(_0x56a1d4,_0x36c339))[_0xfd17('0x3f')](handleError(_0x56a1d4,null));};exports[_0xfd17('0x40')]=function(_0x1facb6,_0xb84dbf){var _0x340dd9={'raw':![],'where':{'id':_0x1facb6['params']['id']}},_0x22a083={};_0x22a083[_0xfd17('0x2f')]=_[_0xfd17('0x30')](db[_0xfd17('0x2b')]['rawAttributes']);_0x22a083['query']=_['keys'](_0x1facb6[_0xfd17('0x31')]);_0x22a083[_0xfd17('0x37')]=_[_0xfd17('0x41')](_0x22a083['model'],_0x22a083[_0xfd17('0x31')]);_0x340dd9['attributes']=_[_0xfd17('0x41')](_0x22a083[_0xfd17('0x2f')],qs[_0xfd17('0x33')](_0x1facb6[_0xfd17('0x31')]['fields']));_0x340dd9[_0xfd17('0x32')]=_0x340dd9['attributes'][_0xfd17('0x42')]?_0x340dd9['attributes']:_0x22a083[_0xfd17('0x2f')];if(_0x1facb6['query'][_0xfd17('0x3c')]){_0x340dd9[_0xfd17('0x43')]=[{'all':!![]}];}_0x340dd9=_['merge']({},_0x340dd9,_0x1facb6[_0xfd17('0x44')]);return db['Campaign'][_0xfd17('0x45')](_0x340dd9)[_0xfd17('0x21')](handleEntityNotFound(_0xb84dbf,null))[_0xfd17('0x21')](respondWithResult(_0xb84dbf,null))[_0xfd17('0x3f')](handleError(_0xb84dbf,null));};exports[_0xfd17('0x46')]=function(_0x57aa2f,_0x5e55a1){return db[_0xfd17('0x2b')]['create'](_0x57aa2f['body'],{})['then'](function(_0x32ac95){var _0x5666b9=_0x57aa2f['user'][_0xfd17('0x23')]({'plain':!![]});if(!_0x5666b9)throw new Error(_0xfd17('0x47'));if(_0x5666b9[_0xfd17('0x48')]==='user'){var _0xda263d=_0x32ac95['get']({'plain':!![]});var _0x39f8ae='IvrCampaigns';return db['UserProfileSection'][_0xfd17('0x45')]({'where':{'name':_0x39f8ae,'userProfileId':_0x5666b9[_0xfd17('0x49')]},'raw':!![]})[_0xfd17('0x21')](function(_0x119317){if(_0x119317&&_0x119317[_0xfd17('0x4a')]===0x0){return db['UserProfileResource'][_0xfd17('0x46')]({'name':_0xda263d['name'],'resourceId':_0xda263d['id'],'type':_0x119317[_0xfd17('0x27')],'sectionId':_0x119317['id']},{})['then'](function(){return _0x32ac95;});}else{return _0x32ac95;}})['catch'](function(_0x3feda3){logger[_0xfd17('0x4b')](_0xfd17('0x4c'),_0x3feda3);throw _0x3feda3;});}return _0x32ac95;})[_0xfd17('0x21')](respondWithResult(_0x5e55a1,0xc9))[_0xfd17('0x3f')](handleError(_0x5e55a1,null));};exports[_0xfd17('0x4d')]=function(_0x1cd6e5,_0xcf4f6e){var _0x807e14={'where':{'id':_0x1cd6e5['params']['id']}},_0x41d07a={};_0x41d07a[_0xfd17('0x2f')]=_[_0xfd17('0x30')](db[_0xfd17('0x2b')][_0xfd17('0x2c')]);_0x807e14[_0xfd17('0x32')]=_[_0xfd17('0x41')](_0x41d07a[_0xfd17('0x2f')],qs['fields'](_0x1cd6e5[_0xfd17('0x31')][_0xfd17('0x33')]));_0x807e14[_0xfd17('0x32')]=_0x807e14[_0xfd17('0x32')][_0xfd17('0x42')]?_0x807e14[_0xfd17('0x32')]:_0x41d07a[_0xfd17('0x2f')];if(_0x1cd6e5[_0xfd17('0x31')]['includeAll']){_0x807e14['include']=[{'all':!![]}];}_0x807e14=_[_0xfd17('0x39')]({},_0x807e14,_0x1cd6e5['options']);return db[_0xfd17('0x2b')][_0xfd17('0x45')](_0x807e14)[_0xfd17('0x21')](handleEntityNotFound(_0xcf4f6e,null))[_0xfd17('0x21')](function(_0x3563a6){if(_0x3563a6){var _0x2766c3=_0x3563a6[_0xfd17('0x23')]({'plain':!![]});_0x2766c3=qs['omit'](_0x2766c3,['id','createdAt',_0xfd17('0x4e')]);_0x1cd6e5[_0xfd17('0x4f')]=_[_0xfd17('0x50')](_0x1cd6e5['body'],['id',_0xfd17('0x51'),'updatedAt']);return db[_0xfd17('0x2b')]['create'](_['merge'](_0x2766c3,_0x1cd6e5[_0xfd17('0x4f')]),{'include':_0x1cd6e5['query'][_0xfd17('0x3c')]?[{'all':!![]}]:undefined})[_0xfd17('0x21')](function(_0x4f4143){var _0x2d4eec=_0x1cd6e5[_0xfd17('0x52')][_0xfd17('0x23')]({'plain':!![]});if(!_0x2d4eec)throw new Error(_0xfd17('0x47'));if(_0x2d4eec[_0xfd17('0x48')]===_0xfd17('0x52')){var _0x1bb31c=_0x4f4143[_0xfd17('0x23')]({'plain':!![]});var _0x2fc62c=_0xfd17('0x24');return db[_0xfd17('0x53')][_0xfd17('0x45')]({'where':{'name':_0x2fc62c,'userProfileId':_0x2d4eec[_0xfd17('0x49')]},'raw':!![]})[_0xfd17('0x21')](function(_0xfa6603){if(_0xfa6603&&_0xfa6603[_0xfd17('0x4a')]===0x0){return db['UserProfileResource'][_0xfd17('0x46')]({'name':_0x1bb31c[_0xfd17('0x27')],'resourceId':_0x1bb31c['id'],'type':_0xfa6603[_0xfd17('0x27')],'sectionId':_0xfa6603['id']},{})['then'](function(){return _0x4f4143;});}else{return _0x4f4143;}})[_0xfd17('0x3f')](function(_0x1d2e25){logger[_0xfd17('0x4b')](_0xfd17('0x4c'),_0x1d2e25);throw _0x1d2e25;});}return _0x4f4143;});}})[_0xfd17('0x21')](respondWithResult(_0xcf4f6e,0xc9))['catch'](handleError(_0xcf4f6e,null));};exports[_0xfd17('0x54')]=function(_0x305c11,_0x17275a){if(_0x305c11[_0xfd17('0x4f')]['id']){delete _0x305c11[_0xfd17('0x4f')]['id'];}return db['Campaign'][_0xfd17('0x45')]({'where':{'id':_0x305c11[_0xfd17('0x55')]['id']}})['then'](handleEntityNotFound(_0x17275a,null))[_0xfd17('0x21')](saveUpdates(_0x305c11['body'],null))[_0xfd17('0x21')](respondWithResult(_0x17275a,null))['catch'](handleError(_0x17275a,null));};exports[_0xfd17('0x22')]=function(_0x41a844,_0x3b0aeb){return db[_0xfd17('0x2b')][_0xfd17('0x45')]({'where':{'id':_0x41a844['params']['id']}})[_0xfd17('0x21')](handleEntityNotFound(_0x3b0aeb,null))[_0xfd17('0x21')](removeEntity(_0x3b0aeb,null))['catch'](handleError(_0x3b0aeb,null));};exports[_0xfd17('0x56')]=function(_0x2c83d1,_0x3259b1,_0x580e11){var _0x48f84b={'raw':!![],'where':{}};var _0xe91427={};var _0x2d287e={'count':0x0,'rows':[]};return db[_0xfd17('0x2b')][_0xfd17('0x57')]({'where':{'id':_0x2c83d1[_0xfd17('0x55')]['id']}})[_0xfd17('0x21')](handleEntityNotFound(_0x3259b1,null))[_0xfd17('0x21')](function(_0x4ac45a){if(_0x4ac45a){_0xe91427['model']=_[_0xfd17('0x30')](db[_0xfd17('0x58')]['rawAttributes']);_0xe91427[_0xfd17('0x31')]=_[_0xfd17('0x30')](_0x2c83d1[_0xfd17('0x31')]);_0xe91427[_0xfd17('0x37')]=_[_0xfd17('0x41')](_0xe91427[_0xfd17('0x2f')],_0xe91427['query']);_0x48f84b[_0xfd17('0x32')]=_[_0xfd17('0x41')](_0xe91427[_0xfd17('0x2f')],qs['fields'](_0x2c83d1['query']['fields']));_0x48f84b['attributes']=_0x48f84b[_0xfd17('0x32')][_0xfd17('0x42')]?_0x48f84b[_0xfd17('0x32')]:_0xe91427[_0xfd17('0x2f')];if(!_0x2c83d1[_0xfd17('0x31')][_0xfd17('0x34')](_0xfd17('0x59'))){_0x48f84b[_0xfd17('0x1f')]=qs['limit'](_0x2c83d1[_0xfd17('0x31')][_0xfd17('0x1f')]);_0x48f84b[_0xfd17('0x1d')]=qs['offset'](_0x2c83d1[_0xfd17('0x31')][_0xfd17('0x1d')]);}_0x48f84b[_0xfd17('0x5a')]=qs[_0xfd17('0x5b')](_0x2c83d1[_0xfd17('0x31')]['sort']);_0x48f84b[_0xfd17('0x35')]=qs[_0xfd17('0x37')](_['pick'](_0x2c83d1['query'],_0xe91427['filters']));_0x48f84b[_0xfd17('0x35')][_0xfd17('0x5c')]=_0x4ac45a['id'];if(_0x2c83d1['query'][_0xfd17('0x38')]){_0x48f84b[_0xfd17('0x35')]=_['merge'](_0x48f84b['where'],{'$or':_['map'](_0x48f84b[_0xfd17('0x32')],function(_0x467a57){var _0x108e58={};_0x108e58[_0x467a57]={'$like':'%'+_0x2c83d1[_0xfd17('0x31')][_0xfd17('0x38')]+'%'};return _0x108e58;})});}_0x48f84b=_['merge']({},_0x48f84b,_0x2c83d1['options']);return db[_0xfd17('0x58')][_0xfd17('0x3b')]({'where':_0x48f84b['where']})[_0xfd17('0x21')](function(_0x32503f){_0x2d287e[_0xfd17('0x3b')]=_0x32503f;if(_0x2c83d1[_0xfd17('0x31')][_0xfd17('0x3c')]){_0x48f84b[_0xfd17('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0xfd17('0x3d')](_0x48f84b);})['then'](function(_0x48be42){_0x2d287e['rows']=_0x48be42;return _0x2d287e;});}})['then'](respondWithFilteredResult(_0x3259b1,_0x48f84b))[_0xfd17('0x3f')](handleError(_0x3259b1,null));};exports[_0xfd17('0x5d')]=function(_0x53c188,_0x4a2634,_0x1a7f92){var _0x430cc4={'raw':!![],'where':{}};var _0x28b054={};var _0x530314={'count':0x0,'rows':[]};return db[_0xfd17('0x2b')][_0xfd17('0x57')]({'where':{'id':_0x53c188[_0xfd17('0x55')]['id']}})[_0xfd17('0x21')](handleEntityNotFound(_0x4a2634,null))[_0xfd17('0x21')](function(_0x5f2179){if(_0x5f2179){_0x28b054['model']=_[_0xfd17('0x30')](db['CmHopperHistory'][_0xfd17('0x2c')]);_0x28b054[_0xfd17('0x31')]=_['keys'](_0x53c188[_0xfd17('0x31')]);_0x28b054[_0xfd17('0x37')]=_[_0xfd17('0x41')](_0x28b054[_0xfd17('0x2f')],_0x28b054[_0xfd17('0x31')]);_0x430cc4[_0xfd17('0x32')]=_[_0xfd17('0x41')](_0x28b054[_0xfd17('0x2f')],qs[_0xfd17('0x33')](_0x53c188[_0xfd17('0x31')][_0xfd17('0x33')]));_0x430cc4[_0xfd17('0x32')]=_0x430cc4['attributes'][_0xfd17('0x42')]?_0x430cc4[_0xfd17('0x32')]:_0x28b054['model'];if(!_0x53c188['query']['hasOwnProperty'](_0xfd17('0x59'))){_0x430cc4[_0xfd17('0x1f')]=qs['limit'](_0x53c188[_0xfd17('0x31')]['limit']);_0x430cc4[_0xfd17('0x1d')]=qs[_0xfd17('0x1d')](_0x53c188[_0xfd17('0x31')][_0xfd17('0x1d')]);}_0x430cc4[_0xfd17('0x5a')]=qs['sort'](_0x53c188[_0xfd17('0x31')]['sort']);_0x430cc4[_0xfd17('0x35')]=qs[_0xfd17('0x37')](_[_0xfd17('0x36')](_0x53c188['query'],_0x28b054[_0xfd17('0x37')]));_0x430cc4[_0xfd17('0x35')]['CampaignId']=_0x5f2179['id'];if(_0x53c188[_0xfd17('0x31')][_0xfd17('0x38')]){_0x430cc4[_0xfd17('0x35')]=_[_0xfd17('0x39')](_0x430cc4[_0xfd17('0x35')],{'$or':_[_0xfd17('0x2a')](_0x430cc4[_0xfd17('0x32')],function(_0x477acd){var _0x1fc804={};_0x1fc804[_0x477acd]={'$like':'%'+_0x53c188[_0xfd17('0x31')]['filter']+'%'};return _0x1fc804;})});}_0x430cc4=_[_0xfd17('0x39')]({},_0x430cc4,_0x53c188['options']);return db[_0xfd17('0x5e')][_0xfd17('0x3b')]({'where':_0x430cc4[_0xfd17('0x35')]})[_0xfd17('0x21')](function(_0x5b17f1){_0x530314['count']=_0x5b17f1;if(_0x53c188['query'][_0xfd17('0x3c')]){_0x430cc4[_0xfd17('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xfd17('0x3d')](_0x430cc4);})[_0xfd17('0x21')](function(_0x575c95){_0x530314['rows']=_0x575c95;return _0x530314;});}})['then'](respondWithFilteredResult(_0x4a2634,_0x430cc4))[_0xfd17('0x3f')](handleError(_0x4a2634,null));};exports[_0xfd17('0x5f')]=function(_0x1b02b3,_0x5c3be5,_0x2479b9){var _0x24fee6={'raw':!![],'where':{}};var _0x164a10={};var _0x2418ae={'count':0x0,'rows':[]};return db[_0xfd17('0x2b')][_0xfd17('0x57')]({'where':{'id':_0x1b02b3[_0xfd17('0x55')]['id']}})['then'](handleEntityNotFound(_0x5c3be5,null))[_0xfd17('0x21')](function(_0x9b7298){if(_0x9b7298){_0x164a10[_0xfd17('0x2f')]=_[_0xfd17('0x30')](db[_0xfd17('0x60')][_0xfd17('0x2c')]);_0x164a10[_0xfd17('0x31')]=_[_0xfd17('0x30')](_0x1b02b3['query']);_0x164a10['filters']=_[_0xfd17('0x41')](_0x164a10[_0xfd17('0x2f')],_0x164a10[_0xfd17('0x31')]);_0x24fee6[_0xfd17('0x32')]=_[_0xfd17('0x41')](_0x164a10[_0xfd17('0x2f')],qs[_0xfd17('0x33')](_0x1b02b3[_0xfd17('0x31')][_0xfd17('0x33')]));_0x24fee6[_0xfd17('0x32')]=_0x24fee6[_0xfd17('0x32')]['length']?_0x24fee6[_0xfd17('0x32')]:_0x164a10[_0xfd17('0x2f')];if(!_0x1b02b3[_0xfd17('0x31')]['hasOwnProperty'](_0xfd17('0x59'))){_0x24fee6[_0xfd17('0x1f')]=qs[_0xfd17('0x1f')](_0x1b02b3[_0xfd17('0x31')][_0xfd17('0x1f')]);_0x24fee6['offset']=qs[_0xfd17('0x1d')](_0x1b02b3[_0xfd17('0x31')]['offset']);}_0x24fee6['order']=qs[_0xfd17('0x5b')](_0x1b02b3[_0xfd17('0x31')][_0xfd17('0x5b')]);_0x24fee6[_0xfd17('0x35')]=qs[_0xfd17('0x37')](_[_0xfd17('0x36')](_0x1b02b3[_0xfd17('0x31')],_0x164a10[_0xfd17('0x37')]));_0x24fee6[_0xfd17('0x35')][_0xfd17('0x5c')]=_0x9b7298['id'];if(_0x1b02b3['query'][_0xfd17('0x38')]){_0x24fee6[_0xfd17('0x35')]=_[_0xfd17('0x39')](_0x24fee6['where'],{'$or':_[_0xfd17('0x2a')](_0x24fee6['attributes'],function(_0xb7341f){var _0x4643da={};_0x4643da[_0xb7341f]={'$like':'%'+_0x1b02b3['query'][_0xfd17('0x38')]+'%'};return _0x4643da;})});}_0x24fee6=_[_0xfd17('0x39')]({},_0x24fee6,_0x1b02b3[_0xfd17('0x44')]);return db[_0xfd17('0x60')][_0xfd17('0x3b')]({'where':_0x24fee6[_0xfd17('0x35')]})['then'](function(_0x31eefd){_0x2418ae['count']=_0x31eefd;if(_0x1b02b3[_0xfd17('0x31')][_0xfd17('0x3c')]){_0x24fee6[_0xfd17('0x43')]=[{'all':!![]}];}return db[_0xfd17('0x60')][_0xfd17('0x3d')](_0x24fee6);})[_0xfd17('0x21')](function(_0xb91832){_0x2418ae[_0xfd17('0x3e')]=_0xb91832;return _0x2418ae;});}})[_0xfd17('0x21')](respondWithFilteredResult(_0x5c3be5,_0x24fee6))['catch'](handleError(_0x5c3be5,null));};exports[_0xfd17('0x61')]=function(_0x59aa86,_0x1b8901,_0xe8f7b4){var _0x49ff07={'raw':!![],'where':{}};var _0x595f4f={};var _0x19f7ca={'count':0x0,'rows':[]};return db[_0xfd17('0x2b')][_0xfd17('0x57')]({'where':{'id':_0x59aa86[_0xfd17('0x55')]['id']}})[_0xfd17('0x21')](handleEntityNotFound(_0x1b8901,null))['then'](function(_0x3623c9){if(_0x3623c9){_0x595f4f[_0xfd17('0x2f')]=_[_0xfd17('0x30')](db['CmHopperBlack'][_0xfd17('0x2c')]);_0x595f4f[_0xfd17('0x31')]=_[_0xfd17('0x30')](_0x59aa86[_0xfd17('0x31')]);_0x595f4f['filters']=_[_0xfd17('0x41')](_0x595f4f[_0xfd17('0x2f')],_0x595f4f[_0xfd17('0x31')]);_0x49ff07[_0xfd17('0x32')]=_[_0xfd17('0x41')](_0x595f4f[_0xfd17('0x2f')],qs[_0xfd17('0x33')](_0x59aa86[_0xfd17('0x31')]['fields']));_0x49ff07[_0xfd17('0x32')]=_0x49ff07['attributes'][_0xfd17('0x42')]?_0x49ff07[_0xfd17('0x32')]:_0x595f4f[_0xfd17('0x2f')];if(!_0x59aa86[_0xfd17('0x31')][_0xfd17('0x34')]('nolimit')){_0x49ff07[_0xfd17('0x1f')]=qs[_0xfd17('0x1f')](_0x59aa86[_0xfd17('0x31')][_0xfd17('0x1f')]);_0x49ff07[_0xfd17('0x1d')]=qs[_0xfd17('0x1d')](_0x59aa86[_0xfd17('0x31')][_0xfd17('0x1d')]);}_0x49ff07[_0xfd17('0x5a')]=qs[_0xfd17('0x5b')](_0x59aa86['query'][_0xfd17('0x5b')]);_0x49ff07[_0xfd17('0x35')]=qs[_0xfd17('0x37')](_[_0xfd17('0x36')](_0x59aa86['query'],_0x595f4f[_0xfd17('0x37')]));_0x49ff07[_0xfd17('0x35')]['CampaignId']=_0x3623c9['id'];if(_0x59aa86['query'][_0xfd17('0x38')]){_0x49ff07[_0xfd17('0x35')]=_[_0xfd17('0x39')](_0x49ff07[_0xfd17('0x35')],{'$or':_[_0xfd17('0x2a')](_0x49ff07['attributes'],function(_0x550926){var _0x205e99={};_0x205e99[_0x550926]={'$like':'%'+_0x59aa86[_0xfd17('0x31')][_0xfd17('0x38')]+'%'};return _0x205e99;})});}_0x49ff07=_[_0xfd17('0x39')]({},_0x49ff07,_0x59aa86[_0xfd17('0x44')]);return db[_0xfd17('0x62')]['count']({'where':_0x49ff07[_0xfd17('0x35')]})[_0xfd17('0x21')](function(_0x170506){_0x19f7ca[_0xfd17('0x3b')]=_0x170506;if(_0x59aa86['query'][_0xfd17('0x3c')]){_0x49ff07[_0xfd17('0x43')]=[{'all':!![]}];}return db[_0xfd17('0x62')][_0xfd17('0x3d')](_0x49ff07);})[_0xfd17('0x21')](function(_0x30ab03){_0x19f7ca[_0xfd17('0x3e')]=_0x30ab03;return _0x19f7ca;});}})[_0xfd17('0x21')](respondWithFilteredResult(_0x1b8901,_0x49ff07))[_0xfd17('0x3f')](handleError(_0x1b8901,null));};exports[_0xfd17('0x63')]=function(_0x470652,_0x85fe8c,_0x25268a){var _0x1a6914={};var _0x945a55={};var _0x441fb4;var _0x815a7b;return db[_0xfd17('0x2b')][_0xfd17('0x57')]({'where':{'id':_0x470652[_0xfd17('0x55')]['id']}})['then'](handleEntityNotFound(_0x85fe8c,null))[_0xfd17('0x21')](function(_0x556870){if(_0x556870){_0x441fb4=_0x556870;_0x945a55[_0xfd17('0x2f')]=_['keys'](db[_0xfd17('0x64')]['rawAttributes']);_0x945a55[_0xfd17('0x31')]=_[_0xfd17('0x30')](_0x470652[_0xfd17('0x31')]);_0x945a55[_0xfd17('0x37')]=_[_0xfd17('0x41')](_0x945a55['model'],_0x945a55[_0xfd17('0x31')]);_0x1a6914[_0xfd17('0x32')]=_[_0xfd17('0x41')](_0x945a55['model'],qs[_0xfd17('0x33')](_0x470652[_0xfd17('0x31')][_0xfd17('0x33')]));_0x1a6914[_0xfd17('0x32')]=_0x1a6914[_0xfd17('0x32')]['length']?_0x1a6914['attributes']:_0x945a55[_0xfd17('0x2f')];_0x1a6914[_0xfd17('0x5a')]=qs[_0xfd17('0x5b')](_0x470652[_0xfd17('0x31')][_0xfd17('0x5b')]);_0x1a6914[_0xfd17('0x35')]=qs[_0xfd17('0x37')](_[_0xfd17('0x36')](_0x470652[_0xfd17('0x31')],_0x945a55[_0xfd17('0x37')]));if(_0x470652[_0xfd17('0x31')][_0xfd17('0x38')]){_0x1a6914[_0xfd17('0x35')]=_['merge'](_0x1a6914['where'],{'$or':_[_0xfd17('0x2a')](_0x1a6914[_0xfd17('0x32')],function(_0xf011d1){var _0x3773f9={};_0x3773f9[_0xf011d1]={'$like':'%'+_0x470652[_0xfd17('0x31')]['filter']+'%'};return _0x3773f9;})});}_0x1a6914=_[_0xfd17('0x39')]({},_0x1a6914,_0x470652[_0xfd17('0x44')]);return _0x441fb4[_0xfd17('0x63')](_0x1a6914);}})['then'](function(_0xc1ce63){if(_0xc1ce63){_0x815a7b=_0xc1ce63['length'];if(!_0x470652[_0xfd17('0x31')][_0xfd17('0x34')](_0xfd17('0x59'))){_0x1a6914[_0xfd17('0x1f')]=qs['limit'](_0x470652[_0xfd17('0x31')][_0xfd17('0x1f')]);_0x1a6914[_0xfd17('0x1d')]=qs[_0xfd17('0x1d')](_0x470652[_0xfd17('0x31')]['offset']);}return _0x441fb4[_0xfd17('0x63')](_0x1a6914);}})['then'](function(_0x106e37){if(_0x106e37){return _0x106e37?{'count':_0x815a7b,'rows':_0x106e37}:null;}})[_0xfd17('0x21')](respondWithResult(_0x85fe8c,null))[_0xfd17('0x3f')](handleError(_0x85fe8c,null));};exports['addLists']=function(_0x39a05d,_0x1d4aba,_0x1a2e5c){var _0x18b6ff,_0x335fce;return db[_0xfd17('0x2b')][_0xfd17('0x45')]({'where':{'id':_0x39a05d['params']['id']}})[_0xfd17('0x21')](handleEntityNotFound(_0x1d4aba,null))[_0xfd17('0x21')](function(_0x398438){if(_0x398438){_0x335fce=_0x398438;return _0x398438[_0xfd17('0x65')](_0x39a05d[_0xfd17('0x4f')]['ids'],_[_0xfd17('0x50')](_0x39a05d[_0xfd17('0x4f')],[_0xfd17('0x66'),'id'])||{});}return null;})[_0xfd17('0x67')](function(_0xea5820){var _0x5d60e0;_0x18b6ff=_0xea5820||[];var _0x77e17a=[];if(_0xea5820){for(var _0x311edf=0x0;_0x311edf<_0xea5820[_0xfd17('0x42')];_0x311edf+=0x1){var _0x2a93c8=_0xea5820[_0x311edf][_0xfd17('0x23')]({'plain':!![]});_0x335fce[_0xfd17('0x68')]=_0x39a05d[_0xfd17('0x4f')][_0xfd17('0x68')]?_0x39a05d['body'][_0xfd17('0x68')]:_0x335fce['dialCheckDuplicateType'];switch(_0x335fce[_0xfd17('0x68')]){case _0xfd17('0x69'):_0x5d60e0=squel['insert']()[_0xfd17('0x6a')](_0xfd17('0x6b'))['fromQuery']([_0xfd17('0x6c'),_0xfd17('0x6d'),_0xfd17('0x6e'),_0xfd17('0x6f'),_0xfd17('0x5c'),'createdAt',_0xfd17('0x4e')],squel[_0xfd17('0x70')]()[_0xfd17('0x71')](_0xfd17('0x6c'),_0xfd17('0x6c'))[_0xfd17('0x71')]('NOW()','scheduledAt')[_0xfd17('0x71')]('id',_0xfd17('0x6e'))[_0xfd17('0x71')](_0x2a93c8['CmListId']['toString'](),'ListId')['field'](_0x39a05d[_0xfd17('0x55')]['id'][_0xfd17('0x72')](),_0xfd17('0x5c'))[_0xfd17('0x71')]('NOW()',_0xfd17('0x51'))[_0xfd17('0x71')](_0xfd17('0x73'),_0xfd17('0x4e'))[_0xfd17('0x74')]('cm_contacts')[_0xfd17('0x35')]('deletedAt\x20IS\x20NULL')[_0xfd17('0x35')](_0xfd17('0x75'),_0x2a93c8[_0xfd17('0x76')]['toString']())[_0xfd17('0x35')]('phone\x20IS\x20NOT\x20NULL')[_0xfd17('0x35')](_0xfd17('0x77'),squel[_0xfd17('0x70')]()[_0xfd17('0x71')](_0xfd17('0x78'))[_0xfd17('0x74')]('cm_hopper_final')[_0xfd17('0x35')]('CampaignId\x20=\x20?',_0x39a05d[_0xfd17('0x55')]['id'][_0xfd17('0x72')]()))[_0xfd17('0x35')](_0xfd17('0x77'),squel[_0xfd17('0x70')]()[_0xfd17('0x71')](_0xfd17('0x79'))[_0xfd17('0x74')](_0xfd17('0x6b'))['where'](_0xfd17('0x7a'),_0x39a05d[_0xfd17('0x55')]['id'][_0xfd17('0x72')]())))[_0xfd17('0x72')]();break;case'onlyIfOpen':_0x5d60e0=squel[_0xfd17('0x7b')]()[_0xfd17('0x6a')](_0xfd17('0x6b'))[_0xfd17('0x7c')]([_0xfd17('0x6c'),_0xfd17('0x6d'),'ContactId','ListId',_0xfd17('0x5c'),'createdAt','updatedAt'],squel[_0xfd17('0x70')]()[_0xfd17('0x71')](_0xfd17('0x6c'),'phone')[_0xfd17('0x71')](_0xfd17('0x73'),_0xfd17('0x6d'))['field']('id',_0xfd17('0x6e'))[_0xfd17('0x71')](_0x2a93c8[_0xfd17('0x76')][_0xfd17('0x72')](),_0xfd17('0x6f'))[_0xfd17('0x71')](_0x39a05d[_0xfd17('0x55')]['id'][_0xfd17('0x72')](),_0xfd17('0x5c'))[_0xfd17('0x71')]('NOW()',_0xfd17('0x51'))[_0xfd17('0x71')](_0xfd17('0x73'),_0xfd17('0x4e'))[_0xfd17('0x74')](_0xfd17('0x7d'))[_0xfd17('0x35')]('deletedAt\x20IS\x20NULL')[_0xfd17('0x35')](_0xfd17('0x75'),_0x2a93c8[_0xfd17('0x76')][_0xfd17('0x72')]())['where'](_0xfd17('0x7e'))[_0xfd17('0x35')](_0xfd17('0x77'),squel['select']()[_0xfd17('0x71')](_0xfd17('0x79'))[_0xfd17('0x74')](_0xfd17('0x6b'))[_0xfd17('0x35')](_0xfd17('0x7a'),_0x39a05d[_0xfd17('0x55')]['id'][_0xfd17('0x72')]())))[_0xfd17('0x72')]();break;default:_0x5d60e0=squel['insert']()[_0xfd17('0x6a')]('cm_hopper')[_0xfd17('0x7c')]([_0xfd17('0x6c'),_0xfd17('0x6d'),'ContactId','ListId',_0xfd17('0x5c'),_0xfd17('0x51'),_0xfd17('0x4e')],squel[_0xfd17('0x70')]()[_0xfd17('0x71')](_0xfd17('0x6c'),_0xfd17('0x6c'))[_0xfd17('0x71')](_0xfd17('0x73'),_0xfd17('0x6d'))[_0xfd17('0x71')]('id',_0xfd17('0x6e'))['field'](_0x2a93c8[_0xfd17('0x76')][_0xfd17('0x72')](),'ListId')['field'](_0x39a05d[_0xfd17('0x55')]['id'][_0xfd17('0x72')](),_0xfd17('0x5c'))[_0xfd17('0x71')](_0xfd17('0x73'),_0xfd17('0x51'))[_0xfd17('0x71')](_0xfd17('0x73'),_0xfd17('0x4e'))[_0xfd17('0x74')]('cm_contacts')[_0xfd17('0x35')](_0xfd17('0x7f'))[_0xfd17('0x35')](_0xfd17('0x75'),_0x2a93c8[_0xfd17('0x76')][_0xfd17('0x72')]())[_0xfd17('0x35')]('phone\x20IS\x20NOT\x20NULL'))[_0xfd17('0x72')]();}_0x77e17a[_0xfd17('0x80')](db[_0xfd17('0x81')][_0xfd17('0x31')](_0x5d60e0));}return BPromise[_0xfd17('0x82')](_0x77e17a);}})[_0xfd17('0x21')](function(){return _0x18b6ff;})[_0xfd17('0x21')](respondWithResult(_0x1d4aba,null))[_0xfd17('0x3f')](handleError(_0x1d4aba,null));};exports['removeLists']=function(_0x3a9f34,_0x42599d,_0x4e545a){return db[_0xfd17('0x2b')][_0xfd17('0x45')]({'where':{'id':_0x3a9f34['params']['id']}})['then'](handleEntityNotFound(_0x42599d,null))[_0xfd17('0x21')](function(_0xd61388){if(_0xd61388){return _0xd61388[_0xfd17('0x83')](_0x3a9f34[_0xfd17('0x31')][_0xfd17('0x66')]);}})[_0xfd17('0x21')](function(_0x4c462e){if(_0x4c462e){return db[_0xfd17('0x58')][_0xfd17('0x22')]({'where':{'ListId':_0x3a9f34['query'][_0xfd17('0x66')],'CampaignId':_0x3a9f34[_0xfd17('0x55')]['id']}})['then'](function(){return _0x4c462e;});}})['then'](respondWithStatusCode(_0x42599d,null))[_0xfd17('0x3f')](handleError(_0x42599d,null));};exports[_0xfd17('0x84')]=function(_0xde37cb,_0x5b3cd8,_0x4de6f1){var _0x3883f7={};var _0x2351b7={};var _0x5844f9;var _0x26a33a;return db['Campaign'][_0xfd17('0x57')]({'where':{'id':_0xde37cb[_0xfd17('0x55')]['id']}})['then'](handleEntityNotFound(_0x5b3cd8,null))[_0xfd17('0x21')](function(_0x42bad7){if(_0x42bad7){_0x5844f9=_0x42bad7;_0x2351b7[_0xfd17('0x2f')]=_[_0xfd17('0x30')](db[_0xfd17('0x64')][_0xfd17('0x2c')]);_0x2351b7[_0xfd17('0x31')]=_[_0xfd17('0x30')](_0xde37cb[_0xfd17('0x31')]);_0x2351b7[_0xfd17('0x37')]=_[_0xfd17('0x41')](_0x2351b7[_0xfd17('0x2f')],_0x2351b7['query']);_0x3883f7['attributes']=_[_0xfd17('0x41')](_0x2351b7['model'],qs['fields'](_0xde37cb[_0xfd17('0x31')][_0xfd17('0x33')]));_0x3883f7[_0xfd17('0x32')]=_0x3883f7['attributes'][_0xfd17('0x42')]?_0x3883f7[_0xfd17('0x32')]:_0x2351b7[_0xfd17('0x2f')];_0x3883f7[_0xfd17('0x5a')]=qs['sort'](_0xde37cb[_0xfd17('0x31')]['sort']);_0x3883f7['where']=qs['filters'](_[_0xfd17('0x36')](_0xde37cb['query'],_0x2351b7[_0xfd17('0x37')]));if(_0xde37cb['query']['filter']){_0x3883f7['where']=_[_0xfd17('0x39')](_0x3883f7['where'],{'$or':_['map'](_0x3883f7['attributes'],function(_0x1fc5ed){var _0x36a686={};_0x36a686[_0x1fc5ed]={'$like':'%'+_0xde37cb['query']['filter']+'%'};return _0x36a686;})});}_0x3883f7=_[_0xfd17('0x39')]({},_0x3883f7,_0xde37cb[_0xfd17('0x44')]);return _0x5844f9[_0xfd17('0x84')](_0x3883f7);}})['then'](function(_0xff1f){if(_0xff1f){_0x26a33a=_0xff1f['length'];if(!_0xde37cb[_0xfd17('0x31')][_0xfd17('0x34')](_0xfd17('0x59'))){_0x3883f7[_0xfd17('0x1f')]=qs[_0xfd17('0x1f')](_0xde37cb['query'][_0xfd17('0x1f')]);_0x3883f7[_0xfd17('0x1d')]=qs[_0xfd17('0x1d')](_0xde37cb[_0xfd17('0x31')][_0xfd17('0x1d')]);}return _0x5844f9[_0xfd17('0x84')](_0x3883f7);}})[_0xfd17('0x21')](function(_0x2770bc){if(_0x2770bc){return _0x2770bc?{'count':_0x26a33a,'rows':_0x2770bc}:null;}})[_0xfd17('0x21')](respondWithResult(_0x5b3cd8,null))['catch'](handleError(_0x5b3cd8,null));};exports[_0xfd17('0x85')]=function(_0x40a79e,_0x2063df,_0x4dc5f3){var _0x5d0f6e,_0x3c9a91;return db[_0xfd17('0x2b')][_0xfd17('0x45')]({'where':{'id':_0x40a79e['params']['id']}})[_0xfd17('0x21')](handleEntityNotFound(_0x2063df,null))['then'](function(_0x3741df){if(_0x3741df){_0x3c9a91=_0x3741df;return _0x3741df[_0xfd17('0x85')](_0x40a79e[_0xfd17('0x4f')][_0xfd17('0x66')],_[_0xfd17('0x50')](_0x40a79e[_0xfd17('0x4f')],['ids','id'])||{});}return null;})['spread'](function(_0x3c5b30){var _0x1e7d18;_0x5d0f6e=_0x3c5b30||[];var _0x1d70a4=[];if(_0x3c5b30){for(var _0x13fd56=0x0;_0x13fd56<_0x3c5b30['length'];_0x13fd56+=0x1){var _0x2265bb=_0x3c5b30[_0x13fd56][_0xfd17('0x23')]({'plain':!![]});_0x1e7d18=squel[_0xfd17('0x7b')]()['into'](_0xfd17('0x86'))[_0xfd17('0x7c')](['phone',_0xfd17('0x6e'),_0xfd17('0x6f'),_0xfd17('0x5c'),'createdAt',_0xfd17('0x4e')],squel[_0xfd17('0x70')]()[_0xfd17('0x71')]('phone',_0xfd17('0x6c'))[_0xfd17('0x71')]('id',_0xfd17('0x6e'))[_0xfd17('0x71')](_0x2265bb[_0xfd17('0x76')]['toString'](),'ListId')[_0xfd17('0x71')](_0x40a79e['params']['id']['toString'](),_0xfd17('0x5c'))[_0xfd17('0x71')](_0xfd17('0x73'),_0xfd17('0x51'))[_0xfd17('0x71')](_0xfd17('0x73'),_0xfd17('0x4e'))[_0xfd17('0x74')]('cm_contacts')['where'](_0xfd17('0x7f'))[_0xfd17('0x35')](_0xfd17('0x75'),_0x2265bb['CmListId'][_0xfd17('0x72')]())[_0xfd17('0x35')]('phone\x20IS\x20NOT\x20NULL'))[_0xfd17('0x72')]();_0x1d70a4[_0xfd17('0x80')](db[_0xfd17('0x81')][_0xfd17('0x31')](_0x1e7d18));}return BPromise[_0xfd17('0x82')](_0x1d70a4);}})[_0xfd17('0x21')](function(){return _0x5d0f6e;})['then'](respondWithResult(_0x2063df,null))[_0xfd17('0x3f')](handleError(_0x2063df,null));};exports['removeBlackLists']=function(_0x15f3a5,_0x5d891f,_0x14e9f8){return db[_0xfd17('0x2b')][_0xfd17('0x45')]({'where':{'id':_0x15f3a5[_0xfd17('0x55')]['id']}})['then'](handleEntityNotFound(_0x5d891f,null))['then'](function(_0x3dc000){if(_0x3dc000){return _0x3dc000['removeBlackLists'](_0x15f3a5[_0xfd17('0x31')][_0xfd17('0x66')]);}})['then'](function(_0x42fd5b){if(_0x42fd5b){return db['CmHopperBlack'][_0xfd17('0x22')]({'where':{'ListId':_0x15f3a5['query']['ids'],'CampaignId':_0x15f3a5[_0xfd17('0x55')]['id']}})[_0xfd17('0x21')](function(){return _0x42fd5b;});}})['then'](respondWithStatusCode(_0x5d891f,null))[_0xfd17('0x3f')](handleError(_0x5d891f,null));};
\ No newline at end of file
+var _0x6a74=['options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','createdAt','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','pick','includeAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','fromQuery','phone','scheduledAt','ListId','select','field','ContactId','toString','updatedAt','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','insert','NOW()','CmListId','cm_contacts','into','sequelize','all','removeLists','getBlackLists','addBlackLists','push','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','UserProfileResource','error','name','index','map','Campaign','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','rawAttributes'];(function(_0x327496,_0x1e2077){var _0x2a875c=function(_0x2946ab){while(--_0x2946ab){_0x327496['push'](_0x327496['shift']());}};_0x2a875c(++_0x1e2077);}(_0x6a74,0x153));var _0x46a7=function(_0x5d226c,_0x45d836){_0x5d226c=_0x5d226c-0x0;var _0x1e3a7c=_0x6a74[_0x5d226c];return _0x1e3a7c;};'use strict';var emlformat=require(_0x46a7('0x0'));var rimraf=require(_0x46a7('0x1'));var zipdir=require(_0x46a7('0x2'));var jsonpatch=require(_0x46a7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x46a7('0x4'));var Mustache=require(_0x46a7('0x5'));var util=require(_0x46a7('0x6'));var path=require(_0x46a7('0x7'));var sox=require(_0x46a7('0x8'));var csv=require(_0x46a7('0x9'));var ejs=require(_0x46a7('0xa'));var fs=require('fs');var fs_extra=require(_0x46a7('0xb'));var _=require(_0x46a7('0xc'));var squel=require(_0x46a7('0xd'));var crypto=require(_0x46a7('0xe'));var jsforce=require(_0x46a7('0xf'));var deskjs=require(_0x46a7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x46a7('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46a7('0x12'));var logger=require(_0x46a7('0x13'))(_0x46a7('0x14'));var utils=require(_0x46a7('0x15'));var config=require(_0x46a7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x46a7('0x17'))['db'];function respondWithStatusCode(_0x1f9826,_0x544fd0){_0x544fd0=_0x544fd0||0xcc;return function(_0x492def){if(_0x492def){return _0x1f9826[_0x46a7('0x18')](_0x544fd0);}return _0x1f9826[_0x46a7('0x19')](_0x544fd0)[_0x46a7('0x1a')]();};}function respondWithResult(_0x109ab3,_0x40ba95){_0x40ba95=_0x40ba95||0xc8;return function(_0x55d04e){if(_0x55d04e){return _0x109ab3[_0x46a7('0x19')](_0x40ba95)[_0x46a7('0x1b')](_0x55d04e);}};}function respondWithFilteredResult(_0x1b09c5,_0x480424){return function(_0x4d959f){if(_0x4d959f){var _0x146cb7=typeof _0x480424[_0x46a7('0x1c')]===_0x46a7('0x1d')&&typeof _0x480424[_0x46a7('0x1e')]===_0x46a7('0x1d');var _0x412318=_0x4d959f[_0x46a7('0x1f')];var _0x376b92=_0x146cb7?0x0:_0x480424[_0x46a7('0x1c')];var _0xdcc478=_0x146cb7?_0x4d959f[_0x46a7('0x1f')]:_0x480424['offset']+_0x480424['limit'];var _0x785e3f;if(_0xdcc478>=_0x412318){_0xdcc478=_0x412318;_0x785e3f=0xc8;}else{_0x785e3f=0xce;}_0x1b09c5['status'](_0x785e3f);return _0x1b09c5[_0x46a7('0x20')](_0x46a7('0x21'),_0x376b92+'-'+_0xdcc478+'/'+_0x412318)[_0x46a7('0x1b')](_0x4d959f);}return null;};}function patchUpdates(_0x14d02d){return function(_0x1895c9){try{jsonpatch[_0x46a7('0x22')](_0x1895c9,_0x14d02d,!![]);}catch(_0x187c26){return BPromise['reject'](_0x187c26);}return _0x1895c9['save']();};}function saveUpdates(_0x2f322a,_0x3f7bfe){return function(_0x5a516e){if(_0x5a516e){return _0x5a516e[_0x46a7('0x23')](_0x2f322a)[_0x46a7('0x24')](function(_0x50a78a){return _0x50a78a;});}return null;};}function removeEntity(_0x521a38,_0x1f746d){return function(_0x4b21c7){if(_0x4b21c7){return _0x4b21c7[_0x46a7('0x25')]()['then'](function(){var _0x416db0=_0x4b21c7['get']({'plain':!![]});var _0x385610='IvrCampaigns';return db[_0x46a7('0x26')][_0x46a7('0x25')]({'where':{'type':_0x385610,'resourceId':_0x416db0['id']}})[_0x46a7('0x24')](function(){return _0x4b21c7;});})[_0x46a7('0x24')](function(){_0x521a38[_0x46a7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x439d8a,_0x4f3e52){return function(_0x165168){if(!_0x165168){_0x439d8a[_0x46a7('0x18')](0x194);}return _0x165168;};}function handleError(_0x2ed66c,_0x4af5f5){_0x4af5f5=_0x4af5f5||0x1f4;return function(_0x4aed9e){logger[_0x46a7('0x27')](_0x4aed9e['stack']);if(_0x4aed9e[_0x46a7('0x28')]){delete _0x4aed9e[_0x46a7('0x28')];}_0x2ed66c['status'](_0x4af5f5)['send'](_0x4aed9e);};}exports[_0x46a7('0x29')]=function(_0x23305d,_0x2ab694){var _0xa40d98={},_0x3180dc={},_0x22756c={'count':0x0,'rows':[]};var _0x378c19=_[_0x46a7('0x2a')](db[_0x46a7('0x2b')]['rawAttributes'],function(_0x22bb31){return{'name':_0x22bb31['fieldName'],'type':_0x22bb31[_0x46a7('0x2c')][_0x46a7('0x2d')]};});_0x3180dc[_0x46a7('0x2e')]=_[_0x46a7('0x2a')](_0x378c19,_0x46a7('0x28'));_0x3180dc[_0x46a7('0x2f')]=_[_0x46a7('0x30')](_0x23305d[_0x46a7('0x2f')]);_0x3180dc[_0x46a7('0x31')]=_[_0x46a7('0x32')](_0x3180dc[_0x46a7('0x2e')],_0x3180dc[_0x46a7('0x2f')]);_0xa40d98['attributes']=_[_0x46a7('0x32')](_0x3180dc['model'],qs[_0x46a7('0x33')](_0x23305d[_0x46a7('0x2f')][_0x46a7('0x33')]));_0xa40d98[_0x46a7('0x34')]=_0xa40d98['attributes'][_0x46a7('0x35')]?_0xa40d98[_0x46a7('0x34')]:_0x3180dc['model'];if(!_0x23305d[_0x46a7('0x2f')]['hasOwnProperty']('nolimit')){_0xa40d98[_0x46a7('0x1e')]=qs[_0x46a7('0x1e')](_0x23305d[_0x46a7('0x2f')]['limit']);_0xa40d98[_0x46a7('0x1c')]=qs['offset'](_0x23305d[_0x46a7('0x2f')][_0x46a7('0x1c')]);}_0xa40d98[_0x46a7('0x36')]=qs[_0x46a7('0x37')](_0x23305d['query'][_0x46a7('0x37')]);_0xa40d98[_0x46a7('0x38')]=qs[_0x46a7('0x31')](_['pick'](_0x23305d[_0x46a7('0x2f')],_0x3180dc[_0x46a7('0x31')]),_0x378c19);if(_0x23305d['query'][_0x46a7('0x39')]){_0xa40d98[_0x46a7('0x38')]=_[_0x46a7('0x3a')](_0xa40d98[_0x46a7('0x38')],{'$or':_[_0x46a7('0x2a')](_0x378c19,function(_0x42f2c6){if(_0x42f2c6['type']!==_0x46a7('0x3b')){var _0x14ab0a={};_0x14ab0a[_0x42f2c6[_0x46a7('0x28')]]={'$like':'%'+_0x23305d['query'][_0x46a7('0x39')]+'%'};return _0x14ab0a;}})});}_0xa40d98=_[_0x46a7('0x3a')]({},_0xa40d98,_0x23305d['options']);var _0x153de0={'where':_0xa40d98[_0x46a7('0x38')]};return db[_0x46a7('0x2b')][_0x46a7('0x1f')](_0x153de0)[_0x46a7('0x24')](function(_0x3f1a59){_0x22756c[_0x46a7('0x1f')]=_0x3f1a59;if(_0x23305d[_0x46a7('0x2f')]['includeAll']){_0xa40d98[_0x46a7('0x3c')]=[{'all':!![]}];}return db[_0x46a7('0x2b')][_0x46a7('0x3d')](_0xa40d98);})[_0x46a7('0x24')](function(_0x38e10a){_0x22756c[_0x46a7('0x3e')]=_0x38e10a;return _0x22756c;})[_0x46a7('0x24')](respondWithFilteredResult(_0x2ab694,_0xa40d98))[_0x46a7('0x3f')](handleError(_0x2ab694,null));};exports[_0x46a7('0x40')]=function(_0x503b62,_0x5763d2){var _0x34525c={'raw':![],'where':{'id':_0x503b62['params']['id']}},_0x51224f={};_0x51224f[_0x46a7('0x2e')]=_['keys'](db[_0x46a7('0x2b')][_0x46a7('0x41')]);_0x51224f['query']=_['keys'](_0x503b62[_0x46a7('0x2f')]);_0x51224f[_0x46a7('0x31')]=_[_0x46a7('0x32')](_0x51224f[_0x46a7('0x2e')],_0x51224f[_0x46a7('0x2f')]);_0x34525c['attributes']=_[_0x46a7('0x32')](_0x51224f[_0x46a7('0x2e')],qs[_0x46a7('0x33')](_0x503b62[_0x46a7('0x2f')]['fields']));_0x34525c[_0x46a7('0x34')]=_0x34525c[_0x46a7('0x34')][_0x46a7('0x35')]?_0x34525c[_0x46a7('0x34')]:_0x51224f[_0x46a7('0x2e')];if(_0x503b62['query']['includeAll']){_0x34525c[_0x46a7('0x3c')]=[{'all':!![]}];}_0x34525c=_[_0x46a7('0x3a')]({},_0x34525c,_0x503b62[_0x46a7('0x42')]);return db[_0x46a7('0x2b')][_0x46a7('0x43')](_0x34525c)[_0x46a7('0x24')](handleEntityNotFound(_0x5763d2,null))[_0x46a7('0x24')](respondWithResult(_0x5763d2,null))['catch'](handleError(_0x5763d2,null));};exports[_0x46a7('0x44')]=function(_0x363c36,_0x318978){return db[_0x46a7('0x2b')][_0x46a7('0x44')](_0x363c36[_0x46a7('0x45')],{})[_0x46a7('0x24')](function(_0xca4195){var _0x2f9fa2=_0x363c36[_0x46a7('0x46')][_0x46a7('0x47')]({'plain':!![]});if(!_0x2f9fa2)throw new Error(_0x46a7('0x48'));if(_0x2f9fa2[_0x46a7('0x49')]===_0x46a7('0x46')){var _0x2d8766=_0xca4195[_0x46a7('0x47')]({'plain':!![]});var _0x170e6c=_0x46a7('0x4a');return db[_0x46a7('0x4b')][_0x46a7('0x43')]({'where':{'name':_0x170e6c,'userProfileId':_0x2f9fa2[_0x46a7('0x4c')]},'raw':!![]})[_0x46a7('0x24')](function(_0xac63bb){if(_0xac63bb&&_0xac63bb[_0x46a7('0x4d')]===0x0){return db[_0x46a7('0x26')][_0x46a7('0x44')]({'name':_0x2d8766[_0x46a7('0x28')],'resourceId':_0x2d8766['id'],'type':_0xac63bb[_0x46a7('0x28')],'sectionId':_0xac63bb['id']},{})[_0x46a7('0x24')](function(){return _0xca4195;});}else{return _0xca4195;}})[_0x46a7('0x3f')](function(_0x391de7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x391de7);throw _0x391de7;});}return _0xca4195;})[_0x46a7('0x24')](respondWithResult(_0x318978,0xc9))[_0x46a7('0x3f')](handleError(_0x318978,null));};exports[_0x46a7('0x4e')]=function(_0x439ec5,_0x2c5b57){var _0x11c43f={'where':{'id':_0x439ec5['params']['id']}},_0x3234a0={};_0x3234a0[_0x46a7('0x2e')]=_['keys'](db[_0x46a7('0x2b')]['rawAttributes']);_0x11c43f[_0x46a7('0x34')]=_[_0x46a7('0x32')](_0x3234a0[_0x46a7('0x2e')],qs[_0x46a7('0x33')](_0x439ec5[_0x46a7('0x2f')]['fields']));_0x11c43f['attributes']=_0x11c43f[_0x46a7('0x34')]['length']?_0x11c43f['attributes']:_0x3234a0['model'];if(_0x439ec5['query']['includeAll']){_0x11c43f[_0x46a7('0x3c')]=[{'all':!![]}];}_0x11c43f=_['merge']({},_0x11c43f,_0x439ec5[_0x46a7('0x42')]);return db[_0x46a7('0x2b')][_0x46a7('0x43')](_0x11c43f)[_0x46a7('0x24')](handleEntityNotFound(_0x2c5b57,null))[_0x46a7('0x24')](function(_0x93e374){if(_0x93e374){var _0x4f4119=_0x93e374[_0x46a7('0x47')]({'plain':!![]});_0x4f4119=qs['omit'](_0x4f4119,['id',_0x46a7('0x4f'),'updatedAt']);_0x439ec5[_0x46a7('0x45')]=_[_0x46a7('0x50')](_0x439ec5[_0x46a7('0x45')],['id',_0x46a7('0x4f'),'updatedAt']);return db[_0x46a7('0x2b')][_0x46a7('0x44')](_['merge'](_0x4f4119,_0x439ec5[_0x46a7('0x45')]),{'include':_0x439ec5[_0x46a7('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0x46a7('0x24')](function(_0x35f1b4){var _0x3e5a4c=_0x439ec5[_0x46a7('0x46')][_0x46a7('0x47')]({'plain':!![]});if(!_0x3e5a4c)throw new Error(_0x46a7('0x48'));if(_0x3e5a4c[_0x46a7('0x49')]==='user'){var _0x354dd6=_0x35f1b4[_0x46a7('0x47')]({'plain':!![]});var _0x732d16=_0x46a7('0x4a');return db[_0x46a7('0x4b')]['find']({'where':{'name':_0x732d16,'userProfileId':_0x3e5a4c[_0x46a7('0x4c')]},'raw':!![]})[_0x46a7('0x24')](function(_0x208146){if(_0x208146&&_0x208146[_0x46a7('0x4d')]===0x0){return db['UserProfileResource'][_0x46a7('0x44')]({'name':_0x354dd6[_0x46a7('0x28')],'resourceId':_0x354dd6['id'],'type':_0x208146['name'],'sectionId':_0x208146['id']},{})[_0x46a7('0x24')](function(){return _0x35f1b4;});}else{return _0x35f1b4;}})[_0x46a7('0x3f')](function(_0x4cbb6b){logger[_0x46a7('0x27')](_0x46a7('0x51'),_0x4cbb6b);throw _0x4cbb6b;});}return _0x35f1b4;});}})[_0x46a7('0x24')](respondWithResult(_0x2c5b57,0xc9))[_0x46a7('0x3f')](handleError(_0x2c5b57,null));};exports[_0x46a7('0x23')]=function(_0x5942a0,_0x522767){if(_0x5942a0[_0x46a7('0x45')]['id']){delete _0x5942a0['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x5942a0['params']['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0x522767,null))[_0x46a7('0x24')](saveUpdates(_0x5942a0['body'],null))[_0x46a7('0x24')](respondWithResult(_0x522767,null))[_0x46a7('0x3f')](handleError(_0x522767,null));};exports[_0x46a7('0x25')]=function(_0x478dbd,_0x38a9b9){return db[_0x46a7('0x2b')][_0x46a7('0x43')]({'where':{'id':_0x478dbd[_0x46a7('0x52')]['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0x38a9b9,null))['then'](removeEntity(_0x38a9b9,null))[_0x46a7('0x3f')](handleError(_0x38a9b9,null));};exports[_0x46a7('0x53')]=function(_0x32c415,_0x2b6215,_0x8011ce){var _0xf4ed56={'raw':!![],'where':{}};var _0x47cfd9={};var _0x137d9d={'count':0x0,'rows':[]};return db[_0x46a7('0x2b')][_0x46a7('0x54')]({'where':{'id':_0x32c415[_0x46a7('0x52')]['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0x2b6215,null))[_0x46a7('0x24')](function(_0xd1892b){if(_0xd1892b){_0x47cfd9['model']=_[_0x46a7('0x30')](db[_0x46a7('0x55')][_0x46a7('0x41')]);_0x47cfd9[_0x46a7('0x2f')]=_['keys'](_0x32c415[_0x46a7('0x2f')]);_0x47cfd9[_0x46a7('0x31')]=_[_0x46a7('0x32')](_0x47cfd9['model'],_0x47cfd9[_0x46a7('0x2f')]);_0xf4ed56[_0x46a7('0x34')]=_[_0x46a7('0x32')](_0x47cfd9[_0x46a7('0x2e')],qs[_0x46a7('0x33')](_0x32c415['query'][_0x46a7('0x33')]));_0xf4ed56[_0x46a7('0x34')]=_0xf4ed56[_0x46a7('0x34')][_0x46a7('0x35')]?_0xf4ed56[_0x46a7('0x34')]:_0x47cfd9[_0x46a7('0x2e')];if(!_0x32c415[_0x46a7('0x2f')][_0x46a7('0x56')](_0x46a7('0x57'))){_0xf4ed56['limit']=qs[_0x46a7('0x1e')](_0x32c415['query'][_0x46a7('0x1e')]);_0xf4ed56[_0x46a7('0x1c')]=qs[_0x46a7('0x1c')](_0x32c415[_0x46a7('0x2f')]['offset']);}_0xf4ed56['order']=qs['sort'](_0x32c415[_0x46a7('0x2f')][_0x46a7('0x37')]);_0xf4ed56[_0x46a7('0x38')]=qs[_0x46a7('0x31')](_[_0x46a7('0x58')](_0x32c415[_0x46a7('0x2f')],_0x47cfd9[_0x46a7('0x31')]));_0xf4ed56[_0x46a7('0x38')]['CampaignId']=_0xd1892b['id'];if(_0x32c415['query'][_0x46a7('0x39')]){_0xf4ed56[_0x46a7('0x38')]=_[_0x46a7('0x3a')](_0xf4ed56[_0x46a7('0x38')],{'$or':_[_0x46a7('0x2a')](_0xf4ed56[_0x46a7('0x34')],function(_0x59cb5d){var _0x488a86={};_0x488a86[_0x59cb5d]={'$like':'%'+_0x32c415[_0x46a7('0x2f')][_0x46a7('0x39')]+'%'};return _0x488a86;})});}_0xf4ed56=_[_0x46a7('0x3a')]({},_0xf4ed56,_0x32c415[_0x46a7('0x42')]);return db[_0x46a7('0x55')][_0x46a7('0x1f')]({'where':_0xf4ed56[_0x46a7('0x38')]})[_0x46a7('0x24')](function(_0x57e6dc){_0x137d9d[_0x46a7('0x1f')]=_0x57e6dc;if(_0x32c415['query'][_0x46a7('0x59')]){_0xf4ed56['include']=[{'all':!![]}];}return db[_0x46a7('0x55')][_0x46a7('0x3d')](_0xf4ed56);})['then'](function(_0x525a1e){_0x137d9d[_0x46a7('0x3e')]=_0x525a1e;return _0x137d9d;});}})['then'](respondWithFilteredResult(_0x2b6215,_0xf4ed56))[_0x46a7('0x3f')](handleError(_0x2b6215,null));};exports[_0x46a7('0x5a')]=function(_0x22406c,_0xa34bfe,_0x1c6537){var _0x157d6b={'raw':!![],'where':{}};var _0x25ea4e={};var _0x3ce21e={'count':0x0,'rows':[]};return db[_0x46a7('0x2b')][_0x46a7('0x54')]({'where':{'id':_0x22406c['params']['id']}})['then'](handleEntityNotFound(_0xa34bfe,null))[_0x46a7('0x24')](function(_0x1f9565){if(_0x1f9565){_0x25ea4e[_0x46a7('0x2e')]=_[_0x46a7('0x30')](db[_0x46a7('0x5b')]['rawAttributes']);_0x25ea4e[_0x46a7('0x2f')]=_[_0x46a7('0x30')](_0x22406c['query']);_0x25ea4e['filters']=_[_0x46a7('0x32')](_0x25ea4e[_0x46a7('0x2e')],_0x25ea4e[_0x46a7('0x2f')]);_0x157d6b[_0x46a7('0x34')]=_[_0x46a7('0x32')](_0x25ea4e[_0x46a7('0x2e')],qs[_0x46a7('0x33')](_0x22406c[_0x46a7('0x2f')][_0x46a7('0x33')]));_0x157d6b[_0x46a7('0x34')]=_0x157d6b[_0x46a7('0x34')]['length']?_0x157d6b[_0x46a7('0x34')]:_0x25ea4e[_0x46a7('0x2e')];if(!_0x22406c['query'][_0x46a7('0x56')](_0x46a7('0x57'))){_0x157d6b[_0x46a7('0x1e')]=qs[_0x46a7('0x1e')](_0x22406c[_0x46a7('0x2f')][_0x46a7('0x1e')]);_0x157d6b[_0x46a7('0x1c')]=qs[_0x46a7('0x1c')](_0x22406c[_0x46a7('0x2f')][_0x46a7('0x1c')]);}_0x157d6b[_0x46a7('0x36')]=qs[_0x46a7('0x37')](_0x22406c['query'][_0x46a7('0x37')]);_0x157d6b['where']=qs['filters'](_[_0x46a7('0x58')](_0x22406c[_0x46a7('0x2f')],_0x25ea4e[_0x46a7('0x31')]));_0x157d6b[_0x46a7('0x38')][_0x46a7('0x5c')]=_0x1f9565['id'];if(_0x22406c['query']['filter']){_0x157d6b[_0x46a7('0x38')]=_[_0x46a7('0x3a')](_0x157d6b[_0x46a7('0x38')],{'$or':_[_0x46a7('0x2a')](_0x157d6b[_0x46a7('0x34')],function(_0x4dd9f0){var _0x1a7779={};_0x1a7779[_0x4dd9f0]={'$like':'%'+_0x22406c['query'][_0x46a7('0x39')]+'%'};return _0x1a7779;})});}_0x157d6b=_['merge']({},_0x157d6b,_0x22406c[_0x46a7('0x42')]);return db[_0x46a7('0x5b')][_0x46a7('0x1f')]({'where':_0x157d6b['where']})['then'](function(_0x403907){_0x3ce21e[_0x46a7('0x1f')]=_0x403907;if(_0x22406c['query'][_0x46a7('0x59')]){_0x157d6b[_0x46a7('0x3c')]=[{'all':!![]}];}return db[_0x46a7('0x5b')][_0x46a7('0x3d')](_0x157d6b);})['then'](function(_0x1f9008){_0x3ce21e['rows']=_0x1f9008;return _0x3ce21e;});}})['then'](respondWithFilteredResult(_0xa34bfe,_0x157d6b))[_0x46a7('0x3f')](handleError(_0xa34bfe,null));};exports[_0x46a7('0x5d')]=function(_0x3b34b6,_0x12c19d,_0x315fa4){var _0x52c118={'raw':!![],'where':{}};var _0x2d2e3e={};var _0x58a9fd={'count':0x0,'rows':[]};return db[_0x46a7('0x2b')][_0x46a7('0x54')]({'where':{'id':_0x3b34b6['params']['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0x12c19d,null))[_0x46a7('0x24')](function(_0xd23de2){if(_0xd23de2){_0x2d2e3e[_0x46a7('0x2e')]=_[_0x46a7('0x30')](db['CmHopperFinal']['rawAttributes']);_0x2d2e3e[_0x46a7('0x2f')]=_['keys'](_0x3b34b6[_0x46a7('0x2f')]);_0x2d2e3e[_0x46a7('0x31')]=_[_0x46a7('0x32')](_0x2d2e3e[_0x46a7('0x2e')],_0x2d2e3e[_0x46a7('0x2f')]);_0x52c118[_0x46a7('0x34')]=_['intersection'](_0x2d2e3e[_0x46a7('0x2e')],qs[_0x46a7('0x33')](_0x3b34b6['query']['fields']));_0x52c118[_0x46a7('0x34')]=_0x52c118[_0x46a7('0x34')][_0x46a7('0x35')]?_0x52c118[_0x46a7('0x34')]:_0x2d2e3e[_0x46a7('0x2e')];if(!_0x3b34b6[_0x46a7('0x2f')]['hasOwnProperty'](_0x46a7('0x57'))){_0x52c118[_0x46a7('0x1e')]=qs[_0x46a7('0x1e')](_0x3b34b6['query'][_0x46a7('0x1e')]);_0x52c118[_0x46a7('0x1c')]=qs[_0x46a7('0x1c')](_0x3b34b6[_0x46a7('0x2f')][_0x46a7('0x1c')]);}_0x52c118[_0x46a7('0x36')]=qs[_0x46a7('0x37')](_0x3b34b6[_0x46a7('0x2f')][_0x46a7('0x37')]);_0x52c118['where']=qs[_0x46a7('0x31')](_[_0x46a7('0x58')](_0x3b34b6[_0x46a7('0x2f')],_0x2d2e3e[_0x46a7('0x31')]));_0x52c118['where']['CampaignId']=_0xd23de2['id'];if(_0x3b34b6['query'][_0x46a7('0x39')]){_0x52c118[_0x46a7('0x38')]=_['merge'](_0x52c118[_0x46a7('0x38')],{'$or':_[_0x46a7('0x2a')](_0x52c118[_0x46a7('0x34')],function(_0x22dbdc){var _0x3b5396={};_0x3b5396[_0x22dbdc]={'$like':'%'+_0x3b34b6['query']['filter']+'%'};return _0x3b5396;})});}_0x52c118=_[_0x46a7('0x3a')]({},_0x52c118,_0x3b34b6[_0x46a7('0x42')]);return db[_0x46a7('0x5e')][_0x46a7('0x1f')]({'where':_0x52c118[_0x46a7('0x38')]})['then'](function(_0x23aa5b){_0x58a9fd[_0x46a7('0x1f')]=_0x23aa5b;if(_0x3b34b6[_0x46a7('0x2f')][_0x46a7('0x59')]){_0x52c118['include']=[{'all':!![]}];}return db[_0x46a7('0x5e')][_0x46a7('0x3d')](_0x52c118);})[_0x46a7('0x24')](function(_0x24a074){_0x58a9fd[_0x46a7('0x3e')]=_0x24a074;return _0x58a9fd;});}})[_0x46a7('0x24')](respondWithFilteredResult(_0x12c19d,_0x52c118))[_0x46a7('0x3f')](handleError(_0x12c19d,null));};exports[_0x46a7('0x5f')]=function(_0xca7c1c,_0x560196,_0x434add){var _0x54be08={'raw':!![],'where':{}};var _0x441632={};var _0x18aa72={'count':0x0,'rows':[]};return db[_0x46a7('0x2b')][_0x46a7('0x54')]({'where':{'id':_0xca7c1c[_0x46a7('0x52')]['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0x560196,null))['then'](function(_0x29cef1){if(_0x29cef1){_0x441632[_0x46a7('0x2e')]=_[_0x46a7('0x30')](db[_0x46a7('0x60')]['rawAttributes']);_0x441632[_0x46a7('0x2f')]=_['keys'](_0xca7c1c[_0x46a7('0x2f')]);_0x441632[_0x46a7('0x31')]=_['intersection'](_0x441632['model'],_0x441632['query']);_0x54be08[_0x46a7('0x34')]=_[_0x46a7('0x32')](_0x441632['model'],qs[_0x46a7('0x33')](_0xca7c1c[_0x46a7('0x2f')][_0x46a7('0x33')]));_0x54be08[_0x46a7('0x34')]=_0x54be08[_0x46a7('0x34')][_0x46a7('0x35')]?_0x54be08[_0x46a7('0x34')]:_0x441632[_0x46a7('0x2e')];if(!_0xca7c1c['query'][_0x46a7('0x56')](_0x46a7('0x57'))){_0x54be08['limit']=qs[_0x46a7('0x1e')](_0xca7c1c[_0x46a7('0x2f')][_0x46a7('0x1e')]);_0x54be08[_0x46a7('0x1c')]=qs[_0x46a7('0x1c')](_0xca7c1c[_0x46a7('0x2f')]['offset']);}_0x54be08[_0x46a7('0x36')]=qs[_0x46a7('0x37')](_0xca7c1c[_0x46a7('0x2f')]['sort']);_0x54be08[_0x46a7('0x38')]=qs['filters'](_[_0x46a7('0x58')](_0xca7c1c[_0x46a7('0x2f')],_0x441632[_0x46a7('0x31')]));_0x54be08[_0x46a7('0x38')][_0x46a7('0x5c')]=_0x29cef1['id'];if(_0xca7c1c[_0x46a7('0x2f')][_0x46a7('0x39')]){_0x54be08[_0x46a7('0x38')]=_['merge'](_0x54be08[_0x46a7('0x38')],{'$or':_[_0x46a7('0x2a')](_0x54be08['attributes'],function(_0x228e51){var _0x453793={};_0x453793[_0x228e51]={'$like':'%'+_0xca7c1c[_0x46a7('0x2f')][_0x46a7('0x39')]+'%'};return _0x453793;})});}_0x54be08=_['merge']({},_0x54be08,_0xca7c1c[_0x46a7('0x42')]);return db[_0x46a7('0x60')]['count']({'where':_0x54be08[_0x46a7('0x38')]})['then'](function(_0x50a325){_0x18aa72[_0x46a7('0x1f')]=_0x50a325;if(_0xca7c1c[_0x46a7('0x2f')][_0x46a7('0x59')]){_0x54be08[_0x46a7('0x3c')]=[{'all':!![]}];}return db[_0x46a7('0x60')][_0x46a7('0x3d')](_0x54be08);})[_0x46a7('0x24')](function(_0x18f5cf){_0x18aa72[_0x46a7('0x3e')]=_0x18f5cf;return _0x18aa72;});}})['then'](respondWithFilteredResult(_0x560196,_0x54be08))['catch'](handleError(_0x560196,null));};exports[_0x46a7('0x61')]=function(_0x3e9c5a,_0x5652c7,_0x4e73f5){var _0x2649ad={};var _0x42c30a={};var _0x499e81;var _0x5e061d;return db[_0x46a7('0x2b')][_0x46a7('0x54')]({'where':{'id':_0x3e9c5a[_0x46a7('0x52')]['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0x5652c7,null))[_0x46a7('0x24')](function(_0xda8a2f){if(_0xda8a2f){_0x499e81=_0xda8a2f;_0x42c30a[_0x46a7('0x2e')]=_[_0x46a7('0x30')](db[_0x46a7('0x62')][_0x46a7('0x41')]);_0x42c30a[_0x46a7('0x2f')]=_['keys'](_0x3e9c5a[_0x46a7('0x2f')]);_0x42c30a[_0x46a7('0x31')]=_['intersection'](_0x42c30a['model'],_0x42c30a[_0x46a7('0x2f')]);_0x2649ad[_0x46a7('0x34')]=_[_0x46a7('0x32')](_0x42c30a[_0x46a7('0x2e')],qs['fields'](_0x3e9c5a[_0x46a7('0x2f')][_0x46a7('0x33')]));_0x2649ad[_0x46a7('0x34')]=_0x2649ad['attributes'][_0x46a7('0x35')]?_0x2649ad[_0x46a7('0x34')]:_0x42c30a[_0x46a7('0x2e')];_0x2649ad[_0x46a7('0x36')]=qs[_0x46a7('0x37')](_0x3e9c5a['query']['sort']);_0x2649ad[_0x46a7('0x38')]=qs[_0x46a7('0x31')](_[_0x46a7('0x58')](_0x3e9c5a[_0x46a7('0x2f')],_0x42c30a[_0x46a7('0x31')]));if(_0x3e9c5a[_0x46a7('0x2f')][_0x46a7('0x39')]){_0x2649ad[_0x46a7('0x38')]=_['merge'](_0x2649ad[_0x46a7('0x38')],{'$or':_[_0x46a7('0x2a')](_0x2649ad['attributes'],function(_0x1120f8){var _0x252ef1={};_0x252ef1[_0x1120f8]={'$like':'%'+_0x3e9c5a[_0x46a7('0x2f')][_0x46a7('0x39')]+'%'};return _0x252ef1;})});}_0x2649ad=_[_0x46a7('0x3a')]({},_0x2649ad,_0x3e9c5a[_0x46a7('0x42')]);return _0x499e81['getLists'](_0x2649ad);}})[_0x46a7('0x24')](function(_0x4a211a){if(_0x4a211a){_0x5e061d=_0x4a211a['length'];if(!_0x3e9c5a['query'][_0x46a7('0x56')](_0x46a7('0x57'))){_0x2649ad['limit']=qs[_0x46a7('0x1e')](_0x3e9c5a[_0x46a7('0x2f')]['limit']);_0x2649ad[_0x46a7('0x1c')]=qs[_0x46a7('0x1c')](_0x3e9c5a[_0x46a7('0x2f')][_0x46a7('0x1c')]);}return _0x499e81[_0x46a7('0x61')](_0x2649ad);}})[_0x46a7('0x24')](function(_0xaeabcb){if(_0xaeabcb){return _0xaeabcb?{'count':_0x5e061d,'rows':_0xaeabcb}:null;}})[_0x46a7('0x24')](respondWithResult(_0x5652c7,null))[_0x46a7('0x3f')](handleError(_0x5652c7,null));};exports[_0x46a7('0x63')]=function(_0x4f7c61,_0xafb247,_0x5bf347){var _0x2e68e9,_0x5a3a03;return db['Campaign']['find']({'where':{'id':_0x4f7c61['params']['id']}})['then'](handleEntityNotFound(_0xafb247,null))[_0x46a7('0x24')](function(_0x47c381){if(_0x47c381){_0x5a3a03=_0x47c381;return _0x47c381['addLists'](_0x4f7c61[_0x46a7('0x45')]['ids'],_[_0x46a7('0x50')](_0x4f7c61[_0x46a7('0x45')],[_0x46a7('0x64'),'id'])||{});}return null;})[_0x46a7('0x65')](function(_0x434f50){var _0x302b8c;_0x2e68e9=_0x434f50||[];var _0x1edbe0=[];if(_0x434f50){for(var _0x2da648=0x0;_0x2da648<_0x434f50[_0x46a7('0x35')];_0x2da648+=0x1){var _0x5ca86e=_0x434f50[_0x2da648][_0x46a7('0x47')]({'plain':!![]});_0x5a3a03['dialCheckDuplicateType']=_0x4f7c61[_0x46a7('0x45')][_0x46a7('0x66')]?_0x4f7c61[_0x46a7('0x45')]['dialCheckDuplicateType']:_0x5a3a03[_0x46a7('0x66')];switch(_0x5a3a03[_0x46a7('0x66')]){case'always':_0x302b8c=squel['insert']()['into']('cm_hopper')[_0x46a7('0x67')]([_0x46a7('0x68'),_0x46a7('0x69'),'ContactId',_0x46a7('0x6a'),_0x46a7('0x5c'),_0x46a7('0x4f'),'updatedAt'],squel[_0x46a7('0x6b')]()[_0x46a7('0x6c')](_0x46a7('0x68'),_0x46a7('0x68'))['field']('NOW()','scheduledAt')['field']('id',_0x46a7('0x6d'))[_0x46a7('0x6c')](_0x5ca86e['CmListId'][_0x46a7('0x6e')](),'ListId')[_0x46a7('0x6c')](_0x4f7c61[_0x46a7('0x52')]['id']['toString'](),_0x46a7('0x5c'))[_0x46a7('0x6c')]('NOW()',_0x46a7('0x4f'))[_0x46a7('0x6c')]('NOW()',_0x46a7('0x6f'))[_0x46a7('0x70')]('cm_contacts')[_0x46a7('0x38')](_0x46a7('0x71'))[_0x46a7('0x38')](_0x46a7('0x72'),_0x5ca86e['CmListId'][_0x46a7('0x6e')]())[_0x46a7('0x38')](_0x46a7('0x73'))[_0x46a7('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x46a7('0x6b')]()[_0x46a7('0x6c')](_0x46a7('0x74'))[_0x46a7('0x70')](_0x46a7('0x75'))[_0x46a7('0x38')]('CampaignId\x20=\x20?',_0x4f7c61[_0x46a7('0x52')]['id'][_0x46a7('0x6e')]()))['where'](_0x46a7('0x76'),squel[_0x46a7('0x6b')]()['field'](_0x46a7('0x77'))[_0x46a7('0x70')](_0x46a7('0x78'))[_0x46a7('0x38')](_0x46a7('0x79'),_0x4f7c61['params']['id'][_0x46a7('0x6e')]())))[_0x46a7('0x6e')]();break;case _0x46a7('0x7a'):_0x302b8c=squel[_0x46a7('0x7b')]()['into'](_0x46a7('0x78'))[_0x46a7('0x67')]([_0x46a7('0x68'),_0x46a7('0x69'),'ContactId',_0x46a7('0x6a'),'CampaignId','createdAt',_0x46a7('0x6f')],squel[_0x46a7('0x6b')]()[_0x46a7('0x6c')](_0x46a7('0x68'),'phone')[_0x46a7('0x6c')](_0x46a7('0x7c'),_0x46a7('0x69'))[_0x46a7('0x6c')]('id',_0x46a7('0x6d'))[_0x46a7('0x6c')](_0x5ca86e[_0x46a7('0x7d')][_0x46a7('0x6e')](),_0x46a7('0x6a'))[_0x46a7('0x6c')](_0x4f7c61[_0x46a7('0x52')]['id']['toString'](),_0x46a7('0x5c'))[_0x46a7('0x6c')]('NOW()',_0x46a7('0x4f'))[_0x46a7('0x6c')](_0x46a7('0x7c'),'updatedAt')[_0x46a7('0x70')](_0x46a7('0x7e'))['where'](_0x46a7('0x71'))['where'](_0x46a7('0x72'),_0x5ca86e[_0x46a7('0x7d')][_0x46a7('0x6e')]())[_0x46a7('0x38')](_0x46a7('0x73'))[_0x46a7('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x46a7('0x6b')]()[_0x46a7('0x6c')](_0x46a7('0x77'))[_0x46a7('0x70')](_0x46a7('0x78'))['where'](_0x46a7('0x79'),_0x4f7c61[_0x46a7('0x52')]['id'][_0x46a7('0x6e')]())))[_0x46a7('0x6e')]();break;default:_0x302b8c=squel[_0x46a7('0x7b')]()[_0x46a7('0x7f')](_0x46a7('0x78'))[_0x46a7('0x67')]([_0x46a7('0x68'),_0x46a7('0x69'),'ContactId',_0x46a7('0x6a'),_0x46a7('0x5c'),_0x46a7('0x4f'),_0x46a7('0x6f')],squel[_0x46a7('0x6b')]()['field'](_0x46a7('0x68'),_0x46a7('0x68'))[_0x46a7('0x6c')](_0x46a7('0x7c'),_0x46a7('0x69'))[_0x46a7('0x6c')]('id','ContactId')[_0x46a7('0x6c')](_0x5ca86e[_0x46a7('0x7d')][_0x46a7('0x6e')](),'ListId')['field'](_0x4f7c61['params']['id'][_0x46a7('0x6e')](),_0x46a7('0x5c'))[_0x46a7('0x6c')]('NOW()',_0x46a7('0x4f'))[_0x46a7('0x6c')]('NOW()',_0x46a7('0x6f'))['from']('cm_contacts')[_0x46a7('0x38')](_0x46a7('0x71'))[_0x46a7('0x38')](_0x46a7('0x72'),_0x5ca86e[_0x46a7('0x7d')]['toString']())[_0x46a7('0x38')](_0x46a7('0x73')))[_0x46a7('0x6e')]();}_0x1edbe0['push'](db[_0x46a7('0x80')][_0x46a7('0x2f')](_0x302b8c));}return BPromise[_0x46a7('0x81')](_0x1edbe0);}})['then'](function(){return _0x2e68e9;})[_0x46a7('0x24')](respondWithResult(_0xafb247,null))[_0x46a7('0x3f')](handleError(_0xafb247,null));};exports[_0x46a7('0x82')]=function(_0x3a4b77,_0x57346f,_0x2c3ec5){return db[_0x46a7('0x2b')][_0x46a7('0x43')]({'where':{'id':_0x3a4b77[_0x46a7('0x52')]['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0x57346f,null))[_0x46a7('0x24')](function(_0x3385ef){if(_0x3385ef){return _0x3385ef['removeLists'](_0x3a4b77[_0x46a7('0x2f')][_0x46a7('0x64')]);}})[_0x46a7('0x24')](function(_0x294bc4){if(_0x294bc4){return db[_0x46a7('0x55')]['destroy']({'where':{'ListId':_0x3a4b77['query'][_0x46a7('0x64')],'CampaignId':_0x3a4b77['params']['id']}})[_0x46a7('0x24')](function(){return _0x294bc4;});}})[_0x46a7('0x24')](respondWithStatusCode(_0x57346f,null))[_0x46a7('0x3f')](handleError(_0x57346f,null));};exports['getBlackLists']=function(_0x40e58f,_0x25c66e,_0x3f485e){var _0x4bccd0={};var _0x2d0003={};var _0x477934;var _0x1841da;return db[_0x46a7('0x2b')][_0x46a7('0x54')]({'where':{'id':_0x40e58f[_0x46a7('0x52')]['id']}})['then'](handleEntityNotFound(_0x25c66e,null))[_0x46a7('0x24')](function(_0x3b2556){if(_0x3b2556){_0x477934=_0x3b2556;_0x2d0003[_0x46a7('0x2e')]=_[_0x46a7('0x30')](db[_0x46a7('0x62')][_0x46a7('0x41')]);_0x2d0003['query']=_[_0x46a7('0x30')](_0x40e58f['query']);_0x2d0003['filters']=_['intersection'](_0x2d0003['model'],_0x2d0003[_0x46a7('0x2f')]);_0x4bccd0[_0x46a7('0x34')]=_[_0x46a7('0x32')](_0x2d0003['model'],qs[_0x46a7('0x33')](_0x40e58f[_0x46a7('0x2f')]['fields']));_0x4bccd0[_0x46a7('0x34')]=_0x4bccd0[_0x46a7('0x34')][_0x46a7('0x35')]?_0x4bccd0['attributes']:_0x2d0003[_0x46a7('0x2e')];_0x4bccd0[_0x46a7('0x36')]=qs[_0x46a7('0x37')](_0x40e58f['query']['sort']);_0x4bccd0['where']=qs[_0x46a7('0x31')](_[_0x46a7('0x58')](_0x40e58f[_0x46a7('0x2f')],_0x2d0003['filters']));if(_0x40e58f['query'][_0x46a7('0x39')]){_0x4bccd0[_0x46a7('0x38')]=_[_0x46a7('0x3a')](_0x4bccd0[_0x46a7('0x38')],{'$or':_[_0x46a7('0x2a')](_0x4bccd0[_0x46a7('0x34')],function(_0x1018b5){var _0xf78160={};_0xf78160[_0x1018b5]={'$like':'%'+_0x40e58f[_0x46a7('0x2f')]['filter']+'%'};return _0xf78160;})});}_0x4bccd0=_[_0x46a7('0x3a')]({},_0x4bccd0,_0x40e58f[_0x46a7('0x42')]);return _0x477934['getBlackLists'](_0x4bccd0);}})[_0x46a7('0x24')](function(_0x110c92){if(_0x110c92){_0x1841da=_0x110c92[_0x46a7('0x35')];if(!_0x40e58f[_0x46a7('0x2f')][_0x46a7('0x56')](_0x46a7('0x57'))){_0x4bccd0[_0x46a7('0x1e')]=qs['limit'](_0x40e58f[_0x46a7('0x2f')][_0x46a7('0x1e')]);_0x4bccd0[_0x46a7('0x1c')]=qs[_0x46a7('0x1c')](_0x40e58f[_0x46a7('0x2f')][_0x46a7('0x1c')]);}return _0x477934[_0x46a7('0x83')](_0x4bccd0);}})['then'](function(_0x4b7f47){if(_0x4b7f47){return _0x4b7f47?{'count':_0x1841da,'rows':_0x4b7f47}:null;}})['then'](respondWithResult(_0x25c66e,null))[_0x46a7('0x3f')](handleError(_0x25c66e,null));};exports[_0x46a7('0x84')]=function(_0x2b35d8,_0x5a5d0d,_0x4aed14){var _0x33ca4f,_0x35ccae;return db[_0x46a7('0x2b')]['find']({'where':{'id':_0x2b35d8['params']['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0x5a5d0d,null))['then'](function(_0x5d4c77){if(_0x5d4c77){_0x35ccae=_0x5d4c77;return _0x5d4c77['addBlackLists'](_0x2b35d8[_0x46a7('0x45')][_0x46a7('0x64')],_[_0x46a7('0x50')](_0x2b35d8[_0x46a7('0x45')],[_0x46a7('0x64'),'id'])||{});}return null;})[_0x46a7('0x65')](function(_0xa7915a){var _0x441830;_0x33ca4f=_0xa7915a||[];var _0x9d79b7=[];if(_0xa7915a){for(var _0x1bb0ef=0x0;_0x1bb0ef<_0xa7915a['length'];_0x1bb0ef+=0x1){var _0x28949f=_0xa7915a[_0x1bb0ef][_0x46a7('0x47')]({'plain':!![]});_0x441830=squel[_0x46a7('0x7b')]()[_0x46a7('0x7f')]('cm_hopper_black')[_0x46a7('0x67')](['phone',_0x46a7('0x6d'),_0x46a7('0x6a'),_0x46a7('0x5c'),_0x46a7('0x4f'),_0x46a7('0x6f')],squel[_0x46a7('0x6b')]()[_0x46a7('0x6c')](_0x46a7('0x68'),_0x46a7('0x68'))[_0x46a7('0x6c')]('id','ContactId')[_0x46a7('0x6c')](_0x28949f[_0x46a7('0x7d')]['toString'](),_0x46a7('0x6a'))[_0x46a7('0x6c')](_0x2b35d8['params']['id'][_0x46a7('0x6e')](),_0x46a7('0x5c'))[_0x46a7('0x6c')]('NOW()',_0x46a7('0x4f'))['field']('NOW()',_0x46a7('0x6f'))['from'](_0x46a7('0x7e'))[_0x46a7('0x38')](_0x46a7('0x71'))[_0x46a7('0x38')](_0x46a7('0x72'),_0x28949f[_0x46a7('0x7d')]['toString']())[_0x46a7('0x38')](_0x46a7('0x73')))[_0x46a7('0x6e')]();_0x9d79b7[_0x46a7('0x85')](db[_0x46a7('0x80')][_0x46a7('0x2f')](_0x441830));}return BPromise[_0x46a7('0x81')](_0x9d79b7);}})['then'](function(){return _0x33ca4f;})[_0x46a7('0x24')](respondWithResult(_0x5a5d0d,null))[_0x46a7('0x3f')](handleError(_0x5a5d0d,null));};exports['removeBlackLists']=function(_0x962b82,_0xc695ce,_0x9b9a05){return db[_0x46a7('0x2b')][_0x46a7('0x43')]({'where':{'id':_0x962b82[_0x46a7('0x52')]['id']}})[_0x46a7('0x24')](handleEntityNotFound(_0xc695ce,null))[_0x46a7('0x24')](function(_0x293712){if(_0x293712){return _0x293712[_0x46a7('0x86')](_0x962b82[_0x46a7('0x2f')]['ids']);}})[_0x46a7('0x24')](function(_0x4f9b2f){if(_0x4f9b2f){return db[_0x46a7('0x60')][_0x46a7('0x25')]({'where':{'ListId':_0x962b82['query'][_0x46a7('0x64')],'CampaignId':_0x962b82[_0x46a7('0x52')]['id']}})[_0x46a7('0x24')](function(){return _0x4f9b2f;});}})['then'](respondWithStatusCode(_0xc695ce,null))[_0x46a7('0x3f')](handleError(_0xc695ce,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 180887a..49fb12d 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index bfc1c68..a289b9d 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 _0x4b1f=['GetCampaign','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','Campaign','findAll','options','raw','where','attributes','include','map','model'];(function(_0x10bb41,_0x10c4a5){var _0x25b1a3=function(_0xe48219){while(--_0xe48219){_0x10bb41['push'](_0x10bb41['shift']());}};_0x25b1a3(++_0x10c4a5);}(_0x4b1f,0x195));var _0xf4b1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4b1f[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var moment=require('moment');var BPromise=require(_0xf4b1('0x2'));var rs=require(_0xf4b1('0x3'));var fs=require('fs');var Redis=require(_0xf4b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4b1('0x5'));var logger=require(_0xf4b1('0x6'))(_0xf4b1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf4b1('0x8')][_0xf4b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x310db5,_0x3b9c78,_0x1abfc7){return new BPromise(function(_0x50738c,_0x59cf77){return client['request'](_0x310db5,_0x1abfc7)[_0xf4b1('0xa')](function(_0x53a786){logger[_0xf4b1('0xb')]('Campaign,\x20%s,\x20%s',_0x3b9c78,'request\x20sent');logger[_0xf4b1('0xc')](_0xf4b1('0xd'),_0x3b9c78,_0xf4b1('0xe'),JSON[_0xf4b1('0xf')](_0x53a786));if(_0x53a786[_0xf4b1('0x10')]){if(_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x11')]===0x1f4){logger[_0xf4b1('0x10')](_0xf4b1('0x12'),_0x3b9c78,_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x13')]);return _0x59cf77(_0x53a786[_0xf4b1('0x10')][_0xf4b1('0x13')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x3b9c78,_0x53a786[_0xf4b1('0x10')]['message']);return _0x50738c(_0x53a786['error'][_0xf4b1('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x3b9c78,_0xf4b1('0xe'));_0x50738c(_0x53a786['result']['message']);}})['catch'](function(_0x5cb2a1){logger[_0xf4b1('0x10')](_0xf4b1('0x12'),_0x3b9c78,_0x5cb2a1);_0x59cf77(_0x5cb2a1);});});}exports['GetCampaign']=function(_0x3b378e){var _0x420f9e=this;return new Promise(function(_0x322b38,_0x465da2){return db[_0xf4b1('0x14')][_0xf4b1('0x15')]({'raw':_0x3b378e['options']?_0x3b378e[_0xf4b1('0x16')][_0xf4b1('0x17')]===undefined?!![]:![]:!![],'where':_0x3b378e['options']?_0x3b378e[_0xf4b1('0x16')][_0xf4b1('0x18')]||null:null,'attributes':_0x3b378e['options']?_0x3b378e[_0xf4b1('0x16')][_0xf4b1('0x19')]||null:null,'limit':_0x3b378e[_0xf4b1('0x16')]?_0x3b378e[_0xf4b1('0x16')]['limit']||null:null,'include':_0x3b378e[_0xf4b1('0x16')]?_0x3b378e[_0xf4b1('0x16')][_0xf4b1('0x1a')]?_[_0xf4b1('0x1b')](_0x3b378e['options'][_0xf4b1('0x1a')],function(_0x474212){return{'model':db[_0x474212['model']],'as':_0x474212['as'],'attributes':_0x474212[_0xf4b1('0x19')],'include':_0x474212['include']?_[_0xf4b1('0x1b')](_0x474212['include'],function(_0x238fbe){return{'model':db[_0x238fbe[_0xf4b1('0x1c')]],'as':_0x238fbe['as'],'attributes':_0x238fbe[_0xf4b1('0x19')],'include':_0x238fbe['include']?_[_0xf4b1('0x1b')](_0x238fbe['include'],function(_0x2e3b90){return{'model':db[_0x2e3b90['model']],'as':_0x2e3b90['as'],'attributes':_0x2e3b90[_0xf4b1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf4b1('0xa')](function(_0x5d28af){logger[_0xf4b1('0xb')](_0xf4b1('0x1d'),_0x3b378e);logger['debug'](_0xf4b1('0x1d'),_0x3b378e,JSON[_0xf4b1('0xf')](_0x5d28af));_0x322b38(_0x5d28af);})[_0xf4b1('0x1e')](function(_0x11ffb3){logger[_0xf4b1('0x10')](_0xf4b1('0x1d'),_0x11ffb3[_0xf4b1('0x13')],_0x3b378e);_0x465da2(_0x420f9e['error'](0x1f4,_0x11ffb3['message']));});});};
\ No newline at end of file
+var _0xbe31=['map','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','GetCampaign','Campaign','findAll','options','raw','limit','include'];(function(_0x44f347,_0x3be1a9){var _0x296219=function(_0x1dac7f){while(--_0x1dac7f){_0x44f347['push'](_0x44f347['shift']());}};_0x296219(++_0x3be1a9);}(_0xbe31,0x83));var _0x1be3=function(_0x162fe4,_0x23a8b1){_0x162fe4=_0x162fe4-0x0;var _0xa64438=_0xbe31[_0x162fe4];return _0xa64438;};'use strict';var _=require('lodash');var util=require(_0x1be3('0x0'));var moment=require(_0x1be3('0x1'));var BPromise=require(_0x1be3('0x2'));var rs=require(_0x1be3('0x3'));var fs=require('fs');var Redis=require(_0x1be3('0x4'));var db=require(_0x1be3('0x5'))['db'];var utils=require(_0x1be3('0x6'));var logger=require(_0x1be3('0x7'))(_0x1be3('0x8'));var config=require('../../config/environment');var jayson=require(_0x1be3('0x9'));var client=jayson['client'][_0x1be3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa757b9,_0x3c925a,_0x2c3965){return new BPromise(function(_0x2bb749,_0x2e4488){return client[_0x1be3('0xb')](_0xa757b9,_0x2c3965)[_0x1be3('0xc')](function(_0x359742){logger[_0x1be3('0xd')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x1be3('0xe'));logger[_0x1be3('0xf')](_0x1be3('0x10'),_0x3c925a,_0x1be3('0xe'),JSON[_0x1be3('0x11')](_0x359742));if(_0x359742[_0x1be3('0x12')]){if(_0x359742[_0x1be3('0x12')][_0x1be3('0x13')]===0x1f4){logger[_0x1be3('0x12')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x359742[_0x1be3('0x12')]['message']);return _0x2e4488(_0x359742[_0x1be3('0x12')][_0x1be3('0x14')]);}logger['error'](_0x1be3('0x15'),_0x3c925a,_0x359742['error'][_0x1be3('0x14')]);return _0x2bb749(_0x359742[_0x1be3('0x12')][_0x1be3('0x14')]);}else{logger[_0x1be3('0xd')](_0x1be3('0x15'),_0x3c925a,_0x1be3('0xe'));_0x2bb749(_0x359742['result']['message']);}})['catch'](function(_0x52d2f2){logger[_0x1be3('0x12')]('Campaign,\x20%s,\x20%s',_0x3c925a,_0x52d2f2);_0x2e4488(_0x52d2f2);});});}exports[_0x1be3('0x16')]=function(_0x6b7edf){var _0xaa1d7b=this;return new Promise(function(_0x1d0c2b,_0x21668a){return db[_0x1be3('0x17')][_0x1be3('0x18')]({'raw':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1a')]===undefined?!![]:![]:!![],'where':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')]['where']||null:null,'attributes':_0x6b7edf['options']?_0x6b7edf[_0x1be3('0x19')]['attributes']||null:null,'limit':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1b')]||null:null,'include':_0x6b7edf[_0x1be3('0x19')]?_0x6b7edf[_0x1be3('0x19')][_0x1be3('0x1c')]?_[_0x1be3('0x1d')](_0x6b7edf['options'][_0x1be3('0x1c')],function(_0x48862c){return{'model':db[_0x48862c[_0x1be3('0x1e')]],'as':_0x48862c['as'],'attributes':_0x48862c[_0x1be3('0x1f')],'include':_0x48862c['include']?_[_0x1be3('0x1d')](_0x48862c['include'],function(_0x134d79){return{'model':db[_0x134d79[_0x1be3('0x1e')]],'as':_0x134d79['as'],'attributes':_0x134d79[_0x1be3('0x1f')],'include':_0x134d79[_0x1be3('0x1c')]?_['map'](_0x134d79[_0x1be3('0x1c')],function(_0x8d1f58){return{'model':db[_0x8d1f58['model']],'as':_0x8d1f58['as'],'attributes':_0x8d1f58[_0x1be3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1be3('0xc')](function(_0x44da09){logger[_0x1be3('0xd')](_0x1be3('0x16'),_0x6b7edf);logger[_0x1be3('0xf')]('GetCampaign',_0x6b7edf,JSON[_0x1be3('0x11')](_0x44da09));_0x1d0c2b(_0x44da09);})['catch'](function(_0x25ed26){logger['error'](_0x1be3('0x16'),_0x25ed26[_0x1be3('0x14')],_0x6b7edf);_0x21668a(_0xaa1d7b['error'](0x1f4,_0x25ed26['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index b8f2ab5..8f454d1 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 _0xbb1c=['getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','/:id/blacklists','removeBlackLists','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x226b60,_0x4fac70){var _0x3d566e=function(_0x123cb9){while(--_0x123cb9){_0x226b60['push'](_0x226b60['shift']());}};_0x3d566e(++_0x4fac70);}(_0xbb1c,0x16e));var _0xcbb1=function(_0x17f5fc,_0xac1ffe){_0x17f5fc=_0x17f5fc-0x0;var _0x45b8fe=_0xbb1c[_0x17f5fc];return _0x45b8fe;};'use strict';var multer=require(_0xcbb1('0x0'));var util=require(_0xcbb1('0x1'));var path=require(_0xcbb1('0x2'));var timeout=require('connect-timeout');var express=require(_0xcbb1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcbb1('0x4'));var interaction=require(_0xcbb1('0x5'));var config=require(_0xcbb1('0x6'));var controller=require('./campaign.controller');router[_0xcbb1('0x7')]('/',auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x9')]);router['get'](_0xcbb1('0xa'),auth['isAuthenticated'](),controller[_0xcbb1('0xb')]);router[_0xcbb1('0x7')](_0xcbb1('0xc'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0xd')]);router[_0xcbb1('0x7')](_0xcbb1('0xe'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0xf')]);router[_0xcbb1('0x7')](_0xcbb1('0x10'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x11')]);router[_0xcbb1('0x7')](_0xcbb1('0x12'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x13')]);router[_0xcbb1('0x7')](_0xcbb1('0x14'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x15')]);router[_0xcbb1('0x7')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xcbb1('0x16')]);router[_0xcbb1('0x17')]('/',auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x18')]);router[_0xcbb1('0x17')](_0xcbb1('0x19'),auth['isAuthenticated'](),controller[_0xcbb1('0x1a')]);router['post'](_0xcbb1('0x14'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x1b')]);router[_0xcbb1('0x17')]('/:id/blacklists',auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x1c')]);router['put'](_0xcbb1('0xa'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x1d')]);router[_0xcbb1('0x1e')](_0xcbb1('0xa'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x1f')]);router['delete'](_0xcbb1('0x14'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x20')]);router[_0xcbb1('0x1e')](_0xcbb1('0x21'),auth[_0xcbb1('0x8')](),controller[_0xcbb1('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0x75a9=['index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','create','/:id/clone','clone','addLists','post','put','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x75a9,0x136));var _0x975a=function(_0x2b3e9d,_0x3b534d){_0x2b3e9d=_0x2b3e9d-0x0;var _0x19a933=_0x75a9[_0x2b3e9d];return _0x19a933;};'use strict';var multer=require(_0x975a('0x0'));var util=require(_0x975a('0x1'));var path=require('path');var timeout=require(_0x975a('0x2'));var express=require(_0x975a('0x3'));var router=express['Router']();var fs_extra=require(_0x975a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x975a('0x5'));var config=require(_0x975a('0x6'));var controller=require(_0x975a('0x7'));router[_0x975a('0x8')]('/',auth[_0x975a('0x9')](),controller[_0x975a('0xa')]);router[_0x975a('0x8')](_0x975a('0xb'),auth['isAuthenticated'](),controller[_0x975a('0xc')]);router[_0x975a('0x8')](_0x975a('0xd'),auth[_0x975a('0x9')](),controller[_0x975a('0xe')]);router['get'](_0x975a('0xf'),auth[_0x975a('0x9')](),controller[_0x975a('0x10')]);router[_0x975a('0x8')](_0x975a('0x11'),auth[_0x975a('0x9')](),controller[_0x975a('0x12')]);router['get']('/:id/hopper_black',auth[_0x975a('0x9')](),controller['getHopperBlacks']);router[_0x975a('0x8')](_0x975a('0x13'),auth[_0x975a('0x9')](),controller[_0x975a('0x14')]);router[_0x975a('0x8')](_0x975a('0x15'),auth[_0x975a('0x9')](),controller['getBlackLists']);router['post']('/',auth[_0x975a('0x9')](),controller[_0x975a('0x16')]);router['post'](_0x975a('0x17'),auth[_0x975a('0x9')](),controller[_0x975a('0x18')]);router['post'](_0x975a('0x13'),auth['isAuthenticated'](),controller[_0x975a('0x19')]);router[_0x975a('0x1a')](_0x975a('0x15'),auth[_0x975a('0x9')](),controller['addBlackLists']);router[_0x975a('0x1b')](_0x975a('0xb'),auth[_0x975a('0x9')](),controller['update']);router['delete'](_0x975a('0xb'),auth[_0x975a('0x9')](),controller[_0x975a('0x1c')]);router['delete'](_0x975a('0x13'),auth['isAuthenticated'](),controller[_0x975a('0x1d')]);router['delete'](_0x975a('0x15'),auth['isAuthenticated'](),controller[_0x975a('0x1e')]);module[_0x975a('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index e4219a5..826bce6 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 _0xcf2a=['key','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x576b19,_0x49d2fe){var _0x2a63c0=function(_0x1087cd){while(--_0x1087cd){_0x576b19['push'](_0x576b19['shift']());}};_0x2a63c0(++_0x49d2fe);}(_0xcf2a,0xbb));var _0xacf2=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xcf2a[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require('sequelize');module[_0xacf2('0x0')]={'key':{'type':Sequelize[_0xacf2('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xacf2('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xacf2('0x3')],'get':function(){return this[_0xacf2('0x4')](_0xacf2('0x5'));}}};
\ No newline at end of file
+var _0xa2d8=['getDataValue','exports','STRING','TEXT','VIRTUAL'];(function(_0x4428f2,_0x5b0153){var _0x1fba84=function(_0x343ca9){while(--_0x343ca9){_0x4428f2['push'](_0x4428f2['shift']());}};_0x1fba84(++_0x5b0153);}(_0xa2d8,0x100));var _0x8a2d=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa2d8[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x8a2d('0x0')]={'key':{'type':Sequelize[_0x8a2d('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x8a2d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x8a2d('0x3')],'get':function(){return this[_0x8a2d('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 94aab3c..009bae6 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 _0x5a58=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','CannedAnswers','end','sendStatus','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','show','params','includeAll','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x27aa84,_0x5e54b7){var _0x2e0ac3=function(_0x331ea4){while(--_0x331ea4){_0x27aa84['push'](_0x27aa84['shift']());}};_0x2e0ac3(++_0x5e54b7);}(_0x5a58,0xab));var _0x85a5=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x5a58[_0x468b0f];return _0x3e74d9;};'use strict';var emlformat=require(_0x85a5('0x0'));var rimraf=require(_0x85a5('0x1'));var zipdir=require(_0x85a5('0x2'));var jsonpatch=require(_0x85a5('0x3'));var rp=require(_0x85a5('0x4'));var moment=require('moment');var BPromise=require(_0x85a5('0x5'));var Mustache=require(_0x85a5('0x6'));var util=require(_0x85a5('0x7'));var path=require(_0x85a5('0x8'));var sox=require(_0x85a5('0x9'));var csv=require('to-csv');var ejs=require(_0x85a5('0xa'));var fs=require('fs');var fs_extra=require(_0x85a5('0xb'));var _=require(_0x85a5('0xc'));var squel=require(_0x85a5('0xd'));var crypto=require('crypto');var jsforce=require(_0x85a5('0xe'));var deskjs=require(_0x85a5('0xf'));var toCsv=require(_0x85a5('0x10'));var querystring=require(_0x85a5('0x11'));var Papa=require(_0x85a5('0x12'));var Redis=require('ioredis');var authService=require(_0x85a5('0x13'));var qs=require(_0x85a5('0x14'));var as=require(_0x85a5('0x15'));var hardwareService=require(_0x85a5('0x16'));var logger=require(_0x85a5('0x17'))(_0x85a5('0x18'));var utils=require(_0x85a5('0x19'));var config=require(_0x85a5('0x1a'));var licenseUtil=require(_0x85a5('0x1b'));var db=require(_0x85a5('0x1c'))['db'];function respondWithStatusCode(_0x4fafd7,_0x4f3971){_0x4f3971=_0x4f3971||0xcc;return function(_0x5a7ed1){if(_0x5a7ed1){return _0x4fafd7['sendStatus'](_0x4f3971);}return _0x4fafd7[_0x85a5('0x1d')](_0x4f3971)['end']();};}function respondWithResult(_0x3cf866,_0x52239f){_0x52239f=_0x52239f||0xc8;return function(_0x52d490){if(_0x52d490){return _0x3cf866[_0x85a5('0x1d')](_0x52239f)['json'](_0x52d490);}};}function respondWithFilteredResult(_0x254c62,_0xf413e8){return function(_0x4d6edd){if(_0x4d6edd){var _0xd61907=typeof _0xf413e8[_0x85a5('0x1e')]===_0x85a5('0x1f')&&typeof _0xf413e8[_0x85a5('0x20')]===_0x85a5('0x1f');var _0x51dbd8=_0x4d6edd[_0x85a5('0x21')];var _0x23beb6=_0xd61907?0x0:_0xf413e8[_0x85a5('0x1e')];var _0x31c542=_0xd61907?_0x4d6edd['count']:_0xf413e8['offset']+_0xf413e8[_0x85a5('0x20')];var _0xba91c8;if(_0x31c542>=_0x51dbd8){_0x31c542=_0x51dbd8;_0xba91c8=0xc8;}else{_0xba91c8=0xce;}_0x254c62[_0x85a5('0x1d')](_0xba91c8);return _0x254c62[_0x85a5('0x22')](_0x85a5('0x23'),_0x23beb6+'-'+_0x31c542+'/'+_0x51dbd8)[_0x85a5('0x24')](_0x4d6edd);}return null;};}function patchUpdates(_0xe923ee){return function(_0x1dd543){try{jsonpatch[_0x85a5('0x25')](_0x1dd543,_0xe923ee,!![]);}catch(_0x375d35){return BPromise['reject'](_0x375d35);}return _0x1dd543['save']();};}function saveUpdates(_0x442f46,_0x235192){return function(_0x439167){if(_0x439167){return _0x439167[_0x85a5('0x26')](_0x442f46)[_0x85a5('0x27')](function(_0x387ebc){return _0x387ebc;});}return null;};}function removeEntity(_0x1b06ea,_0x39cb3b){return function(_0x5af998){if(_0x5af998){return _0x5af998[_0x85a5('0x28')]()[_0x85a5('0x27')](function(){var _0x3b966c=_0x5af998['get']({'plain':!![]});var _0x4cdb32=_0x85a5('0x29');return db['UserProfileResource'][_0x85a5('0x28')]({'where':{'type':_0x4cdb32,'resourceId':_0x3b966c['id']}})[_0x85a5('0x27')](function(){return _0x5af998;});})[_0x85a5('0x27')](function(){_0x1b06ea['status'](0xcc)[_0x85a5('0x2a')]();});}};}function handleEntityNotFound(_0x478d58,_0x5484f2){return function(_0x56b36d){if(!_0x56b36d){_0x478d58[_0x85a5('0x2b')](0x194);}return _0x56b36d;};}function handleError(_0x4cf778,_0x51310c){_0x51310c=_0x51310c||0x1f4;return function(_0x82006a){logger[_0x85a5('0x2c')](_0x82006a['stack']);if(_0x82006a[_0x85a5('0x2d')]){delete _0x82006a[_0x85a5('0x2d')];}_0x4cf778[_0x85a5('0x1d')](_0x51310c)[_0x85a5('0x2e')](_0x82006a);};}exports[_0x85a5('0x2f')]=function(_0x3b6de1,_0x10b27b){var _0xc6f0f8={},_0x11ba49={},_0x24b0a7={'count':0x0,'rows':[]};var _0x2e2785=_[_0x85a5('0x30')](db[_0x85a5('0x31')][_0x85a5('0x32')],function(_0x2ab8b5){return{'name':_0x2ab8b5[_0x85a5('0x33')],'type':_0x2ab8b5[_0x85a5('0x34')][_0x85a5('0x35')]};});_0x11ba49['model']=_[_0x85a5('0x30')](_0x2e2785,'name');_0x11ba49[_0x85a5('0x36')]=_[_0x85a5('0x37')](_0x3b6de1[_0x85a5('0x36')]);_0x11ba49[_0x85a5('0x38')]=_[_0x85a5('0x39')](_0x11ba49['model'],_0x11ba49[_0x85a5('0x36')]);_0xc6f0f8[_0x85a5('0x3a')]=_[_0x85a5('0x39')](_0x11ba49[_0x85a5('0x3b')],qs[_0x85a5('0x3c')](_0x3b6de1['query'][_0x85a5('0x3c')]));_0xc6f0f8[_0x85a5('0x3a')]=_0xc6f0f8[_0x85a5('0x3a')][_0x85a5('0x3d')]?_0xc6f0f8[_0x85a5('0x3a')]:_0x11ba49[_0x85a5('0x3b')];if(!_0x3b6de1[_0x85a5('0x36')][_0x85a5('0x3e')](_0x85a5('0x3f'))){_0xc6f0f8[_0x85a5('0x20')]=qs[_0x85a5('0x20')](_0x3b6de1[_0x85a5('0x36')][_0x85a5('0x20')]);_0xc6f0f8[_0x85a5('0x1e')]=qs[_0x85a5('0x1e')](_0x3b6de1['query'][_0x85a5('0x1e')]);}_0xc6f0f8[_0x85a5('0x40')]=qs['sort'](_0x3b6de1['query'][_0x85a5('0x41')]);_0xc6f0f8[_0x85a5('0x42')]=qs[_0x85a5('0x38')](_[_0x85a5('0x43')](_0x3b6de1[_0x85a5('0x36')],_0x11ba49[_0x85a5('0x38')]),_0x2e2785);if(_0x3b6de1['query'][_0x85a5('0x44')]){_0xc6f0f8['where']=_[_0x85a5('0x45')](_0xc6f0f8[_0x85a5('0x42')],{'$or':[{'key':{'$like':'%'+_0x3b6de1[_0x85a5('0x36')][_0x85a5('0x44')]+'%'}},{'value':{'$like':'%'+_0x3b6de1[_0x85a5('0x36')][_0x85a5('0x44')]+'%'}}]});}_0xc6f0f8=_[_0x85a5('0x45')]({},_0xc6f0f8,_0x3b6de1[_0x85a5('0x46')]);var _0x906fd0={'where':_0xc6f0f8[_0x85a5('0x42')]};return db[_0x85a5('0x31')]['count'](_0x906fd0)[_0x85a5('0x27')](function(_0x101172){_0x24b0a7[_0x85a5('0x21')]=_0x101172;if(_0x3b6de1[_0x85a5('0x36')]['includeAll']){_0xc6f0f8[_0x85a5('0x47')]=[{'all':!![]}];}return db[_0x85a5('0x31')]['findAll'](_0xc6f0f8);})[_0x85a5('0x27')](function(_0x375016){_0x24b0a7[_0x85a5('0x48')]=_0x375016;return _0x24b0a7;})['then'](respondWithFilteredResult(_0x10b27b,_0xc6f0f8))['catch'](handleError(_0x10b27b,null));};exports[_0x85a5('0x49')]=function(_0x1c7c50,_0x117006){var _0x136cda={'raw':!![],'where':{'id':_0x1c7c50[_0x85a5('0x4a')]['id']}},_0x6c0d43={};_0x6c0d43[_0x85a5('0x3b')]=_[_0x85a5('0x37')](db['CannedAnswer'][_0x85a5('0x32')]);_0x6c0d43[_0x85a5('0x36')]=_[_0x85a5('0x37')](_0x1c7c50[_0x85a5('0x36')]);_0x6c0d43[_0x85a5('0x38')]=_[_0x85a5('0x39')](_0x6c0d43[_0x85a5('0x3b')],_0x6c0d43[_0x85a5('0x36')]);_0x136cda[_0x85a5('0x3a')]=_[_0x85a5('0x39')](_0x6c0d43[_0x85a5('0x3b')],qs['fields'](_0x1c7c50[_0x85a5('0x36')][_0x85a5('0x3c')]));_0x136cda[_0x85a5('0x3a')]=_0x136cda['attributes']['length']?_0x136cda['attributes']:_0x6c0d43[_0x85a5('0x3b')];if(_0x1c7c50['query'][_0x85a5('0x4b')]){_0x136cda['include']=[{'all':!![]}];}_0x136cda=_['merge']({},_0x136cda,_0x1c7c50[_0x85a5('0x46')]);return db[_0x85a5('0x31')][_0x85a5('0x4c')](_0x136cda)[_0x85a5('0x27')](handleEntityNotFound(_0x117006,null))[_0x85a5('0x27')](respondWithResult(_0x117006,null))[_0x85a5('0x4d')](handleError(_0x117006,null));};exports[_0x85a5('0x26')]=function(_0x18a713,_0x59ac2a){if(_0x18a713[_0x85a5('0x4e')]['id']){delete _0x18a713[_0x85a5('0x4e')]['id'];}return db['CannedAnswer'][_0x85a5('0x4c')]({'where':{'id':_0x18a713['params']['id']}})[_0x85a5('0x27')](handleEntityNotFound(_0x59ac2a,null))[_0x85a5('0x27')](saveUpdates(_0x18a713[_0x85a5('0x4e')],null))['then'](respondWithResult(_0x59ac2a,null))['catch'](handleError(_0x59ac2a,null));};exports[_0x85a5('0x28')]=function(_0x57445d,_0x5eab99){return db[_0x85a5('0x31')][_0x85a5('0x4c')]({'where':{'id':_0x57445d['params']['id']}})[_0x85a5('0x27')](handleEntityNotFound(_0x5eab99,null))[_0x85a5('0x27')](removeEntity(_0x5eab99,null))['catch'](handleError(_0x5eab99,null));};exports['create']=function(_0xa71b65,_0x55fa4d){var _0x211e86={'key':_0xa71b65[_0x85a5('0x4e')][_0x85a5('0x35')]};if(_0xa71b65['body']['MailAccountId']){_0x211e86[_0x85a5('0x4f')]=_0xa71b65[_0x85a5('0x4e')][_0x85a5('0x4f')];}else if(_0xa71b65[_0x85a5('0x4e')]['SmsAccountId']){_0x211e86['SmsAccountId']=_0xa71b65[_0x85a5('0x4e')][_0x85a5('0x50')];}else if(_0xa71b65[_0x85a5('0x4e')][_0x85a5('0x51')]){_0x211e86['OpenchannelAccountId']=_0xa71b65['body']['OpenchannelAccountId'];}else if(_0xa71b65['body'][_0x85a5('0x52')]){_0x211e86[_0x85a5('0x52')]=_0xa71b65[_0x85a5('0x4e')][_0x85a5('0x52')];}return db[_0x85a5('0x31')][_0x85a5('0x4c')]({'where':_0x211e86})[_0x85a5('0x27')](function(_0x7337ad){if(_0x7337ad){throw new db[(_0x85a5('0x53'))][(_0x85a5('0x54'))](_0x85a5('0x55'));}return db['CannedAnswer'][_0x85a5('0x56')](_0xa71b65[_0x85a5('0x4e')]);})[_0x85a5('0x27')](function(_0x831404){var _0x571a00=_0xa71b65['user']['get']({'plain':!![]});if(!_0x571a00)throw new Error(_0x85a5('0x57'));if(_0x571a00['role']===_0x85a5('0x58')){var _0x4b9c41=_0x831404[_0x85a5('0x59')]({'plain':!![]});return db[_0x85a5('0x5a')][_0x85a5('0x4c')]({'where':{'name':_0x85a5('0x29'),'userProfileId':_0x571a00[_0x85a5('0x5b')]},'raw':!![]})[_0x85a5('0x27')](function(_0x264aec){if(_0x264aec&&_0x264aec['autoAssociation']===0x0){return db[_0x85a5('0x5c')][_0x85a5('0x56')]({'name':_0x4b9c41['name'],'resourceId':_0x4b9c41['id'],'type':_0x264aec[_0x85a5('0x2d')],'sectionId':_0x264aec['id']},{})['then'](function(){return _0x831404;});}else{return _0x831404;}})[_0x85a5('0x4d')](function(_0x46112e){logger[_0x85a5('0x2c')](_0x85a5('0x5d'),_0x46112e);throw _0x46112e;});}return _0x831404;})['then'](respondWithResult(_0x55fa4d,0xc9))[_0x85a5('0x4d')](handleError(_0x55fa4d,null));};
\ No newline at end of file
+var _0x2e33=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','show','params','include','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js'];(function(_0x44fb83,_0x496f92){var _0x5b5d30=function(_0xca944d){while(--_0xca944d){_0x44fb83['push'](_0x44fb83['shift']());}};_0x5b5d30(++_0x496f92);}(_0x2e33,0x152));var _0x32e3=function(_0x1c53e8,_0x487058){_0x1c53e8=_0x1c53e8-0x0;var _0x400ab9=_0x2e33[_0x1c53e8];return _0x400ab9;};'use strict';var emlformat=require(_0x32e3('0x0'));var rimraf=require(_0x32e3('0x1'));var zipdir=require(_0x32e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32e3('0x3'));var moment=require(_0x32e3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x32e3('0x5'));var util=require(_0x32e3('0x6'));var path=require(_0x32e3('0x7'));var sox=require(_0x32e3('0x8'));var csv=require(_0x32e3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32e3('0xa'));var _=require('lodash');var squel=require(_0x32e3('0xb'));var crypto=require(_0x32e3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x32e3('0xd'));var toCsv=require(_0x32e3('0x9'));var querystring=require(_0x32e3('0xe'));var Papa=require('papaparse');var Redis=require(_0x32e3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x32e3('0x10'));var as=require(_0x32e3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32e3('0x12'))(_0x32e3('0x13'));var utils=require(_0x32e3('0x14'));var config=require(_0x32e3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x32e3('0x16'))['db'];function respondWithStatusCode(_0x72e41f,_0x3921af){_0x3921af=_0x3921af||0xcc;return function(_0x3fd8ef){if(_0x3fd8ef){return _0x72e41f[_0x32e3('0x17')](_0x3921af);}return _0x72e41f[_0x32e3('0x18')](_0x3921af)[_0x32e3('0x19')]();};}function respondWithResult(_0x13ef5a,_0x4641b2){_0x4641b2=_0x4641b2||0xc8;return function(_0x1d7ef7){if(_0x1d7ef7){return _0x13ef5a[_0x32e3('0x18')](_0x4641b2)[_0x32e3('0x1a')](_0x1d7ef7);}};}function respondWithFilteredResult(_0x172cd0,_0x3e04bd){return function(_0xc2f5b1){if(_0xc2f5b1){var _0x588f13=typeof _0x3e04bd[_0x32e3('0x1b')]==='undefined'&&typeof _0x3e04bd[_0x32e3('0x1c')]===_0x32e3('0x1d');var _0x29fd0f=_0xc2f5b1['count'];var _0x5c3977=_0x588f13?0x0:_0x3e04bd['offset'];var _0x139718=_0x588f13?_0xc2f5b1['count']:_0x3e04bd[_0x32e3('0x1b')]+_0x3e04bd[_0x32e3('0x1c')];var _0x447fa1;if(_0x139718>=_0x29fd0f){_0x139718=_0x29fd0f;_0x447fa1=0xc8;}else{_0x447fa1=0xce;}_0x172cd0[_0x32e3('0x18')](_0x447fa1);return _0x172cd0[_0x32e3('0x1e')](_0x32e3('0x1f'),_0x5c3977+'-'+_0x139718+'/'+_0x29fd0f)[_0x32e3('0x1a')](_0xc2f5b1);}return null;};}function patchUpdates(_0x36d670){return function(_0x359400){try{jsonpatch[_0x32e3('0x20')](_0x359400,_0x36d670,!![]);}catch(_0x207491){return BPromise[_0x32e3('0x21')](_0x207491);}return _0x359400[_0x32e3('0x22')]();};}function saveUpdates(_0x170b90,_0x2bdaff){return function(_0x2b6784){if(_0x2b6784){return _0x2b6784[_0x32e3('0x23')](_0x170b90)['then'](function(_0x58171f){return _0x58171f;});}return null;};}function removeEntity(_0x378f87,_0x46e09e){return function(_0x5c48b5){if(_0x5c48b5){return _0x5c48b5[_0x32e3('0x24')]()[_0x32e3('0x25')](function(){var _0xbcd850=_0x5c48b5[_0x32e3('0x26')]({'plain':!![]});var _0x3e9cf6=_0x32e3('0x27');return db[_0x32e3('0x28')][_0x32e3('0x24')]({'where':{'type':_0x3e9cf6,'resourceId':_0xbcd850['id']}})[_0x32e3('0x25')](function(){return _0x5c48b5;});})[_0x32e3('0x25')](function(){_0x378f87[_0x32e3('0x18')](0xcc)[_0x32e3('0x19')]();});}};}function handleEntityNotFound(_0xb4fe51,_0x807955){return function(_0x41f887){if(!_0x41f887){_0xb4fe51[_0x32e3('0x17')](0x194);}return _0x41f887;};}function handleError(_0x329845,_0x111e03){_0x111e03=_0x111e03||0x1f4;return function(_0x2a0145){logger[_0x32e3('0x29')](_0x2a0145['stack']);if(_0x2a0145[_0x32e3('0x2a')]){delete _0x2a0145[_0x32e3('0x2a')];}_0x329845[_0x32e3('0x18')](_0x111e03)[_0x32e3('0x2b')](_0x2a0145);};}exports[_0x32e3('0x2c')]=function(_0x12df73,_0x55ac99){var _0x2379d4={},_0x2bd160={},_0x435b89={'count':0x0,'rows':[]};var _0x1c91a1=_[_0x32e3('0x2d')](db[_0x32e3('0x2e')][_0x32e3('0x2f')],function(_0x1f0704){return{'name':_0x1f0704[_0x32e3('0x30')],'type':_0x1f0704[_0x32e3('0x31')][_0x32e3('0x32')]};});_0x2bd160[_0x32e3('0x33')]=_[_0x32e3('0x2d')](_0x1c91a1,'name');_0x2bd160['query']=_[_0x32e3('0x34')](_0x12df73[_0x32e3('0x35')]);_0x2bd160[_0x32e3('0x36')]=_[_0x32e3('0x37')](_0x2bd160[_0x32e3('0x33')],_0x2bd160[_0x32e3('0x35')]);_0x2379d4[_0x32e3('0x38')]=_['intersection'](_0x2bd160['model'],qs[_0x32e3('0x39')](_0x12df73['query'][_0x32e3('0x39')]));_0x2379d4[_0x32e3('0x38')]=_0x2379d4[_0x32e3('0x38')][_0x32e3('0x3a')]?_0x2379d4[_0x32e3('0x38')]:_0x2bd160['model'];if(!_0x12df73[_0x32e3('0x35')][_0x32e3('0x3b')](_0x32e3('0x3c'))){_0x2379d4[_0x32e3('0x1c')]=qs[_0x32e3('0x1c')](_0x12df73[_0x32e3('0x35')][_0x32e3('0x1c')]);_0x2379d4[_0x32e3('0x1b')]=qs[_0x32e3('0x1b')](_0x12df73[_0x32e3('0x35')][_0x32e3('0x1b')]);}_0x2379d4[_0x32e3('0x3d')]=qs[_0x32e3('0x3e')](_0x12df73[_0x32e3('0x35')][_0x32e3('0x3e')]);_0x2379d4[_0x32e3('0x3f')]=qs[_0x32e3('0x36')](_[_0x32e3('0x40')](_0x12df73['query'],_0x2bd160[_0x32e3('0x36')]),_0x1c91a1);if(_0x12df73[_0x32e3('0x35')][_0x32e3('0x41')]){_0x2379d4[_0x32e3('0x3f')]=_[_0x32e3('0x42')](_0x2379d4[_0x32e3('0x3f')],{'$or':[{'key':{'$like':'%'+_0x12df73[_0x32e3('0x35')][_0x32e3('0x41')]+'%'}},{'value':{'$like':'%'+_0x12df73['query'][_0x32e3('0x41')]+'%'}}]});}_0x2379d4=_['merge']({},_0x2379d4,_0x12df73[_0x32e3('0x43')]);var _0x4b3b94={'where':_0x2379d4['where']};return db['CannedAnswer'][_0x32e3('0x44')](_0x4b3b94)[_0x32e3('0x25')](function(_0x457db0){_0x435b89[_0x32e3('0x44')]=_0x457db0;if(_0x12df73[_0x32e3('0x35')][_0x32e3('0x45')]){_0x2379d4['include']=[{'all':!![]}];}return db[_0x32e3('0x2e')][_0x32e3('0x46')](_0x2379d4);})[_0x32e3('0x25')](function(_0x4a51b3){_0x435b89[_0x32e3('0x47')]=_0x4a51b3;return _0x435b89;})[_0x32e3('0x25')](respondWithFilteredResult(_0x55ac99,_0x2379d4))['catch'](handleError(_0x55ac99,null));};exports[_0x32e3('0x48')]=function(_0xeb7c5d,_0x1a82a0){var _0x429ae3={'raw':!![],'where':{'id':_0xeb7c5d[_0x32e3('0x49')]['id']}},_0x7d7928={};_0x7d7928[_0x32e3('0x33')]=_[_0x32e3('0x34')](db[_0x32e3('0x2e')][_0x32e3('0x2f')]);_0x7d7928[_0x32e3('0x35')]=_['keys'](_0xeb7c5d[_0x32e3('0x35')]);_0x7d7928[_0x32e3('0x36')]=_[_0x32e3('0x37')](_0x7d7928[_0x32e3('0x33')],_0x7d7928[_0x32e3('0x35')]);_0x429ae3[_0x32e3('0x38')]=_[_0x32e3('0x37')](_0x7d7928[_0x32e3('0x33')],qs[_0x32e3('0x39')](_0xeb7c5d[_0x32e3('0x35')][_0x32e3('0x39')]));_0x429ae3[_0x32e3('0x38')]=_0x429ae3[_0x32e3('0x38')]['length']?_0x429ae3[_0x32e3('0x38')]:_0x7d7928[_0x32e3('0x33')];if(_0xeb7c5d[_0x32e3('0x35')]['includeAll']){_0x429ae3[_0x32e3('0x4a')]=[{'all':!![]}];}_0x429ae3=_['merge']({},_0x429ae3,_0xeb7c5d[_0x32e3('0x43')]);return db[_0x32e3('0x2e')][_0x32e3('0x4b')](_0x429ae3)['then'](handleEntityNotFound(_0x1a82a0,null))[_0x32e3('0x25')](respondWithResult(_0x1a82a0,null))[_0x32e3('0x4c')](handleError(_0x1a82a0,null));};exports['update']=function(_0x374ed7,_0x47a63c){if(_0x374ed7['body']['id']){delete _0x374ed7[_0x32e3('0x4d')]['id'];}return db[_0x32e3('0x2e')][_0x32e3('0x4b')]({'where':{'id':_0x374ed7['params']['id']}})['then'](handleEntityNotFound(_0x47a63c,null))[_0x32e3('0x25')](saveUpdates(_0x374ed7[_0x32e3('0x4d')],null))[_0x32e3('0x25')](respondWithResult(_0x47a63c,null))[_0x32e3('0x4c')](handleError(_0x47a63c,null));};exports[_0x32e3('0x24')]=function(_0x146afd,_0x7a5d3c){return db[_0x32e3('0x2e')][_0x32e3('0x4b')]({'where':{'id':_0x146afd[_0x32e3('0x49')]['id']}})[_0x32e3('0x25')](handleEntityNotFound(_0x7a5d3c,null))[_0x32e3('0x25')](removeEntity(_0x7a5d3c,null))[_0x32e3('0x4c')](handleError(_0x7a5d3c,null));};exports[_0x32e3('0x4e')]=function(_0x2c864b,_0x468d83){var _0x1d4b9c={'key':_0x2c864b[_0x32e3('0x4d')][_0x32e3('0x32')]};if(_0x2c864b['body']['MailAccountId']){_0x1d4b9c[_0x32e3('0x4f')]=_0x2c864b[_0x32e3('0x4d')][_0x32e3('0x4f')];}else if(_0x2c864b[_0x32e3('0x4d')][_0x32e3('0x50')]){_0x1d4b9c[_0x32e3('0x50')]=_0x2c864b[_0x32e3('0x4d')][_0x32e3('0x50')];}else if(_0x2c864b[_0x32e3('0x4d')]['OpenchannelAccountId']){_0x1d4b9c[_0x32e3('0x51')]=_0x2c864b[_0x32e3('0x4d')][_0x32e3('0x51')];}else if(_0x2c864b['body'][_0x32e3('0x52')]){_0x1d4b9c['ChatWebsiteId']=_0x2c864b[_0x32e3('0x4d')][_0x32e3('0x52')];}return db['CannedAnswer']['find']({'where':_0x1d4b9c})[_0x32e3('0x25')](function(_0xeedfca){if(_0xeedfca){throw new db['Sequelize'][(_0x32e3('0x53'))](_0x32e3('0x54'));}return db[_0x32e3('0x2e')]['create'](_0x2c864b[_0x32e3('0x4d')]);})[_0x32e3('0x25')](function(_0x5f047e){var _0x32a586=_0x2c864b[_0x32e3('0x55')]['get']({'plain':!![]});if(!_0x32a586)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32a586['role']===_0x32e3('0x55')){var _0x4e39e9=_0x5f047e[_0x32e3('0x26')]({'plain':!![]});return db[_0x32e3('0x56')][_0x32e3('0x4b')]({'where':{'name':_0x32e3('0x27'),'userProfileId':_0x32a586['userProfileId']},'raw':!![]})[_0x32e3('0x25')](function(_0x1b15e8){if(_0x1b15e8&&_0x1b15e8['autoAssociation']===0x0){return db[_0x32e3('0x28')][_0x32e3('0x4e')]({'name':_0x4e39e9[_0x32e3('0x2a')],'resourceId':_0x4e39e9['id'],'type':_0x1b15e8[_0x32e3('0x2a')],'sectionId':_0x1b15e8['id']},{})[_0x32e3('0x25')](function(){return _0x5f047e;});}else{return _0x5f047e;}})[_0x32e3('0x4c')](function(_0x4ed7aa){logger[_0x32e3('0x29')](_0x32e3('0x57'),_0x4ed7aa);throw _0x4ed7aa;});}return _0x5f047e;})['then'](respondWithResult(_0x468d83,0xc9))['catch'](handleError(_0x468d83,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 4158db8..433f302 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 _0x9972=['utf8mb4_unicode_ci','util','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9972,0xeb));var _0x2997=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9972[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x2997('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2997('0x1'));var BPromise=require('bluebird');var rp=require(_0x2997('0x2'));var fs=require('fs');var path=require(_0x2997('0x3'));var rimraf=require(_0x2997('0x4'));var config=require(_0x2997('0x5'));var attributes=require(_0x2997('0x6'));module[_0x2997('0x7')]=function(_0x2f11b7,_0x259004){return _0x2f11b7[_0x2997('0x8')](_0x2997('0x9'),attributes,{'tableName':_0x2997('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2997('0xb'),'collate':_0x2997('0xc')});};
\ No newline at end of file
+var _0xbc0a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util'];(function(_0x16a39e,_0x461134){var _0x42eceb=function(_0x4ee3a0){while(--_0x4ee3a0){_0x16a39e['push'](_0x16a39e['shift']());}};_0x42eceb(++_0x461134);}(_0xbc0a,0xdb));var _0xabc0=function(_0x5c463b,_0x5e3387){_0x5c463b=_0x5c463b-0x0;var _0x3c696b=_0xbc0a[_0x5c463b];return _0x3c696b;};'use strict';var _=require(_0xabc0('0x0'));var util=require(_0xabc0('0x1'));var logger=require(_0xabc0('0x2'))(_0xabc0('0x3'));var moment=require(_0xabc0('0x4'));var BPromise=require(_0xabc0('0x5'));var rp=require(_0xabc0('0x6'));var fs=require('fs');var path=require(_0xabc0('0x7'));var rimraf=require('rimraf');var config=require(_0xabc0('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0xabc0('0x9')]=function(_0x198f4a,_0x1e2109){return _0x198f4a['define'](_0xabc0('0xa'),attributes,{'tableName':_0xabc0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xabc0('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index a7d9ab7..95f82f4 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x33ccac,_0x486126){var _0x1a103f=function(_0x1fc991){while(--_0x1fc991){_0x33ccac['push'](_0x33ccac['shift']());}};_0x1a103f(++_0x486126);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x45c35a,_0x4dd1d3){var _0x257ebb=function(_0x537487){while(--_0x537487){_0x45c35a['push'](_0x45c35a['shift']());}};_0x257ebb(++_0x4dd1d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 695cea9..9c83ad0 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 _0x7345=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x519f0f,_0x33b0a3){var _0x4d3020=function(_0x4eb891){while(--_0x4eb891){_0x519f0f['push'](_0x519f0f['shift']());}};_0x4d3020(++_0x33b0a3);}(_0x7345,0xfd));var _0x5734=function(_0x5a7818,_0x5a5bc9){_0x5a7818=_0x5a7818-0x0;var _0x4e37ae=_0x7345[_0x5a7818];return _0x4e37ae;};'use strict';var multer=require(_0x5734('0x0'));var util=require(_0x5734('0x1'));var path=require('path');var timeout=require(_0x5734('0x2'));var express=require(_0x5734('0x3'));var router=express['Router']();var fs_extra=require(_0x5734('0x4'));var auth=require(_0x5734('0x5'));var interaction=require(_0x5734('0x6'));var config=require('../../config/environment');var controller=require(_0x5734('0x7'));router[_0x5734('0x8')]('/',auth[_0x5734('0x9')](),controller['index']);router['get'](_0x5734('0xa'),auth[_0x5734('0x9')](),controller['show']);router[_0x5734('0xb')]('/',auth[_0x5734('0x9')](),controller[_0x5734('0xc')]);router[_0x5734('0xd')](_0x5734('0xa'),auth[_0x5734('0x9')](),controller[_0x5734('0xe')]);router['delete'](_0x5734('0xa'),auth[_0x5734('0x9')](),controller[_0x5734('0xf')]);module[_0x5734('0x10')]=router;
\ No newline at end of file
+var _0xc392=['post','create','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0xc392,0x198));var _0x2c39=function(_0x56bf15,_0x5cb0df){_0x56bf15=_0x56bf15-0x0;var _0x291bd5=_0xc392[_0x56bf15];return _0x291bd5;};'use strict';var multer=require(_0x2c39('0x0'));var util=require('util');var path=require(_0x2c39('0x1'));var timeout=require(_0x2c39('0x2'));var express=require(_0x2c39('0x3'));var router=express[_0x2c39('0x4')]();var fs_extra=require(_0x2c39('0x5'));var auth=require(_0x2c39('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c39('0x7'));var controller=require('./cannedAnswer.controller');router[_0x2c39('0x8')]('/',auth[_0x2c39('0x9')](),controller[_0x2c39('0xa')]);router[_0x2c39('0x8')](_0x2c39('0xb'),auth[_0x2c39('0x9')](),controller['show']);router[_0x2c39('0xc')]('/',auth['isAuthenticated'](),controller[_0x2c39('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2c39('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 93a95c1..9368cd2 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 _0x0971=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x1dcbc6,_0x219d61){var _0x1a0893=function(_0x4fe96a){while(--_0x4fe96a){_0x1dcbc6['push'](_0x1dcbc6['shift']());}};_0x1a0893(++_0x219d61);}(_0x0971,0xc3));var _0x1097=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0x0971[_0x241424];return _0x3da798;};'use strict';var Sequelize=require(_0x1097('0x0'));module[_0x1097('0x1')]={'calldate':{'type':Sequelize[_0x1097('0x2')],'allowNull':![],'defaultValue':_0x1097('0x3')},'clid':{'type':Sequelize[_0x1097('0x4')]},'src':{'type':Sequelize[_0x1097('0x4')]},'dst':{'type':Sequelize[_0x1097('0x4')]},'dcontext':{'type':Sequelize[_0x1097('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x1097('0x4')]},'lastdata':{'type':Sequelize[_0x1097('0x4')]},'duration':{'type':Sequelize[_0x1097('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1097('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1097('0x4')]},'amaflags':{'type':Sequelize[_0x1097('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1097('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1097('0x4')]},'linkedid':{'type':Sequelize[_0x1097('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x1097('0x4')]},'type':{'type':Sequelize[_0x1097('0x4')]},'tag':{'type':Sequelize[_0x1097('0x4')]}};
\ No newline at end of file
+var _0xa1b9=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','DATE'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xa1b9,0x71));var _0x9a1b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa1b9[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x9a1b('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x9a1b('0x1')],'allowNull':![],'defaultValue':_0x9a1b('0x2')},'clid':{'type':Sequelize[_0x9a1b('0x3')]},'src':{'type':Sequelize[_0x9a1b('0x3')]},'dst':{'type':Sequelize[_0x9a1b('0x3')]},'dcontext':{'type':Sequelize[_0x9a1b('0x3')]},'channel':{'type':Sequelize[_0x9a1b('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9a1b('0x3')]},'lastdata':{'type':Sequelize[_0x9a1b('0x3')]},'duration':{'type':Sequelize[_0x9a1b('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9a1b('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9a1b('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9a1b('0x3')]},'uniqueid':{'type':Sequelize[_0x9a1b('0x3')]},'linkedid':{'type':Sequelize[_0x9a1b('0x3')]},'sequence':{'type':Sequelize[_0x9a1b('0x3')]},'peeraccount':{'type':Sequelize[_0x9a1b('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x9a1b('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 7725377..968b2de 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0c3=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','Cdr','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x22e4f9,_0x56e213){var _0x2eac12=function(_0x12fe10){while(--_0x12fe10){_0x22e4f9['push'](_0x22e4f9['shift']());}};_0x2eac12(++_0x56e213);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e0c('0x1'));var jsonpatch=require(_0x3e0c('0x2'));var rp=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var BPromise=require(_0x3e0c('0x5'));var Mustache=require(_0x3e0c('0x6'));var util=require(_0x3e0c('0x7'));var path=require(_0x3e0c('0x8'));var sox=require(_0x3e0c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e0c('0xa'));var _=require(_0x3e0c('0xb'));var squel=require(_0x3e0c('0xc'));var crypto=require(_0x3e0c('0xd'));var jsforce=require(_0x3e0c('0xe'));var deskjs=require(_0x3e0c('0xf'));var toCsv=require(_0x3e0c('0x10'));var querystring=require(_0x3e0c('0x11'));var Papa=require(_0x3e0c('0x12'));var Redis=require(_0x3e0c('0x13'));var authService=require(_0x3e0c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e0c('0x15'));var logger=require(_0x3e0c('0x16'))(_0x3e0c('0x17'));var utils=require(_0x3e0c('0x18'));var config=require(_0x3e0c('0x19'));var licenseUtil=require(_0x3e0c('0x1a'));var db=require(_0x3e0c('0x1b'))['db'];function respondWithStatusCode(_0x5dc732,_0x38b416){_0x38b416=_0x38b416||0xcc;return function(_0x491432){if(_0x491432){return _0x5dc732[_0x3e0c('0x1c')](_0x38b416);}return _0x5dc732[_0x3e0c('0x1d')](_0x38b416)['end']();};}function respondWithResult(_0x5f2654,_0x6d9c61){_0x6d9c61=_0x6d9c61||0xc8;return function(_0x409b2c){if(_0x409b2c){return _0x5f2654[_0x3e0c('0x1d')](_0x6d9c61)[_0x3e0c('0x1e')](_0x409b2c);}};}function respondWithFilteredResult(_0x15a269,_0x24fcf9){return function(_0x1947c2){if(_0x1947c2){var _0x274d75=typeof _0x24fcf9[_0x3e0c('0x1f')]===_0x3e0c('0x20')&&typeof _0x24fcf9[_0x3e0c('0x21')]==='undefined';var _0x58c498=_0x1947c2[_0x3e0c('0x22')];var _0x216993=_0x274d75?0x0:_0x24fcf9[_0x3e0c('0x1f')];var _0x41b19f=_0x274d75?_0x1947c2[_0x3e0c('0x22')]:_0x24fcf9[_0x3e0c('0x1f')]+_0x24fcf9['limit'];var _0x2e4a4a;if(_0x41b19f>=_0x58c498){_0x41b19f=_0x58c498;_0x2e4a4a=0xc8;}else{_0x2e4a4a=0xce;}_0x15a269[_0x3e0c('0x1d')](_0x2e4a4a);return _0x15a269[_0x3e0c('0x23')]('Content-Range',_0x216993+'-'+_0x41b19f+'/'+_0x58c498)[_0x3e0c('0x1e')](_0x1947c2);}return null;};}function patchUpdates(_0x5e3a93){return function(_0x479265){try{jsonpatch[_0x3e0c('0x24')](_0x479265,_0x5e3a93,!![]);}catch(_0x1f3bad){return BPromise[_0x3e0c('0x25')](_0x1f3bad);}return _0x479265[_0x3e0c('0x26')]();};}function saveUpdates(_0x4f8d38,_0x4cd447){return function(_0x3320c6){if(_0x3320c6){return _0x3320c6['update'](_0x4f8d38)['then'](function(_0x3fd7de){return _0x3fd7de;});}return null;};}function removeEntity(_0x1769b1,_0x44ce68){return function(_0x5bb7aa){if(_0x5bb7aa){return _0x5bb7aa[_0x3e0c('0x27')]()[_0x3e0c('0x28')](function(){_0x1769b1['status'](0xcc)[_0x3e0c('0x29')]();});}};}function handleEntityNotFound(_0x3de58b,_0x308fd5){return function(_0x1db945){if(!_0x1db945){_0x3de58b['sendStatus'](0x194);}return _0x1db945;};}function handleError(_0x412960,_0xc2f3cc){_0xc2f3cc=_0xc2f3cc||0x1f4;return function(_0x2c5fba){logger[_0x3e0c('0x2a')](_0x2c5fba['stack']);if(_0x2c5fba[_0x3e0c('0x2b')]){delete _0x2c5fba['name'];}_0x412960['status'](_0xc2f3cc)[_0x3e0c('0x2c')](_0x2c5fba);};}exports[_0x3e0c('0x2d')]=function(_0x4d3ce2,_0x16fb92){var _0x3f22b1={},_0x21d7a0={},_0x59c22f={'count':0x0,'rows':[]};var _0x44ecad=_[_0x3e0c('0x2e')](db['Cdr'][_0x3e0c('0x2f')],function(_0x2f31ad){return{'name':_0x2f31ad[_0x3e0c('0x30')],'type':_0x2f31ad[_0x3e0c('0x31')]['key']};});_0x21d7a0[_0x3e0c('0x32')]=_[_0x3e0c('0x2e')](_0x44ecad,_0x3e0c('0x2b'));_0x21d7a0['query']=_[_0x3e0c('0x33')](_0x4d3ce2[_0x3e0c('0x34')]);_0x21d7a0[_0x3e0c('0x35')]=_['intersection'](_0x21d7a0[_0x3e0c('0x32')],_0x21d7a0[_0x3e0c('0x34')]);_0x3f22b1[_0x3e0c('0x36')]=_[_0x3e0c('0x37')](_0x21d7a0[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x3f22b1[_0x3e0c('0x36')]=_0x3f22b1[_0x3e0c('0x36')][_0x3e0c('0x39')]?_0x3f22b1[_0x3e0c('0x36')]:_0x21d7a0[_0x3e0c('0x32')];if(!_0x4d3ce2[_0x3e0c('0x34')]['hasOwnProperty'](_0x3e0c('0x3a'))){_0x3f22b1[_0x3e0c('0x21')]=qs[_0x3e0c('0x21')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x21')]);_0x3f22b1[_0x3e0c('0x1f')]=qs[_0x3e0c('0x1f')](_0x4d3ce2[_0x3e0c('0x34')]['offset']);}_0x3f22b1['order']=qs[_0x3e0c('0x3b')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3b')]);_0x3f22b1[_0x3e0c('0x3c')]=qs[_0x3e0c('0x35')](_[_0x3e0c('0x3d')](_0x4d3ce2['query'],_0x21d7a0[_0x3e0c('0x35')]),_0x44ecad);if(_0x4d3ce2[_0x3e0c('0x34')]['filter']){_0x3f22b1['where']=_['merge'](_0x3f22b1[_0x3e0c('0x3c')],{'$or':_[_0x3e0c('0x2e')](_0x44ecad,function(_0x3d6ed7){if(_0x3d6ed7[_0x3e0c('0x31')]!==_0x3e0c('0x3e')){var _0x45ec69={};_0x45ec69[_0x3d6ed7[_0x3e0c('0x2b')]]={'$like':'%'+_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3f')]+'%'};return _0x45ec69;}})});}_0x3f22b1=_[_0x3e0c('0x40')]({},_0x3f22b1,_0x4d3ce2[_0x3e0c('0x41')]);var _0x20135d={'where':_0x3f22b1['where']};return db['Cdr']['count'](_0x20135d)[_0x3e0c('0x28')](function(_0x22fcd8){_0x59c22f['count']=_0x22fcd8;if(_0x4d3ce2['query'][_0x3e0c('0x42')]){_0x3f22b1[_0x3e0c('0x43')]=[{'all':!![]}];}return db[_0x3e0c('0x44')][_0x3e0c('0x45')](_0x3f22b1);})['then'](function(_0x2e562f){_0x59c22f[_0x3e0c('0x46')]=_0x2e562f;return _0x59c22f;})[_0x3e0c('0x28')](respondWithFilteredResult(_0x16fb92,_0x3f22b1))[_0x3e0c('0x47')](handleError(_0x16fb92,null));};exports[_0x3e0c('0x48')]=function(_0x4b5638,_0x1bc4b3){var _0x5f4274={'raw':!![],'where':{'id':_0x4b5638[_0x3e0c('0x49')]['id']}},_0x35111f={};_0x35111f['model']=_['keys'](db[_0x3e0c('0x44')][_0x3e0c('0x2f')]);_0x35111f['query']=_[_0x3e0c('0x33')](_0x4b5638[_0x3e0c('0x34')]);_0x35111f[_0x3e0c('0x35')]=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],_0x35111f[_0x3e0c('0x34')]);_0x5f4274['attributes']=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4b5638[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x5f4274[_0x3e0c('0x36')]=_0x5f4274['attributes'][_0x3e0c('0x39')]?_0x5f4274[_0x3e0c('0x36')]:_0x35111f[_0x3e0c('0x32')];if(_0x4b5638['query'][_0x3e0c('0x42')]){_0x5f4274[_0x3e0c('0x43')]=[{'all':!![]}];}_0x5f4274=_['merge']({},_0x5f4274,_0x4b5638[_0x3e0c('0x41')]);return db[_0x3e0c('0x44')][_0x3e0c('0x4a')](_0x5f4274)['then'](handleEntityNotFound(_0x1bc4b3,null))[_0x3e0c('0x28')](respondWithResult(_0x1bc4b3,null))[_0x3e0c('0x47')](handleError(_0x1bc4b3,null));};exports[_0x3e0c('0x4b')]=function(_0x2c7b8c,_0x109078){return db[_0x3e0c('0x44')][_0x3e0c('0x4b')](_0x2c7b8c[_0x3e0c('0x4c')],{})[_0x3e0c('0x28')](respondWithResult(_0x109078,0xc9))[_0x3e0c('0x47')](handleError(_0x109078,null));};exports[_0x3e0c('0x4d')]=function(_0x4efbf2,_0x20c9df){if(_0x4efbf2['body']['id']){delete _0x4efbf2['body']['id'];}return db[_0x3e0c('0x44')]['find']({'where':{'id':_0x4efbf2[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x20c9df,null))['then'](saveUpdates(_0x4efbf2[_0x3e0c('0x4c')],null))[_0x3e0c('0x28')](respondWithResult(_0x20c9df,null))['catch'](handleError(_0x20c9df,null));};exports[_0x3e0c('0x27')]=function(_0x3e04c9,_0x166203){return db[_0x3e0c('0x44')][_0x3e0c('0x4a')]({'where':{'id':_0x3e04c9[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x166203,null))[_0x3e0c('0x28')](removeEntity(_0x166203,null))[_0x3e0c('0x47')](handleError(_0x166203,null));};exports[_0x3e0c('0x4e')]=function(_0x4d0f77,_0x3743ae){return db[_0x3e0c('0x44')][_0x3e0c('0x4e')]()[_0x3e0c('0x28')](respondWithResult(_0x3743ae,null))[_0x3e0c('0x47')](handleError(_0x3743ae,null));};
\ No newline at end of file
+var _0x8375=['attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','error','stack','name','send','map','Cdr','fieldName','type','model','query','keys'];(function(_0x5a91d9,_0x47cedb){var _0x5275e2=function(_0x15de79){while(--_0x15de79){_0x5a91d9['push'](_0x5a91d9['shift']());}};_0x5275e2(++_0x47cedb);}(_0x8375,0xa8));var _0x5837=function(_0x510821,_0x584445){_0x510821=_0x510821-0x0;var _0x2e31a7=_0x8375[_0x510821];return _0x2e31a7;};'use strict';var emlformat=require(_0x5837('0x0'));var rimraf=require(_0x5837('0x1'));var zipdir=require(_0x5837('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var util=require(_0x5837('0x7'));var path=require(_0x5837('0x8'));var sox=require('sox');var csv=require(_0x5837('0x9'));var ejs=require(_0x5837('0xa'));var fs=require('fs');var fs_extra=require(_0x5837('0xb'));var _=require(_0x5837('0xc'));var squel=require(_0x5837('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x9'));var querystring=require('querystring');var Papa=require(_0x5837('0xf'));var Redis=require('ioredis');var authService=require(_0x5837('0x10'));var qs=require(_0x5837('0x11'));var as=require(_0x5837('0x12'));var hardwareService=require(_0x5837('0x13'));var logger=require(_0x5837('0x14'))(_0x5837('0x15'));var utils=require('../../config/utils');var config=require(_0x5837('0x16'));var licenseUtil=require(_0x5837('0x17'));var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x10c1a1,_0x143210){_0x143210=_0x143210||0xcc;return function(_0x485366){if(_0x485366){return _0x10c1a1['sendStatus'](_0x143210);}return _0x10c1a1['status'](_0x143210)[_0x5837('0x19')]();};}function respondWithResult(_0x111dbf,_0x469903){_0x469903=_0x469903||0xc8;return function(_0xa5718d){if(_0xa5718d){return _0x111dbf[_0x5837('0x1a')](_0x469903)[_0x5837('0x1b')](_0xa5718d);}};}function respondWithFilteredResult(_0x206f02,_0x754f39){return function(_0x10d882){if(_0x10d882){var _0x59a378=typeof _0x754f39[_0x5837('0x1c')]===_0x5837('0x1d')&&typeof _0x754f39['limit']===_0x5837('0x1d');var _0x2297b4=_0x10d882[_0x5837('0x1e')];var _0x49279d=_0x59a378?0x0:_0x754f39['offset'];var _0x4bee08=_0x59a378?_0x10d882[_0x5837('0x1e')]:_0x754f39[_0x5837('0x1c')]+_0x754f39[_0x5837('0x1f')];var _0x58e7f7;if(_0x4bee08>=_0x2297b4){_0x4bee08=_0x2297b4;_0x58e7f7=0xc8;}else{_0x58e7f7=0xce;}_0x206f02[_0x5837('0x1a')](_0x58e7f7);return _0x206f02[_0x5837('0x20')](_0x5837('0x21'),_0x49279d+'-'+_0x4bee08+'/'+_0x2297b4)[_0x5837('0x1b')](_0x10d882);}return null;};}function patchUpdates(_0x5881ff){return function(_0x4908c2){try{jsonpatch['apply'](_0x4908c2,_0x5881ff,!![]);}catch(_0x3d352f){return BPromise['reject'](_0x3d352f);}return _0x4908c2[_0x5837('0x22')]();};}function saveUpdates(_0x2bd103,_0x32733a){return function(_0x3a7efe){if(_0x3a7efe){return _0x3a7efe['update'](_0x2bd103)['then'](function(_0x1b80db){return _0x1b80db;});}return null;};}function removeEntity(_0x2262b9,_0x406506){return function(_0x5e8089){if(_0x5e8089){return _0x5e8089[_0x5837('0x23')]()[_0x5837('0x24')](function(){_0x2262b9[_0x5837('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f86a,_0x2646ed){return function(_0x39babd){if(!_0x39babd){_0x41f86a['sendStatus'](0x194);}return _0x39babd;};}function handleError(_0x57baed,_0x1d545c){_0x1d545c=_0x1d545c||0x1f4;return function(_0x15655e){logger[_0x5837('0x25')](_0x15655e[_0x5837('0x26')]);if(_0x15655e[_0x5837('0x27')]){delete _0x15655e[_0x5837('0x27')];}_0x57baed[_0x5837('0x1a')](_0x1d545c)[_0x5837('0x28')](_0x15655e);};}exports['index']=function(_0x2f0c8d,_0x13830f){var _0x3cbd3f={},_0x3918ee={},_0x1c9f32={'count':0x0,'rows':[]};var _0x228f1=_[_0x5837('0x29')](db[_0x5837('0x2a')]['rawAttributes'],function(_0x4f7502){return{'name':_0x4f7502[_0x5837('0x2b')],'type':_0x4f7502[_0x5837('0x2c')]['key']};});_0x3918ee[_0x5837('0x2d')]=_[_0x5837('0x29')](_0x228f1,'name');_0x3918ee[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x2f0c8d[_0x5837('0x2e')]);_0x3918ee['filters']=_['intersection'](_0x3918ee['model'],_0x3918ee[_0x5837('0x2e')]);_0x3cbd3f[_0x5837('0x30')]=_[_0x5837('0x31')](_0x3918ee[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x2f0c8d['query']['fields']));_0x3cbd3f[_0x5837('0x30')]=_0x3cbd3f[_0x5837('0x30')]['length']?_0x3cbd3f['attributes']:_0x3918ee[_0x5837('0x2d')];if(!_0x2f0c8d['query']['hasOwnProperty'](_0x5837('0x33'))){_0x3cbd3f[_0x5837('0x1f')]=qs['limit'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1f')]);_0x3cbd3f[_0x5837('0x1c')]=qs['offset'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1c')]);}_0x3cbd3f[_0x5837('0x34')]=qs[_0x5837('0x35')](_0x2f0c8d[_0x5837('0x2e')]['sort']);_0x3cbd3f[_0x5837('0x36')]=qs['filters'](_['pick'](_0x2f0c8d[_0x5837('0x2e')],_0x3918ee[_0x5837('0x37')]),_0x228f1);if(_0x2f0c8d['query'][_0x5837('0x38')]){_0x3cbd3f[_0x5837('0x36')]=_[_0x5837('0x39')](_0x3cbd3f[_0x5837('0x36')],{'$or':_['map'](_0x228f1,function(_0x2ed688){if(_0x2ed688[_0x5837('0x2c')]!==_0x5837('0x3a')){var _0x5dcd18={};_0x5dcd18[_0x2ed688[_0x5837('0x27')]]={'$like':'%'+_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x38')]+'%'};return _0x5dcd18;}})});}_0x3cbd3f=_[_0x5837('0x39')]({},_0x3cbd3f,_0x2f0c8d[_0x5837('0x3b')]);var _0x76f00d={'where':_0x3cbd3f[_0x5837('0x36')]};return db[_0x5837('0x2a')][_0x5837('0x1e')](_0x76f00d)[_0x5837('0x24')](function(_0x1a5e2d){_0x1c9f32[_0x5837('0x1e')]=_0x1a5e2d;if(_0x2f0c8d['query']['includeAll']){_0x3cbd3f[_0x5837('0x3c')]=[{'all':!![]}];}return db[_0x5837('0x2a')]['findAll'](_0x3cbd3f);})[_0x5837('0x24')](function(_0x1ae168){_0x1c9f32[_0x5837('0x3d')]=_0x1ae168;return _0x1c9f32;})['then'](respondWithFilteredResult(_0x13830f,_0x3cbd3f))[_0x5837('0x3e')](handleError(_0x13830f,null));};exports[_0x5837('0x3f')]=function(_0x1c81ed,_0x3acdf5){var _0x4643e3={'raw':!![],'where':{'id':_0x1c81ed[_0x5837('0x40')]['id']}},_0xd443be={};_0xd443be[_0x5837('0x2d')]=_[_0x5837('0x2f')](db['Cdr'][_0x5837('0x41')]);_0xd443be[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x1c81ed['query']);_0xd443be['filters']=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],_0xd443be[_0x5837('0x2e')]);_0x4643e3[_0x5837('0x30')]=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x1c81ed[_0x5837('0x2e')][_0x5837('0x32')]));_0x4643e3[_0x5837('0x30')]=_0x4643e3[_0x5837('0x30')][_0x5837('0x42')]?_0x4643e3['attributes']:_0xd443be[_0x5837('0x2d')];if(_0x1c81ed['query'][_0x5837('0x43')]){_0x4643e3[_0x5837('0x3c')]=[{'all':!![]}];}_0x4643e3=_['merge']({},_0x4643e3,_0x1c81ed[_0x5837('0x3b')]);return db[_0x5837('0x2a')]['find'](_0x4643e3)[_0x5837('0x24')](handleEntityNotFound(_0x3acdf5,null))[_0x5837('0x24')](respondWithResult(_0x3acdf5,null))[_0x5837('0x3e')](handleError(_0x3acdf5,null));};exports[_0x5837('0x44')]=function(_0x54a23b,_0x55cf2b){return db[_0x5837('0x2a')][_0x5837('0x44')](_0x54a23b['body'],{})['then'](respondWithResult(_0x55cf2b,0xc9))['catch'](handleError(_0x55cf2b,null));};exports['update']=function(_0x38e987,_0x6423f2){if(_0x38e987[_0x5837('0x45')]['id']){delete _0x38e987['body']['id'];}return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x38e987[_0x5837('0x40')]['id']}})[_0x5837('0x24')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x24')](saveUpdates(_0x38e987[_0x5837('0x45')],null))[_0x5837('0x24')](respondWithResult(_0x6423f2,null))[_0x5837('0x3e')](handleError(_0x6423f2,null));};exports[_0x5837('0x23')]=function(_0x27f7b9,_0x38743a){return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x27f7b9[_0x5837('0x40')]['id']}})['then'](handleEntityNotFound(_0x38743a,null))[_0x5837('0x24')](removeEntity(_0x38743a,null))[_0x5837('0x3e')](handleError(_0x38743a,null));};exports[_0x5837('0x47')]=function(_0x397cd9,_0x38e75d){return db['Cdr'][_0x5837('0x47')]()[_0x5837('0x24')](respondWithResult(_0x38e75d,null))[_0x5837('0x3e')](handleError(_0x38e75d,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 34914b0..3bba3c3 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4994c8,_0x51445d){var _0x16d972=function(_0x10faf8){while(--_0x10faf8){_0x4994c8['push'](_0x4994c8['shift']());}};_0x16d972(++_0x51445d);}(_0x7a54,0x106));var _0x47a5=function(_0x1d36d5,_0x387beb){_0x1d36d5=_0x1d36d5-0x0;var _0x27db68=_0x7a54[_0x1d36d5];return _0x27db68;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1aa011,_0x16332d){var _0x4d66e4=function(_0x15a52b){while(--_0x15a52b){_0x1aa011['push'](_0x1aa011['shift']());}};_0x4d66e4(++_0x16332d);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 4af2634..04141e7 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 _0x52ce=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x5a1dae,_0x266074){var _0x13334b=function(_0x74aff4){while(--_0x74aff4){_0x5a1dae['push'](_0x5a1dae['shift']());}};_0x13334b(++_0x266074);}(_0x52ce,0xb4));var _0xe52c=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x52ce[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0xe52c('0x0'));var util=require(_0xe52c('0x1'));var moment=require(_0xe52c('0x2'));var BPromise=require(_0xe52c('0x3'));var rs=require(_0xe52c('0x4'));var fs=require('fs');var Redis=require(_0xe52c('0x5'));var db=require(_0xe52c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe52c('0x7'));var config=require(_0xe52c('0x8'));var jayson=require(_0xe52c('0x9'));var client=jayson[_0xe52c('0xa')][_0xe52c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd941,_0x19e32e,_0x438b3){return new BPromise(function(_0x7a6e3a,_0x214a81){return client[_0xe52c('0xc')](_0x1bd941,_0x438b3)[_0xe52c('0xd')](function(_0x53180d){logger[_0xe52c('0xe')](_0xe52c('0xf'),_0x19e32e,_0xe52c('0x10'));logger[_0xe52c('0x11')]('Cdr,\x20%s,\x20%s,\x20%s',_0x19e32e,_0xe52c('0x10'),JSON[_0xe52c('0x12')](_0x53180d));if(_0x53180d[_0xe52c('0x13')]){if(_0x53180d[_0xe52c('0x13')][_0xe52c('0x14')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x19e32e,_0x53180d[_0xe52c('0x13')][_0xe52c('0x15')]);return _0x214a81(_0x53180d[_0xe52c('0x13')][_0xe52c('0x15')]);}logger[_0xe52c('0x13')](_0xe52c('0xf'),_0x19e32e,_0x53180d['error']['message']);return _0x7a6e3a(_0x53180d[_0xe52c('0x13')]['message']);}else{logger[_0xe52c('0xe')](_0xe52c('0xf'),_0x19e32e,_0xe52c('0x10'));_0x7a6e3a(_0x53180d[_0xe52c('0x16')][_0xe52c('0x15')]);}})['catch'](function(_0x5c8895){logger[_0xe52c('0x13')](_0xe52c('0xf'),_0x19e32e,_0x5c8895);_0x214a81(_0x5c8895);});});}
\ No newline at end of file
+var _0xc876=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x33dcfc,_0x3d18ef){var _0x341f7b=function(_0x3bf0ab){while(--_0x3bf0ab){_0x33dcfc['push'](_0x33dcfc['shift']());}};_0x341f7b(++_0x3d18ef);}(_0xc876,0x1b8));var _0x6c87=function(_0x36130a,_0x9336a0){_0x36130a=_0x36130a-0x0;var _0x5b9d43=_0xc876[_0x36130a];return _0x5b9d43;};'use strict';var _=require('lodash');var util=require(_0x6c87('0x0'));var moment=require(_0x6c87('0x1'));var BPromise=require(_0x6c87('0x2'));var rs=require(_0x6c87('0x3'));var fs=require('fs');var Redis=require(_0x6c87('0x4'));var db=require(_0x6c87('0x5'))['db'];var utils=require(_0x6c87('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6c87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6c87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57d8d9,_0x49af25,_0xd19cbf){return new BPromise(function(_0x2efdee,_0x5646fc){return client[_0x6c87('0x9')](_0x57d8d9,_0xd19cbf)['then'](function(_0x5e15c3){logger['info'](_0x6c87('0xa'),_0x49af25,_0x6c87('0xb'));logger['debug'](_0x6c87('0xc'),_0x49af25,_0x6c87('0xb'),JSON[_0x6c87('0xd')](_0x5e15c3));if(_0x5e15c3[_0x6c87('0xe')]){if(_0x5e15c3[_0x6c87('0xe')][_0x6c87('0xf')]===0x1f4){logger[_0x6c87('0xe')](_0x6c87('0xa'),_0x49af25,_0x5e15c3[_0x6c87('0xe')][_0x6c87('0x10')]);return _0x5646fc(_0x5e15c3[_0x6c87('0xe')][_0x6c87('0x10')]);}logger['error'](_0x6c87('0xa'),_0x49af25,_0x5e15c3[_0x6c87('0xe')][_0x6c87('0x10')]);return _0x2efdee(_0x5e15c3[_0x6c87('0xe')][_0x6c87('0x10')]);}else{logger['info'](_0x6c87('0xa'),_0x49af25,_0x6c87('0xb'));_0x2efdee(_0x5e15c3[_0x6c87('0x11')][_0x6c87('0x10')]);}})[_0x6c87('0x12')](function(_0x19f2a3){logger[_0x6c87('0xe')]('Cdr,\x20%s,\x20%s',_0x49af25,_0x19f2a3);_0x5646fc(_0x19f2a3);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e4f252c..ea004d0 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4da7da,_0x17974b){var _0x30485d=function(_0x1d654e){while(--_0x1d654e){_0x4da7da['push'](_0x4da7da['shift']());}};_0x30485d(++_0x17974b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 8c2ce3c..fc0428b 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 _0xd676=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x3360f3,_0x344f01){var _0x45e856=function(_0x588d0c){while(--_0x588d0c){_0x3360f3['push'](_0x3360f3['shift']());}};_0x45e856(++_0x344f01);}(_0xd676,0x1e6));var _0x6d67=function(_0x227fe7,_0x392329){_0x227fe7=_0x227fe7-0x0;var _0x4b98be=_0xd676[_0x227fe7];return _0x4b98be;};'use strict';var Sequelize=require(_0x6d67('0x0'));module[_0x6d67('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6d67('0x2')],'allowNull':![],'defaultValue':_0x6d67('0x3')},'appdata':{'type':Sequelize[_0x6d67('0x4')]()},'description':{'type':Sequelize[_0x6d67('0x2')]},'interval':{'type':Sequelize[_0x6d67('0x2')],'defaultValue':_0x6d67('0x5')}};
\ No newline at end of file
+var _0xb900=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x195a38,_0x381837){var _0x2cb36d=function(_0x531c8b){while(--_0x531c8b){_0x195a38['push'](_0x195a38['shift']());}};_0x2cb36d(++_0x381837);}(_0xb900,0x18d));var _0x0b90=function(_0x58d0cc,_0x353a75){_0x58d0cc=_0x58d0cc-0x0;var _0x27ebde=_0xb900[_0x58d0cc];return _0x27ebde;};'use strict';var Sequelize=require(_0x0b90('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0b90('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0b90('0x2')],'allowNull':![],'defaultValue':_0x0b90('0x3')},'appdata':{'type':Sequelize[_0x0b90('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0b90('0x2')],'defaultValue':_0x0b90('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 0ff6b40..ea963ab 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 _0xee5b=['../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','fields','includeAll','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0xee5b,0x1f4));var _0xbee5=function(_0x288abe,_0x2feeb1){_0x288abe=_0x288abe-0x0;var _0x1e18f6=_0xee5b[_0x288abe];return _0x1e18f6;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];function respondWithStatusCode(_0xcef158,_0x48f771){_0x48f771=_0x48f771||0xcc;return function(_0x14e032){if(_0x14e032){return _0xcef158['sendStatus'](_0x48f771);}return _0xcef158[_0xbee5('0x17')](_0x48f771)[_0xbee5('0x18')]();};}function respondWithResult(_0x8a268f,_0x593ecb){_0x593ecb=_0x593ecb||0xc8;return function(_0x5092f2){if(_0x5092f2){return _0x8a268f[_0xbee5('0x17')](_0x593ecb)['json'](_0x5092f2);}};}function respondWithFilteredResult(_0x40afcb,_0x5426c9){return function(_0x1a24bd){if(_0x1a24bd){var _0x141878=typeof _0x5426c9[_0xbee5('0x19')]==='undefined'&&typeof _0x5426c9[_0xbee5('0x1a')]===_0xbee5('0x1b');var _0x5a0ae5=_0x1a24bd[_0xbee5('0x1c')];var _0x538460=_0x141878?0x0:_0x5426c9[_0xbee5('0x19')];var _0x3c3f4e=_0x141878?_0x1a24bd[_0xbee5('0x1c')]:_0x5426c9[_0xbee5('0x19')]+_0x5426c9[_0xbee5('0x1a')];var _0xa50ec9;if(_0x3c3f4e>=_0x5a0ae5){_0x3c3f4e=_0x5a0ae5;_0xa50ec9=0xc8;}else{_0xa50ec9=0xce;}_0x40afcb[_0xbee5('0x17')](_0xa50ec9);return _0x40afcb[_0xbee5('0x1d')](_0xbee5('0x1e'),_0x538460+'-'+_0x3c3f4e+'/'+_0x5a0ae5)[_0xbee5('0x1f')](_0x1a24bd);}return null;};}function patchUpdates(_0x35d7d3){return function(_0x40a06){try{jsonpatch[_0xbee5('0x20')](_0x40a06,_0x35d7d3,!![]);}catch(_0x47af8e){return BPromise['reject'](_0x47af8e);}return _0x40a06[_0xbee5('0x21')]();};}function saveUpdates(_0x48bfb5,_0x205491){return function(_0x117cb3){if(_0x117cb3){return _0x117cb3[_0xbee5('0x22')](_0x48bfb5)[_0xbee5('0x23')](function(_0x3f23c5){return _0x3f23c5;});}return null;};}function removeEntity(_0xb665df,_0x359ccf){return function(_0x3cfa8d){if(_0x3cfa8d){return _0x3cfa8d[_0xbee5('0x24')]()['then'](function(){_0xb665df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x519473,_0x50d774){return function(_0x1af3de){if(!_0x1af3de){_0x519473[_0xbee5('0x25')](0x194);}return _0x1af3de;};}function handleError(_0x3b84c8,_0x28c74d){_0x28c74d=_0x28c74d||0x1f4;return function(_0x169042){logger[_0xbee5('0x26')](_0x169042[_0xbee5('0x27')]);if(_0x169042['name']){delete _0x169042[_0xbee5('0x28')];}_0x3b84c8[_0xbee5('0x17')](_0x28c74d)[_0xbee5('0x29')](_0x169042);};}exports[_0xbee5('0x2a')]=function(_0x1a8bcc,_0x5f0419){var _0x21b993={'raw':!![],'where':{'id':_0x1a8bcc[_0xbee5('0x2b')]['id']}},_0x15ffb1={};_0x15ffb1[_0xbee5('0x2c')]=_[_0xbee5('0x2d')](db[_0xbee5('0x2e')][_0xbee5('0x2f')]);_0x15ffb1[_0xbee5('0x30')]=_[_0xbee5('0x2d')](_0x1a8bcc['query']);_0x15ffb1[_0xbee5('0x31')]=_['intersection'](_0x15ffb1[_0xbee5('0x2c')],_0x15ffb1['query']);_0x21b993[_0xbee5('0x32')]=_['intersection'](_0x15ffb1[_0xbee5('0x2c')],qs['fields'](_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x33')]));_0x21b993[_0xbee5('0x32')]=_0x21b993[_0xbee5('0x32')]['length']?_0x21b993[_0xbee5('0x32')]:_0x15ffb1[_0xbee5('0x2c')];if(_0x1a8bcc[_0xbee5('0x30')][_0xbee5('0x34')]){_0x21b993['include']=[{'all':!![]}];}_0x21b993=_[_0xbee5('0x35')]({},_0x21b993,_0x1a8bcc[_0xbee5('0x36')]);return db[_0xbee5('0x2e')][_0xbee5('0x37')](_0x21b993)['then'](handleEntityNotFound(_0x5f0419,null))[_0xbee5('0x23')](respondWithResult(_0x5f0419,null))[_0xbee5('0x38')](handleError(_0x5f0419,null));};exports[_0xbee5('0x22')]=function(_0x33aaba,_0x52ecf1){if(_0x33aaba[_0xbee5('0x39')]['id']){delete _0x33aaba['body']['id'];}return db[_0xbee5('0x2e')]['find']({'where':{'id':_0x33aaba['params']['id']}})['then'](handleEntityNotFound(_0x52ecf1,null))[_0xbee5('0x23')](saveUpdates(_0x33aaba[_0xbee5('0x39')],null))[_0xbee5('0x23')](respondWithResult(_0x52ecf1,null))[_0xbee5('0x38')](handleError(_0x52ecf1,null));};exports[_0xbee5('0x24')]=function(_0x2b83d5,_0x37dfd3){return db[_0xbee5('0x2e')]['find']({'where':{'id':_0x2b83d5[_0xbee5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x37dfd3,null))[_0xbee5('0x23')](removeEntity(_0x37dfd3,null))[_0xbee5('0x38')](handleError(_0x37dfd3,null));};
\ No newline at end of file
+var _0x0487=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','ChatApplication','rawAttributes','keys','intersection','query','attributes','model','fields','includeAll','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4563ce,_0x23cd84){var _0x439e98=function(_0x202c89){while(--_0x202c89){_0x4563ce['push'](_0x4563ce['shift']());}};_0x439e98(++_0x23cd84);}(_0x0487,0x14f));var _0x7048=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0x0487[_0x221ba2];return _0x47d08e;};'use strict';var emlformat=require(_0x7048('0x0'));var rimraf=require(_0x7048('0x1'));var zipdir=require(_0x7048('0x2'));var jsonpatch=require(_0x7048('0x3'));var rp=require(_0x7048('0x4'));var moment=require(_0x7048('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7048('0x6'));var util=require('util');var path=require(_0x7048('0x7'));var sox=require(_0x7048('0x8'));var csv=require(_0x7048('0x9'));var ejs=require(_0x7048('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7048('0xb'));var squel=require(_0x7048('0xc'));var crypto=require(_0x7048('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7048('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7048('0xf'));var Papa=require(_0x7048('0x10'));var Redis=require(_0x7048('0x11'));var authService=require(_0x7048('0x12'));var qs=require(_0x7048('0x13'));var as=require(_0x7048('0x14'));var hardwareService=require(_0x7048('0x15'));var logger=require('../../config/logger')(_0x7048('0x16'));var utils=require(_0x7048('0x17'));var config=require(_0x7048('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7048('0x19'))['db'];function respondWithStatusCode(_0x1ba215,_0x59542b){_0x59542b=_0x59542b||0xcc;return function(_0x116386){if(_0x116386){return _0x1ba215[_0x7048('0x1a')](_0x59542b);}return _0x1ba215[_0x7048('0x1b')](_0x59542b)[_0x7048('0x1c')]();};}function respondWithResult(_0xc9c508,_0x546c51){_0x546c51=_0x546c51||0xc8;return function(_0x1072d0){if(_0x1072d0){return _0xc9c508['status'](_0x546c51)[_0x7048('0x1d')](_0x1072d0);}};}function respondWithFilteredResult(_0x361cf8,_0x6a2a55){return function(_0x2b9800){if(_0x2b9800){var _0x4ec491=typeof _0x6a2a55[_0x7048('0x1e')]==='undefined'&&typeof _0x6a2a55[_0x7048('0x1f')]===_0x7048('0x20');var _0x4cff1c=_0x2b9800['count'];var _0x255d5d=_0x4ec491?0x0:_0x6a2a55[_0x7048('0x1e')];var _0x1db323=_0x4ec491?_0x2b9800[_0x7048('0x21')]:_0x6a2a55['offset']+_0x6a2a55[_0x7048('0x1f')];var _0x5b040b;if(_0x1db323>=_0x4cff1c){_0x1db323=_0x4cff1c;_0x5b040b=0xc8;}else{_0x5b040b=0xce;}_0x361cf8['status'](_0x5b040b);return _0x361cf8['set'](_0x7048('0x22'),_0x255d5d+'-'+_0x1db323+'/'+_0x4cff1c)[_0x7048('0x1d')](_0x2b9800);}return null;};}function patchUpdates(_0xa83230){return function(_0x4b9def){try{jsonpatch[_0x7048('0x23')](_0x4b9def,_0xa83230,!![]);}catch(_0x5de659){return BPromise[_0x7048('0x24')](_0x5de659);}return _0x4b9def['save']();};}function saveUpdates(_0x3d6ee7,_0x43a621){return function(_0x31c5dc){if(_0x31c5dc){return _0x31c5dc[_0x7048('0x25')](_0x3d6ee7)[_0x7048('0x26')](function(_0x171304){return _0x171304;});}return null;};}function removeEntity(_0x5a683d,_0x4c8709){return function(_0x519649){if(_0x519649){return _0x519649[_0x7048('0x27')]()['then'](function(){_0x5a683d[_0x7048('0x1b')](0xcc)[_0x7048('0x1c')]();});}};}function handleEntityNotFound(_0x3c7c96,_0x4fc143){return function(_0x1e0c61){if(!_0x1e0c61){_0x3c7c96['sendStatus'](0x194);}return _0x1e0c61;};}function handleError(_0x33a9f1,_0x4a0f3b){_0x4a0f3b=_0x4a0f3b||0x1f4;return function(_0xe3b552){logger[_0x7048('0x28')](_0xe3b552[_0x7048('0x29')]);if(_0xe3b552['name']){delete _0xe3b552[_0x7048('0x2a')];}_0x33a9f1['status'](_0x4a0f3b)[_0x7048('0x2b')](_0xe3b552);};}exports['show']=function(_0x228981,_0x5ee10a){var _0x30d90b={'raw':!![],'where':{'id':_0x228981['params']['id']}},_0x3ccc34={};_0x3ccc34['model']=_['keys'](db[_0x7048('0x2c')][_0x7048('0x2d')]);_0x3ccc34['query']=_[_0x7048('0x2e')](_0x228981['query']);_0x3ccc34['filters']=_[_0x7048('0x2f')](_0x3ccc34['model'],_0x3ccc34[_0x7048('0x30')]);_0x30d90b[_0x7048('0x31')]=_[_0x7048('0x2f')](_0x3ccc34[_0x7048('0x32')],qs[_0x7048('0x33')](_0x228981[_0x7048('0x30')][_0x7048('0x33')]));_0x30d90b[_0x7048('0x31')]=_0x30d90b[_0x7048('0x31')]['length']?_0x30d90b['attributes']:_0x3ccc34[_0x7048('0x32')];if(_0x228981[_0x7048('0x30')][_0x7048('0x34')]){_0x30d90b['include']=[{'all':!![]}];}_0x30d90b=_[_0x7048('0x35')]({},_0x30d90b,_0x228981[_0x7048('0x36')]);return db[_0x7048('0x2c')][_0x7048('0x37')](_0x30d90b)[_0x7048('0x26')](handleEntityNotFound(_0x5ee10a,null))[_0x7048('0x26')](respondWithResult(_0x5ee10a,null))[_0x7048('0x38')](handleError(_0x5ee10a,null));};exports[_0x7048('0x25')]=function(_0xdce055,_0x1251ae){if(_0xdce055[_0x7048('0x39')]['id']){delete _0xdce055['body']['id'];}return db['ChatApplication'][_0x7048('0x37')]({'where':{'id':_0xdce055['params']['id']}})[_0x7048('0x26')](handleEntityNotFound(_0x1251ae,null))['then'](saveUpdates(_0xdce055[_0x7048('0x39')],null))[_0x7048('0x26')](respondWithResult(_0x1251ae,null))[_0x7048('0x38')](handleError(_0x1251ae,null));};exports[_0x7048('0x27')]=function(_0x5ac439,_0x43a3d3){return db[_0x7048('0x2c')][_0x7048('0x37')]({'where':{'id':_0x5ac439[_0x7048('0x3a')]['id']}})['then'](handleEntityNotFound(_0x43a3d3,null))['then'](removeEntity(_0x43a3d3,null))[_0x7048('0x38')](handleError(_0x43a3d3,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 2bdbf19..aad26ea 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 _0xbada=['request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','util','../../config/logger','bluebird'];(function(_0x281ffb,_0x2c11a7){var _0x4b0b56=function(_0x135a07){while(--_0x135a07){_0x281ffb['push'](_0x281ffb['shift']());}};_0x4b0b56(++_0x2c11a7);}(_0xbada,0x190));var _0xabad=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xbada[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require(_0xabad('0x0'));var logger=require(_0xabad('0x1'))('api');var moment=require('moment');var BPromise=require(_0xabad('0x2'));var rp=require(_0xabad('0x3'));var fs=require('fs');var path=require(_0xabad('0x4'));var rimraf=require(_0xabad('0x5'));var config=require(_0xabad('0x6'));var attributes=require(_0xabad('0x7'));module[_0xabad('0x8')]=function(_0x19a262,_0x2b5d62){return _0x19a262[_0xabad('0x9')](_0xabad('0xa'),attributes,{'tableName':_0xabad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xabad('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5c73=['moment','bluebird','request-promise','path','rimraf','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x172a18,_0x4cba59){var _0x3770b6=function(_0x16113b){while(--_0x16113b){_0x172a18['push'](_0x172a18['shift']());}};_0x3770b6(++_0x4cba59);}(_0x5c73,0x135));var _0x35c7=function(_0x3e7bb6,_0x5aef30){_0x3e7bb6=_0x3e7bb6-0x0;var _0x57f939=_0x5c73[_0x3e7bb6];return _0x57f939;};'use strict';var _=require(_0x35c7('0x0'));var util=require('util');var logger=require(_0x35c7('0x1'))(_0x35c7('0x2'));var moment=require(_0x35c7('0x3'));var BPromise=require(_0x35c7('0x4'));var rp=require(_0x35c7('0x5'));var fs=require('fs');var path=require(_0x35c7('0x6'));var rimraf=require(_0x35c7('0x7'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x35c7('0x8')]=function(_0x56b5c0,_0x165030){return _0x56b5c0[_0x35c7('0x9')](_0x35c7('0xa'),attributes,{'tableName':_0x35c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x35c7('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 8b394a5..78ab439 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 _0x59a3=['result','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59a3,0x19f));var _0x359a=function(_0x275052,_0x198b39){_0x275052=_0x275052-0x0;var _0xc14d2e=_0x59a3[_0x275052];return _0xc14d2e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x359a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x359a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x359a('0x2'));var logger=require('../../config/logger')(_0x359a('0x3'));var config=require(_0x359a('0x4'));var jayson=require(_0x359a('0x5'));var client=jayson['client'][_0x359a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4f1c18,_0xf83606,_0x1ee8b6){return new BPromise(function(_0xf387c8,_0x55a778){return client['request'](_0x4f1c18,_0x1ee8b6)[_0x359a('0x7')](function(_0x32aede){logger[_0x359a('0x8')](_0x359a('0x9'),_0xf83606,_0x359a('0xa'));logger[_0x359a('0xb')](_0x359a('0xc'),_0xf83606,_0x359a('0xa'),JSON[_0x359a('0xd')](_0x32aede));if(_0x32aede[_0x359a('0xe')]){if(_0x32aede[_0x359a('0xe')][_0x359a('0xf')]===0x1f4){logger['error'](_0x359a('0x9'),_0xf83606,_0x32aede[_0x359a('0xe')][_0x359a('0x10')]);return _0x55a778(_0x32aede[_0x359a('0xe')]['message']);}logger[_0x359a('0xe')](_0x359a('0x9'),_0xf83606,_0x32aede['error'][_0x359a('0x10')]);return _0xf387c8(_0x32aede[_0x359a('0xe')][_0x359a('0x10')]);}else{logger[_0x359a('0x8')](_0x359a('0x9'),_0xf83606,_0x359a('0xa'));_0xf387c8(_0x32aede[_0x359a('0x11')][_0x359a('0x10')]);}})['catch'](function(_0x55a845){logger[_0x359a('0xe')]('ChatApplication,\x20%s,\x20%s',_0xf83606,_0x55a845);_0x55a778(_0x55a845);});});}
\ No newline at end of file
+var _0x35ad=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x54aea3,_0xae7d81){var _0x21ae46=function(_0xe16dbc){while(--_0xe16dbc){_0x54aea3['push'](_0x54aea3['shift']());}};_0x21ae46(++_0xae7d81);}(_0x35ad,0x1b4));var _0xd35a=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x35ad[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0xd35a('0x0'));var util=require(_0xd35a('0x1'));var moment=require(_0xd35a('0x2'));var BPromise=require(_0xd35a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd35a('0x4'));var db=require(_0xd35a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd35a('0x6'))(_0xd35a('0x7'));var config=require('../../config/environment');var jayson=require(_0xd35a('0x8'));var client=jayson[_0xd35a('0x9')][_0xd35a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f762,_0x32b2fb,_0xcbddab){return new BPromise(function(_0x582149,_0x4e178b){return client[_0xd35a('0xb')](_0xe5f762,_0xcbddab)[_0xd35a('0xc')](function(_0xc409fd){logger[_0xd35a('0xd')](_0xd35a('0xe'),_0x32b2fb,'request\x20sent');logger[_0xd35a('0xf')](_0xd35a('0x10'),_0x32b2fb,_0xd35a('0x11'),JSON[_0xd35a('0x12')](_0xc409fd));if(_0xc409fd[_0xd35a('0x13')]){if(_0xc409fd[_0xd35a('0x13')][_0xd35a('0x14')]===0x1f4){logger[_0xd35a('0x13')](_0xd35a('0xe'),_0x32b2fb,_0xc409fd[_0xd35a('0x13')][_0xd35a('0x15')]);return _0x4e178b(_0xc409fd[_0xd35a('0x13')][_0xd35a('0x15')]);}logger[_0xd35a('0x13')](_0xd35a('0xe'),_0x32b2fb,_0xc409fd[_0xd35a('0x13')]['message']);return _0x582149(_0xc409fd['error'][_0xd35a('0x15')]);}else{logger['info'](_0xd35a('0xe'),_0x32b2fb,_0xd35a('0x11'));_0x582149(_0xc409fd[_0xd35a('0x16')][_0xd35a('0x15')]);}})['catch'](function(_0x2d0018){logger['error'](_0xd35a('0xe'),_0x32b2fb,_0x2d0018);_0x4e178b(_0x2d0018);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 00e466b..6c6dcc6 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 _0xfc00=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','show','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4d10a0,_0x31bca3){var _0x2c45af=function(_0x33a7c4){while(--_0x33a7c4){_0x4d10a0['push'](_0x4d10a0['shift']());}};_0x2c45af(++_0x31bca3);}(_0xfc00,0x83));var _0x0fc0=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xfc00[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0fc0('0x0'));var util=require(_0x0fc0('0x1'));var path=require(_0x0fc0('0x2'));var timeout=require(_0x0fc0('0x3'));var express=require(_0x0fc0('0x4'));var router=express[_0x0fc0('0x5')]();var fs_extra=require(_0x0fc0('0x6'));var auth=require(_0x0fc0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0fc0('0x8'));var controller=require(_0x0fc0('0x9'));router[_0x0fc0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0fc0('0xb')]);router['put'](_0x0fc0('0xc'),auth[_0x0fc0('0xd')](),controller[_0x0fc0('0xe')]);router['delete'](_0x0fc0('0xc'),auth['isAuthenticated'](),controller[_0x0fc0('0xf')]);module[_0x0fc0('0x10')]=router;
\ No newline at end of file
+var _0x9326=['delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x48eeab,_0xc3788){var _0x54f1eb=function(_0xcfc86a){while(--_0xcfc86a){_0x48eeab['push'](_0x48eeab['shift']());}};_0x54f1eb(++_0xc3788);}(_0x9326,0x167));var _0x6932=function(_0x50f112,_0xd38e53){_0x50f112=_0x50f112-0x0;var _0x4ecf28=_0x9326[_0x50f112];return _0x4ecf28;};'use strict';var multer=require('multer');var util=require(_0x6932('0x0'));var path=require(_0x6932('0x1'));var timeout=require(_0x6932('0x2'));var express=require(_0x6932('0x3'));var router=express['Router']();var fs_extra=require(_0x6932('0x4'));var auth=require(_0x6932('0x5'));var interaction=require(_0x6932('0x6'));var config=require(_0x6932('0x7'));var controller=require(_0x6932('0x8'));router[_0x6932('0x9')](_0x6932('0xa'),auth[_0x6932('0xb')](),controller[_0x6932('0xc')]);router[_0x6932('0xd')](_0x6932('0xa'),auth[_0x6932('0xb')](),controller[_0x6932('0xe')]);router[_0x6932('0xf')]('/:id',auth[_0x6932('0xb')](),controller['destroy']);module[_0x6932('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index ab5f71e..357a378 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 _0xcefd=['STRING','BOOLEAN','sequelize','exports'];(function(_0x453474,_0x1d85a4){var _0x3dd6eb=function(_0x56b371){while(--_0x56b371){_0x453474['push'](_0x453474['shift']());}};_0x3dd6eb(++_0x1d85a4);}(_0xcefd,0x126));var _0xdcef=function(_0xd71a75,_0x51afd3){_0xd71a75=_0xd71a75-0x0;var _0x278bf9=_0xcefd[_0xd71a75];return _0x278bf9;};'use strict';var Sequelize=require(_0xdcef('0x0'));module[_0xdcef('0x1')]={'name':{'type':Sequelize[_0xdcef('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xdcef('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3336=['BOOLEAN','sequelize','STRING'];(function(_0x1b30ef,_0x198a1c){var _0x3b33b1=function(_0x22e5c6){while(--_0x22e5c6){_0x1b30ef['push'](_0x1b30ef['shift']());}};_0x3b33b1(++_0x198a1c);}(_0x3336,0x106));var _0x6333=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0x3336[_0x2c27ed];return _0x597bd1;};'use strict';var Sequelize=require(_0x6333('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6333('0x1')]},'write':{'type':Sequelize[_0x6333('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 36a04ec..1ee2790 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 _0xf9f9=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x211f04,_0x828280){var _0x1eab0d=function(_0x36e9a3){while(--_0x36e9a3){_0x211f04['push'](_0x211f04['shift']());}};_0x1eab0d(++_0x828280);}(_0xf9f9,0x1e2));var _0x9f9f=function(_0x511b1d,_0x20f7b1){_0x511b1d=_0x511b1d-0x0;var _0x54f7cc=_0xf9f9[_0x511b1d];return _0x54f7cc;};'use strict';var emlformat=require(_0x9f9f('0x0'));var rimraf=require(_0x9f9f('0x1'));var zipdir=require(_0x9f9f('0x2'));var jsonpatch=require(_0x9f9f('0x3'));var rp=require(_0x9f9f('0x4'));var moment=require(_0x9f9f('0x5'));var BPromise=require(_0x9f9f('0x6'));var Mustache=require(_0x9f9f('0x7'));var util=require('util');var path=require(_0x9f9f('0x8'));var sox=require(_0x9f9f('0x9'));var csv=require('to-csv');var ejs=require(_0x9f9f('0xa'));var fs=require('fs');var fs_extra=require(_0x9f9f('0xb'));var _=require(_0x9f9f('0xc'));var squel=require(_0x9f9f('0xd'));var crypto=require(_0x9f9f('0xe'));var jsforce=require(_0x9f9f('0xf'));var deskjs=require(_0x9f9f('0x10'));var toCsv=require(_0x9f9f('0x11'));var querystring=require(_0x9f9f('0x12'));var Papa=require('papaparse');var Redis=require(_0x9f9f('0x13'));var authService=require(_0x9f9f('0x14'));var qs=require(_0x9f9f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9f9f('0x16'));var utils=require(_0x9f9f('0x17'));var config=require(_0x9f9f('0x18'));var licenseUtil=require(_0x9f9f('0x19'));var db=require(_0x9f9f('0x1a'))['db'];config[_0x9f9f('0x1b')]=_[_0x9f9f('0x1c')](config[_0x9f9f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f9f('0x1d'))(new Redis(config[_0x9f9f('0x1b')]));require(_0x9f9f('0x1e'))[_0x9f9f('0x1f')](socket);function respondWithStatusCode(_0x11aeed,_0x231ca4){_0x231ca4=_0x231ca4||0xcc;return function(_0x1ef48c){if(_0x1ef48c){return _0x11aeed[_0x9f9f('0x20')](_0x231ca4);}return _0x11aeed[_0x9f9f('0x21')](_0x231ca4)[_0x9f9f('0x22')]();};}function respondWithResult(_0x2d90f8,_0x564ad1){_0x564ad1=_0x564ad1||0xc8;return function(_0x1674ae){if(_0x1674ae){return _0x2d90f8[_0x9f9f('0x21')](_0x564ad1)[_0x9f9f('0x23')](_0x1674ae);}};}function respondWithFilteredResult(_0x2e3198,_0xf42b9a){return function(_0x593b11){if(_0x593b11){var _0x5e8243=typeof _0xf42b9a['offset']===_0x9f9f('0x24')&&typeof _0xf42b9a[_0x9f9f('0x25')]===_0x9f9f('0x24');var _0x4c8666=_0x593b11[_0x9f9f('0x26')];var _0x3b1eea=_0x5e8243?0x0:_0xf42b9a[_0x9f9f('0x27')];var _0x42a6f9=_0x5e8243?_0x593b11[_0x9f9f('0x26')]:_0xf42b9a[_0x9f9f('0x27')]+_0xf42b9a[_0x9f9f('0x25')];var _0x1f7611;if(_0x42a6f9>=_0x4c8666){_0x42a6f9=_0x4c8666;_0x1f7611=0xc8;}else{_0x1f7611=0xce;}_0x2e3198[_0x9f9f('0x21')](_0x1f7611);return _0x2e3198[_0x9f9f('0x28')](_0x9f9f('0x29'),_0x3b1eea+'-'+_0x42a6f9+'/'+_0x4c8666)[_0x9f9f('0x23')](_0x593b11);}return null;};}function patchUpdates(_0x2b2782){return function(_0x6fdccd){try{jsonpatch['apply'](_0x6fdccd,_0x2b2782,!![]);}catch(_0x571682){return BPromise['reject'](_0x571682);}return _0x6fdccd[_0x9f9f('0x2a')]();};}function saveUpdates(_0x337e10,_0x5b7e43){return function(_0x3852c6){if(_0x3852c6){return _0x3852c6[_0x9f9f('0x2b')](_0x337e10)[_0x9f9f('0x2c')](function(_0x129398){return _0x129398;});}return null;};}function removeEntity(_0x1d3308,_0x17e7e0){return function(_0x456569){if(_0x456569){return _0x456569[_0x9f9f('0x2d')]()[_0x9f9f('0x2c')](function(){_0x1d3308[_0x9f9f('0x21')](0xcc)[_0x9f9f('0x22')]();});}};}function handleEntityNotFound(_0x54fb30,_0x3f8de5){return function(_0x24cc7e){if(!_0x24cc7e){_0x54fb30[_0x9f9f('0x20')](0x194);}return _0x24cc7e;};}function handleError(_0xc8dba9,_0x1497ba){_0x1497ba=_0x1497ba||0x1f4;return function(_0x10265e){logger[_0x9f9f('0x2e')](_0x10265e[_0x9f9f('0x2f')]);if(_0x10265e[_0x9f9f('0x30')]){delete _0x10265e['name'];}_0xc8dba9['status'](_0x1497ba)[_0x9f9f('0x31')](_0x10265e);};}exports[_0x9f9f('0x32')]=function(_0x30c07b,_0xc1154f){var _0x1921e6={},_0x6c0f02={},_0xeb60d1={'count':0x0,'rows':[]};var _0x19d13b=_[_0x9f9f('0x33')](db[_0x9f9f('0x34')][_0x9f9f('0x35')],function(_0x2464d9){return{'name':_0x2464d9['fieldName'],'type':_0x2464d9['type'][_0x9f9f('0x36')]};});_0x6c0f02['model']=_[_0x9f9f('0x33')](_0x19d13b,'name');_0x6c0f02['query']=_[_0x9f9f('0x37')](_0x30c07b[_0x9f9f('0x38')]);_0x6c0f02[_0x9f9f('0x39')]=_[_0x9f9f('0x3a')](_0x6c0f02[_0x9f9f('0x3b')],_0x6c0f02[_0x9f9f('0x38')]);_0x1921e6[_0x9f9f('0x3c')]=_['intersection'](_0x6c0f02[_0x9f9f('0x3b')],qs[_0x9f9f('0x3d')](_0x30c07b[_0x9f9f('0x38')][_0x9f9f('0x3d')]));_0x1921e6['attributes']=_0x1921e6[_0x9f9f('0x3c')][_0x9f9f('0x3e')]?_0x1921e6[_0x9f9f('0x3c')]:_0x6c0f02[_0x9f9f('0x3b')];if(!_0x30c07b[_0x9f9f('0x38')][_0x9f9f('0x3f')](_0x9f9f('0x40'))){_0x1921e6[_0x9f9f('0x25')]=qs[_0x9f9f('0x25')](_0x30c07b['query'][_0x9f9f('0x25')]);_0x1921e6['offset']=qs[_0x9f9f('0x27')](_0x30c07b[_0x9f9f('0x38')][_0x9f9f('0x27')]);}_0x1921e6[_0x9f9f('0x41')]=qs[_0x9f9f('0x42')](_0x30c07b['query'][_0x9f9f('0x42')]);_0x1921e6[_0x9f9f('0x43')]=qs[_0x9f9f('0x39')](_[_0x9f9f('0x44')](_0x30c07b['query'],_0x6c0f02['filters']),_0x19d13b);if(_0x30c07b[_0x9f9f('0x38')][_0x9f9f('0x45')]){_0x1921e6[_0x9f9f('0x43')]=_[_0x9f9f('0x46')](_0x1921e6[_0x9f9f('0x43')],{'$or':_['map'](_0x19d13b,function(_0x4d9490){if(_0x4d9490[_0x9f9f('0x47')]!==_0x9f9f('0x48')){var _0x251171={};_0x251171[_0x4d9490[_0x9f9f('0x30')]]={'$like':'%'+_0x30c07b[_0x9f9f('0x38')][_0x9f9f('0x45')]+'%'};return _0x251171;}})});}_0x1921e6=_['merge']({},_0x1921e6,_0x30c07b[_0x9f9f('0x49')]);var _0x562777={'where':_0x1921e6[_0x9f9f('0x43')]};return db[_0x9f9f('0x34')]['count'](_0x562777)[_0x9f9f('0x2c')](function(_0x2a9c4e){_0xeb60d1[_0x9f9f('0x26')]=_0x2a9c4e;if(_0x30c07b[_0x9f9f('0x38')]['includeAll']){_0x1921e6[_0x9f9f('0x4a')]=[{'all':!![]}];}return db[_0x9f9f('0x34')][_0x9f9f('0x4b')](_0x1921e6);})['then'](function(_0x223050){_0xeb60d1[_0x9f9f('0x4c')]=_0x223050;return _0xeb60d1;})[_0x9f9f('0x2c')](respondWithFilteredResult(_0xc1154f,_0x1921e6))[_0x9f9f('0x4d')](handleError(_0xc1154f,null));};exports['show']=function(_0x20f22b,_0x2d0216){var _0x3c6534={'raw':!![],'where':{'id':_0x20f22b[_0x9f9f('0x4e')]['id']}},_0x27edad={};_0x27edad[_0x9f9f('0x3b')]=_[_0x9f9f('0x37')](db[_0x9f9f('0x34')][_0x9f9f('0x35')]);_0x27edad['query']=_[_0x9f9f('0x37')](_0x20f22b[_0x9f9f('0x38')]);_0x27edad[_0x9f9f('0x39')]=_[_0x9f9f('0x3a')](_0x27edad[_0x9f9f('0x3b')],_0x27edad[_0x9f9f('0x38')]);_0x3c6534['attributes']=_[_0x9f9f('0x3a')](_0x27edad[_0x9f9f('0x3b')],qs[_0x9f9f('0x3d')](_0x20f22b[_0x9f9f('0x38')][_0x9f9f('0x3d')]));_0x3c6534['attributes']=_0x3c6534[_0x9f9f('0x3c')]['length']?_0x3c6534[_0x9f9f('0x3c')]:_0x27edad[_0x9f9f('0x3b')];if(_0x20f22b['query'][_0x9f9f('0x4f')]){_0x3c6534['include']=[{'all':!![]}];}_0x3c6534=_[_0x9f9f('0x46')]({},_0x3c6534,_0x20f22b[_0x9f9f('0x49')]);return db[_0x9f9f('0x34')][_0x9f9f('0x50')](_0x3c6534)['then'](handleEntityNotFound(_0x2d0216,null))[_0x9f9f('0x2c')](respondWithResult(_0x2d0216,null))[_0x9f9f('0x4d')](handleError(_0x2d0216,null));};exports[_0x9f9f('0x51')]=function(_0x403248,_0x3a615e){return db[_0x9f9f('0x34')]['create'](_0x403248[_0x9f9f('0x52')],{})[_0x9f9f('0x2c')](respondWithResult(_0x3a615e,0xc9))[_0x9f9f('0x4d')](handleError(_0x3a615e,null));};exports['update']=function(_0x24aacc,_0x12f39a){if(_0x24aacc[_0x9f9f('0x52')]['id']){delete _0x24aacc[_0x9f9f('0x52')]['id'];}return db[_0x9f9f('0x34')][_0x9f9f('0x50')]({'where':{'id':_0x24aacc[_0x9f9f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x12f39a,null))[_0x9f9f('0x2c')](saveUpdates(_0x24aacc['body'],null))[_0x9f9f('0x2c')](respondWithResult(_0x12f39a,null))[_0x9f9f('0x4d')](handleError(_0x12f39a,null));};exports[_0x9f9f('0x2d')]=function(_0x2b0e6d,_0x30b331){return db[_0x9f9f('0x34')][_0x9f9f('0x50')]({'where':{'id':_0x2b0e6d[_0x9f9f('0x4e')]['id']}})[_0x9f9f('0x2c')](handleEntityNotFound(_0x30b331,null))[_0x9f9f('0x2c')](removeEntity(_0x30b331,null))['catch'](handleError(_0x30b331,null));};exports[_0x9f9f('0x53')]=function(_0x4c2b7b,_0x590183){return db[_0x9f9f('0x34')]['describe']()[_0x9f9f('0x2c')](respondWithResult(_0x590183,null))[_0x9f9f('0x4d')](handleError(_0x590183,null));};exports[_0x9f9f('0x54')]=function(_0x5f1f22,_0x11b889,_0x83ae45){return db[_0x9f9f('0x55')][_0x9f9f('0x26')]({'where':{'ChatGroupId':_0x5f1f22[_0x9f9f('0x4e')]['id'],'ToId':_0x5f1f22[_0x9f9f('0x56')]['id'],'read':![]}})[_0x9f9f('0x2c')](function(_0x2e8401){return{'id':_[_0x9f9f('0x57')](_0x5f1f22[_0x9f9f('0x4e')]['id']),'count':_0x2e8401};})[_0x9f9f('0x2c')](respondWithResult(_0x11b889,null))[_0x9f9f('0x4d')](handleError(_0x11b889,null));};exports[_0x9f9f('0x58')]=function(_0x2d7ecb,_0x29d1e2,_0x36bf7){return db[_0x9f9f('0x34')][_0x9f9f('0x50')]({'where':{'id':_0x2d7ecb[_0x9f9f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x29d1e2,null))[_0x9f9f('0x2c')](function(_0x30c6f7){if(_0x30c6f7){return _0x30c6f7[_0x9f9f('0x58')](_0x2d7ecb['body']['ids'],_[_0x9f9f('0x59')](_0x2d7ecb[_0x9f9f('0x52')],[_0x9f9f('0x5a'),'id'])||{});}})[_0x9f9f('0x2c')](respondWithResult(_0x29d1e2,null))[_0x9f9f('0x4d')](handleError(_0x29d1e2,null));};exports[_0x9f9f('0x5b')]=function(_0x5b3dac,_0x2a8eec,_0x297920){var _0x3e718a={};var _0x2e69eb={};var _0xb26e78;var _0x2c53d0;return db[_0x9f9f('0x34')][_0x9f9f('0x5c')]({'where':{'id':_0x5b3dac[_0x9f9f('0x4e')]['id']}})[_0x9f9f('0x2c')](handleEntityNotFound(_0x2a8eec,null))[_0x9f9f('0x2c')](function(_0x2409ab){if(_0x2409ab){_0xb26e78=_0x2409ab;_0x2e69eb[_0x9f9f('0x3b')]=_[_0x9f9f('0x37')](db[_0x9f9f('0x5d')][_0x9f9f('0x35')]);_0x2e69eb[_0x9f9f('0x38')]=_[_0x9f9f('0x37')](_0x5b3dac[_0x9f9f('0x38')]);_0x2e69eb[_0x9f9f('0x39')]=_[_0x9f9f('0x3a')](_0x2e69eb[_0x9f9f('0x3b')],_0x2e69eb[_0x9f9f('0x38')]);_0x3e718a[_0x9f9f('0x3c')]=_['intersection'](_0x2e69eb[_0x9f9f('0x3b')],qs[_0x9f9f('0x3d')](_0x5b3dac[_0x9f9f('0x38')][_0x9f9f('0x3d')]));_0x3e718a[_0x9f9f('0x3c')]=_0x3e718a[_0x9f9f('0x3c')][_0x9f9f('0x3e')]?_0x3e718a[_0x9f9f('0x3c')]:_0x2e69eb[_0x9f9f('0x3b')];_0x3e718a['order']=qs[_0x9f9f('0x42')](_0x5b3dac[_0x9f9f('0x38')][_0x9f9f('0x42')]);_0x3e718a[_0x9f9f('0x43')]=qs['filters'](_['pick'](_0x5b3dac[_0x9f9f('0x38')],_0x2e69eb[_0x9f9f('0x39')]));if(_0x5b3dac[_0x9f9f('0x38')][_0x9f9f('0x45')]){_0x3e718a['where']=_[_0x9f9f('0x46')](_0x3e718a[_0x9f9f('0x43')],{'$or':_[_0x9f9f('0x33')](_0x3e718a[_0x9f9f('0x3c')],function(_0x334fc5){var _0x5dab8f={};_0x5dab8f[_0x334fc5]={'$like':'%'+_0x5b3dac[_0x9f9f('0x38')][_0x9f9f('0x45')]+'%'};return _0x5dab8f;})});}_0x3e718a=_[_0x9f9f('0x46')]({},_0x3e718a,_0x5b3dac[_0x9f9f('0x49')]);return _0xb26e78['getMembers'](_0x3e718a);}})[_0x9f9f('0x2c')](function(_0x3ee787){if(_0x3ee787){_0x2c53d0=_0x3ee787[_0x9f9f('0x3e')];if(!_0x5b3dac['query'][_0x9f9f('0x3f')](_0x9f9f('0x40'))){_0x3e718a[_0x9f9f('0x25')]=qs[_0x9f9f('0x25')](_0x5b3dac['query'][_0x9f9f('0x25')]);_0x3e718a[_0x9f9f('0x27')]=qs[_0x9f9f('0x27')](_0x5b3dac[_0x9f9f('0x38')][_0x9f9f('0x27')]);}return _0xb26e78[_0x9f9f('0x5b')](_0x3e718a);}})[_0x9f9f('0x2c')](function(_0x5d55db){if(_0x5d55db){return _0x5d55db?{'count':_0x2c53d0,'rows':_0x5d55db}:null;}})['then'](respondWithResult(_0x2a8eec,null))[_0x9f9f('0x4d')](handleError(_0x2a8eec,null));};exports['removeMembers']=function(_0x4d91ef,_0xc3b5e6,_0x5ded6a){return db[_0x9f9f('0x34')][_0x9f9f('0x50')]({'where':{'id':_0x4d91ef[_0x9f9f('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc3b5e6,null))[_0x9f9f('0x2c')](function(_0x51cb94){if(_0x51cb94){return _0x51cb94[_0x9f9f('0x5e')](_0x4d91ef[_0x9f9f('0x38')][_0x9f9f('0x5a')]);}})['then'](respondWithStatusCode(_0xc3b5e6,null))[_0x9f9f('0x4d')](handleError(_0xc3b5e6,null));};exports[_0x9f9f('0x5f')]=function(_0x4886b0,_0x338a74,_0x438b06){if(_0x4886b0[_0x9f9f('0x52')]['id']){delete _0x4886b0[_0x9f9f('0x52')]['id'];}return db['ChatGroup'][_0x9f9f('0x50')]({'where':{'id':_0x4886b0[_0x9f9f('0x4e')]['id']}})[_0x9f9f('0x2c')](handleEntityNotFound(_0x338a74,null))[_0x9f9f('0x2c')](function(_0x4aae64){if(_0x4aae64){_0x4886b0[_0x9f9f('0x52')][_0x9f9f('0x60')]=_0x4aae64['id'];return db[_0x9f9f('0x55')][_0x9f9f('0x51')](_0x4886b0[_0x9f9f('0x52')]);}})['then'](respondWithResult(_0x338a74,null))[_0x9f9f('0x4d')](handleError(_0x338a74,null));};exports[_0x9f9f('0x61')]=function(_0x5c1687,_0x621a33,_0x2719e2){var _0x55a064={};var _0x5be15d={};var _0x29471a;var _0x2a3af6;return db['ChatGroup'][_0x9f9f('0x5c')]({'where':{'id':_0x5c1687[_0x9f9f('0x4e')]['id']}})[_0x9f9f('0x2c')](handleEntityNotFound(_0x621a33,null))['then'](function(_0x1745b5){if(_0x1745b5){_0x29471a=_0x1745b5;_0x5be15d['model']=_[_0x9f9f('0x37')](db[_0x9f9f('0x55')][_0x9f9f('0x35')]);_0x5be15d[_0x9f9f('0x38')]=_[_0x9f9f('0x37')](_0x5c1687['query']);_0x5be15d[_0x9f9f('0x39')]=_['intersection'](_0x5be15d[_0x9f9f('0x3b')],_0x5be15d[_0x9f9f('0x38')]);_0x55a064['attributes']=_['intersection'](_0x5be15d['model'],qs[_0x9f9f('0x3d')](_0x5c1687['query'][_0x9f9f('0x3d')]));_0x55a064[_0x9f9f('0x3c')]=_0x55a064[_0x9f9f('0x3c')]['length']?_0x55a064[_0x9f9f('0x3c')]:_0x5be15d['model'];_0x55a064['order']=qs[_0x9f9f('0x42')](_0x5c1687[_0x9f9f('0x38')][_0x9f9f('0x42')]);_0x55a064['where']=qs[_0x9f9f('0x39')](_[_0x9f9f('0x44')](_0x5c1687[_0x9f9f('0x38')],_0x5be15d[_0x9f9f('0x39')]));if(_0x5c1687[_0x9f9f('0x38')]['filter']){_0x55a064[_0x9f9f('0x43')]=_[_0x9f9f('0x46')](_0x55a064[_0x9f9f('0x43')],{'$or':_[_0x9f9f('0x33')](_0x55a064[_0x9f9f('0x3c')],function(_0x5693bb){var _0x31c320={};_0x31c320[_0x5693bb]={'$like':'%'+_0x5c1687[_0x9f9f('0x38')][_0x9f9f('0x45')]+'%'};return _0x31c320;})});}if(_0x5c1687[_0x9f9f('0x38')][_0x9f9f('0x62')]){var _0x1c7751=_0x5c1687['query']['$gte']['split'](',');var _0x4fa5f5={};_0x4fa5f5[_0x1c7751[0x0]]={'$gte':moment(_0x1c7751[0x1])[_0x9f9f('0x63')]('YYYY-MM-DD\x20HH:mm:ss')};_0x55a064['where']=_[_0x9f9f('0x46')](_0x55a064[_0x9f9f('0x43')],_0x4fa5f5);}_0x55a064=_['merge']({},_0x55a064,_0x5c1687['options']);return _0x29471a[_0x9f9f('0x61')](_0x55a064);}})['then'](function(_0x4f907b){if(_0x4f907b){_0x2a3af6=_0x4f907b[_0x9f9f('0x3e')];if(!_0x5c1687[_0x9f9f('0x38')]['hasOwnProperty'](_0x9f9f('0x40'))){_0x55a064[_0x9f9f('0x25')]=qs[_0x9f9f('0x25')](_0x5c1687[_0x9f9f('0x38')][_0x9f9f('0x25')]);_0x55a064['offset']=qs[_0x9f9f('0x27')](_0x5c1687[_0x9f9f('0x38')][_0x9f9f('0x27')]);}return _0x29471a[_0x9f9f('0x61')](_0x55a064);}})['then'](function(_0x558768){if(_0x558768){return _0x558768?{'count':_0x2a3af6,'rows':_0x558768}:null;}})[_0x9f9f('0x2c')](respondWithResult(_0x621a33,null))['catch'](handleError(_0x621a33,null));};
\ No newline at end of file
+var _0x8879=['pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','ChatGroup','rawAttributes','length','includeAll','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','removeMembers','addMessage','getMessages','$gte','format','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','./chatGroup.socket','register','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','reject','update','then','destroy','stack','name','index','fieldName','type','model','map','query','keys','intersection','attributes','fields','order','sort','filters'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8879,0x126));var _0x9887=function(_0x70689a,_0x5ab73d){_0x70689a=_0x70689a-0x0;var _0x30ee81=_0x8879[_0x70689a];return _0x30ee81;};'use strict';var emlformat=require(_0x9887('0x0'));var rimraf=require(_0x9887('0x1'));var zipdir=require(_0x9887('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9887('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9887('0x4'));var util=require(_0x9887('0x5'));var path=require(_0x9887('0x6'));var sox=require(_0x9887('0x7'));var csv=require('to-csv');var ejs=require(_0x9887('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9887('0x9'));var jsforce=require(_0x9887('0xa'));var deskjs=require(_0x9887('0xb'));var toCsv=require(_0x9887('0xc'));var querystring=require(_0x9887('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9887('0xe'));var qs=require(_0x9887('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9887('0x10'));var logger=require(_0x9887('0x11'))(_0x9887('0x12'));var utils=require(_0x9887('0x13'));var config=require(_0x9887('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9887('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9887('0x16'))(new Redis(config[_0x9887('0x17')]));require(_0x9887('0x18'))[_0x9887('0x19')](socket);function respondWithStatusCode(_0x2f7723,_0x456565){_0x456565=_0x456565||0xcc;return function(_0x4acc58){if(_0x4acc58){return _0x2f7723[_0x9887('0x1a')](_0x456565);}return _0x2f7723['status'](_0x456565)[_0x9887('0x1b')]();};}function respondWithResult(_0x79569a,_0x2529cc){_0x2529cc=_0x2529cc||0xc8;return function(_0x41ee3b){if(_0x41ee3b){return _0x79569a['status'](_0x2529cc)['json'](_0x41ee3b);}};}function respondWithFilteredResult(_0x560428,_0x1cb66b){return function(_0xdfd15f){if(_0xdfd15f){var _0x11c2ce=typeof _0x1cb66b[_0x9887('0x1c')]===_0x9887('0x1d')&&typeof _0x1cb66b['limit']==='undefined';var _0x3d5655=_0xdfd15f[_0x9887('0x1e')];var _0x29e366=_0x11c2ce?0x0:_0x1cb66b['offset'];var _0x32b6c9=_0x11c2ce?_0xdfd15f[_0x9887('0x1e')]:_0x1cb66b['offset']+_0x1cb66b[_0x9887('0x1f')];var _0x42eed9;if(_0x32b6c9>=_0x3d5655){_0x32b6c9=_0x3d5655;_0x42eed9=0xc8;}else{_0x42eed9=0xce;}_0x560428[_0x9887('0x20')](_0x42eed9);return _0x560428[_0x9887('0x21')](_0x9887('0x22'),_0x29e366+'-'+_0x32b6c9+'/'+_0x3d5655)['json'](_0xdfd15f);}return null;};}function patchUpdates(_0xa1f249){return function(_0x2e0368){try{jsonpatch['apply'](_0x2e0368,_0xa1f249,!![]);}catch(_0x3570ae){return BPromise[_0x9887('0x23')](_0x3570ae);}return _0x2e0368['save']();};}function saveUpdates(_0x385262,_0x585be8){return function(_0x28375d){if(_0x28375d){return _0x28375d[_0x9887('0x24')](_0x385262)[_0x9887('0x25')](function(_0x551343){return _0x551343;});}return null;};}function removeEntity(_0x2ffdcb,_0x364935){return function(_0x19dd27){if(_0x19dd27){return _0x19dd27[_0x9887('0x26')]()['then'](function(){_0x2ffdcb[_0x9887('0x20')](0xcc)[_0x9887('0x1b')]();});}};}function handleEntityNotFound(_0x53de9c,_0x5405a6){return function(_0x14a589){if(!_0x14a589){_0x53de9c[_0x9887('0x1a')](0x194);}return _0x14a589;};}function handleError(_0x3b39e7,_0x5c4749){_0x5c4749=_0x5c4749||0x1f4;return function(_0x35bbbb){logger['error'](_0x35bbbb[_0x9887('0x27')]);if(_0x35bbbb[_0x9887('0x28')]){delete _0x35bbbb[_0x9887('0x28')];}_0x3b39e7[_0x9887('0x20')](_0x5c4749)['send'](_0x35bbbb);};}exports[_0x9887('0x29')]=function(_0x21e84f,_0x30c41b){var _0x5af7e8={},_0x2df053={},_0x5eb4d7={'count':0x0,'rows':[]};var _0x509383=_['map'](db['ChatGroup']['rawAttributes'],function(_0x179d42){return{'name':_0x179d42[_0x9887('0x2a')],'type':_0x179d42[_0x9887('0x2b')]['key']};});_0x2df053[_0x9887('0x2c')]=_[_0x9887('0x2d')](_0x509383,'name');_0x2df053[_0x9887('0x2e')]=_[_0x9887('0x2f')](_0x21e84f[_0x9887('0x2e')]);_0x2df053['filters']=_[_0x9887('0x30')](_0x2df053[_0x9887('0x2c')],_0x2df053[_0x9887('0x2e')]);_0x5af7e8[_0x9887('0x31')]=_[_0x9887('0x30')](_0x2df053[_0x9887('0x2c')],qs[_0x9887('0x32')](_0x21e84f[_0x9887('0x2e')]['fields']));_0x5af7e8[_0x9887('0x31')]=_0x5af7e8['attributes']['length']?_0x5af7e8[_0x9887('0x31')]:_0x2df053[_0x9887('0x2c')];if(!_0x21e84f[_0x9887('0x2e')]['hasOwnProperty']('nolimit')){_0x5af7e8[_0x9887('0x1f')]=qs[_0x9887('0x1f')](_0x21e84f['query'][_0x9887('0x1f')]);_0x5af7e8[_0x9887('0x1c')]=qs[_0x9887('0x1c')](_0x21e84f[_0x9887('0x2e')]['offset']);}_0x5af7e8[_0x9887('0x33')]=qs[_0x9887('0x34')](_0x21e84f[_0x9887('0x2e')][_0x9887('0x34')]);_0x5af7e8['where']=qs[_0x9887('0x35')](_[_0x9887('0x36')](_0x21e84f[_0x9887('0x2e')],_0x2df053[_0x9887('0x35')]),_0x509383);if(_0x21e84f['query'][_0x9887('0x37')]){_0x5af7e8[_0x9887('0x38')]=_[_0x9887('0x39')](_0x5af7e8[_0x9887('0x38')],{'$or':_[_0x9887('0x2d')](_0x509383,function(_0x346640){if(_0x346640[_0x9887('0x2b')]!==_0x9887('0x3a')){var _0x186584={};_0x186584[_0x346640[_0x9887('0x28')]]={'$like':'%'+_0x21e84f['query'][_0x9887('0x37')]+'%'};return _0x186584;}})});}_0x5af7e8=_[_0x9887('0x39')]({},_0x5af7e8,_0x21e84f[_0x9887('0x3b')]);var _0x25f552={'where':_0x5af7e8['where']};return db['ChatGroup']['count'](_0x25f552)[_0x9887('0x25')](function(_0x4eaf9e){_0x5eb4d7[_0x9887('0x1e')]=_0x4eaf9e;if(_0x21e84f[_0x9887('0x2e')]['includeAll']){_0x5af7e8[_0x9887('0x3c')]=[{'all':!![]}];}return db['ChatGroup'][_0x9887('0x3d')](_0x5af7e8);})[_0x9887('0x25')](function(_0x52e17d){_0x5eb4d7['rows']=_0x52e17d;return _0x5eb4d7;})['then'](respondWithFilteredResult(_0x30c41b,_0x5af7e8))['catch'](handleError(_0x30c41b,null));};exports[_0x9887('0x3e')]=function(_0x47675a,_0x2529b8){var _0x383373={'raw':!![],'where':{'id':_0x47675a[_0x9887('0x3f')]['id']}},_0x369d1c={};_0x369d1c[_0x9887('0x2c')]=_[_0x9887('0x2f')](db[_0x9887('0x40')][_0x9887('0x41')]);_0x369d1c[_0x9887('0x2e')]=_[_0x9887('0x2f')](_0x47675a['query']);_0x369d1c[_0x9887('0x35')]=_[_0x9887('0x30')](_0x369d1c['model'],_0x369d1c[_0x9887('0x2e')]);_0x383373[_0x9887('0x31')]=_[_0x9887('0x30')](_0x369d1c[_0x9887('0x2c')],qs[_0x9887('0x32')](_0x47675a['query'][_0x9887('0x32')]));_0x383373['attributes']=_0x383373['attributes'][_0x9887('0x42')]?_0x383373[_0x9887('0x31')]:_0x369d1c['model'];if(_0x47675a[_0x9887('0x2e')][_0x9887('0x43')]){_0x383373[_0x9887('0x3c')]=[{'all':!![]}];}_0x383373=_[_0x9887('0x39')]({},_0x383373,_0x47675a[_0x9887('0x3b')]);return db['ChatGroup'][_0x9887('0x44')](_0x383373)[_0x9887('0x25')](handleEntityNotFound(_0x2529b8,null))[_0x9887('0x25')](respondWithResult(_0x2529b8,null))[_0x9887('0x45')](handleError(_0x2529b8,null));};exports[_0x9887('0x46')]=function(_0x334b13,_0x4e14be){return db[_0x9887('0x40')][_0x9887('0x46')](_0x334b13[_0x9887('0x47')],{})[_0x9887('0x25')](respondWithResult(_0x4e14be,0xc9))[_0x9887('0x45')](handleError(_0x4e14be,null));};exports[_0x9887('0x24')]=function(_0x452dae,_0x1542f7){if(_0x452dae[_0x9887('0x47')]['id']){delete _0x452dae[_0x9887('0x47')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x452dae[_0x9887('0x3f')]['id']}})[_0x9887('0x25')](handleEntityNotFound(_0x1542f7,null))[_0x9887('0x25')](saveUpdates(_0x452dae[_0x9887('0x47')],null))['then'](respondWithResult(_0x1542f7,null))['catch'](handleError(_0x1542f7,null));};exports[_0x9887('0x26')]=function(_0xb1006d,_0x23d72e){return db[_0x9887('0x40')]['find']({'where':{'id':_0xb1006d[_0x9887('0x3f')]['id']}})[_0x9887('0x25')](handleEntityNotFound(_0x23d72e,null))[_0x9887('0x25')](removeEntity(_0x23d72e,null))[_0x9887('0x45')](handleError(_0x23d72e,null));};exports[_0x9887('0x48')]=function(_0x15b8a9,_0x9496fd){return db[_0x9887('0x40')][_0x9887('0x48')]()[_0x9887('0x25')](respondWithResult(_0x9496fd,null))['catch'](handleError(_0x9496fd,null));};exports[_0x9887('0x49')]=function(_0x346ec3,_0x4bd596,_0x303124){return db[_0x9887('0x4a')]['count']({'where':{'ChatGroupId':_0x346ec3[_0x9887('0x3f')]['id'],'ToId':_0x346ec3[_0x9887('0x4b')]['id'],'read':![]}})[_0x9887('0x25')](function(_0x599b64){return{'id':_[_0x9887('0x4c')](_0x346ec3['params']['id']),'count':_0x599b64};})[_0x9887('0x25')](respondWithResult(_0x4bd596,null))[_0x9887('0x45')](handleError(_0x4bd596,null));};exports[_0x9887('0x4d')]=function(_0x39b745,_0x1aac87,_0x595eab){return db['ChatGroup']['find']({'where':{'id':_0x39b745[_0x9887('0x3f')]['id']}})[_0x9887('0x25')](handleEntityNotFound(_0x1aac87,null))[_0x9887('0x25')](function(_0x4eaef1){if(_0x4eaef1){return _0x4eaef1[_0x9887('0x4d')](_0x39b745[_0x9887('0x47')]['ids'],_[_0x9887('0x4e')](_0x39b745['body'],[_0x9887('0x4f'),'id'])||{});}})[_0x9887('0x25')](respondWithResult(_0x1aac87,null))[_0x9887('0x45')](handleError(_0x1aac87,null));};exports[_0x9887('0x50')]=function(_0x45307c,_0x197b47,_0x186a7f){var _0x5a0119={};var _0x4c7f78={};var _0x483c67;var _0x3ba0c4;return db['ChatGroup'][_0x9887('0x51')]({'where':{'id':_0x45307c[_0x9887('0x3f')]['id']}})[_0x9887('0x25')](handleEntityNotFound(_0x197b47,null))[_0x9887('0x25')](function(_0x5ad1f1){if(_0x5ad1f1){_0x483c67=_0x5ad1f1;_0x4c7f78[_0x9887('0x2c')]=_[_0x9887('0x2f')](db['User'][_0x9887('0x41')]);_0x4c7f78['query']=_['keys'](_0x45307c[_0x9887('0x2e')]);_0x4c7f78[_0x9887('0x35')]=_[_0x9887('0x30')](_0x4c7f78[_0x9887('0x2c')],_0x4c7f78[_0x9887('0x2e')]);_0x5a0119[_0x9887('0x31')]=_[_0x9887('0x30')](_0x4c7f78[_0x9887('0x2c')],qs[_0x9887('0x32')](_0x45307c['query']['fields']));_0x5a0119[_0x9887('0x31')]=_0x5a0119[_0x9887('0x31')][_0x9887('0x42')]?_0x5a0119[_0x9887('0x31')]:_0x4c7f78[_0x9887('0x2c')];_0x5a0119[_0x9887('0x33')]=qs[_0x9887('0x34')](_0x45307c[_0x9887('0x2e')][_0x9887('0x34')]);_0x5a0119[_0x9887('0x38')]=qs[_0x9887('0x35')](_['pick'](_0x45307c[_0x9887('0x2e')],_0x4c7f78[_0x9887('0x35')]));if(_0x45307c['query'][_0x9887('0x37')]){_0x5a0119[_0x9887('0x38')]=_[_0x9887('0x39')](_0x5a0119[_0x9887('0x38')],{'$or':_['map'](_0x5a0119[_0x9887('0x31')],function(_0x54a332){var _0x4cb0c8={};_0x4cb0c8[_0x54a332]={'$like':'%'+_0x45307c[_0x9887('0x2e')][_0x9887('0x37')]+'%'};return _0x4cb0c8;})});}_0x5a0119=_[_0x9887('0x39')]({},_0x5a0119,_0x45307c[_0x9887('0x3b')]);return _0x483c67[_0x9887('0x50')](_0x5a0119);}})['then'](function(_0x2cf894){if(_0x2cf894){_0x3ba0c4=_0x2cf894['length'];if(!_0x45307c[_0x9887('0x2e')]['hasOwnProperty']('nolimit')){_0x5a0119[_0x9887('0x1f')]=qs[_0x9887('0x1f')](_0x45307c[_0x9887('0x2e')][_0x9887('0x1f')]);_0x5a0119[_0x9887('0x1c')]=qs[_0x9887('0x1c')](_0x45307c[_0x9887('0x2e')][_0x9887('0x1c')]);}return _0x483c67[_0x9887('0x50')](_0x5a0119);}})[_0x9887('0x25')](function(_0x3f6437){if(_0x3f6437){return _0x3f6437?{'count':_0x3ba0c4,'rows':_0x3f6437}:null;}})[_0x9887('0x25')](respondWithResult(_0x197b47,null))[_0x9887('0x45')](handleError(_0x197b47,null));};exports[_0x9887('0x52')]=function(_0xb181b0,_0x56c329,_0x56daf8){return db['ChatGroup'][_0x9887('0x44')]({'where':{'id':_0xb181b0[_0x9887('0x3f')]['id']}})[_0x9887('0x25')](handleEntityNotFound(_0x56c329,null))[_0x9887('0x25')](function(_0x70e600){if(_0x70e600){return _0x70e600[_0x9887('0x52')](_0xb181b0[_0x9887('0x2e')][_0x9887('0x4f')]);}})[_0x9887('0x25')](respondWithStatusCode(_0x56c329,null))[_0x9887('0x45')](handleError(_0x56c329,null));};exports[_0x9887('0x53')]=function(_0x502794,_0x5f364d,_0x50686d){if(_0x502794[_0x9887('0x47')]['id']){delete _0x502794[_0x9887('0x47')]['id'];}return db[_0x9887('0x40')][_0x9887('0x44')]({'where':{'id':_0x502794[_0x9887('0x3f')]['id']}})[_0x9887('0x25')](handleEntityNotFound(_0x5f364d,null))[_0x9887('0x25')](function(_0x4bfc6c){if(_0x4bfc6c){_0x502794[_0x9887('0x47')]['ChatGroupId']=_0x4bfc6c['id'];return db[_0x9887('0x4a')][_0x9887('0x46')](_0x502794[_0x9887('0x47')]);}})[_0x9887('0x25')](respondWithResult(_0x5f364d,null))[_0x9887('0x45')](handleError(_0x5f364d,null));};exports[_0x9887('0x54')]=function(_0x52212b,_0x2fa7f0,_0x91c8ef){var _0x15e507={};var _0x1cc465={};var _0x2d5314;var _0x5607b3;return db['ChatGroup'][_0x9887('0x51')]({'where':{'id':_0x52212b['params']['id']}})[_0x9887('0x25')](handleEntityNotFound(_0x2fa7f0,null))[_0x9887('0x25')](function(_0x3e2caf){if(_0x3e2caf){_0x2d5314=_0x3e2caf;_0x1cc465[_0x9887('0x2c')]=_[_0x9887('0x2f')](db[_0x9887('0x4a')][_0x9887('0x41')]);_0x1cc465['query']=_['keys'](_0x52212b[_0x9887('0x2e')]);_0x1cc465[_0x9887('0x35')]=_[_0x9887('0x30')](_0x1cc465[_0x9887('0x2c')],_0x1cc465[_0x9887('0x2e')]);_0x15e507[_0x9887('0x31')]=_[_0x9887('0x30')](_0x1cc465[_0x9887('0x2c')],qs[_0x9887('0x32')](_0x52212b['query'][_0x9887('0x32')]));_0x15e507[_0x9887('0x31')]=_0x15e507[_0x9887('0x31')][_0x9887('0x42')]?_0x15e507[_0x9887('0x31')]:_0x1cc465[_0x9887('0x2c')];_0x15e507[_0x9887('0x33')]=qs['sort'](_0x52212b[_0x9887('0x2e')][_0x9887('0x34')]);_0x15e507[_0x9887('0x38')]=qs['filters'](_[_0x9887('0x36')](_0x52212b[_0x9887('0x2e')],_0x1cc465[_0x9887('0x35')]));if(_0x52212b[_0x9887('0x2e')]['filter']){_0x15e507[_0x9887('0x38')]=_[_0x9887('0x39')](_0x15e507[_0x9887('0x38')],{'$or':_[_0x9887('0x2d')](_0x15e507[_0x9887('0x31')],function(_0x5453a4){var _0x468d6a={};_0x468d6a[_0x5453a4]={'$like':'%'+_0x52212b['query'][_0x9887('0x37')]+'%'};return _0x468d6a;})});}if(_0x52212b[_0x9887('0x2e')][_0x9887('0x55')]){var _0x198a09=_0x52212b[_0x9887('0x2e')][_0x9887('0x55')]['split'](',');var _0x5a4691={};_0x5a4691[_0x198a09[0x0]]={'$gte':moment(_0x198a09[0x1])[_0x9887('0x56')]('YYYY-MM-DD\x20HH:mm:ss')};_0x15e507[_0x9887('0x38')]=_['merge'](_0x15e507[_0x9887('0x38')],_0x5a4691);}_0x15e507=_[_0x9887('0x39')]({},_0x15e507,_0x52212b[_0x9887('0x3b')]);return _0x2d5314[_0x9887('0x54')](_0x15e507);}})[_0x9887('0x25')](function(_0x3183d3){if(_0x3183d3){_0x5607b3=_0x3183d3[_0x9887('0x42')];if(!_0x52212b[_0x9887('0x2e')]['hasOwnProperty']('nolimit')){_0x15e507[_0x9887('0x1f')]=qs[_0x9887('0x1f')](_0x52212b[_0x9887('0x2e')]['limit']);_0x15e507['offset']=qs[_0x9887('0x1c')](_0x52212b[_0x9887('0x2e')]['offset']);}return _0x2d5314[_0x9887('0x54')](_0x15e507);}})[_0x9887('0x25')](function(_0x4d6cce){if(_0x4d6cce){return _0x4d6cce?{'count':_0x5607b3,'rows':_0x4d6cce}:null;}})[_0x9887('0x25')](respondWithResult(_0x2fa7f0,null))[_0x9887('0x45')](handleError(_0x2fa7f0,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index fc326c9..24a2861 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 _0x133d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xd642dd,_0x769cc5){var _0x30c262=function(_0x43a1b7){while(--_0x43a1b7){_0xd642dd['push'](_0xd642dd['shift']());}};_0x30c262(++_0x769cc5);}(_0x133d,0x193));var _0xd133=function(_0x444e8b,_0x3524cc){_0x444e8b=_0x444e8b-0x0;var _0x35eb37=_0x133d[_0x444e8b];return _0x35eb37;};'use strict';var EventEmitter=require(_0xd133('0x0'));var ChatGroup=require(_0xd133('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd133('0x2')](0x0);var events={'afterCreate':_0xd133('0x3'),'afterUpdate':'update','afterDestroy':_0xd133('0x4')};function emitEvent(_0x583539){return function(_0x455877,_0x837965,_0x177524){ChatGroupEvents[_0xd133('0x5')](_0x583539+':'+_0x455877['id'],_0x455877);ChatGroupEvents[_0xd133('0x5')](_0x583539,_0x455877);_0x177524(null);};}for(var e in events){if(events[_0xd133('0x6')](e)){var event=events[e];ChatGroup[_0xd133('0x7')](e,emitEvent(event));}}module[_0xd133('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x4186=['../../mysqldb','ChatGroup','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x384a72,_0x34ed13){var _0x1f0e2d=function(_0x464ac3){while(--_0x464ac3){_0x384a72['push'](_0x384a72['shift']());}};_0x1f0e2d(++_0x34ed13);}(_0x4186,0x11f));var _0x6418=function(_0x2fc113,_0x45ec6e){_0x2fc113=_0x2fc113-0x0;var _0x5144ce=_0x4186[_0x2fc113];return _0x5144ce;};'use strict';var EventEmitter=require(_0x6418('0x0'));var ChatGroup=require(_0x6418('0x1'))['db'][_0x6418('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6418('0x3')](0x0);var events={'afterCreate':_0x6418('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xcdf6ce){return function(_0x30821c,_0x3b1670,_0x2bb490){ChatGroupEvents[_0x6418('0x5')](_0xcdf6ce+':'+_0x30821c['id'],_0x30821c);ChatGroupEvents['emit'](_0xcdf6ce,_0x30821c);_0x2bb490(null);};}for(var e in events){if(events[_0x6418('0x6')](e)){var event=events[e];ChatGroup[_0x6418('0x7')](e,emitEvent(event));}}module[_0x6418('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 0a1abe5..3f8f0b2 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 _0xb583=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4ea45c,_0x30f6ac){var _0x5b5a1c=function(_0x20f5d6){while(--_0x20f5d6){_0x4ea45c['push'](_0x4ea45c['shift']());}};_0x5b5a1c(++_0x30f6ac);}(_0xb583,0x95));var _0x3b58=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb583[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x3b58('0x0'));var util=require('util');var logger=require(_0x3b58('0x1'))(_0x3b58('0x2'));var moment=require(_0x3b58('0x3'));var BPromise=require(_0x3b58('0x4'));var rp=require(_0x3b58('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b58('0x6'));var config=require(_0x3b58('0x7'));var attributes=require(_0x3b58('0x8'));module[_0x3b58('0x9')]=function(_0x3acfdb,_0x32042b){return _0x3acfdb[_0x3b58('0xa')](_0x3b58('0xb'),attributes,{'tableName':_0x3b58('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe0a2=['chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','ChatGroup'];(function(_0x230aa8,_0x114400){var _0x3b5d74=function(_0xfe287e){while(--_0xfe287e){_0x230aa8['push'](_0x230aa8['shift']());}};_0x3b5d74(++_0x114400);}(_0xe0a2,0xe8));var _0x2e0a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe0a2[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x2e0a('0x0'));var logger=require(_0x2e0a('0x1'))(_0x2e0a('0x2'));var moment=require(_0x2e0a('0x3'));var BPromise=require(_0x2e0a('0x4'));var rp=require(_0x2e0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2e0a('0x6'));var attributes=require('./chatGroup.attributes');module[_0x2e0a('0x7')]=function(_0x39c350,_0x52ddcf){return _0x39c350[_0x2e0a('0x8')](_0x2e0a('0x9'),attributes,{'tableName':_0x2e0a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index e30e2e5..4137674 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 _0xf29c=['request','then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatGroup.socket','register'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0xf29c,0xc7));var _0xcf29=function(_0xbc3fa5,_0x32c376){_0xbc3fa5=_0xbc3fa5-0x0;var _0x16be6e=_0xf29c[_0xbc3fa5];return _0x16be6e;};'use strict';var _=require('lodash');var util=require(_0xcf29('0x0'));var moment=require(_0xcf29('0x1'));var BPromise=require(_0xcf29('0x2'));var rs=require(_0xcf29('0x3'));var fs=require('fs');var Redis=require(_0xcf29('0x4'));var db=require(_0xcf29('0x5'))['db'];var utils=require(_0xcf29('0x6'));var logger=require(_0xcf29('0x7'))(_0xcf29('0x8'));var config=require(_0xcf29('0x9'));var jayson=require(_0xcf29('0xa'));var client=jayson[_0xcf29('0xb')][_0xcf29('0xc')]({'port':0x232a});config[_0xcf29('0xd')]=_[_0xcf29('0xe')](config[_0xcf29('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf29('0xd')]));require(_0xcf29('0xf'))[_0xcf29('0x10')](socket);function respondWithRpcPromise(_0x18bfa3,_0x4268c6,_0x2f3bd5){return new BPromise(function(_0x2ed7fa,_0x38b122){return client[_0xcf29('0x11')](_0x18bfa3,_0x2f3bd5)[_0xcf29('0x12')](function(_0xb13a72){logger[_0xcf29('0x13')]('ChatGroup,\x20%s,\x20%s',_0x4268c6,_0xcf29('0x14'));logger[_0xcf29('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4268c6,_0xcf29('0x14'),JSON['stringify'](_0xb13a72));if(_0xb13a72[_0xcf29('0x16')]){if(_0xb13a72[_0xcf29('0x16')][_0xcf29('0x17')]===0x1f4){logger[_0xcf29('0x16')](_0xcf29('0x18'),_0x4268c6,_0xb13a72[_0xcf29('0x16')][_0xcf29('0x19')]);return _0x38b122(_0xb13a72[_0xcf29('0x16')][_0xcf29('0x19')]);}logger['error'](_0xcf29('0x18'),_0x4268c6,_0xb13a72['error'][_0xcf29('0x19')]);return _0x2ed7fa(_0xb13a72['error'][_0xcf29('0x19')]);}else{logger['info'](_0xcf29('0x18'),_0x4268c6,'request\x20sent');_0x2ed7fa(_0xb13a72[_0xcf29('0x1a')][_0xcf29('0x19')]);}})['catch'](function(_0xe2b5b1){logger[_0xcf29('0x16')]('ChatGroup,\x20%s,\x20%s',_0x4268c6,_0xe2b5b1);_0x38b122(_0xe2b5b1);});});}
\ No newline at end of file
+var _0xdf71=['redis','defaults','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1891c9,_0xf570b1){var _0x416a55=function(_0x48720c){while(--_0x48720c){_0x1891c9['push'](_0x1891c9['shift']());}};_0x416a55(++_0xf570b1);}(_0xdf71,0x1d2));var _0x1df7=function(_0x521378,_0x2f8004){_0x521378=_0x521378-0x0;var _0x4b2fc4=_0xdf71[_0x521378];return _0x4b2fc4;};'use strict';var _=require(_0x1df7('0x0'));var util=require('util');var moment=require(_0x1df7('0x1'));var BPromise=require(_0x1df7('0x2'));var rs=require(_0x1df7('0x3'));var fs=require('fs');var Redis=require(_0x1df7('0x4'));var db=require(_0x1df7('0x5'))['db'];var utils=require(_0x1df7('0x6'));var logger=require(_0x1df7('0x7'))('rpc');var config=require(_0x1df7('0x8'));var jayson=require(_0x1df7('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x1df7('0xa')]=_[_0x1df7('0xb')](config['redis'],{'host':_0x1df7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1df7('0xa')]));require(_0x1df7('0xd'))[_0x1df7('0xe')](socket);function respondWithRpcPromise(_0x319511,_0x589400,_0x3bc01a){return new BPromise(function(_0x3e44fd,_0x28585a){return client[_0x1df7('0xf')](_0x319511,_0x3bc01a)[_0x1df7('0x10')](function(_0x1a9882){logger['info'](_0x1df7('0x11'),_0x589400,'request\x20sent');logger[_0x1df7('0x12')](_0x1df7('0x13'),_0x589400,_0x1df7('0x14'),JSON[_0x1df7('0x15')](_0x1a9882));if(_0x1a9882[_0x1df7('0x16')]){if(_0x1a9882['error'][_0x1df7('0x17')]===0x1f4){logger[_0x1df7('0x16')](_0x1df7('0x11'),_0x589400,_0x1a9882['error']['message']);return _0x28585a(_0x1a9882[_0x1df7('0x16')]['message']);}logger[_0x1df7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x1a9882[_0x1df7('0x16')][_0x1df7('0x18')]);return _0x3e44fd(_0x1a9882[_0x1df7('0x16')][_0x1df7('0x18')]);}else{logger[_0x1df7('0x19')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x1df7('0x14'));_0x3e44fd(_0x1a9882[_0x1df7('0x1a')][_0x1df7('0x18')]);}})[_0x1df7('0x1b')](function(_0x5af91){logger[_0x1df7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x5af91);_0x28585a(_0x5af91);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 25043fc..447bcb5 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 _0x0fbd=['chatGroup:','./chatGroup.events','save','remove','emit','removeListener','length'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x0fbd,0x94));var _0xd0fb=function(_0x5ef449,_0xf72961){_0x5ef449=_0x5ef449-0x0;var _0x17a45f=_0x0fbd[_0x5ef449];return _0x17a45f;};'use strict';var ChatGroupEvents=require(_0xd0fb('0x0'));var events=[_0xd0fb('0x1'),_0xd0fb('0x2'),'update'];function createListener(_0x1f7468,_0x27d68a){return function(_0x5a0d43){_0x27d68a[_0xd0fb('0x3')](_0x1f7468,_0x5a0d43);};}function removeListener(_0x190125,_0x1745e8){return function(){ChatGroupEvents[_0xd0fb('0x4')](_0x190125,_0x1745e8);};}exports['register']=function(_0xc19662){for(var _0x504712=0x0,_0x224899=events[_0xd0fb('0x5')];_0x504712<_0x224899;_0x504712++){var _0x255f3b=events[_0x504712];var _0x28f4a2=createListener(_0xd0fb('0x6')+_0x255f3b,_0xc19662);ChatGroupEvents['on'](_0x255f3b,_0x28f4a2);}};
\ No newline at end of file
+var _0x9af9=['save','remove','update','emit','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9af9,0xbc));var _0x99af=function(_0x1bf854,_0x382429){_0x1bf854=_0x1bf854-0x0;var _0x2a5815=_0x9af9[_0x1bf854];return _0x2a5815;};'use strict';var ChatGroupEvents=require(_0x99af('0x0'));var events=[_0x99af('0x1'),_0x99af('0x2'),_0x99af('0x3')];function createListener(_0x58d49b,_0x219b97){return function(_0x2bdf89){_0x219b97[_0x99af('0x4')](_0x58d49b,_0x2bdf89);};}function removeListener(_0x48acbb,_0x326229){return function(){ChatGroupEvents[_0x99af('0x5')](_0x48acbb,_0x326229);};}exports[_0x99af('0x6')]=function(_0x12692a){for(var _0xc25441=0x0,_0x37041d=events[_0x99af('0x7')];_0xc25441<_0x37041d;_0xc25441++){var _0x990263=events[_0xc25441];var _0x30bdc8=createListener(_0x99af('0x8')+_0x990263,_0x12692a);ChatGroupEvents['on'](_0x990263,_0x30bdc8);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index d0bcca8..b6b2481 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 _0x118d=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','/:id/messages','getMessages','post','create','addMembers','put','delete','removeMembers'];(function(_0x500c00,_0x2d6ca9){var _0x2ce95f=function(_0x268596){while(--_0x268596){_0x500c00['push'](_0x500c00['shift']());}};_0x2ce95f(++_0x2d6ca9);}(_0x118d,0xfd));var _0xd118=function(_0x2dba4b,_0x157663){_0x2dba4b=_0x2dba4b-0x0;var _0x98a485=_0x118d[_0x2dba4b];return _0x98a485;};'use strict';var multer=require(_0xd118('0x0'));var util=require(_0xd118('0x1'));var path=require(_0xd118('0x2'));var timeout=require(_0xd118('0x3'));var express=require(_0xd118('0x4'));var router=express[_0xd118('0x5')]();var fs_extra=require(_0xd118('0x6'));var auth=require(_0xd118('0x7'));var interaction=require(_0xd118('0x8'));var config=require(_0xd118('0x9'));var controller=require('./chatGroup.controller');router[_0xd118('0xa')]('/',auth['isAuthenticated'](),controller[_0xd118('0xb')]);router[_0xd118('0xa')](_0xd118('0xc'),auth[_0xd118('0xd')](),controller[_0xd118('0xe')]);router['get'](_0xd118('0xf'),auth[_0xd118('0xd')](),controller[_0xd118('0x10')]);router[_0xd118('0xa')](_0xd118('0x11'),auth[_0xd118('0xd')](),controller['getUnread']);router[_0xd118('0xa')](_0xd118('0x12'),auth[_0xd118('0xd')](),controller['getMembers']);router[_0xd118('0xa')](_0xd118('0x13'),auth[_0xd118('0xd')](),controller[_0xd118('0x14')]);router[_0xd118('0x15')]('/',auth[_0xd118('0xd')](),controller[_0xd118('0x16')]);router[_0xd118('0x15')](_0xd118('0x12'),auth[_0xd118('0xd')](),controller[_0xd118('0x17')]);router['post'](_0xd118('0x13'),auth[_0xd118('0xd')](),controller['addMessage']);router[_0xd118('0x18')](_0xd118('0xf'),auth[_0xd118('0xd')](),controller['update']);router[_0xd118('0x19')]('/:id',auth[_0xd118('0xd')](),controller['destroy']);router['delete'](_0xd118('0x12'),auth[_0xd118('0xd')](),controller[_0xd118('0x1a')]);module[_0xd118('0x1b')]=router;
\ No newline at end of file
+var _0xfc6f=['./chatGroup.controller','isAuthenticated','index','/describe','describe','/:id/unread','getUnread','/:id/members','getMembers','post','create','addMembers','/:id/messages','addMessage','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0xfc6f,0xde));var _0xffc6=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xfc6f[_0x257642];return _0x3d813b;};'use strict';var multer=require(_0xffc6('0x0'));var util=require(_0xffc6('0x1'));var path=require(_0xffc6('0x2'));var timeout=require(_0xffc6('0x3'));var express=require(_0xffc6('0x4'));var router=express[_0xffc6('0x5')]();var fs_extra=require(_0xffc6('0x6'));var auth=require(_0xffc6('0x7'));var interaction=require(_0xffc6('0x8'));var config=require(_0xffc6('0x9'));var controller=require(_0xffc6('0xa'));router['get']('/',auth[_0xffc6('0xb')](),controller[_0xffc6('0xc')]);router['get'](_0xffc6('0xd'),auth[_0xffc6('0xb')](),controller[_0xffc6('0xe')]);router['get']('/:id',auth[_0xffc6('0xb')](),controller['show']);router['get'](_0xffc6('0xf'),auth['isAuthenticated'](),controller[_0xffc6('0x10')]);router['get'](_0xffc6('0x11'),auth[_0xffc6('0xb')](),controller[_0xffc6('0x12')]);router['get']('/:id/messages',auth[_0xffc6('0xb')](),controller['getMessages']);router[_0xffc6('0x13')]('/',auth['isAuthenticated'](),controller[_0xffc6('0x14')]);router[_0xffc6('0x13')](_0xffc6('0x11'),auth[_0xffc6('0xb')](),controller[_0xffc6('0x15')]);router[_0xffc6('0x13')](_0xffc6('0x16'),auth[_0xffc6('0xb')](),controller[_0xffc6('0x17')]);router[_0xffc6('0x18')]('/:id',auth[_0xffc6('0xb')](),controller['update']);router[_0xffc6('0x19')]('/:id',auth[_0xffc6('0xb')](),controller[_0xffc6('0x1a')]);router[_0xffc6('0x19')](_0xffc6('0x11'),auth[_0xffc6('0xb')](),controller[_0xffc6('0x1b')]);module[_0xffc6('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 56d64ac..10b06b8 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 _0x215d=['thumb','TEXT','DATE','STRING','sequelize','BOOLEAN','INTEGER','ENUM','star'];(function(_0x1460ab,_0x74d06e){var _0x1eeb5c=function(_0x28de38){while(--_0x28de38){_0x1460ab['push'](_0x1460ab['shift']());}};_0x1eeb5c(++_0x74d06e);}(_0x215d,0x187));var _0xd215=function(_0x5d89d4,_0x405d88){_0x5d89d4=_0x5d89d4-0x0;var _0x2419fb=_0x215d[_0x5d89d4];return _0x2419fb;};'use strict';var Sequelize=require(_0xd215('0x0'));module['exports']={'closed':{'type':Sequelize[_0xd215('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd215('0x2')]},'ratingType':{'type':Sequelize[_0xd215('0x3')](_0xd215('0x4'),_0xd215('0x5')),'defaultValue':_0xd215('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xd215('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd215('0x7')]},'disposition':{'type':Sequelize[_0xd215('0x8')]},'secondDisposition':{'type':Sequelize[_0xd215('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd215('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xd215('0x8')]},'osName':{'type':Sequelize[_0xd215('0x8')]},'osVersion':{'type':Sequelize[_0xd215('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xd215('0x8')]},'deviceType':{'type':Sequelize[_0xd215('0x8')]},'referer':{'type':Sequelize[_0xd215('0x6')]},'customerIp':{'type':Sequelize[_0xd215('0x8')]},'formData':{'type':Sequelize[_0xd215('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xd215('0x7')]},'lastMsgAt':{'type':Sequelize[_0xd215('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xd215('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd215('0x8')]},'customerPort':{'type':Sequelize[_0xd215('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xd215('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xd215('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfd6f=['thumb','star','TEXT','DATE','STRING','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x4ba024,_0x156702){var _0x553e63=function(_0x53f35d){while(--_0x53f35d){_0x4ba024['push'](_0x4ba024['shift']());}};_0x553e63(++_0x156702);}(_0xfd6f,0x19d));var _0xffd6=function(_0xf1b3d,_0x3f4ea5){_0xf1b3d=_0xf1b3d-0x0;var _0x440b8d=_0xfd6f[_0xf1b3d];return _0x440b8d;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'closed':{'type':Sequelize[_0xffd6('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xffd6('0x3')]},'ratingType':{'type':Sequelize[_0xffd6('0x4')]('star',_0xffd6('0x5')),'defaultValue':_0xffd6('0x6')},'ratingMessage':{'type':Sequelize[_0xffd6('0x7')]},'pathTranscript':{'type':Sequelize[_0xffd6('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xffd6('0x8')]},'disposition':{'type':Sequelize[_0xffd6('0x9')]},'secondDisposition':{'type':Sequelize[_0xffd6('0x9')]},'thirdDisposition':{'type':Sequelize[_0xffd6('0x9')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xffd6('0x9')]},'browserVersion':{'type':Sequelize[_0xffd6('0x9')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xffd6('0x9')]},'deviceVendor':{'type':Sequelize[_0xffd6('0x9')]},'deviceType':{'type':Sequelize[_0xffd6('0x9')]},'referer':{'type':Sequelize[_0xffd6('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xffd6('0x7')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xffd6('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xffd6('0x4')]('in',_0xffd6('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xffd6('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xffd6('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d5b515f..5c52d76 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 _0x955f=['CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','a.key','Account.key','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','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','groupBy','ChatInteractionId','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','disposition','AbandonInteraction','attachmentUpload','originalname','file','mimetype','attachmentDownload','findOne','closed','Unauthorized','Attachment','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','includeAgent','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','direction','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','YYYY-MM-DD\x20HH:mm:ss','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','stack','name','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x2a7909,_0x50e5fa){var _0x3052b3=function(_0x5b5568){while(--_0x5b5568){_0x2a7909['push'](_0x2a7909['shift']());}};_0x3052b3(++_0x50e5fa);}(_0x955f,0x1eb));var _0xf955=function(_0x24842c,_0x232d3d){_0x24842c=_0x24842c-0x0;var _0x152f31=_0x955f[_0x24842c];return _0x152f31;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf955('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf955('0x13'))(_0xf955('0x14'));var utils=require(_0xf955('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf955('0x16'));var db=require('../../mysqldb')['db'];config[_0xf955('0x17')]=_['defaults'](config[_0xf955('0x17')],{'host':_0xf955('0x18'),'port':0x18eb});var socket=require(_0xf955('0x19'))(new Redis(config[_0xf955('0x17')]));require(_0xf955('0x1a'))[_0xf955('0x1b')](socket);var jayson=require(_0xf955('0x1c'));var client=jayson[_0xf955('0x1d')][_0xf955('0x1e')]({'port':0x232b});var client9004=jayson[_0xf955('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0xc29b35,_0x54e60b,_0x3139d5,_0x3a814f){return new BPromise(function(_0x2f881b,_0x15c07c){var _0x50930d=_0x3a814f||client;return _0x50930d['request'](_0xc29b35,_0x3139d5)[_0xf955('0x1f')](function(_0xe6de5c){logger[_0xf955('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x54e60b,_0xf955('0x21'));logger[_0xf955('0x22')](_0xf955('0x23'),_0x54e60b,_0xf955('0x21'),JSON[_0xf955('0x24')](_0xe6de5c));if(_0xe6de5c['error']){if(_0xe6de5c[_0xf955('0x25')][_0xf955('0x26')]===0x1f4){logger[_0xf955('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x54e60b,_0xe6de5c[_0xf955('0x25')]['message']);return _0x15c07c(_0xe6de5c[_0xf955('0x25')][_0xf955('0x27')]);}logger[_0xf955('0x25')](_0xf955('0x28'),_0x54e60b,_0xe6de5c[_0xf955('0x25')]['message']);return _0x2f881b(_0xe6de5c[_0xf955('0x25')][_0xf955('0x27')]);}else{logger[_0xf955('0x20')](_0xf955('0x28'),_0x54e60b,_0xf955('0x21'));_0x2f881b(_0xe6de5c[_0xf955('0x29')][_0xf955('0x27')]);}})['catch'](function(_0x18f435){logger[_0xf955('0x25')](_0xf955('0x28'),_0x54e60b,_0x18f435);_0x15c07c(_0x18f435);});});}function respondWithStatusCode(_0x406632,_0x2dcd55){_0x2dcd55=_0x2dcd55||0xcc;return function(_0x13a86d){if(_0x13a86d){return _0x406632[_0xf955('0x2a')](_0x2dcd55);}return _0x406632['status'](_0x2dcd55)[_0xf955('0x2b')]();};}function respondWithResult(_0x145098,_0x41c9f6){_0x41c9f6=_0x41c9f6||0xc8;return function(_0xbd0b74){if(_0xbd0b74){return _0x145098[_0xf955('0x2c')](_0x41c9f6)[_0xf955('0x2d')](_0xbd0b74);}};}function respondWithFilteredResult(_0x4d4af0,_0x2232a7){return function(_0x1e5d37){if(_0x1e5d37){var _0x4ec3e8=typeof _0x2232a7[_0xf955('0x2e')]===_0xf955('0x2f')&&typeof _0x2232a7[_0xf955('0x30')]===_0xf955('0x2f');var _0x59bfb5=_0x1e5d37[_0xf955('0x31')];var _0x518fb3=_0x4ec3e8?0x0:_0x2232a7[_0xf955('0x2e')];var _0x2c222a=_0x4ec3e8?_0x1e5d37[_0xf955('0x31')]:_0x2232a7[_0xf955('0x2e')]+_0x2232a7[_0xf955('0x30')];var _0x32121b;if(_0x2c222a>=_0x59bfb5){_0x2c222a=_0x59bfb5;_0x32121b=0xc8;}else{_0x32121b=0xce;}_0x4d4af0[_0xf955('0x2c')](_0x32121b);return _0x4d4af0[_0xf955('0x32')]('Content-Range',_0x518fb3+'-'+_0x2c222a+'/'+_0x59bfb5)[_0xf955('0x2d')](_0x1e5d37);}return null;};}function patchUpdates(_0x165cc4){return function(_0x3964d3){try{jsonpatch[_0xf955('0x33')](_0x3964d3,_0x165cc4,!![]);}catch(_0x4fea0c){return BPromise[_0xf955('0x34')](_0x4fea0c);}return _0x3964d3[_0xf955('0x35')]();};}function saveUpdates(_0x3c81bc,_0xe1b436){return function(_0xdbc53e){if(_0xdbc53e){return _0xdbc53e['update'](_0x3c81bc)['then'](function(_0x5480db){return _0x5480db;});}return null;};}function removeEntity(_0x2626cb,_0x3783dc){return function(_0x374e95){if(_0x374e95){return _0x374e95[_0xf955('0x36')]()[_0xf955('0x1f')](function(){_0x2626cb[_0xf955('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3acc4b,_0x515dc6){return function(_0x8f842f){if(!_0x8f842f){_0x3acc4b[_0xf955('0x2a')](0x194);}return _0x8f842f;};}function handleError(_0xe33ef2,_0x51762d){_0x51762d=_0x51762d||0x1f4;return function(_0x60a421){logger['error'](_0x60a421[_0xf955('0x37')]);if(_0x60a421[_0xf955('0x38')]){delete _0x60a421[_0xf955('0x38')];}_0xe33ef2[_0xf955('0x2c')](_0x51762d)['send'](_0x60a421);};}function getMustacheRender(_0xf35170,_0x118c92){return Mustache['render'](_0xf35170,_[_0xf955('0x39')](_0x118c92[_0xf955('0x3a')],{'contact':_0x118c92[_0xf955('0x3b')],'message':_0x118c92['message'],'agent':_0x118c92[_0xf955('0x3c')],'interaction':_0x118c92[_0xf955('0x3d')],'account':_0x118c92[_0xf955('0x3e')]}))||'';}function getInteractionUsers(_0x488b6e,_0x97e8ff){return new BPromise(function(_0x195faa,_0x21e4a6){try{if(_0x97e8ff[_0x488b6e['id']]){_0x488b6e[_0xf955('0x3f')]=_[_0xf955('0x40')](_0x97e8ff[_0x488b6e['id']],function(_0x3c4b29){return{'id':_0x3c4b29['id'],'fullname':_0x3c4b29[_0xf955('0x41')]};});}}catch(_0x228dae){_0x21e4a6(_0x228dae);}_0x195faa(_0x488b6e);});}function getInteractionTags(_0x5671c7,_0x8fa41b){return new BPromise(function(_0x7123c1,_0x2aacdf){try{if(_0x5671c7[_0xf955('0x42')]){_0x5671c7[_0xf955('0x43')]=[];_0x5671c7[_0xf955('0x42')][_0xf955('0x44')](',')[_0xf955('0x45')](function(_0x47651b){_0x5671c7[_0xf955('0x43')][_0xf955('0x46')](_0x8fa41b[_0x47651b]);});}delete _0x5671c7[_0xf955('0x42')];}catch(_0x40d7e9){_0x2aacdf(_0x40d7e9);}_0x7123c1(_0x5671c7);});}function updateChatInteraction(_0x159ae3,_0x3557b5,_0x248f60){return new BPromise(function(_0x356ec2,_0x34f0f1){return getInteractionUsers(_0x159ae3,_0x248f60)[_0xf955('0x1f')](function(_0x5dd300){return getInteractionTags(_0x5dd300,_0x3557b5);})[_0xf955('0x1f')](function(_0x25d809){_0x356ec2(_0x25d809);})[_0xf955('0x47')](function(_0x5f0ef9){_0x34f0f1(_0x5f0ef9);});});}exports[_0xf955('0x48')]=function(_0x485e77,_0x398224){var _0x56a4ca={},_0x103ac2={},_0x24cb74={'count':0x0,'rows':[]};var _0x213136=_[_0xf955('0x40')](db['ChatInteraction'][_0xf955('0x49')],function(_0xdb1cc){return{'name':_0xdb1cc[_0xf955('0x4a')],'type':_0xdb1cc['type']['key']};});_0x103ac2[_0xf955('0x4b')]=_[_0xf955('0x40')](_0x213136,_0xf955('0x38'));_0x103ac2[_0xf955('0x4c')]=_['keys'](_0x485e77[_0xf955('0x4c')]);_0x103ac2[_0xf955('0x4d')]=_[_0xf955('0x4e')](_0x103ac2['model'],_0x103ac2[_0xf955('0x4c')]);_0x56a4ca['attributes']=_[_0xf955('0x4e')](_0x103ac2[_0xf955('0x4b')],qs[_0xf955('0x4f')](_0x485e77['query'][_0xf955('0x4f')]));_0x56a4ca[_0xf955('0x50')]=_0x56a4ca[_0xf955('0x50')][_0xf955('0x51')]?_0x56a4ca['attributes']:_0x103ac2[_0xf955('0x4b')];if(!_0x485e77[_0xf955('0x4c')][_0xf955('0x52')](_0xf955('0x53'))){_0x56a4ca[_0xf955('0x30')]=qs['limit'](_0x485e77[_0xf955('0x4c')]['limit']);_0x56a4ca[_0xf955('0x2e')]=qs['offset'](_0x485e77[_0xf955('0x4c')]['offset']);}_0x56a4ca['order']=qs[_0xf955('0x54')](_0x485e77[_0xf955('0x4c')]['sort']);_0x56a4ca[_0xf955('0x55')]=qs['filters'](_['pick'](_0x485e77['query'],_0x103ac2['filters']),_0x213136);var _0x3c37e2=[];var _0x1abe1c=squel['select']()['field']('id')[_0xf955('0x56')](_0xf955('0x38'))[_0xf955('0x56')](_0xf955('0x57'))[_0xf955('0x58')](_0xf955('0x59'));var _0x190500=squel[_0xf955('0x5a')]()[_0xf955('0x56')](_0xf955('0x5b'))[_0xf955('0x56')](_0xf955('0x5c'))['field'](_0xf955('0x5d'))[_0xf955('0x58')](_0xf955('0x5e'),'ui')[_0xf955('0x5f')](_0xf955('0x60'),'u','u.id\x20=\x20ui.UserId');var _0xf5d575=squel[_0xf955('0x5a')]()[_0xf955('0x58')](_0xf955('0x61'),'i')[_0xf955('0x5f')](_0xf955('0x62'),'c',_0xf955('0x63'))[_0xf955('0x5f')](_0xf955('0x60'),'o',_0xf955('0x64'))['left_join'](_0xf955('0x65'),'a',_0xf955('0x66'))[_0xf955('0x5f')](_0xf955('0x67'),'me',_0xf955('0x68'))[_0xf955('0x5f')](_0xf955('0x69'),'it',_0xf955('0x6a'))[_0xf955('0x5f')](_0xf955('0x59'),'t',_0xf955('0x6b'));var _0x2b8173=squel['expr']();var _0x1388a0=[];var _0x452de9=squel[_0xf955('0x6c')]();var _0x3eb727;if(_0x485e77[_0xf955('0x4c')][_0xf955('0x6d')]){_0x3eb727=as[_0xf955('0x6e')](_0x485e77['query']['search']);var _0x5e73ff=_0x3eb727[_0xf955('0x6f')];for(var _0x530ec7=0x0;_0x530ec7<_0x3eb727['conditions'][_0xf955('0x51')];_0x530ec7++){var _0x533e0f=_0x3eb727[_0xf955('0x70')][_0x530ec7];var _0x3fa5b5='i';var _0x158469=_[_0xf955('0x71')](_0x213136,['name',_0x533e0f[_0xf955('0x56')]]);if(!_0x158469){switch(_0x533e0f[_0xf955('0x56')]){case _0xf955('0x72'):if(_0x533e0f[_0xf955('0x73')]==0x1){_0xf5d575[_0xf955('0x74')]('`'+_0x533e0f['field']+_0xf955('0x75'));}else{_0xf5d575['having']('`'+_0x533e0f[_0xf955('0x56')]+_0xf955('0x76'));}break;case _0xf955('0x77'):if(_0x533e0f['operator']===_0xf955('0x78')){if(_0x533e0f[_0xf955('0x73')][_0xf955('0x44')]('\x20')[_0xf955('0x51')]>0x1){_0x2b8173[_0x5e73ff](_0xf955('0x79'),qs[_0xf955('0x7a')](_0x533e0f[_0xf955('0x73')]),null);}else{var _0x47e5de='%'+_0x533e0f['value']+'%';_0x2b8173[_0x5e73ff](_0xf955('0x7b'),_0x47e5de,_0x47e5de,_0x47e5de);}}else{_0x158469=_[_0xf955('0x71')](_0x213136,[_0xf955('0x38'),_0xf955('0x7c')]);_0x533e0f[_0xf955('0x56')]=_0xf955('0x7c');_0x4b85c2=as[_0xf955('0x7d')](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')][_0xf955('0x80')],_0x4b85c2['value'][_0xf955('0x2b')]);}break;case'Tag':var _0x431729=_0x533e0f['value']['split'](',')[_0xf955('0x40')](function(_0x20f11c){return Number(_0x20f11c);});_0x431729['forEach'](function(_0x1e95c3){_0x452de9['or'](_0xf955('0x81'),'%,'+_0x1e95c3+',%');});_0x1388a0=_['union'](_0x1388a0,_0x431729);break;case'User':if(_0x533e0f[_0xf955('0x82')]===_0xf955('0x78')){_0x2b8173[_0x5e73ff](_0xf955('0x83'),'%'+_0x533e0f['value']+'%',null);}else{_0x158469=_[_0xf955('0x71')](_0x213136,[_0xf955('0x38'),_0xf955('0x84')]);_0x533e0f[_0xf955('0x56')]=_0xf955('0x84');_0x4b85c2=as[_0xf955('0x7d')](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2['value'][_0xf955('0x80')],_0x4b85c2[_0xf955('0x73')]['end']);}break;case _0xf955('0x3a'):_0x4b85c2=as[_0xf955('0x7d')]('me',null,_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')]['start'],_0x4b85c2[_0xf955('0x73')][_0xf955('0x2b')]);break;}}else{var _0x4b85c2=as['buildExpression'](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')][_0xf955('0x80')],_0x4b85c2['value'][_0xf955('0x2b')]);}}}else{var _0x430571=_(_0x485e77[_0xf955('0x4c')])[_0xf955('0x85')]()[_0xf955('0x40')](function(_0x3e9c6e){return _[_0xf955('0x86')](_0x213136,[_0xf955('0x38'),_0x3e9c6e])?_0x3e9c6e:undefined;})[_0xf955('0x87')]()[_0xf955('0x73')]();if(!_[_0xf955('0x88')](_0x430571)){_0x430571[_0xf955('0x45')](function(_0x4254a2){if(_0x4254a2==='ChatWebsiteId'){_0xf5d575[_0xf955('0x55')](_0xf955('0x89'),[][_0xf955('0x8a')](_0x485e77[_0xf955('0x4c')][_0x4254a2]));}else if(_0x4254a2==='createdAt'){var _0xcf6900=JSON[_0xf955('0x8b')](_0x485e77[_0xf955('0x4c')][_0x4254a2])[_0xf955('0x8c')];var _0x2b266d=JSON[_0xf955('0x8b')](_0x485e77[_0xf955('0x4c')][_0x4254a2])[_0xf955('0x8d')];_0xf5d575[_0xf955('0x55')](_0xf955('0x8e'),_0xcf6900,_0x2b266d);}else{if(_0x485e77[_0xf955('0x4c')][_0x4254a2]==='null'){_0xf5d575[_0xf955('0x55')]('i.'+_0x4254a2+_0xf955('0x8f'));}else{_0xf5d575[_0xf955('0x55')]('i.'+_0x4254a2+_0xf955('0x90'),_0x485e77[_0xf955('0x4c')][_0x4254a2]);}}});}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x91')]){if(_0x485e77['query'][_0xf955('0x91')]==0x1){_0xf5d575['having'](_0xf955('0x92'));}else{_0xf5d575['having'](_0xf955('0x93'));}}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x94')]){_0x1388a0=_[_0xf955('0x95')](_0x485e77[_0xf955('0x4c')][_0xf955('0x94')])?_0x485e77['query'][_0xf955('0x94')]:new Array(_0x485e77[_0xf955('0x4c')][_0xf955('0x94')]);_0x1388a0['forEach'](function(_0x526346){_0x452de9['or'](_0xf955('0x81'),'%,'+_0x526346+',%');});}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x96')]){var _0x595d60=_0x485e77[_0xf955('0x4c')]['filter'][_0xf955('0x97')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf955('0x98')](_0x595d60)){_0x2b8173['or'](_0xf955('0x99'),_0x595d60+'%');}else{_0x2b8173['or'](_0xf955('0x9a'),qs['getFullTextValue'](_0x595d60))['or'](_0xf955('0x9b'),_0x595d60+'%');}}}_0xf5d575[_0xf955('0x55')](_0x2b8173);_0xf5d575[_0xf955('0x9c')]('i.id');var _0xba62d0={'type':db[_0xf955('0x9d')][_0xf955('0x9e')][_0xf955('0x9f')],'raw':!![]};var _0x419da5=_0xf5d575[_0xf955('0xa0')]();_0x419da5[_0xf955('0x56')]('i.id');_0x419da5[_0xf955('0x56')](_0xf955('0xa1'),_0xf955('0x72'));if(_0x56a4ca[_0xf955('0xa2')]){_0x56a4ca[_0xf955('0xa2')]['forEach'](function(_0x15c3e1){var _0x23f90c=_0x15c3e1[0x0]==='contactName'?_0x15c3e1[0x0]:'i.'+_0x15c3e1[0x0];_0xf5d575['order'](_0x23f90c,_0x15c3e1[0x1]===_0xf955('0xa3')?![]:!![]);});}if(!_[_0xf955('0x88')](_0x1388a0)){_0xf5d575[_0xf955('0x74')](_0x452de9);_0x419da5[_0xf955('0x55')]('t.id\x20IN\x20?',_0x1388a0);}BPromise[_0xf955('0xa4')]()['then'](function(){if(!_0x3eb727){if(_0x485e77['query'][_0xf955('0xa5')])return;_0x419da5[_0xf955('0x55')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xf5d575['where'](_0xf955('0xa6'));return;}if(_0x485e77[_0xf955('0xa7')][_0xf955('0xa8')]!=='agent')return;return _0x485e77['user'][_0xf955('0xa9')]({'attributes':['id'],'raw':!![]})[_0xf955('0x1f')](function(_0x15fc7e){if(_['isEmpty'](_0x15fc7e)){_0x419da5['where']('i.ChatWebsiteId\x20IS\x20NULL');_0xf5d575['where'](_0xf955('0xaa'));}else{_0x419da5['where'](_0xf955('0x89'),_[_0xf955('0x40')](_0x15fc7e,'id'));_0xf5d575[_0xf955('0x55')](_0xf955('0x89'),_[_0xf955('0x40')](_0x15fc7e,'id'));}});})['then'](function(){if(_0x485e77[_0xf955('0xa7')][_0xf955('0xa8')]===_0xf955('0x3c')&&!_0x3eb727&&!_0x485e77[_0xf955('0x4c')]['ChatWebsiteId'])return[];return db[_0xf955('0xab')][_0xf955('0x4c')](_0x419da5['toString'](),_0xba62d0);})[_0xf955('0x1f')](function(_0x1819f6){_0x24cb74[_0xf955('0x31')]=_0x1819f6[_0xf955('0x51')];if(_0x24cb74[_0xf955('0x31')]===0x0)return[];return db[_0xf955('0xab')]['query'](_0x1abe1c['toString'](),_0xba62d0)[_0xf955('0x1f')](function(_0x545275){_0x3c37e2=_[_0xf955('0xac')](_0x545275,'id');_0xba62d0=_[_0xf955('0x39')](_0xba62d0,{'model':db[_0xf955('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x485e77[_0xf955('0x4c')]['fields']){_0x56a4ca['attributes'][_0xf955('0x45')](function(_0x12b9f8){_0xf5d575[_0xf955('0x56')]('i.'+_0x12b9f8);});}else{_0xf5d575[_0xf955('0x56')](_0xf955('0xa1'),'unreadMessages');_0xf5d575[_0xf955('0x56')](_0xf955('0xae'),_0xf955('0xaf'));_0xf5d575[_0xf955('0x56')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xf5d575[_0xf955('0x56')](_0xf955('0xb0'),'contactName');_0xf5d575[_0xf955('0x56')](_0xf955('0xb1'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb2'),'Contact.firstName');_0xf5d575[_0xf955('0x56')](_0xf955('0xb3'),_0xf955('0xb4'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb5'),_0xf955('0xb6'));_0xf5d575[_0xf955('0x56')]('c.phone','Contact.phone');_0xf5d575['field'](_0xf955('0xb7'),_0xf955('0xb8'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb9'),_0xf955('0xba'));_0xf5d575[_0xf955('0x56')](_0xf955('0xbb'),'Owner.fullname');_0xf5d575[_0xf955('0x56')](_0xf955('0xbc'),'Owner.internal');_0xf5d575[_0xf955('0x56')](_0xf955('0xbd'),_0xf955('0x42'));}if(_0x56a4ca[_0xf955('0x30')])_0xf5d575[_0xf955('0x30')](_0x56a4ca[_0xf955('0x30')]);if(_0x56a4ca[_0xf955('0x2e')])_0xf5d575[_0xf955('0x2e')](_0x56a4ca['offset']);return db['sequelize']['query'](_0xf5d575[_0xf955('0xbe')](),_0xba62d0);})[_0xf955('0x1f')](function(_0x210666){if(_0x210666[_0xf955('0x51')]>0x0)_0x190500[_0xf955('0x55')]('ui.ChatInteractionId\x20IN\x20?',_[_0xf955('0x40')](_0x210666,'id'));return db[_0xf955('0xab')][_0xf955('0x4c')](_0x190500[_0xf955('0xbe')](),_0xba62d0)[_0xf955('0x1f')](function(_0x36731b){var _0x11f6f8=_[_0xf955('0xbf')](_0x36731b,_0xf955('0xc0'));var _0x4a71e5=[];_0x210666[_0xf955('0x45')](function(_0x47daca){_0x4a71e5[_0xf955('0x46')](updateChatInteraction(_0x47daca,_0x3c37e2,_0x11f6f8));});return BPromise[_0xf955('0xc1')](_0x4a71e5);});});})[_0xf955('0x1f')](function(_0x427ab9){_0x24cb74[_0xf955('0xc2')]=_0x427ab9;return _0x24cb74;})[_0xf955('0x1f')](respondWithFilteredResult(_0x398224,_0x56a4ca))[_0xf955('0x47')](handleError(_0x398224,null));};exports['show']=function(_0x1ef189,_0x4bb590){var _0x222df2={'raw':![],'where':{'id':_0x1ef189['params']['id']}},_0x40d7c7={};_0x40d7c7[_0xf955('0x4b')]=_[_0xf955('0x85')](db[_0xf955('0xad')][_0xf955('0x49')]);_0x40d7c7[_0xf955('0x4c')]=_[_0xf955('0x85')](_0x1ef189[_0xf955('0x4c')]);_0x40d7c7['filters']=_[_0xf955('0x4e')](_0x40d7c7[_0xf955('0x4b')],_0x40d7c7['query']);_0x222df2[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x40d7c7['model'],qs['fields'](_0x1ef189[_0xf955('0x4c')][_0xf955('0x4f')]));_0x222df2[_0xf955('0x50')]=_0x222df2['attributes'][_0xf955('0x51')]?_0x222df2[_0xf955('0x50')]:_0x40d7c7[_0xf955('0x4b')];if(_0x1ef189[_0xf955('0x4c')][_0xf955('0xc3')]){_0x222df2[_0xf955('0xc4')]=[{'all':!![]}];}_0x222df2=_[_0xf955('0x39')]({},_0x222df2,_0x1ef189[_0xf955('0xc5')]);return db[_0xf955('0xad')][_0xf955('0x71')](_0x222df2)[_0xf955('0x1f')](handleEntityNotFound(_0x4bb590,null))[_0xf955('0x1f')](respondWithResult(_0x4bb590,null))[_0xf955('0x47')](handleError(_0x4bb590,null));};exports[_0xf955('0xc6')]=function(_0x490981,_0x58464d){return db[_0xf955('0xad')][_0xf955('0xc6')](_0x490981[_0xf955('0x3a')],{})[_0xf955('0x1f')](respondWithResult(_0x58464d,0xc9))[_0xf955('0x47')](handleError(_0x58464d,null));};exports['update']=function(_0x161d06,_0x3bab0d){if(_0x161d06['body']['id']){delete _0x161d06[_0xf955('0x3a')]['id'];}return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x161d06[_0xf955('0xc7')]['id']}})['then'](handleEntityNotFound(_0x3bab0d,null))[_0xf955('0x1f')](saveUpdates(_0x161d06['body'],null))[_0xf955('0x1f')](respondWithResult(_0x3bab0d,null))[_0xf955('0x47')](handleError(_0x3bab0d,null));};exports[_0xf955('0x36')]=function(_0xe9f9a8,_0x5aff59){return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0xe9f9a8[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x5aff59,null))[_0xf955('0x1f')](removeEntity(_0x5aff59,null))['catch'](handleError(_0x5aff59,null));};exports[_0xf955('0xc8')]=function(_0x1f38db,_0x395013){return db['ChatInteraction'][_0xf955('0xc8')]()[_0xf955('0x1f')](respondWithResult(_0x395013,null))[_0xf955('0x47')](handleError(_0x395013,null));};exports[_0xf955('0xc9')]=function(_0x19665c,_0x437020){var _0x12d158=_0x19665c['params']['id'];var _0x5a6abe;var _0x4e3013;var _0x345a7c;return db[_0xf955('0xad')]['findOne']({'where':{'id':_0x12d158}})[_0xf955('0x1f')](function(_0x42ba43){_0x5a6abe=_0x42ba43;return db[_0xf955('0xca')]['findOne']({'where':{'id':_0x42ba43[_0xf955('0xa5')]},'attributes':['id',_0xf955('0xcb'),'vidaooEscalation','vidaooTopic',_0xf955('0xcc'),_0xf955('0xcd')],'raw':!![]});})[_0xf955('0x1f')](function(_0x30baa1){if(_0x30baa1&&_0x30baa1[_0xf955('0xcb')]&&_0x30baa1['vidaooEscalation']){_0x4e3013=_0x30baa1;var _0xc881d4={'interaction':{'id':_0x12d158},'agent':{'id':_0x19665c[_0xf955('0xa7')]['id'],'name':_0x19665c[_0xf955('0xa7')][_0xf955('0x38')],'fullname':_0x19665c[_0xf955('0xa7')]['fullname'],'email':_0x19665c[_0xf955('0xa7')][_0xf955('0xce')]},'contact':_0x19665c[_0xf955('0x3a')][_0xf955('0x3b')],'account':_0x19665c['body'][_0xf955('0x3e')]};var _0x410d1f={'rejectUnauthorized':![],'method':_0xf955('0xcf'),'url':_0xf955('0xd0'),'headers':{'X-APIKEY':_0x30baa1[_0xf955('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x19665c['user'][_0xf955('0xce')]],'buttons':null,'topic':_0x4e3013[_0xf955('0xd1')],'note':_['isNull'](_0x4e3013[_0xf955('0xcc')])?null:getMustacheRender(_0x4e3013[_0xf955('0xcc')],_0xc881d4),'metadata':null},'redirect':_0xf955('0xd2'),'json':!![]};try{if(!_[_0xf955('0xd3')](_0x4e3013[_0xf955('0xcd')])){var _0x38e031=getMustacheRender(_0x4e3013[_0xf955('0xcd')],_0xc881d4);var _0x4f53ef=JSON[_0xf955('0x8b')](_0x38e031);_0x410d1f[_0xf955('0x3a')]['metadata']=_0x4f53ef;}}catch(_0x5395aa){throw new db[(_0xf955('0x9d'))][(_0xf955('0xd4'))](_0xf955('0xd5'));}return rp(_0x410d1f);}else{throw new db[(_0xf955('0x9d'))]['ValidationError'](_0xf955('0xd6'));}})[_0xf955('0x1f')](function(_0x57e0d7){_0x345a7c=_0x57e0d7;if(_0x345a7c['id']){var _0x54903a={'body':_0x345a7c[_0xf955('0xd7')],'ChatWebsiteId':_0x4e3013['id'],'ChatInteractionId':_0x5a6abe['id'],'direction':_0xf955('0xd8'),'UserId':_0x19665c[_0xf955('0xa7')]['id']};return db[_0xf955('0xd9')]['create'](_0x54903a,{});}else{throw new db[(_0xf955('0x9d'))][(_0xf955('0xd4'))](_0xf955('0xda'));}})[_0xf955('0x1f')](function(){return _0x5a6abe[_0xf955('0xdb')]({'vidaooSessionId':_0x345a7c['id']});})[_0xf955('0x1f')](respondWithResult(_0x437020,null))[_0xf955('0x47')](handleError(_0x437020,null));};exports[_0xf955('0xdc')]=function(_0x4c7a54,_0xde084e){if(_0x4c7a54[_0xf955('0x3a')]['id']){delete _0x4c7a54[_0xf955('0x3a')]['id'];}return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x4c7a54[_0xf955('0xc7')]['id']},'include':[{'model':db[_0xf955('0xdd')],'as':_0xf955('0x77')}]})[_0xf955('0x1f')](handleEntityNotFound(_0xde084e,null))[_0xf955('0x1f')](saveUpdates(_0x4c7a54['body'],null))[_0xf955('0x1f')](respondWithResult(_0xde084e,null))[_0xf955('0x47')](handleError(_0xde084e,null));};exports[_0xf955('0xde')]=function(_0x27391f,_0x269ae2,_0x3250df){if(_0x27391f[_0xf955('0x3a')]['id']){delete _0x27391f['body']['id'];}return db[_0xf955('0xad')]['find']({'where':{'id':_0x27391f[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](function(_0x14cde9){if(!_0x14cde9){logger[_0xf955('0x25')](_0xf955('0xdf'),_0xf955('0xde'),0x194,_0xf955('0xe0'));_0x269ae2[_0xf955('0x2a')](0x194);}else{if(_0x14cde9[_0xf955('0x84')]){throw new db['Sequelize'][(_0xf955('0xd4'))](_0xf955('0xe1'));}}return _0x14cde9;})[_0xf955('0x1f')](function(_0x3d5c15){if(_0x3d5c15){return _0x3d5c15[_0xf955('0xe2')]({'closed':_0x27391f[_0xf955('0x3a')]['closed'],'disposition':_0x27391f[_0xf955('0x3a')][_0xf955('0xe3')]})[_0xf955('0x1f')](function(_0x5c8a3f){return _0x5c8a3f;});}})[_0xf955('0x1f')](function(_0x471223){return respondWithRpcPromise(_0xf955('0xe4'),_0xf955('0xde'),_0x27391f[_0xf955('0x3a')],client9004);})[_0xf955('0x1f')](respondWithResult(_0x269ae2,null))['catch'](handleError(_0x269ae2,null));};exports[_0xf955('0xe5')]=function(_0x4775bd,_0x2a862f,_0x42e3eb){_0x4775bd[_0xf955('0x3a')][_0xf955('0x38')]=_0x4775bd['file'][_0xf955('0xe6')];_0x4775bd['body']['basename']=_0x4775bd['file']['filename'];_0x4775bd[_0xf955('0x3a')]['type']=_0x4775bd[_0xf955('0xe7')][_0xf955('0xe8')];return db['Attachment'][_0xf955('0xc6')](_0x4775bd['body'])[_0xf955('0x1f')](respondWithResult(_0x2a862f,0xc9))['catch'](handleError(_0x2a862f,null));};exports[_0xf955('0xe9')]=function(_0x267963,_0x28ce39,_0x43a5c3){return db['ChatInteraction'][_0xf955('0xea')]({'where':{'id':_0x267963['params']['id']},'raw':!![]})[_0xf955('0x1f')](handleEntityNotFound(_0x28ce39,null))[_0xf955('0x1f')](function(_0x30fd01){if(_0x30fd01){if(_0x30fd01[_0xf955('0xeb')]){return _0x28ce39[_0xf955('0x2c')](0x193)[_0xf955('0x2d')]({'status':0x193,'message':_0xf955('0xec')});}return db[_0xf955('0xed')][_0xf955('0xea')]({'where':{'id':_0x267963[_0xf955('0x4c')]['attachId']},'raw':!![]})[_0xf955('0x1f')](handleEntityNotFound(_0x28ce39,null));}})[_0xf955('0x1f')](function(_0x444e24){if(_0x444e24){var _0x2fb11a=_0x444e24[_0xf955('0xee')]!==null;var _0x2ce35c=path[_0xf955('0xef')](config['root'],_0xf955('0xf0'));if(_0x2fb11a){_0x2ce35c=path[_0xf955('0xef')](_0x2ce35c,_0xf955('0xf1'));}var _0x1e35d7=path[_0xf955('0xef')](_0x2ce35c,_0x444e24[_0xf955('0xf2')]);return _0x28ce39[_0xf955('0xf3')](_0x1e35d7);}})[_0xf955('0x47')](handleError(_0x28ce39,null));};exports[_0xf955('0xf4')]=function(_0x38016a,_0x52ad4d){var _0x1620ec=null;var _0x2c8e49=null;var _0x2b3deb=null;var _0x1ae12a=null;if(_0x38016a[_0xf955('0x3a')]['id']){delete _0x38016a[_0xf955('0x3a')]['id'];}if(_0x38016a[_0xf955('0x3a')][_0xf955('0xf5')]){_0x1ae12a=path['join'](config[_0xf955('0xf6')],_0xf955('0xf7'),util[_0xf955('0xf8')](_0xf955('0xf9'),Date[_0xf955('0xfa')]()));_0x38016a[_0xf955('0x3a')][_0xf955('0xfb')]=_0x1ae12a;}return db[_0xf955('0xad')]['find']({'where':{'id':_0x38016a['params']['id']},'include':[{'model':db[_0xf955('0xd9')],'as':_0xf955('0xfc'),'include':[{'model':db[_0xf955('0xfd')],'as':_0xf955('0xfd')}]}]})['then'](handleEntityNotFound(_0x52ad4d,null))['then'](saveUpdates(_0x38016a[_0xf955('0x3a')],null))[_0xf955('0x1f')](function(_0x4860ad){if(_0x4860ad){_0x1620ec=_0x4860ad;return db[_0xf955('0xca')][_0xf955('0x71')]({'where':{'id':_0x1620ec[_0xf955('0xa5')]}});}})[_0xf955('0x1f')](function(_0x1c0211){if(_0x1c0211){_0x2b3deb=_0x1c0211;return db['CmContact'][_0xf955('0x71')]({'where':{'id':_0x1620ec[_0xf955('0x7c')]}});}})[_0xf955('0x1f')](function(_0x106640){if(_0x106640){_0x2c8e49=_0x106640;if(_0x1ae12a){var _0x101722=null;for(var _0x479dc0=0x1;_0x479dc0<_0x1620ec[_0xf955('0xfc')]['length'];++_0x479dc0){_0x101722=_0x1620ec[_0xf955('0xfc')][_0x479dc0];var _0x570005=_0x101722[_0xf955('0x84')]?util[_0xf955('0xf8')](_0xf955('0xfe'),_0x2b3deb[_0xf955('0xff')],_0x101722[_0xf955('0x84')]):_0xf955('0x100');var _0x85661f=_0x38016a[_0xf955('0x3a')][_0xf955('0x101')]||util[_0xf955('0xf8')]('%s%d','Visitor',_0x101722[_0xf955('0x7c')]);switch(_0x2b3deb[_0xf955('0x102')]){case _0xf955('0x103'):_0x570005=_0x101722[_0xf955('0x84')]?util['format']('%s%d',_0x2b3deb[_0xf955('0xff')],_0x101722['UserId']):'System';break;case _0xf955('0x104'):_0x570005=_0x101722['UserId']?_0x101722[_0xf955('0xfd')][_0xf955('0x105')]||_0x101722['User']['fullname']:_0xf955('0x100');break;case _0xf955('0x106'):_0x570005=_0x101722[_0xf955('0x84')]?_0x101722[_0xf955('0xfd')][_0xf955('0x41')]:'System';break;default:_0x570005=_0x101722[_0xf955('0x84')]?util['format']('%s%d',_0x2b3deb['agentAlias'],_0x101722[_0xf955('0x84')]):_0xf955('0x100');}var _0x23d382=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x101722[_0xf955('0x107')])['format'](_0xf955('0x108')),_0x101722['direction']==='in'?_0x85661f:_0x570005,_0x101722[_0xf955('0x3a')]);if(!_0x101722[_0xf955('0x109')]){fs['appendFileSync'](_0x1ae12a,_0x23d382);}}return db[_0xf955('0x10a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf955('0x10b')],'as':_0xf955('0x10c'),'raw':!![]}]});}}})[_0xf955('0x1f')](function(_0x1e6165){if(_0x1e6165&&_0x1e6165[_0xf955('0x10c')]&&_0x38016a['body']){var _0x4a6338={'tls':{'rejectUnauthorized':![]}};if(_0x1e6165[_0xf955('0x10c')][_0xf955('0x10d')]){_0x4a6338[_0xf955('0x10d')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x10d')];}else{_0x4a6338[_0xf955('0x10e')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x10e')];_0x4a6338[_0xf955('0x10f')]=_0x1e6165['Smtp'][_0xf955('0x10f')];_0x4a6338[_0xf955('0x110')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x110')];}if(_0x1e6165[_0xf955('0x10c')]['authentication']){_0x4a6338[_0xf955('0x111')]={'user':_0x1e6165[_0xf955('0x10c')]['user'],'pass':_0x1e6165[_0xf955('0x10c')]['pass']};}return respondWithRpcPromise('SendMail',_0xf955('0x112'),{'account':_0x4a6338,'message':{'from':util[_0xf955('0xf8')](_0xf955('0x113'),_0x1e6165[_0xf955('0x38')],_0x1e6165['email']||_0x1e6165[_0xf955('0x10c')][_0xf955('0xa7')]),'to':_0x38016a[_0xf955('0x3a')][_0xf955('0xf5')],'subject':'Mail\x20Transcript','text':util[_0xf955('0xf8')](_0xf955('0x114'),_0x38016a['body'][_0xf955('0xf5')]),'attachments':[{'path':_0x1ae12a}]}})[_0xf955('0x1f')](function(){return _0x1620ec;})[_0xf955('0x47')](function(_0x50502a){console[_0xf955('0x25')](_0x50502a);});}else{return _0x1620ec;}})[_0xf955('0x1f')](respondWithStatusCode(_0x52ad4d,0xc8))[_0xf955('0x47')](handleError(_0x52ad4d,null));};exports['addMessage']=function(_0x1d2e9c,_0x49718e,_0x5aeba7){return db['ChatMessage'][_0xf955('0x71')]({'where':{'id':_0x1d2e9c[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x49718e,null))[_0xf955('0x1f')](function(_0x10cd8e){if(_0x10cd8e){return _0x10cd8e[_0xf955('0x115')](_0x1d2e9c['body'][_0xf955('0x116')],_[_0xf955('0x117')](_0x1d2e9c[_0xf955('0x3a')],[_0xf955('0x116'),'id'])||{});}})[_0xf955('0x1f')](respondWithResult(_0x49718e,null))[_0xf955('0x47')](handleError(_0x49718e,null));};exports[_0xf955('0x118')]=function(_0x287adf,_0x38177d,_0x56a307){var _0x49c6ca={'raw':![],'where':{}};var _0x36f3b3={};var _0x252118={'count':0x0,'rows':[]};return db[_0xf955('0xad')]['findOne']({'where':{'id':_0x287adf['params']['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x38177d,null))['then'](function(_0x1dd4b4){if(_0x1dd4b4){_0x36f3b3[_0xf955('0x4b')]=_[_0xf955('0x85')](db[_0xf955('0xd9')]['rawAttributes']);_0x36f3b3[_0xf955('0x4c')]=_[_0xf955('0x85')](_0x287adf[_0xf955('0x4c')]);_0x36f3b3['filters']=_[_0xf955('0x4e')](_0x36f3b3['model'],_0x36f3b3[_0xf955('0x4c')]);_0x49c6ca[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x36f3b3[_0xf955('0x4b')],qs['fields'](_0x287adf[_0xf955('0x4c')][_0xf955('0x4f')]));_0x49c6ca[_0xf955('0x50')]=_0x49c6ca['attributes'][_0xf955('0x51')]?_0x49c6ca['attributes']:_0x36f3b3[_0xf955('0x4b')];if(!_0x287adf['query'][_0xf955('0x52')]('nolimit')){_0x49c6ca[_0xf955('0x30')]=qs['limit'](_0x287adf['query']['limit']);_0x49c6ca[_0xf955('0x2e')]=qs['offset'](_0x287adf['query'][_0xf955('0x2e')]);}_0x49c6ca[_0xf955('0xa2')]=qs[_0xf955('0x54')](_0x287adf[_0xf955('0x4c')][_0xf955('0x54')]);_0x49c6ca[_0xf955('0x55')]=qs[_0xf955('0x4d')](_[_0xf955('0x119')](_0x287adf['query'],_0x36f3b3[_0xf955('0x4d')]));_0x49c6ca[_0xf955('0x55')][_0xf955('0xc0')]=_0x1dd4b4['id'];if(_0x287adf[_0xf955('0x4c')][_0xf955('0x96')]){_0x49c6ca[_0xf955('0x55')]=_[_0xf955('0x39')](_0x49c6ca[_0xf955('0x55')],{'$or':_[_0xf955('0x40')](_0x49c6ca['attributes'],function(_0x1d1df4){var _0x1b7a62={};_0x1b7a62[_0x1d1df4]={'$like':'%'+_0x287adf[_0xf955('0x4c')][_0xf955('0x96')]+'%'};return _0x1b7a62;})});}if(_0x287adf[_0xf955('0x4c')][_0xf955('0x8c')]){var _0x547464=_0x287adf[_0xf955('0x4c')][_0xf955('0x8c')][_0xf955('0x44')](',');var _0x280d1c={};_0x280d1c[_0x547464[0x0]]={'$gte':moment(_0x547464[0x1])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x49c6ca[_0xf955('0x55')]=_[_0xf955('0x39')](_0x49c6ca['where'],_0x280d1c);}_0x49c6ca=_['merge']({},_0x49c6ca,_0x287adf['options']);return db[_0xf955('0xd9')][_0xf955('0x31')]({'where':_0x49c6ca[_0xf955('0x55')]})[_0xf955('0x1f')](function(_0x14bed6){_0x252118[_0xf955('0x31')]=_0x14bed6;if(_0x287adf[_0xf955('0x4c')][_0xf955('0xc3')]){_0x49c6ca[_0xf955('0xc4')]=[{'all':!![]}];}return db[_0xf955('0xd9')]['findAll'](_0x49c6ca);})[_0xf955('0x1f')](function(_0x7996b8){_0x252118[_0xf955('0xc2')]=_0x7996b8;return _0x252118;});}})[_0xf955('0x1f')](respondWithFilteredResult(_0x38177d,_0x49c6ca))[_0xf955('0x47')](handleError(_0x38177d,null));};exports['getMyMessages']=function(_0xac8cdf,_0x70fa9f,_0x5e650f){var _0x39d911={'where':{}},_0x2fbf0c={},_0x1612e4={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf955('0xea')]({'where':{'id':_0xac8cdf[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x70fa9f,null))[_0xf955('0x1f')](function(_0x1a7da8){if(_0x1a7da8){_0x2fbf0c[_0xf955('0x4b')]=_[_0xf955('0x85')](db['ChatMessage'][_0xf955('0x49')]);_0x2fbf0c['query']=_['keys'](_0xac8cdf['query']);_0x2fbf0c[_0xf955('0x4d')]=_[_0xf955('0x4e')](_0x2fbf0c[_0xf955('0x4b')],_0x2fbf0c[_0xf955('0x4c')]);_0x39d911[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x2fbf0c[_0xf955('0x4b')],qs['fields'](_0xac8cdf['query'][_0xf955('0x4f')]));_0x39d911[_0xf955('0x50')]=_0x39d911['attributes']['length']?_0x39d911[_0xf955('0x50')]:_0x2fbf0c[_0xf955('0x4b')];if(!_0xac8cdf[_0xf955('0x4c')]['hasOwnProperty']('nolimit')){_0x39d911[_0xf955('0x30')]=qs[_0xf955('0x30')](_0xac8cdf[_0xf955('0x4c')][_0xf955('0x30')]);_0x39d911[_0xf955('0x2e')]=qs['offset'](_0xac8cdf['query'][_0xf955('0x2e')]);}_0x39d911[_0xf955('0xa2')]=qs[_0xf955('0x54')](_0xac8cdf[_0xf955('0x4c')]['sort']);_0x39d911[_0xf955('0x55')]=qs[_0xf955('0x4d')](_[_0xf955('0x119')](_0xac8cdf[_0xf955('0x4c')],_0x2fbf0c[_0xf955('0x4d')]));_0x39d911[_0xf955('0x55')]['ChatInteractionId']=_0x1a7da8['id'];if(_0xac8cdf['query'][_0xf955('0x96')]){_0x39d911['where']=_[_0xf955('0x39')](_0x39d911[_0xf955('0x55')],{'$or':_['map'](_0x39d911['attributes'],function(_0x4a3d8c){var _0x170ea7={};_0x170ea7[_0x4a3d8c]={'$like':'%'+_0xac8cdf[_0xf955('0x4c')][_0xf955('0x96')]+'%'};return _0x170ea7;})});}_0x39d911[_0xf955('0x55')][_0xf955('0x109')]=![];if(_0xac8cdf[_0xf955('0x4c')]['id']){_0x39d911[_0xf955('0x55')]['id']={'$gt':_0xac8cdf[_0xf955('0x4c')]['id']};}_0x39d911=_[_0xf955('0x39')]({},_0x39d911,_0xac8cdf['options']);return db[_0xf955('0xd9')]['count']({'where':_0x39d911['where']})[_0xf955('0x1f')](function(_0x36327c){_0x1612e4[_0xf955('0x31')]=_0x36327c;_0x39d911[_0xf955('0xc4')]=[];if(_0xac8cdf['query'][_0xf955('0x11a')]){_0x39d911['include'][_0xf955('0x46')]({'model':db[_0xf955('0xfd')],'as':_0xf955('0xfd'),'attributes':['id',_0xf955('0x41'),'alias']});}if(_0xac8cdf[_0xf955('0x4c')][_0xf955('0xc3')]){_0x39d911[_0xf955('0xc4')]=[{'all':!![]}];}return db[_0xf955('0xd9')][_0xf955('0x11b')](_0x39d911);})[_0xf955('0x1f')](function(_0x3e4239){_0x1612e4[_0xf955('0xc2')]=_0x3e4239;return _0x1612e4;});}})[_0xf955('0x1f')](respondWithFilteredResult(_0x70fa9f,_0x39d911))['catch'](handleError(_0x70fa9f,null));};exports[_0xf955('0x11c')]=function(_0x11a228,_0x2d37c2,_0x932b98){return db[_0xf955('0xad')]['find']({'where':{'id':_0x11a228[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x2d37c2,null))[_0xf955('0x1f')](function(_0x147f3c){if(_0x147f3c){return _0x147f3c[_0xf955('0x11d')](_0x11a228[_0xf955('0x3a')]['ids'],_[_0xf955('0x117')](_0x11a228[_0xf955('0x3a')],[_0xf955('0x116'),'id'])||{})[_0xf955('0x11e')](function(){return db[_0xf955('0x11f')]['findAll']({'attributes':['id',_0xf955('0x38'),_0xf955('0x57')],'where':{'id':_0x11a228[_0xf955('0x3a')]['ids']}});})[_0xf955('0x1f')](function(_0xfcaf21){socket['emit'](_0xf955('0x120'),{'id':Number(_0x11a228[_0xf955('0xc7')]['id']),'tags':_0xfcaf21||[]});return{'id':Number(_0x11a228[_0xf955('0xc7')]['id']),'tags':_0xfcaf21||[]};});}})[_0xf955('0x1f')](respondWithResult(_0x2d37c2,null))[_0xf955('0x47')](handleError(_0x2d37c2,null));};exports['removeTags']=function(_0x572efd,_0x357dbc,_0x2b9880){return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x572efd[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x357dbc,null))['then'](function(_0x23968f){if(_0x23968f){return _0x23968f[_0xf955('0x121')](_0x572efd[_0xf955('0x4c')][_0xf955('0x116')]);}})['then'](respondWithStatusCode(_0x357dbc,null))[_0xf955('0x47')](handleError(_0x357dbc,null));};exports[_0xf955('0xf3')]=function(_0x3842e1,_0x204e4e){var _0x47b877=moment()[_0xf955('0x122')]()[_0xf955('0xbe')]();var _0x1624e9=path[_0xf955('0xef')](config[_0xf955('0xf6')],_0xf955('0x123'),_0xf955('0x124'),'tmp');var _0x3ccc35=path[_0xf955('0xef')](config[_0xf955('0xf6')],_0xf955('0x123'),_0xf955('0x124'),_0xf955('0x125'));var _0x72b500=path[_0xf955('0xef')](_0x1624e9,_0x47b877);var _0x1d4aa6=util[_0xf955('0xf8')](_0xf955('0x126'),_0x3842e1[_0xf955('0xc7')]['id'],_0x47b877);var _0x4896ae=path[_0xf955('0xef')](_0x1624e9,_0x1d4aa6);var _0x3b67e3=[];_0x3b67e3[_0xf955('0x46')]({'model':db['User'],'as':_0xf955('0xfd'),'attributes':['id','fullname'],'raw':!![]});_0x3b67e3[_0xf955('0x46')]({'model':db[_0xf955('0xdd')],'as':_0xf955('0x77'),'attributes':['id',_0xf955('0x127'),'lastName'],'raw':!![]});if(_0x3842e1['query']['attachments']){_0x3b67e3[_0xf955('0x46')]({'model':db[_0xf955('0xed')],'as':_0xf955('0xed'),'raw':!![]});}var _0x21b589=[{'model':db[_0xf955('0xd9')],'as':'Messages','attributes':['id',_0xf955('0x3a'),_0xf955('0x107'),_0xf955('0x128'),_0xf955('0x109'),'read'],'include':_0x3b67e3}];_0x21b589[_0xf955('0x46')]({'model':db[_0xf955('0xca')],'as':_0xf955('0x129'),'attributes':['id',_0xf955('0x38')]});_0x21b589[_0xf955('0x46')]({'model':db[_0xf955('0xfd')],'as':'Owner','attributes':['id',_0xf955('0x41')]});return db['ChatInteraction'][_0xf955('0x71')]({'where':{'id':_0x3842e1['params']['id']},'include':_0x21b589})[_0xf955('0x1f')](handleEntityNotFound(_0x204e4e,null))[_0xf955('0x1f')](function(_0x1ed31c){if(_0x1ed31c){var _0x2e8dc2=_0x1ed31c[_0xf955('0x12a')]({'plain':!![]});fs[_0xf955('0x12b')](_0x72b500);var _0x58b727={'channel':_0xf955('0x12c'),'account':_0x2e8dc2[_0xf955('0x129')][_0xf955('0x38')],'agent':_0x2e8dc2[_0xf955('0x12d')]?_0x2e8dc2[_0xf955('0x12d')][_0xf955('0x41')]:_0xf955('0x12e'),'createdAt':moment(_0x2e8dc2['createdAt'])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf955('0xbe')](),'closedAt':_0x2e8dc2['closed']?moment(_0x2e8dc2[_0xf955('0x12f')])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf955('0xbe')]():'','disposition':_0x2e8dc2['disposition'],'chatInfo':{'browser':_0x2e8dc2[_0xf955('0x130')],'os':_0x2e8dc2['osName'],'referer':_0x2e8dc2[_0xf955('0x131')],'customerIp':_0x2e8dc2[_0xf955('0x132')],'customerPort':_0x2e8dc2[_0xf955('0x133')]?_0x2e8dc2[_0xf955('0x133')]:'N.A.'},'messages':_(_0x2e8dc2[_0xf955('0xfc')])[_0xf955('0x134')]()[_0xf955('0x96')]({'secret':![]})[_0xf955('0x40')](function(_0x1307a6){if(_0x1307a6[_0xf955('0xed')]){var _0x3328b9=path[_0xf955('0xef')](_0x3ccc35,_0x1307a6['Attachment'][_0xf955('0xf2')]);if(fs[_0xf955('0x135')](_0x3328b9)){fs[_0xf955('0x136')](_0x3328b9)[_0xf955('0x137')](fs['createWriteStream'](path[_0xf955('0xef')](_0x72b500,_0x1307a6[_0xf955('0xed')][_0xf955('0xf2')])));}}return{'date':moment(_0x1307a6[_0xf955('0x107')])[_0xf955('0xf8')](_0xf955('0x138'))['toString'](),'sender':_0x1307a6[_0xf955('0x128')]===_0xf955('0xd8')?_0x1307a6['User']?_0x1307a6[_0xf955('0xfd')][_0xf955('0x41')]:_0xf955('0x100'):_0x1307a6[_0xf955('0x77')][_0xf955('0x127')]+(_0x1307a6[_0xf955('0x77')][_0xf955('0x139')]?'\x20'+_0x1307a6['Contact'][_0xf955('0x139')]:''),'body':_0x1307a6[_0xf955('0xed')]?_0x1307a6[_0xf955('0xed')][_0xf955('0xf2')]:_0x1307a6[_0xf955('0x3a')],'direction':_0x1307a6[_0xf955('0x128')]===_0xf955('0xd8')?'A':'C','secret':_0x1307a6['secret'],'read':_0x1307a6[_0xf955('0x91')],'attachment':_0x1307a6[_0xf955('0xed')]};})[_0xf955('0x73')]()};return ejs[_0xf955('0x13a')](path[_0xf955('0xef')](config[_0xf955('0xf6')],'server',_0xf955('0x13b'),_0xf955('0x13c')),{'interaction':_0x58b727})[_0xf955('0x1f')](function(_0x385676){var _0x5a9193=path['join'](_0x72b500,_0xf955('0x13d')+_0x2e8dc2['id']+'-'+_0x47b877+_0xf955('0x13e'));var _0x157508={'path':_0x5a9193,'channel':'Chat','interactionId':_0x2e8dc2['id']};return pdf[_0xf955('0x13f')](_0x385676,_0x157508);})['then'](function(){return new BPromise(function(_0x37bdd4,_0x4f8fc8){zipdir(_0x72b500,{'saveTo':_0x4896ae},function(_0x5f3e0f,_0x4ad147){if(_0x5f3e0f)return _0x4f8fc8(_0x5f3e0f);return _0x37bdd4(_0x4ad147);});})[_0xf955('0x1f')](function(){return new BPromise(function(_0x2dc607,_0x355871){rimraf(_0x72b500,function(_0x1c5b1d){if(_0x1c5b1d)_0x355871(_0x1c5b1d);return _0x2dc607();});});})[_0xf955('0x1f')](function(){return _0x204e4e[_0xf955('0xf3')](_0x4896ae,_0x1d4aa6,function(_0x5eac2b){if(_0x5eac2b){console[_0xf955('0x140')](_0xf955('0x141'),_0x5eac2b);}else{fs[_0xf955('0x142')](_0x4896ae);}});});});}else{return _0x204e4e[_0xf955('0x2a')](0xc8);}})[_0xf955('0x47')](handleError(_0x204e4e,null));};
\ No newline at end of file
+var _0x5f66=['email','isNull','vidaooNote','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','file','originalname','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','agentIdentifier','agent_alias','alias','agent_fullname','createdAt','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filter','findAll','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','transcript-','.pdf','log','err','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','name','merge','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','body','destroy','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooApiKey','https://api-vidaoo.xcally.com/api/v1/meetings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var pdf=require(_0x65f6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65f6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x65f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x65f6('0x14'))['db'];config['redis']=_[_0x65f6('0x15')](config[_0x65f6('0x16')],{'host':_0x65f6('0x17'),'port':0x18eb});var socket=require(_0x65f6('0x18'))(new Redis(config[_0x65f6('0x16')]));require(_0x65f6('0x19'))[_0x65f6('0x1a')](socket);var jayson=require(_0x65f6('0x1b'));var client=jayson[_0x65f6('0x1c')][_0x65f6('0x1d')]({'port':0x232b});var client9004=jayson['client'][_0x65f6('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x49a913,_0x5dd324,_0x1693e6,_0x5c69f8){return new BPromise(function(_0x37330d,_0x1c955c){var _0x1b1cbb=_0x5c69f8||client;return _0x1b1cbb[_0x65f6('0x1e')](_0x49a913,_0x1693e6)[_0x65f6('0x1f')](function(_0x18380e){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x65f6('0x20'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5dd324,'request\x20sent',JSON[_0x65f6('0x21')](_0x18380e));if(_0x18380e[_0x65f6('0x22')]){if(_0x18380e['error'][_0x65f6('0x23')]===0x1f4){logger[_0x65f6('0x22')](_0x65f6('0x24'),_0x5dd324,_0x18380e[_0x65f6('0x22')][_0x65f6('0x25')]);return _0x1c955c(_0x18380e[_0x65f6('0x22')]['message']);}logger[_0x65f6('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x18380e['error'][_0x65f6('0x25')]);return _0x37330d(_0x18380e[_0x65f6('0x22')]['message']);}else{logger[_0x65f6('0x26')](_0x65f6('0x24'),_0x5dd324,_0x65f6('0x20'));_0x37330d(_0x18380e[_0x65f6('0x27')]['message']);}})[_0x65f6('0x28')](function(_0x59ea32){logger[_0x65f6('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x5dd324,_0x59ea32);_0x1c955c(_0x59ea32);});});}function respondWithStatusCode(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0xcc;return function(_0x29abdb){if(_0x29abdb){return _0x5cb131[_0x65f6('0x29')](_0x4fde2f);}return _0x5cb131['status'](_0x4fde2f)[_0x65f6('0x2a')]();};}function respondWithResult(_0x28f710,_0x52277c){_0x52277c=_0x52277c||0xc8;return function(_0x325cb4){if(_0x325cb4){return _0x28f710[_0x65f6('0x2b')](_0x52277c)[_0x65f6('0x2c')](_0x325cb4);}};}function respondWithFilteredResult(_0x559330,_0x4ac04b){return function(_0x488d36){if(_0x488d36){var _0x266cfe=typeof _0x4ac04b[_0x65f6('0x2d')]===_0x65f6('0x2e')&&typeof _0x4ac04b[_0x65f6('0x2f')]===_0x65f6('0x2e');var _0x14a387=_0x488d36[_0x65f6('0x30')];var _0x4ace4c=_0x266cfe?0x0:_0x4ac04b['offset'];var _0x154cbd=_0x266cfe?_0x488d36[_0x65f6('0x30')]:_0x4ac04b['offset']+_0x4ac04b['limit'];var _0x10b368;if(_0x154cbd>=_0x14a387){_0x154cbd=_0x14a387;_0x10b368=0xc8;}else{_0x10b368=0xce;}_0x559330[_0x65f6('0x2b')](_0x10b368);return _0x559330[_0x65f6('0x31')](_0x65f6('0x32'),_0x4ace4c+'-'+_0x154cbd+'/'+_0x14a387)[_0x65f6('0x2c')](_0x488d36);}return null;};}function patchUpdates(_0x2d32be){return function(_0x5792a0){try{jsonpatch[_0x65f6('0x33')](_0x5792a0,_0x2d32be,!![]);}catch(_0x38f3c6){return BPromise[_0x65f6('0x34')](_0x38f3c6);}return _0x5792a0['save']();};}function saveUpdates(_0x217f35,_0x2a7aa8){return function(_0xbaed3c){if(_0xbaed3c){return _0xbaed3c[_0x65f6('0x35')](_0x217f35)[_0x65f6('0x1f')](function(_0x2f054c){return _0x2f054c;});}return null;};}function removeEntity(_0x4d4d84,_0x3c7c58){return function(_0x1b24ea){if(_0x1b24ea){return _0x1b24ea['destroy']()[_0x65f6('0x1f')](function(){_0x4d4d84['status'](0xcc)[_0x65f6('0x2a')]();});}};}function handleEntityNotFound(_0x50494b,_0x2b9fb6){return function(_0x24f7fd){if(!_0x24f7fd){_0x50494b['sendStatus'](0x194);}return _0x24f7fd;};}function handleError(_0x12dee6,_0x13e41a){_0x13e41a=_0x13e41a||0x1f4;return function(_0x3b261d){logger['error'](_0x3b261d['stack']);if(_0x3b261d[_0x65f6('0x36')]){delete _0x3b261d['name'];}_0x12dee6[_0x65f6('0x2b')](_0x13e41a)['send'](_0x3b261d);};}function getMustacheRender(_0x22d760,_0x2b9675){return Mustache['render'](_0x22d760,_[_0x65f6('0x37')](_0x2b9675['body'],{'contact':_0x2b9675['contact'],'message':_0x2b9675[_0x65f6('0x25')],'agent':_0x2b9675[_0x65f6('0x38')],'interaction':_0x2b9675[_0x65f6('0x39')],'account':_0x2b9675[_0x65f6('0x3a')]}))||'';}function getInteractionUsers(_0xbe54fe,_0x28845a){return new BPromise(function(_0x1a55da,_0x1153f1){try{if(_0x28845a[_0xbe54fe['id']]){_0xbe54fe['Users']=_[_0x65f6('0x3b')](_0x28845a[_0xbe54fe['id']],function(_0x49d8ee){return{'id':_0x49d8ee['id'],'fullname':_0x49d8ee[_0x65f6('0x3c')]};});}}catch(_0xa4394a){_0x1153f1(_0xa4394a);}_0x1a55da(_0xbe54fe);});}function getInteractionTags(_0x4ba7db,_0x2ea7f7){return new BPromise(function(_0x5ef5c2,_0x32148f){try{if(_0x4ba7db[_0x65f6('0x3d')]){_0x4ba7db[_0x65f6('0x3e')]=[];_0x4ba7db[_0x65f6('0x3d')][_0x65f6('0x3f')](',')[_0x65f6('0x40')](function(_0xed4c96){_0x4ba7db[_0x65f6('0x3e')][_0x65f6('0x41')](_0x2ea7f7[_0xed4c96]);});}delete _0x4ba7db['TagIds'];}catch(_0x170d3e){_0x32148f(_0x170d3e);}_0x5ef5c2(_0x4ba7db);});}function updateChatInteraction(_0x400ed2,_0x377ae5,_0x181798){return new BPromise(function(_0x83e2d9,_0x1ac040){return getInteractionUsers(_0x400ed2,_0x181798)[_0x65f6('0x1f')](function(_0x2e91e8){return getInteractionTags(_0x2e91e8,_0x377ae5);})[_0x65f6('0x1f')](function(_0x2abbed){_0x83e2d9(_0x2abbed);})[_0x65f6('0x28')](function(_0x2c008a){_0x1ac040(_0x2c008a);});});}exports[_0x65f6('0x42')]=function(_0x27157d,_0xb1a132){var _0x2cb38d={},_0x5119ee={},_0x2dd16c={'count':0x0,'rows':[]};var _0x37cd36=_[_0x65f6('0x3b')](db[_0x65f6('0x43')]['rawAttributes'],function(_0x1bf5bf){return{'name':_0x1bf5bf[_0x65f6('0x44')],'type':_0x1bf5bf[_0x65f6('0x45')]['key']};});_0x5119ee[_0x65f6('0x46')]=_[_0x65f6('0x3b')](_0x37cd36,_0x65f6('0x36'));_0x5119ee[_0x65f6('0x47')]=_['keys'](_0x27157d[_0x65f6('0x47')]);_0x5119ee['filters']=_[_0x65f6('0x48')](_0x5119ee[_0x65f6('0x46')],_0x5119ee['query']);_0x2cb38d[_0x65f6('0x49')]=_['intersection'](_0x5119ee[_0x65f6('0x46')],qs[_0x65f6('0x4a')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x4a')]));_0x2cb38d[_0x65f6('0x49')]=_0x2cb38d[_0x65f6('0x49')]['length']?_0x2cb38d['attributes']:_0x5119ee[_0x65f6('0x46')];if(!_0x27157d[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x2cb38d[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x2cb38d[_0x65f6('0x2d')]=qs['offset'](_0x27157d[_0x65f6('0x47')][_0x65f6('0x2d')]);}_0x2cb38d[_0x65f6('0x4d')]=qs['sort'](_0x27157d[_0x65f6('0x47')][_0x65f6('0x4e')]);_0x2cb38d['where']=qs[_0x65f6('0x4f')](_[_0x65f6('0x50')](_0x27157d['query'],_0x5119ee[_0x65f6('0x4f')]),_0x37cd36);var _0x4f96c4=[];var _0x247be3=squel[_0x65f6('0x51')]()[_0x65f6('0x52')]('id')['field'](_0x65f6('0x36'))[_0x65f6('0x52')]('color')[_0x65f6('0x53')](_0x65f6('0x54'));var _0x48a2ed=squel[_0x65f6('0x51')]()[_0x65f6('0x52')](_0x65f6('0x55'))[_0x65f6('0x52')](_0x65f6('0x56'))[_0x65f6('0x52')](_0x65f6('0x57'))[_0x65f6('0x53')]('user_has_chat_interactions','ui')['left_join']('users','u',_0x65f6('0x58'));var _0x2091f1=squel[_0x65f6('0x51')]()[_0x65f6('0x53')]('chat_interactions','i')[_0x65f6('0x59')](_0x65f6('0x5a'),'c',_0x65f6('0x5b'))['left_join'](_0x65f6('0x5c'),'o',_0x65f6('0x5d'))[_0x65f6('0x59')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x65f6('0x59')](_0x65f6('0x5e'),'me',_0x65f6('0x5f'))[_0x65f6('0x59')](_0x65f6('0x60'),'it',_0x65f6('0x61'))[_0x65f6('0x59')](_0x65f6('0x54'),'t',_0x65f6('0x62'));var _0xddbd90=squel[_0x65f6('0x63')]();var _0x141fcc=[];var _0x30adee=squel[_0x65f6('0x63')]();var _0x5ba9c6;if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x64')]){_0x5ba9c6=as[_0x65f6('0x65')](_0x27157d['query'][_0x65f6('0x64')]);var _0x16dec0=_0x5ba9c6[_0x65f6('0x66')];for(var _0x3096b8=0x0;_0x3096b8<_0x5ba9c6['conditions'][_0x65f6('0x67')];_0x3096b8++){var _0x4227f5=_0x5ba9c6[_0x65f6('0x68')][_0x3096b8];var _0x3e0d8b='i';var _0x553ff0=_[_0x65f6('0x69')](_0x37cd36,[_0x65f6('0x36'),_0x4227f5['field']]);if(!_0x553ff0){switch(_0x4227f5[_0x65f6('0x52')]){case _0x65f6('0x6a'):if(_0x4227f5[_0x65f6('0x6b')]==0x1){_0x2091f1['having']('`'+_0x4227f5[_0x65f6('0x52')]+_0x65f6('0x6c'));}else{_0x2091f1[_0x65f6('0x6d')]('`'+_0x4227f5[_0x65f6('0x52')]+_0x65f6('0x6e'));}break;case _0x65f6('0x6f'):if(_0x4227f5['operator']==='$substring'){if(_0x4227f5['value'][_0x65f6('0x3f')]('\x20')[_0x65f6('0x67')]>0x1){_0xddbd90[_0x16dec0](_0x65f6('0x70'),qs[_0x65f6('0x71')](_0x4227f5[_0x65f6('0x6b')]),null);}else{var _0x304cf9='%'+_0x4227f5['value']+'%';_0xddbd90[_0x16dec0](_0x65f6('0x72'),_0x304cf9,_0x304cf9,_0x304cf9);}}else{_0x553ff0=_[_0x65f6('0x69')](_0x37cd36,['name',_0x65f6('0x73')]);_0x4227f5[_0x65f6('0x52')]=_0x65f6('0x73');_0xf69bf6=as['buildExpression'](_0x3e0d8b,_0x553ff0[_0x65f6('0x45')],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6['value'][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);}break;case _0x65f6('0x76'):var _0x3d55f7=_0x4227f5[_0x65f6('0x6b')][_0x65f6('0x3f')](',')['map'](function(_0x4e5e94){return Number(_0x4e5e94);});_0x3d55f7[_0x65f6('0x40')](function(_0x3da139){_0x30adee['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3da139+',%');});_0x141fcc=_[_0x65f6('0x77')](_0x141fcc,_0x3d55f7);break;case'User':if(_0x4227f5[_0x65f6('0x78')]==='$substring'){_0xddbd90[_0x16dec0](_0x65f6('0x79'),'%'+_0x4227f5[_0x65f6('0x6b')]+'%',null);}else{_0x553ff0=_[_0x65f6('0x69')](_0x37cd36,[_0x65f6('0x36'),_0x65f6('0x7a')]);_0x4227f5[_0x65f6('0x52')]=_0x65f6('0x7a');_0xf69bf6=as[_0x65f6('0x7b')](_0x3e0d8b,_0x553ff0[_0x65f6('0x45')],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6['text'],_0xf69bf6['value'][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);}break;case'body':_0xf69bf6=as['buildExpression']('me',null,_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x75')],_0xf69bf6[_0x65f6('0x6b')][_0x65f6('0x2a')]);break;}}else{var _0xf69bf6=as['buildExpression'](_0x3e0d8b,_0x553ff0['type'],_0x4227f5);_0xddbd90[_0x16dec0](_0xf69bf6[_0x65f6('0x74')],_0xf69bf6[_0x65f6('0x6b')]['start'],_0xf69bf6[_0x65f6('0x6b')]['end']);}}}else{var _0x254e9f=_(_0x27157d[_0x65f6('0x47')])[_0x65f6('0x7c')]()[_0x65f6('0x3b')](function(_0x558888){return _[_0x65f6('0x7d')](_0x37cd36,[_0x65f6('0x36'),_0x558888])?_0x558888:undefined;})[_0x65f6('0x7e')]()['value']();if(!_['isEmpty'](_0x254e9f)){_0x254e9f[_0x65f6('0x40')](function(_0x583a01){if(_0x583a01===_0x65f6('0x7f')){_0x2091f1[_0x65f6('0x80')](_0x65f6('0x81'),[][_0x65f6('0x82')](_0x27157d['query'][_0x583a01]));}else if(_0x583a01==='createdAt'){var _0x56f7f1=JSON[_0x65f6('0x83')](_0x27157d[_0x65f6('0x47')][_0x583a01])[_0x65f6('0x84')];var _0x57464e=JSON[_0x65f6('0x83')](_0x27157d[_0x65f6('0x47')][_0x583a01])[_0x65f6('0x85')];_0x2091f1['where'](_0x65f6('0x86'),_0x56f7f1,_0x57464e);}else{if(_0x27157d[_0x65f6('0x47')][_0x583a01]==='null'){_0x2091f1[_0x65f6('0x80')]('i.'+_0x583a01+_0x65f6('0x87'));}else{_0x2091f1['where']('i.'+_0x583a01+_0x65f6('0x88'),_0x27157d['query'][_0x583a01]);}}});}if(_0x27157d[_0x65f6('0x47')]['read']){if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x89')]==0x1){_0x2091f1['having'](_0x65f6('0x8a'));}else{_0x2091f1[_0x65f6('0x6d')](_0x65f6('0x8b'));}}if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')]){_0x141fcc=_[_0x65f6('0x8d')](_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')])?_0x27157d[_0x65f6('0x47')][_0x65f6('0x8c')]:new Array(_0x27157d[_0x65f6('0x47')]['tag']);_0x141fcc[_0x65f6('0x40')](function(_0x1cf1bd){_0x30adee['or'](_0x65f6('0x8e'),'%,'+_0x1cf1bd+',%');});}if(_0x27157d[_0x65f6('0x47')]['filter']){var _0x453080=_0x27157d[_0x65f6('0x47')]['filter'][_0x65f6('0x8f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x65f6('0x90')](_0x453080)){_0xddbd90['or']('i.id\x20LIKE\x20?',_0x453080+'%');}else{_0xddbd90['or'](_0x65f6('0x91'),qs[_0x65f6('0x71')](_0x453080))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x453080+'%');}}}_0x2091f1['where'](_0xddbd90);_0x2091f1[_0x65f6('0x92')](_0x65f6('0x93'));var _0x5158c9={'type':db[_0x65f6('0x94')][_0x65f6('0x95')][_0x65f6('0x96')],'raw':!![]};var _0x4edba0=_0x2091f1[_0x65f6('0x97')]();_0x4edba0[_0x65f6('0x52')]('i.id');_0x4edba0[_0x65f6('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x65f6('0x6a'));if(_0x2cb38d['order']){_0x2cb38d['order'][_0x65f6('0x40')](function(_0x1cf4ed){var _0x199d63=_0x1cf4ed[0x0]===_0x65f6('0x98')?_0x1cf4ed[0x0]:'i.'+_0x1cf4ed[0x0];_0x2091f1[_0x65f6('0x4d')](_0x199d63,_0x1cf4ed[0x1]===_0x65f6('0x99')?![]:!![]);});}if(!_[_0x65f6('0x9a')](_0x141fcc)){_0x2091f1[_0x65f6('0x6d')](_0x30adee);_0x4edba0['where']('t.id\x20IN\x20?',_0x141fcc);}BPromise[_0x65f6('0x9b')]()['then'](function(){if(!_0x5ba9c6){if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x7f')])return;_0x4edba0[_0x65f6('0x80')](_0x65f6('0x9c'));_0x2091f1[_0x65f6('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x27157d[_0x65f6('0x9d')][_0x65f6('0x9e')]!==_0x65f6('0x38'))return;return _0x27157d['user'][_0x65f6('0x9f')]({'attributes':['id'],'raw':!![]})[_0x65f6('0x1f')](function(_0x4254c2){if(_[_0x65f6('0x9a')](_0x4254c2)){_0x4edba0[_0x65f6('0x80')](_0x65f6('0xa0'));_0x2091f1['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x4edba0[_0x65f6('0x80')](_0x65f6('0x81'),_[_0x65f6('0x3b')](_0x4254c2,'id'));_0x2091f1[_0x65f6('0x80')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x4254c2,'id'));}});})[_0x65f6('0x1f')](function(){if(_0x27157d[_0x65f6('0x9d')][_0x65f6('0x9e')]===_0x65f6('0x38')&&!_0x5ba9c6&&!_0x27157d[_0x65f6('0x47')][_0x65f6('0x7f')])return[];return db['sequelize']['query'](_0x4edba0['toString'](),_0x5158c9);})[_0x65f6('0x1f')](function(_0x2e63bb){_0x2dd16c[_0x65f6('0x30')]=_0x2e63bb[_0x65f6('0x67')];if(_0x2dd16c['count']===0x0)return[];return db['sequelize'][_0x65f6('0x47')](_0x247be3[_0x65f6('0xa1')](),_0x5158c9)['then'](function(_0x346fa9){_0x4f96c4=_['keyBy'](_0x346fa9,'id');_0x5158c9=_[_0x65f6('0x37')](_0x5158c9,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27157d[_0x65f6('0x47')][_0x65f6('0x4a')]){_0x2cb38d['attributes'][_0x65f6('0x40')](function(_0x330e18){_0x2091f1[_0x65f6('0x52')]('i.'+_0x330e18);});}else{_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa2'),_0x65f6('0x6a'));_0x2091f1['field'](_0x65f6('0xa3'),'Account.key');_0x2091f1[_0x65f6('0x52')]('a.mandatoryDisposition',_0x65f6('0xa4'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa5'),_0x65f6('0x98'));_0x2091f1['field'](_0x65f6('0xa6'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xa7'),'Contact.firstName');_0x2091f1['field'](_0x65f6('0xa8'),_0x65f6('0xa9'));_0x2091f1['field'](_0x65f6('0xaa'),_0x65f6('0xab'));_0x2091f1[_0x65f6('0x52')]('c.phone',_0x65f6('0xac'));_0x2091f1[_0x65f6('0x52')]('c.mobile',_0x65f6('0xad'));_0x2091f1[_0x65f6('0x52')](_0x65f6('0xae'),'Contact.fax');_0x2091f1[_0x65f6('0x52')](_0x65f6('0xaf'),_0x65f6('0xb0'));_0x2091f1['field'](_0x65f6('0xb1'),'Owner.internal');_0x2091f1[_0x65f6('0x52')](_0x65f6('0xb2'),_0x65f6('0x3d'));}if(_0x2cb38d[_0x65f6('0x2f')])_0x2091f1[_0x65f6('0x2f')](_0x2cb38d[_0x65f6('0x2f')]);if(_0x2cb38d['offset'])_0x2091f1[_0x65f6('0x2d')](_0x2cb38d[_0x65f6('0x2d')]);return db[_0x65f6('0xb3')][_0x65f6('0x47')](_0x2091f1[_0x65f6('0xa1')](),_0x5158c9);})['then'](function(_0x59f421){if(_0x59f421['length']>0x0)_0x48a2ed[_0x65f6('0x80')](_0x65f6('0xb4'),_[_0x65f6('0x3b')](_0x59f421,'id'));return db['sequelize'][_0x65f6('0x47')](_0x48a2ed['toString'](),_0x5158c9)['then'](function(_0x3133f4){var _0x41b58b=_['groupBy'](_0x3133f4,_0x65f6('0xb5'));var _0x3c5053=[];_0x59f421[_0x65f6('0x40')](function(_0x2ba1f7){_0x3c5053[_0x65f6('0x41')](updateChatInteraction(_0x2ba1f7,_0x4f96c4,_0x41b58b));});return BPromise[_0x65f6('0xb6')](_0x3c5053);});});})[_0x65f6('0x1f')](function(_0x3291ac){_0x2dd16c[_0x65f6('0xb7')]=_0x3291ac;return _0x2dd16c;})[_0x65f6('0x1f')](respondWithFilteredResult(_0xb1a132,_0x2cb38d))[_0x65f6('0x28')](handleError(_0xb1a132,null));};exports[_0x65f6('0xb8')]=function(_0x5c9cc0,_0x349af7){var _0x52dc75={'raw':![],'where':{'id':_0x5c9cc0[_0x65f6('0xb9')]['id']}},_0x55355f={};_0x55355f[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0x43')]['rawAttributes']);_0x55355f[_0x65f6('0x47')]=_['keys'](_0x5c9cc0['query']);_0x55355f[_0x65f6('0x4f')]=_[_0x65f6('0x48')](_0x55355f[_0x65f6('0x46')],_0x55355f[_0x65f6('0x47')]);_0x52dc75[_0x65f6('0x49')]=_[_0x65f6('0x48')](_0x55355f['model'],qs[_0x65f6('0x4a')](_0x5c9cc0['query'][_0x65f6('0x4a')]));_0x52dc75[_0x65f6('0x49')]=_0x52dc75[_0x65f6('0x49')]['length']?_0x52dc75[_0x65f6('0x49')]:_0x55355f['model'];if(_0x5c9cc0['query'][_0x65f6('0xba')]){_0x52dc75[_0x65f6('0xbb')]=[{'all':!![]}];}_0x52dc75=_[_0x65f6('0x37')]({},_0x52dc75,_0x5c9cc0[_0x65f6('0xbc')]);return db[_0x65f6('0x43')]['find'](_0x52dc75)[_0x65f6('0x1f')](handleEntityNotFound(_0x349af7,null))[_0x65f6('0x1f')](respondWithResult(_0x349af7,null))[_0x65f6('0x28')](handleError(_0x349af7,null));};exports[_0x65f6('0xbd')]=function(_0x51f1e5,_0x3cd4c1){return db[_0x65f6('0x43')][_0x65f6('0xbd')](_0x51f1e5[_0x65f6('0xbe')],{})[_0x65f6('0x1f')](respondWithResult(_0x3cd4c1,0xc9))[_0x65f6('0x28')](handleError(_0x3cd4c1,null));};exports[_0x65f6('0x35')]=function(_0x8aab06,_0x558410){if(_0x8aab06[_0x65f6('0xbe')]['id']){delete _0x8aab06[_0x65f6('0xbe')]['id'];}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x8aab06[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x558410,null))['then'](saveUpdates(_0x8aab06[_0x65f6('0xbe')],null))[_0x65f6('0x1f')](respondWithResult(_0x558410,null))['catch'](handleError(_0x558410,null));};exports[_0x65f6('0xbf')]=function(_0x547275,_0x24ff7c){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x547275[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x24ff7c,null))['then'](removeEntity(_0x24ff7c,null))[_0x65f6('0x28')](handleError(_0x24ff7c,null));};exports[_0x65f6('0xc0')]=function(_0x2394eb,_0x31870f){return db[_0x65f6('0x43')]['describe']()['then'](respondWithResult(_0x31870f,null))[_0x65f6('0x28')](handleError(_0x31870f,null));};exports[_0x65f6('0xc1')]=function(_0x2993ee,_0x3cf2d9){var _0x4c070f=_0x2993ee['params']['id'];var _0x534004;var _0x42a2f6;var _0x3b0a97;return db[_0x65f6('0x43')]['findOne']({'where':{'id':_0x4c070f}})[_0x65f6('0x1f')](function(_0x3b5592){_0x534004=_0x3b5592;return db[_0x65f6('0xc2')][_0x65f6('0xc3')]({'where':{'id':_0x3b5592[_0x65f6('0x7f')]},'attributes':['id','vidaooApiKey',_0x65f6('0xc4'),_0x65f6('0xc5'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x65f6('0x1f')](function(_0x173b54){if(_0x173b54&&_0x173b54[_0x65f6('0xc6')]&&_0x173b54[_0x65f6('0xc4')]){_0x42a2f6=_0x173b54;var _0x17bbc9={'interaction':{'id':_0x4c070f},'agent':{'id':_0x2993ee['user']['id'],'name':_0x2993ee[_0x65f6('0x9d')]['name'],'fullname':_0x2993ee[_0x65f6('0x9d')]['fullname'],'email':_0x2993ee[_0x65f6('0x9d')]['email']},'contact':_0x2993ee[_0x65f6('0xbe')]['contact'],'account':_0x2993ee[_0x65f6('0xbe')][_0x65f6('0x3a')]};var _0x494f9c={'rejectUnauthorized':![],'method':'POST','url':_0x65f6('0xc7'),'headers':{'X-APIKEY':_0x173b54[_0x65f6('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2993ee[_0x65f6('0x9d')][_0x65f6('0xc8')]],'buttons':null,'topic':_0x42a2f6[_0x65f6('0xc5')],'note':_[_0x65f6('0xc9')](_0x42a2f6[_0x65f6('0xca')])?null:getMustacheRender(_0x42a2f6[_0x65f6('0xca')],_0x17bbc9),'metadata':null},'redirect':_0x65f6('0xcb'),'json':!![]};try{if(!_[_0x65f6('0xc9')](_0x42a2f6[_0x65f6('0xcc')])){var _0x6babec=getMustacheRender(_0x42a2f6[_0x65f6('0xcc')],_0x17bbc9);var _0x42177e=JSON[_0x65f6('0x83')](_0x6babec);_0x494f9c[_0x65f6('0xbe')][_0x65f6('0xcd')]=_0x42177e;}}catch(_0x5efe82){throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))](_0x65f6('0xcf'));}return rp(_0x494f9c);}else{throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))](_0x65f6('0xd0'));}})[_0x65f6('0x1f')](function(_0x2b3415){_0x3b0a97=_0x2b3415;if(_0x3b0a97['id']){var _0x3c9d49={'body':_0x3b0a97['join_url'],'ChatWebsiteId':_0x42a2f6['id'],'ChatInteractionId':_0x534004['id'],'direction':_0x65f6('0xd1'),'UserId':_0x2993ee[_0x65f6('0x9d')]['id']};return db[_0x65f6('0xd2')][_0x65f6('0xbd')](_0x3c9d49,{});}else{throw new db['Sequelize'][(_0x65f6('0xce'))](_0x65f6('0xd3'));}})['then'](function(){return _0x534004[_0x65f6('0xd4')]({'vidaooSessionId':_0x3b0a97['id']});})[_0x65f6('0x1f')](respondWithResult(_0x3cf2d9,null))[_0x65f6('0x28')](handleError(_0x3cf2d9,null));};exports[_0x65f6('0xd5')]=function(_0x2b89d5,_0x409dd7){if(_0x2b89d5['body']['id']){delete _0x2b89d5[_0x65f6('0xbe')]['id'];}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x2b89d5[_0x65f6('0xb9')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x409dd7,null))[_0x65f6('0x1f')](saveUpdates(_0x2b89d5[_0x65f6('0xbe')],null))[_0x65f6('0x1f')](respondWithResult(_0x409dd7,null))[_0x65f6('0x28')](handleError(_0x409dd7,null));};exports[_0x65f6('0xd6')]=function(_0x5515a4,_0x542805,_0x2281d5){if(_0x5515a4[_0x65f6('0xbe')]['id']){delete _0x5515a4[_0x65f6('0xbe')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5515a4[_0x65f6('0xb9')]['id']}})['then'](function(_0x10a218){if(!_0x10a218){logger[_0x65f6('0x22')](_0x65f6('0xd7'),_0x65f6('0xd6'),0x194,_0x65f6('0xd8'));_0x542805[_0x65f6('0x29')](0x194);}else{if(_0x10a218[_0x65f6('0x7a')]){throw new db[(_0x65f6('0x94'))][(_0x65f6('0xce'))]('Interaction\x20already\x20assigned');}}return _0x10a218;})[_0x65f6('0x1f')](function(_0x129ae0){if(_0x129ae0){return _0x129ae0['update']({'closed':_0x5515a4[_0x65f6('0xbe')]['closed'],'disposition':_0x5515a4[_0x65f6('0xbe')][_0x65f6('0xd9')]})[_0x65f6('0x1f')](function(_0x579d52){return _0x579d52;});}})[_0x65f6('0x1f')](function(_0x5745e8){return respondWithRpcPromise('AbandonInteraction',_0x65f6('0xd6'),_0x5515a4[_0x65f6('0xbe')],client9004);})['then'](respondWithResult(_0x542805,null))[_0x65f6('0x28')](handleError(_0x542805,null));};exports['attachmentUpload']=function(_0x2b8edf,_0x28b9f4,_0x24e7f7){_0x2b8edf[_0x65f6('0xbe')][_0x65f6('0x36')]=_0x2b8edf[_0x65f6('0xda')][_0x65f6('0xdb')];_0x2b8edf[_0x65f6('0xbe')]['basename']=_0x2b8edf[_0x65f6('0xda')][_0x65f6('0xdc')];_0x2b8edf[_0x65f6('0xbe')][_0x65f6('0x45')]=_0x2b8edf[_0x65f6('0xda')]['mimetype'];return db[_0x65f6('0xdd')]['create'](_0x2b8edf[_0x65f6('0xbe')])['then'](respondWithResult(_0x28b9f4,0xc9))[_0x65f6('0x28')](handleError(_0x28b9f4,null));};exports[_0x65f6('0xde')]=function(_0x83ec2e,_0x3f61c4,_0x230eb9){return db[_0x65f6('0x43')][_0x65f6('0xc3')]({'where':{'id':_0x83ec2e[_0x65f6('0xb9')]['id']},'raw':!![]})[_0x65f6('0x1f')](handleEntityNotFound(_0x3f61c4,null))[_0x65f6('0x1f')](function(_0x72a333){if(_0x72a333){if(_0x72a333[_0x65f6('0xdf')]){return _0x3f61c4[_0x65f6('0x2b')](0x193)[_0x65f6('0x2c')]({'status':0x193,'message':_0x65f6('0xe0')});}return db[_0x65f6('0xdd')][_0x65f6('0xc3')]({'where':{'id':_0x83ec2e['query'][_0x65f6('0xe1')]},'raw':!![]})['then'](handleEntityNotFound(_0x3f61c4,null));}})[_0x65f6('0x1f')](function(_0x34f1cf){if(_0x34f1cf){var _0x431691=_0x34f1cf[_0x65f6('0xe2')]!==null;var _0x17f1f6=path[_0x65f6('0xe3')](config['root'],_0x65f6('0xe4'));if(_0x431691){_0x17f1f6=path[_0x65f6('0xe3')](_0x17f1f6,_0x65f6('0xe5'));}var _0x359734=path[_0x65f6('0xe3')](_0x17f1f6,_0x34f1cf[_0x65f6('0xe6')]);return _0x3f61c4[_0x65f6('0xe7')](_0x359734);}})[_0x65f6('0x28')](handleError(_0x3f61c4,null));};exports[_0x65f6('0xe8')]=function(_0x53da3a,_0x33831f){var _0x4ecd83=null;var _0x5e4778=null;var _0x4427bf=null;var _0x927c22=null;if(_0x53da3a[_0x65f6('0xbe')]['id']){delete _0x53da3a[_0x65f6('0xbe')]['id'];}if(_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xe9')]){_0x927c22=path[_0x65f6('0xe3')](config['root'],_0x65f6('0xea'),util[_0x65f6('0xeb')](_0x65f6('0xec'),Date[_0x65f6('0xed')]()));_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xee')]=_0x927c22;}return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x53da3a[_0x65f6('0xb9')]['id']},'include':[{'model':db[_0x65f6('0xd2')],'as':_0x65f6('0xef'),'include':[{'model':db[_0x65f6('0xf0')],'as':_0x65f6('0xf0')}]}]})['then'](handleEntityNotFound(_0x33831f,null))['then'](saveUpdates(_0x53da3a['body'],null))[_0x65f6('0x1f')](function(_0x3edd09){if(_0x3edd09){_0x4ecd83=_0x3edd09;return db[_0x65f6('0xc2')]['find']({'where':{'id':_0x4ecd83[_0x65f6('0x7f')]}});}})[_0x65f6('0x1f')](function(_0x10d421){if(_0x10d421){_0x4427bf=_0x10d421;return db['CmContact'][_0x65f6('0x69')]({'where':{'id':_0x4ecd83[_0x65f6('0x73')]}});}})['then'](function(_0x346aa3){if(_0x346aa3){_0x5e4778=_0x346aa3;if(_0x927c22){var _0x1f4a0d=null;for(var _0x3369b6=0x1;_0x3369b6<_0x4ecd83['Messages'][_0x65f6('0x67')];++_0x3369b6){_0x1f4a0d=_0x4ecd83[_0x65f6('0xef')][_0x3369b6];var _0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):_0x65f6('0xf3');var _0x128304=_0x53da3a['body'][_0x65f6('0xf4')]||util[_0x65f6('0xeb')](_0x65f6('0xf1'),'Visitor',_0x1f4a0d['ContactId']);switch(_0x4427bf[_0x65f6('0xf5')]){case'website_alias':_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):'System';break;case _0x65f6('0xf6'):_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?_0x1f4a0d[_0x65f6('0xf0')][_0x65f6('0xf7')]||_0x1f4a0d['User'][_0x65f6('0x3c')]:_0x65f6('0xf3');break;case _0x65f6('0xf8'):_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?_0x1f4a0d[_0x65f6('0xf0')][_0x65f6('0x3c')]:_0x65f6('0xf3');break;default:_0x29656f=_0x1f4a0d[_0x65f6('0x7a')]?util[_0x65f6('0xeb')](_0x65f6('0xf1'),_0x4427bf[_0x65f6('0xf2')],_0x1f4a0d[_0x65f6('0x7a')]):_0x65f6('0xf3');}var _0x31e87d=util[_0x65f6('0xeb')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1f4a0d[_0x65f6('0xf9')])[_0x65f6('0xeb')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1f4a0d['direction']==='in'?_0x128304:_0x29656f,_0x1f4a0d[_0x65f6('0xbe')]);if(!_0x1f4a0d[_0x65f6('0xfa')]){fs[_0x65f6('0xfb')](_0x927c22,_0x31e87d);}}return db[_0x65f6('0xfc')][_0x65f6('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0x65f6('0xfd')],'as':_0x65f6('0xfe'),'raw':!![]}]});}}})['then'](function(_0x2922b9){if(_0x2922b9&&_0x2922b9['Smtp']&&_0x53da3a['body']){var _0x35062f={'tls':{'rejectUnauthorized':![]}};if(_0x2922b9[_0x65f6('0xfe')][_0x65f6('0xff')]){_0x35062f[_0x65f6('0xff')]=_0x2922b9['Smtp']['service'];}else{_0x35062f[_0x65f6('0x100')]=_0x2922b9[_0x65f6('0xfe')]['host'];_0x35062f['port']=_0x2922b9['Smtp'][_0x65f6('0x101')];_0x35062f[_0x65f6('0x102')]=_0x2922b9[_0x65f6('0xfe')][_0x65f6('0x102')];}if(_0x2922b9[_0x65f6('0xfe')]['authentication']){_0x35062f['auth']={'user':_0x2922b9[_0x65f6('0xfe')][_0x65f6('0x9d')],'pass':_0x2922b9[_0x65f6('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x65f6('0x103'),{'account':_0x35062f,'message':{'from':util[_0x65f6('0xeb')]('\x22%s\x22\x20<%s>',_0x2922b9[_0x65f6('0x36')],_0x2922b9[_0x65f6('0xc8')]||_0x2922b9['Smtp'][_0x65f6('0x9d')]),'to':_0x53da3a['body'][_0x65f6('0xe9')],'subject':_0x65f6('0x104'),'text':util[_0x65f6('0xeb')](_0x65f6('0x105'),_0x53da3a[_0x65f6('0xbe')][_0x65f6('0xe9')]),'attachments':[{'path':_0x927c22}]}})['then'](function(){return _0x4ecd83;})[_0x65f6('0x28')](function(_0x31f4ae){console['error'](_0x31f4ae);});}else{return _0x4ecd83;}})[_0x65f6('0x1f')](respondWithStatusCode(_0x33831f,0xc8))[_0x65f6('0x28')](handleError(_0x33831f,null));};exports[_0x65f6('0x106')]=function(_0x4b2f42,_0x491533,_0x322df1){return db[_0x65f6('0xd2')][_0x65f6('0x69')]({'where':{'id':_0x4b2f42[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x491533,null))[_0x65f6('0x1f')](function(_0x5e4078){if(_0x5e4078){return _0x5e4078['addMessage'](_0x4b2f42[_0x65f6('0xbe')][_0x65f6('0x107')],_[_0x65f6('0x108')](_0x4b2f42[_0x65f6('0xbe')],[_0x65f6('0x107'),'id'])||{});}})[_0x65f6('0x1f')](respondWithResult(_0x491533,null))[_0x65f6('0x28')](handleError(_0x491533,null));};exports[_0x65f6('0x109')]=function(_0x201edb,_0x42c4b8,_0x169632){var _0x32f5d5={'raw':![],'where':{}};var _0x594789={};var _0x624c21={'count':0x0,'rows':[]};return db[_0x65f6('0x43')][_0x65f6('0xc3')]({'where':{'id':_0x201edb[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x42c4b8,null))[_0x65f6('0x1f')](function(_0xd00f2f){if(_0xd00f2f){_0x594789[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0xd2')]['rawAttributes']);_0x594789[_0x65f6('0x47')]=_[_0x65f6('0x7c')](_0x201edb[_0x65f6('0x47')]);_0x594789['filters']=_[_0x65f6('0x48')](_0x594789[_0x65f6('0x46')],_0x594789[_0x65f6('0x47')]);_0x32f5d5['attributes']=_['intersection'](_0x594789[_0x65f6('0x46')],qs[_0x65f6('0x4a')](_0x201edb[_0x65f6('0x47')][_0x65f6('0x4a')]));_0x32f5d5[_0x65f6('0x49')]=_0x32f5d5[_0x65f6('0x49')][_0x65f6('0x67')]?_0x32f5d5[_0x65f6('0x49')]:_0x594789[_0x65f6('0x46')];if(!_0x201edb[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x32f5d5[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x201edb[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x32f5d5[_0x65f6('0x2d')]=qs[_0x65f6('0x2d')](_0x201edb['query'][_0x65f6('0x2d')]);}_0x32f5d5[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x201edb[_0x65f6('0x47')]['sort']);_0x32f5d5[_0x65f6('0x80')]=qs['filters'](_[_0x65f6('0x50')](_0x201edb[_0x65f6('0x47')],_0x594789[_0x65f6('0x4f')]));_0x32f5d5[_0x65f6('0x80')][_0x65f6('0xb5')]=_0xd00f2f['id'];if(_0x201edb['query'][_0x65f6('0x10a')]){_0x32f5d5['where']=_['merge'](_0x32f5d5['where'],{'$or':_[_0x65f6('0x3b')](_0x32f5d5['attributes'],function(_0x28caab){var _0x3db2fd={};_0x3db2fd[_0x28caab]={'$like':'%'+_0x201edb[_0x65f6('0x47')][_0x65f6('0x10a')]+'%'};return _0x3db2fd;})});}if(_0x201edb[_0x65f6('0x47')][_0x65f6('0x84')]){var _0x18461c=_0x201edb[_0x65f6('0x47')]['$gte']['split'](',');var _0x13af41={};_0x13af41[_0x18461c[0x0]]={'$gte':moment(_0x18461c[0x1])[_0x65f6('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x32f5d5[_0x65f6('0x80')]=_['merge'](_0x32f5d5['where'],_0x13af41);}_0x32f5d5=_[_0x65f6('0x37')]({},_0x32f5d5,_0x201edb[_0x65f6('0xbc')]);return db[_0x65f6('0xd2')][_0x65f6('0x30')]({'where':_0x32f5d5[_0x65f6('0x80')]})['then'](function(_0x1bc75c){_0x624c21['count']=_0x1bc75c;if(_0x201edb[_0x65f6('0x47')]['includeAll']){_0x32f5d5['include']=[{'all':!![]}];}return db[_0x65f6('0xd2')][_0x65f6('0x10b')](_0x32f5d5);})[_0x65f6('0x1f')](function(_0x27e5fa){_0x624c21[_0x65f6('0xb7')]=_0x27e5fa;return _0x624c21;});}})[_0x65f6('0x1f')](respondWithFilteredResult(_0x42c4b8,_0x32f5d5))[_0x65f6('0x28')](handleError(_0x42c4b8,null));};exports[_0x65f6('0x10c')]=function(_0x504520,_0xe8f14f,_0x494de7){var _0x13e006={'where':{}},_0x186cf6={},_0x21ce60={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x65f6('0xc3')]({'where':{'id':_0x504520[_0x65f6('0xb9')]['id']}})['then'](handleEntityNotFound(_0xe8f14f,null))[_0x65f6('0x1f')](function(_0x3e1f7c){if(_0x3e1f7c){_0x186cf6[_0x65f6('0x46')]=_[_0x65f6('0x7c')](db[_0x65f6('0xd2')]['rawAttributes']);_0x186cf6[_0x65f6('0x47')]=_[_0x65f6('0x7c')](_0x504520[_0x65f6('0x47')]);_0x186cf6['filters']=_['intersection'](_0x186cf6[_0x65f6('0x46')],_0x186cf6[_0x65f6('0x47')]);_0x13e006[_0x65f6('0x49')]=_[_0x65f6('0x48')](_0x186cf6[_0x65f6('0x46')],qs['fields'](_0x504520['query']['fields']));_0x13e006[_0x65f6('0x49')]=_0x13e006[_0x65f6('0x49')]['length']?_0x13e006['attributes']:_0x186cf6['model'];if(!_0x504520[_0x65f6('0x47')][_0x65f6('0x4b')](_0x65f6('0x4c'))){_0x13e006[_0x65f6('0x2f')]=qs[_0x65f6('0x2f')](_0x504520[_0x65f6('0x47')][_0x65f6('0x2f')]);_0x13e006[_0x65f6('0x2d')]=qs[_0x65f6('0x2d')](_0x504520[_0x65f6('0x47')][_0x65f6('0x2d')]);}_0x13e006[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x504520[_0x65f6('0x47')][_0x65f6('0x4e')]);_0x13e006['where']=qs[_0x65f6('0x4f')](_[_0x65f6('0x50')](_0x504520[_0x65f6('0x47')],_0x186cf6[_0x65f6('0x4f')]));_0x13e006[_0x65f6('0x80')][_0x65f6('0xb5')]=_0x3e1f7c['id'];if(_0x504520['query'][_0x65f6('0x10a')]){_0x13e006[_0x65f6('0x80')]=_['merge'](_0x13e006['where'],{'$or':_[_0x65f6('0x3b')](_0x13e006['attributes'],function(_0x4fd7ca){var _0x343d7b={};_0x343d7b[_0x4fd7ca]={'$like':'%'+_0x504520[_0x65f6('0x47')]['filter']+'%'};return _0x343d7b;})});}_0x13e006[_0x65f6('0x80')][_0x65f6('0xfa')]=![];if(_0x504520['query']['id']){_0x13e006[_0x65f6('0x80')]['id']={'$gt':_0x504520[_0x65f6('0x47')]['id']};}_0x13e006=_[_0x65f6('0x37')]({},_0x13e006,_0x504520[_0x65f6('0xbc')]);return db[_0x65f6('0xd2')][_0x65f6('0x30')]({'where':_0x13e006[_0x65f6('0x80')]})[_0x65f6('0x1f')](function(_0x443f1f){_0x21ce60['count']=_0x443f1f;_0x13e006[_0x65f6('0xbb')]=[];if(_0x504520[_0x65f6('0x47')][_0x65f6('0x10d')]){_0x13e006[_0x65f6('0xbb')][_0x65f6('0x41')]({'model':db[_0x65f6('0xf0')],'as':'User','attributes':['id',_0x65f6('0x3c'),'alias']});}if(_0x504520['query']['includeAll']){_0x13e006[_0x65f6('0xbb')]=[{'all':!![]}];}return db['ChatMessage'][_0x65f6('0x10b')](_0x13e006);})[_0x65f6('0x1f')](function(_0x285cef){_0x21ce60[_0x65f6('0xb7')]=_0x285cef;return _0x21ce60;});}})[_0x65f6('0x1f')](respondWithFilteredResult(_0xe8f14f,_0x13e006))[_0x65f6('0x28')](handleError(_0xe8f14f,null));};exports[_0x65f6('0x10e')]=function(_0x5a4c42,_0x5db63d,_0x352012){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x5a4c42['params']['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x5db63d,null))['then'](function(_0x1188a2){if(_0x1188a2){return _0x1188a2[_0x65f6('0x10f')](_0x5a4c42[_0x65f6('0xbe')]['ids'],_[_0x65f6('0x108')](_0x5a4c42[_0x65f6('0xbe')],[_0x65f6('0x107'),'id'])||{})[_0x65f6('0x110')](function(){return db['Tag']['findAll']({'attributes':['id',_0x65f6('0x36'),'color'],'where':{'id':_0x5a4c42[_0x65f6('0xbe')]['ids']}});})[_0x65f6('0x1f')](function(_0x38b1ed){socket[_0x65f6('0x111')]('chatInteractionTags:save',{'id':Number(_0x5a4c42[_0x65f6('0xb9')]['id']),'tags':_0x38b1ed||[]});return{'id':Number(_0x5a4c42[_0x65f6('0xb9')]['id']),'tags':_0x38b1ed||[]};});}})[_0x65f6('0x1f')](respondWithResult(_0x5db63d,null))[_0x65f6('0x28')](handleError(_0x5db63d,null));};exports[_0x65f6('0x112')]=function(_0x5fb1fa,_0x19c8d4,_0x4e40d4){return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0x5fb1fa[_0x65f6('0xb9')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x19c8d4,null))[_0x65f6('0x1f')](function(_0x41da12){if(_0x41da12){return _0x41da12[_0x65f6('0x112')](_0x5fb1fa[_0x65f6('0x47')][_0x65f6('0x107')]);}})['then'](respondWithStatusCode(_0x19c8d4,null))[_0x65f6('0x28')](handleError(_0x19c8d4,null));};exports['download']=function(_0xa3fb44,_0x459924){var _0x286c97=moment()[_0x65f6('0x113')]()[_0x65f6('0xa1')]();var _0x36f46f=path[_0x65f6('0xe3')](config[_0x65f6('0x114')],_0x65f6('0x115'),_0x65f6('0x116'),_0x65f6('0x117'));var _0x38e6ff=path[_0x65f6('0xe3')](config[_0x65f6('0x114')],_0x65f6('0x115'),_0x65f6('0x116'),_0x65f6('0x118'));var _0x560dbb=path[_0x65f6('0xe3')](_0x36f46f,_0x286c97);var _0x2315bc=util['format'](_0x65f6('0x119'),_0xa3fb44[_0x65f6('0xb9')]['id'],_0x286c97);var _0x2eda77=path[_0x65f6('0xe3')](_0x36f46f,_0x2315bc);var _0x2a163e=[];_0x2a163e[_0x65f6('0x41')]({'model':db['User'],'as':'User','attributes':['id',_0x65f6('0x3c')],'raw':!![]});_0x2a163e[_0x65f6('0x41')]({'model':db[_0x65f6('0x11a')],'as':'Contact','attributes':['id',_0x65f6('0x11b'),'lastName'],'raw':!![]});if(_0xa3fb44[_0x65f6('0x47')][_0x65f6('0x118')]){_0x2a163e[_0x65f6('0x41')]({'model':db[_0x65f6('0xdd')],'as':'Attachment','raw':!![]});}var _0x41156f=[{'model':db['ChatMessage'],'as':_0x65f6('0xef'),'attributes':['id',_0x65f6('0xbe'),_0x65f6('0xf9'),'direction',_0x65f6('0xfa'),'read'],'include':_0x2a163e}];_0x41156f['push']({'model':db[_0x65f6('0xc2')],'as':_0x65f6('0x11c'),'attributes':['id',_0x65f6('0x36')]});_0x41156f[_0x65f6('0x41')]({'model':db[_0x65f6('0xf0')],'as':_0x65f6('0x11d'),'attributes':['id',_0x65f6('0x3c')]});return db[_0x65f6('0x43')][_0x65f6('0x69')]({'where':{'id':_0xa3fb44[_0x65f6('0xb9')]['id']},'include':_0x41156f})[_0x65f6('0x1f')](handleEntityNotFound(_0x459924,null))['then'](function(_0x168cac){if(_0x168cac){var _0x5d4415=_0x168cac[_0x65f6('0x11e')]({'plain':!![]});fs[_0x65f6('0x11f')](_0x560dbb);var _0x4943cd={'channel':_0x65f6('0x120'),'account':_0x5d4415[_0x65f6('0x11c')]['name'],'agent':_0x5d4415['Owner']?_0x5d4415[_0x65f6('0x11d')]['fullname']:'N.A.','createdAt':moment(_0x5d4415[_0x65f6('0xf9')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')](),'closedAt':_0x5d4415[_0x65f6('0xdf')]?moment(_0x5d4415[_0x65f6('0x122')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')]():'','disposition':_0x5d4415['disposition'],'chatInfo':{'browser':_0x5d4415[_0x65f6('0x123')],'os':_0x5d4415[_0x65f6('0x124')],'referer':_0x5d4415['referer'],'customerIp':_0x5d4415[_0x65f6('0x125')],'customerPort':_0x5d4415[_0x65f6('0x126')]?_0x5d4415[_0x65f6('0x126')]:_0x65f6('0x127')},'messages':_(_0x5d4415[_0x65f6('0xef')])[_0x65f6('0x128')]()['filter']({'secret':![]})['map'](function(_0x9d51e3){if(_0x9d51e3[_0x65f6('0xdd')]){var _0x22aac6=path[_0x65f6('0xe3')](_0x38e6ff,_0x9d51e3[_0x65f6('0xdd')]['basename']);if(fs[_0x65f6('0x129')](_0x22aac6)){fs[_0x65f6('0x12a')](_0x22aac6)[_0x65f6('0x12b')](fs[_0x65f6('0x12c')](path[_0x65f6('0xe3')](_0x560dbb,_0x9d51e3[_0x65f6('0xdd')][_0x65f6('0xe6')])));}}return{'date':moment(_0x9d51e3[_0x65f6('0xf9')])[_0x65f6('0xeb')](_0x65f6('0x121'))[_0x65f6('0xa1')](),'sender':_0x9d51e3['direction']===_0x65f6('0xd1')?_0x9d51e3[_0x65f6('0xf0')]?_0x9d51e3['User']['fullname']:_0x65f6('0xf3'):_0x9d51e3[_0x65f6('0x6f')][_0x65f6('0x11b')]+(_0x9d51e3['Contact'][_0x65f6('0x12d')]?'\x20'+_0x9d51e3[_0x65f6('0x6f')][_0x65f6('0x12d')]:''),'body':_0x9d51e3[_0x65f6('0xdd')]?_0x9d51e3[_0x65f6('0xdd')][_0x65f6('0xe6')]:_0x9d51e3[_0x65f6('0xbe')],'direction':_0x9d51e3['direction']===_0x65f6('0xd1')?'A':'C','secret':_0x9d51e3['secret'],'read':_0x9d51e3[_0x65f6('0x89')],'attachment':_0x9d51e3[_0x65f6('0xdd')]};})[_0x65f6('0x6b')]()};return ejs[_0x65f6('0x12e')](path[_0x65f6('0xe3')](config[_0x65f6('0x114')],'server',_0x65f6('0x12f'),'downloadInteraction.ejs'),{'interaction':_0x4943cd})[_0x65f6('0x1f')](function(_0x5081ad){var _0x32829e=path['join'](_0x560dbb,_0x65f6('0x130')+_0x5d4415['id']+'-'+_0x286c97+_0x65f6('0x131'));var _0x3f421f={'path':_0x32829e,'channel':_0x65f6('0x120'),'interactionId':_0x5d4415['id']};return pdf['createPdfFromHTML'](_0x5081ad,_0x3f421f);})[_0x65f6('0x1f')](function(){return new BPromise(function(_0xbf09f6,_0x3d6e08){zipdir(_0x560dbb,{'saveTo':_0x2eda77},function(_0x2c4af8,_0x71483f){if(_0x2c4af8)return _0x3d6e08(_0x2c4af8);return _0xbf09f6(_0x71483f);});})[_0x65f6('0x1f')](function(){return new BPromise(function(_0xd06566,_0x21bf41){rimraf(_0x560dbb,function(_0x538dae){if(_0x538dae)_0x21bf41(_0x538dae);return _0xd06566();});});})['then'](function(){return _0x459924[_0x65f6('0xe7')](_0x2eda77,_0x2315bc,function(_0x121e5b){if(_0x121e5b){console[_0x65f6('0x132')](_0x65f6('0x133'),_0x121e5b);}else{fs['unlinkSync'](_0x2eda77);}});});});}else{return _0x459924[_0x65f6('0x29')](0xc8);}})[_0x65f6('0x28')](handleError(_0x459924,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index b66f2f2..b34ec20 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 _0x1286=['catch','hasOwnProperty','hook','exports','ChatInteraction','../../mysqldb','setMaxListeners','save','then','setDataValue','Users','map','unreadMessages','length','emit'];(function(_0x22187d,_0x1a3192){var _0x4595df=function(_0x5ec0ed){while(--_0x5ec0ed){_0x22187d['push'](_0x22187d['shift']());}};_0x4595df(++_0x1a3192);}(_0x1286,0xa9));var _0x6128=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0x1286[_0x581af1];return _0x54c22e;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x6128('0x0')];var ChatMessage=require(_0x6128('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6128('0x2')](0x0);var events={'afterCreate':_0x6128('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x270d00){return function(_0x5ec365,_0x1ed6d3,_0x327c4e){_0x5ec365['getUsers']({'attributes':['id'],'raw':!![]})[_0x6128('0x4')](function(_0x1a4515){_0x5ec365[_0x6128('0x5')](_0x6128('0x6'),_0x1a4515[_0x6128('0x7')](function(_0x1b417a){return{'id':_0x1b417a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5ec365['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6128('0x4')](function(_0x16adbc){_0x5ec365[_0x6128('0x5')](_0x6128('0x8'),_0x16adbc[_0x6128('0x9')]);ChatInteractionEvents['emit'](_0x270d00+':'+_0x5ec365['id'],_0x5ec365);ChatInteractionEvents[_0x6128('0xa')](_0x270d00,_0x5ec365);_0x327c4e(null);})[_0x6128('0xb')](_0x327c4e(null));};}for(var e in events){if(events[_0x6128('0xc')](e)){var event=events[e];ChatInteraction[_0x6128('0xd')](e,emitEvent(event));}}module[_0x6128('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb190=['setDataValue','Users','findAll','unreadMessages','length','emit','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x5183a1,_0xea76ab){var _0x20919d=function(_0x52f355){while(--_0x52f355){_0x5183a1['push'](_0x5183a1['shift']());}};_0x20919d(++_0xea76ab);}(_0xb190,0x17d));var _0x0b19=function(_0x2eea6f,_0x3690cf){_0x2eea6f=_0x2eea6f-0x0;var _0x2bcabb=_0xb190[_0x2eea6f];return _0x2bcabb;};'use strict';var EventEmitter=require(_0x0b19('0x0'));var ChatInteraction=require(_0x0b19('0x1'))['db'][_0x0b19('0x2')];var ChatMessage=require(_0x0b19('0x1'))['db'][_0x0b19('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0b19('0x4')](0x0);var events={'afterCreate':_0x0b19('0x5'),'afterUpdate':'update','afterDestroy':_0x0b19('0x6')};function emitEvent(_0x42a509){return function(_0x570784,_0x5b08ac,_0x365320){_0x570784[_0x0b19('0x7')]({'attributes':['id'],'raw':!![]})[_0x0b19('0x8')](function(_0xb73cdc){_0x570784[_0x0b19('0x9')](_0x0b19('0xa'),_0xb73cdc['map'](function(_0x154ee9){return{'id':_0x154ee9['id']};}));return ChatMessage[_0x0b19('0xb')]({'where':{'ChatInteractionId':_0x570784['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0b19('0x8')](function(_0x4e1ee3){_0x570784[_0x0b19('0x9')](_0x0b19('0xc'),_0x4e1ee3[_0x0b19('0xd')]);ChatInteractionEvents[_0x0b19('0xe')](_0x42a509+':'+_0x570784['id'],_0x570784);ChatInteractionEvents['emit'](_0x42a509,_0x570784);_0x365320(null);})['catch'](_0x365320(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 83d7b25..aba675f 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 _0x29b0=['path','rimraf','./chatInteraction.attributes','exports','define','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x57d7f7,_0x335c81){var _0x1a6800=function(_0x251345){while(--_0x251345){_0x57d7f7['push'](_0x57d7f7['shift']());}};_0x1a6800(++_0x335c81);}(_0x29b0,0x82));var _0x029b=function(_0x555038,_0x159b73){_0x555038=_0x555038-0x0;var _0x4455a0=_0x29b0[_0x555038];return _0x4455a0;};'use strict';var _=require(_0x029b('0x0'));var util=require(_0x029b('0x1'));var logger=require('../../config/logger')(_0x029b('0x2'));var moment=require(_0x029b('0x3'));var BPromise=require(_0x029b('0x4'));var rp=require(_0x029b('0x5'));var fs=require('fs');var path=require(_0x029b('0x6'));var rimraf=require(_0x029b('0x7'));var config=require('../../config/environment');var attributes=require(_0x029b('0x8'));module[_0x029b('0x9')]=function(_0x84c6a9,_0x16468e){return _0x84c6a9[_0x029b('0xa')]('ChatInteraction',attributes,{'tableName':_0x029b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x402f50,_0xdc97b8,_0x181472){if(_0x402f50['changed'](_0x029b('0xc'))){_0x402f50['closedAt']=moment()[_0x029b('0xd')](_0x029b('0xe'));}_0x181472(null,_0x402f50);}},'charset':_0x029b('0xf'),'collate':_0x029b('0x10')});};
\ No newline at end of file
+var _0xced7=['utf8mb4','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','closedAt','format'];(function(_0x3520b8,_0x2d2034){var _0x262768=function(_0xd3aab){while(--_0xd3aab){_0x3520b8['push'](_0x3520b8['shift']());}};_0x262768(++_0x2d2034);}(_0xced7,0xaa));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ced('0x0'));var util=require(_0x7ced('0x1'));var logger=require(_0x7ced('0x2'))('api');var moment=require(_0x7ced('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ced('0x4'));var config=require(_0x7ced('0x5'));var attributes=require(_0x7ced('0x6'));module[_0x7ced('0x7')]=function(_0x4f404a,_0x37b814){return _0x4f404a[_0x7ced('0x8')]('ChatInteraction',attributes,{'tableName':_0x7ced('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38b7ba,_0xdb7297,_0xcfc591){if(_0x38b7ba['changed']('closed')){_0x38b7ba[_0x7ced('0xa')]=moment()[_0x7ced('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0xcfc591(null,_0x38b7ba);}},'charset':_0x7ced('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 010cc91..f9b6170 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 _0x12a0=['AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','debug','stringify','AddTagsToChatInteraction','find','addTags','ids'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x12a0,0x115));var _0x012a=function(_0x545168,_0x215698){_0x545168=_0x545168-0x0;var _0x3d20c8=_0x12a0[_0x545168];return _0x3d20c8;};'use strict';var _=require(_0x012a('0x0'));var util=require(_0x012a('0x1'));var moment=require(_0x012a('0x2'));var BPromise=require(_0x012a('0x3'));var rs=require(_0x012a('0x4'));var fs=require('fs');var Redis=require(_0x012a('0x5'));var db=require(_0x012a('0x6'))['db'];var utils=require(_0x012a('0x7'));var logger=require(_0x012a('0x8'))(_0x012a('0x9'));var config=require(_0x012a('0xa'));var jayson=require(_0x012a('0xb'));var client=jayson[_0x012a('0xc')][_0x012a('0xd')]({'port':0x232a});config[_0x012a('0xe')]=_[_0x012a('0xf')](config['redis'],{'host':_0x012a('0x10'),'port':0x18eb});var socket=require(_0x012a('0x11'))(new Redis(config[_0x012a('0xe')]));require(_0x012a('0x12'))[_0x012a('0x13')](socket);function respondWithRpcPromise(_0x5a1743,_0x3fb68b,_0x3574d5){return new BPromise(function(_0x2bd955,_0x2fca8c){return client[_0x012a('0x14')](_0x5a1743,_0x3574d5)[_0x012a('0x15')](function(_0x306647){logger[_0x012a('0x16')](_0x012a('0x17'),_0x3fb68b,_0x012a('0x18'));logger['debug'](_0x012a('0x19'),_0x3fb68b,_0x012a('0x18'),JSON['stringify'](_0x306647));if(_0x306647['error']){if(_0x306647[_0x012a('0x1a')][_0x012a('0x1b')]===0x1f4){logger[_0x012a('0x1a')](_0x012a('0x17'),_0x3fb68b,_0x306647['error'][_0x012a('0x1c')]);return _0x2fca8c(_0x306647['error']['message']);}logger[_0x012a('0x1a')](_0x012a('0x17'),_0x3fb68b,_0x306647['error']['message']);return _0x2bd955(_0x306647[_0x012a('0x1a')][_0x012a('0x1c')]);}else{logger[_0x012a('0x16')](_0x012a('0x17'),_0x3fb68b,_0x012a('0x18'));_0x2bd955(_0x306647[_0x012a('0x1d')][_0x012a('0x1c')]);}})[_0x012a('0x1e')](function(_0x5ad775){logger[_0x012a('0x1a')](_0x012a('0x17'),_0x3fb68b,_0x5ad775);_0x2fca8c(_0x5ad775);});});}exports[_0x012a('0x1f')]=function(_0x1461a2){var _0x3901f0=this;return new Promise(function(_0x583995,_0x2fc4c3){return db[_0x012a('0x20')][_0x012a('0x21')](_0x1461a2[_0x012a('0x22')],{'raw':_0x1461a2['options']?_0x1461a2[_0x012a('0x23')][_0x012a('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1461a2[_0x012a('0x23')]?_0x1461a2['options'][_0x012a('0x25')]||null:null,'attributes':_0x1461a2['options']?_0x1461a2[_0x012a('0x23')][_0x012a('0x26')]||null:null,'limit':_0x1461a2['options']?_0x1461a2['options']['limit']||null:null})[_0x012a('0x15')](function(_0x52ffb5){logger['info'](_0x012a('0x1f'),_0x1461a2);logger[_0x012a('0x27')](_0x012a('0x1f'),_0x1461a2,JSON[_0x012a('0x28')](_0x52ffb5));_0x583995(_0x52ffb5);})['catch'](function(_0x46fb17){logger[_0x012a('0x1a')](_0x012a('0x1f'),_0x46fb17['message'],_0x1461a2);_0x2fc4c3(_0x3901f0[_0x012a('0x1a')](0x1f4,_0x46fb17[_0x012a('0x1c')]));});});};exports[_0x012a('0x29')]=function(_0x3a2d0b){return new Promise(function(_0x5aa4b0,_0x47db36){return db['ChatInteraction'][_0x012a('0x2a')]({'where':_0x3a2d0b[_0x012a('0x23')]?_0x3a2d0b['options'][_0x012a('0x25')]||null:null})[_0x012a('0x15')](function(_0x468d5a){if(_0x468d5a){return _0x468d5a[_0x012a('0x2b')](_0x3a2d0b[_0x012a('0x22')][_0x012a('0x2c')],_['omit'](_0x3a2d0b[_0x012a('0x22')],['ids','id'])||{});}})['spread'](function(_0x3db439){logger[_0x012a('0x16')](_0x012a('0x2d'),_0x3a2d0b);logger['debug']('AddTags',_0x3a2d0b,JSON[_0x012a('0x28')](_0x3db439));_0x5aa4b0(_0x3db439);})[_0x012a('0x1e')](function(_0x11489c){logger[_0x012a('0x1a')](_0x012a('0x2d'),_0x11489c[_0x012a('0x1c')],_0x3a2d0b);_0x47db36(_this[_0x012a('0x1a')](0x1f4,_0x11489c[_0x012a('0x1c')]));});});};
\ No newline at end of file
+var _0x2a31=['limit','AddTagsToChatInteraction','find','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2a31,0x1d4));var _0x12a3=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x2a31[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x12a3('0x0'));var util=require('util');var moment=require(_0x12a3('0x1'));var BPromise=require(_0x12a3('0x2'));var rs=require(_0x12a3('0x3'));var fs=require('fs');var Redis=require(_0x12a3('0x4'));var db=require(_0x12a3('0x5'))['db'];var utils=require(_0x12a3('0x6'));var logger=require(_0x12a3('0x7'))(_0x12a3('0x8'));var config=require(_0x12a3('0x9'));var jayson=require(_0x12a3('0xa'));var client=jayson[_0x12a3('0xb')][_0x12a3('0xc')]({'port':0x232a});config[_0x12a3('0xd')]=_['defaults'](config[_0x12a3('0xd')],{'host':_0x12a3('0xe'),'port':0x18eb});var socket=require(_0x12a3('0xf'))(new Redis(config[_0x12a3('0xd')]));require(_0x12a3('0x10'))[_0x12a3('0x11')](socket);function respondWithRpcPromise(_0x1fe705,_0x269573,_0x52aa7e){return new BPromise(function(_0x28bb41,_0x4cc99a){return client[_0x12a3('0x12')](_0x1fe705,_0x52aa7e)[_0x12a3('0x13')](function(_0x29ae26){logger[_0x12a3('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x269573,_0x12a3('0x15'));logger[_0x12a3('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x269573,'request\x20sent',JSON[_0x12a3('0x17')](_0x29ae26));if(_0x29ae26[_0x12a3('0x18')]){if(_0x29ae26[_0x12a3('0x18')][_0x12a3('0x19')]===0x1f4){logger['error'](_0x12a3('0x1a'),_0x269573,_0x29ae26[_0x12a3('0x18')]['message']);return _0x4cc99a(_0x29ae26[_0x12a3('0x18')][_0x12a3('0x1b')]);}logger['error'](_0x12a3('0x1a'),_0x269573,_0x29ae26['error'][_0x12a3('0x1b')]);return _0x28bb41(_0x29ae26[_0x12a3('0x18')]['message']);}else{logger[_0x12a3('0x14')](_0x12a3('0x1a'),_0x269573,_0x12a3('0x15'));_0x28bb41(_0x29ae26[_0x12a3('0x1c')]['message']);}})[_0x12a3('0x1d')](function(_0x36ac73){logger[_0x12a3('0x18')](_0x12a3('0x1a'),_0x269573,_0x36ac73);_0x4cc99a(_0x36ac73);});});}exports[_0x12a3('0x1e')]=function(_0x34786b){var _0x4e6e8f=this;return new Promise(function(_0x5b8d1b,_0x15978d){return db[_0x12a3('0x1f')][_0x12a3('0x20')](_0x34786b[_0x12a3('0x21')],{'raw':_0x34786b['options']?_0x34786b[_0x12a3('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34786b['options']?_0x34786b[_0x12a3('0x22')][_0x12a3('0x23')]||null:null,'attributes':_0x34786b[_0x12a3('0x22')]?_0x34786b[_0x12a3('0x22')]['attributes']||null:null,'limit':_0x34786b[_0x12a3('0x22')]?_0x34786b[_0x12a3('0x22')][_0x12a3('0x24')]||null:null})[_0x12a3('0x13')](function(_0x38ec8f){logger[_0x12a3('0x14')](_0x12a3('0x1e'),_0x34786b);logger[_0x12a3('0x16')](_0x12a3('0x1e'),_0x34786b,JSON['stringify'](_0x38ec8f));_0x5b8d1b(_0x38ec8f);})[_0x12a3('0x1d')](function(_0x4a0328){logger[_0x12a3('0x18')](_0x12a3('0x1e'),_0x4a0328[_0x12a3('0x1b')],_0x34786b);_0x15978d(_0x4e6e8f[_0x12a3('0x18')](0x1f4,_0x4a0328[_0x12a3('0x1b')]));});});};exports[_0x12a3('0x25')]=function(_0x293933){return new Promise(function(_0x28a475,_0x4df5d2){return db['ChatInteraction'][_0x12a3('0x26')]({'where':_0x293933['options']?_0x293933[_0x12a3('0x22')][_0x12a3('0x23')]||null:null})[_0x12a3('0x13')](function(_0x2c3ea8){if(_0x2c3ea8){return _0x2c3ea8['addTags'](_0x293933['body'][_0x12a3('0x27')],_[_0x12a3('0x28')](_0x293933[_0x12a3('0x21')],['ids','id'])||{});}})['spread'](function(_0x92ec55){logger[_0x12a3('0x14')]('AddTags',_0x293933);logger[_0x12a3('0x16')](_0x12a3('0x29'),_0x293933,JSON[_0x12a3('0x17')](_0x92ec55));_0x28a475(_0x92ec55);})[_0x12a3('0x1d')](function(_0x4cbdff){logger[_0x12a3('0x18')]('AddTags',_0x4cbdff[_0x12a3('0x1b')],_0x293933);_0x4df5d2(_this[_0x12a3('0x18')](0x1f4,_0x4cbdff['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 6e0531a..131952b 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 _0x84f2=['emit','removeListener','register','length','./chatInteraction.events','update'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x84f2,0xe8));var _0x284f=function(_0x349ac1,_0x443243){_0x349ac1=_0x349ac1-0x0;var _0x77840a=_0x84f2[_0x349ac1];return _0x77840a;};'use strict';var ChatInteractionEvents=require(_0x284f('0x0'));var events=['save','remove',_0x284f('0x1')];function createListener(_0x322996,_0x4e2524){return function(_0x43d3b1){_0x4e2524[_0x284f('0x2')](_0x322996,_0x43d3b1);};}function removeListener(_0x467570,_0x5bf7e8){return function(){ChatInteractionEvents[_0x284f('0x3')](_0x467570,_0x5bf7e8);};}exports[_0x284f('0x4')]=function(_0x21d272){for(var _0x2a34bb=0x0,_0x9b1795=events[_0x284f('0x5')];_0x2a34bb<_0x9b1795;_0x2a34bb++){var _0x1245c8=events[_0x2a34bb];var _0x2c0d88=createListener('chatInteraction:'+_0x1245c8,_0x21d272);ChatInteractionEvents['on'](_0x1245c8,_0x2c0d88);}};
\ No newline at end of file
+var _0xe35c=['update','removeListener','register','length','./chatInteraction.events','save','remove'];(function(_0x1d9fb2,_0x5ad61a){var _0x1bb0f5=function(_0x4ca2d0){while(--_0x4ca2d0){_0x1d9fb2['push'](_0x1d9fb2['shift']());}};_0x1bb0f5(++_0x5ad61a);}(_0xe35c,0x146));var _0xce35=function(_0x48615d,_0x21e9ee){_0x48615d=_0x48615d-0x0;var _0x3ef212=_0xe35c[_0x48615d];return _0x3ef212;};'use strict';var ChatInteractionEvents=require(_0xce35('0x0'));var events=[_0xce35('0x1'),_0xce35('0x2'),_0xce35('0x3')];function createListener(_0x1ace65,_0x21eade){return function(_0x4f48a7){_0x21eade['emit'](_0x1ace65,_0x4f48a7);};}function removeListener(_0x17648a,_0x4a005b){return function(){ChatInteractionEvents[_0xce35('0x4')](_0x17648a,_0x4a005b);};}exports[_0xce35('0x5')]=function(_0x3a4bb){for(var _0x47e53c=0x0,_0x270b81=events[_0xce35('0x6')];_0x47e53c<_0x270b81;_0x47e53c++){var _0x2b4a82=events[_0x47e53c];var _0x74ae5e=createListener('chatInteraction:'+_0x2b4a82,_0x3a4bb);ChatInteractionEvents['on'](_0x2b4a82,_0x74ae5e);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 85e58de..77aa3c0 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 _0xed7a=['removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0xed7a,0x115));var _0xaed7=function(_0x565f1f,_0x53a9df){_0x565f1f=_0x565f1f-0x0;var _0x1daf05=_0xed7a[_0x565f1f];return _0x1daf05;};'use strict';var multer=require(_0xaed7('0x0'));var util=require(_0xaed7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaed7('0x2'));var router=express[_0xaed7('0x3')]();var fs_extra=require(_0xaed7('0x4'));var auth=require(_0xaed7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaed7('0x6'));var controller=require(_0xaed7('0x7'));router[_0xaed7('0x8')]('/',auth[_0xaed7('0x9')](),controller[_0xaed7('0xa')]);router['get'](_0xaed7('0xb'),auth['isAuthenticated'](),controller[_0xaed7('0xc')]);router[_0xaed7('0x8')]('/:id',auth[_0xaed7('0xd')](),controller[_0xaed7('0xe')]);router[_0xaed7('0x8')](_0xaed7('0xf'),auth[_0xaed7('0xd')](),controller[_0xaed7('0x10')]);router[_0xaed7('0x8')](_0xaed7('0x11'),auth[_0xaed7('0x9')](),controller[_0xaed7('0x12')]);router[_0xaed7('0x8')](_0xaed7('0x13'),auth[_0xaed7('0xd')](),controller['getMyMessages']);router[_0xaed7('0x8')](_0xaed7('0x14'),auth['isAuthenticated'](),controller[_0xaed7('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaed7('0x16')]);router[_0xaed7('0x17')]('/:id/vidaoo',auth[_0xaed7('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xaed7('0x18')]({'destination':function(_0x4e60a8,_0x15c83c,_0x4bfb5c){_0x4bfb5c(null,path[_0xaed7('0x19')](config[_0xaed7('0x1a')],_0xaed7('0x1b')));},'filename':function(_0x6d7442,_0x1c887c,_0x26a286){_0x26a286(null,util[_0xaed7('0x1c')](_0xaed7('0x1d'),Date[_0xaed7('0x1e')](),_0x1c887c[_0xaed7('0x1f')][_0xaed7('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xaed7('0x17')]('/:id/attachment_upload',upload[_0xaed7('0x21')](_0xaed7('0x22')),controller['attachmentUpload']);router[_0xaed7('0x17')](_0xaed7('0x11'),auth[_0xaed7('0xd')](),controller[_0xaed7('0x23')]);router[_0xaed7('0x17')](_0xaed7('0x24'),auth[_0xaed7('0x9')](),interaction[_0xaed7('0x25')](_0xaed7('0x26'),_0xaed7('0x27')),controller[_0xaed7('0x28')]);router[_0xaed7('0x29')](_0xaed7('0x2a'),auth['isAuthenticated'](),interaction[_0xaed7('0x25')](_0xaed7('0x26'),_0xaed7('0x2b')),controller[_0xaed7('0x2c')]);router[_0xaed7('0x29')](_0xaed7('0x2d'),controller[_0xaed7('0x2e')]);router[_0xaed7('0x29')](_0xaed7('0x2f'),auth[_0xaed7('0xd')](),controller[_0xaed7('0x30')]);router[_0xaed7('0x29')](_0xaed7('0x31'),controller[_0xaed7('0x32')]);router['delete']('/:id',auth[_0xaed7('0x9')](),interaction[_0xaed7('0x25')](_0xaed7('0x26'),_0xaed7('0x33')),controller['destroy']);router[_0xaed7('0x34')](_0xaed7('0x24'),auth['isAuthenticated'](),controller[_0xaed7('0x35')]);module[_0xaed7('0x36')]=router;
\ No newline at end of file
+var _0xacaf=['isAuthenticated','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','/:id/custom_update','customUpdate','put','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xacaf,0x16e));var _0xfaca=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0xacaf[_0x3c487b];return _0x1d65f6;};'use strict';var multer=require('multer');var util=require(_0xfaca('0x0'));var path=require(_0xfaca('0x1'));var timeout=require(_0xfaca('0x2'));var express=require(_0xfaca('0x3'));var router=express[_0xfaca('0x4')]();var fs_extra=require(_0xfaca('0x5'));var auth=require(_0xfaca('0x6'));var interaction=require(_0xfaca('0x7'));var config=require(_0xfaca('0x8'));var controller=require(_0xfaca('0x9'));router[_0xfaca('0xa')]('/',auth['isAuthenticated'](),controller[_0xfaca('0xb')]);router[_0xfaca('0xa')](_0xfaca('0xc'),auth['isAuthenticated'](),controller[_0xfaca('0xd')]);router[_0xfaca('0xa')](_0xfaca('0xe'),auth[_0xfaca('0xf')](),controller[_0xfaca('0x10')]);router[_0xfaca('0xa')](_0xfaca('0x11'),auth[_0xfaca('0xf')](),controller['attachmentDownload']);router[_0xfaca('0xa')](_0xfaca('0x12'),auth[_0xfaca('0x13')](),controller['getMessages']);router[_0xfaca('0xa')](_0xfaca('0x14'),auth[_0xfaca('0xf')](),controller[_0xfaca('0x15')]);router[_0xfaca('0xa')](_0xfaca('0x16'),auth[_0xfaca('0x13')](),controller[_0xfaca('0x17')]);router[_0xfaca('0x18')]('/',auth[_0xfaca('0x13')](),controller['create']);router['post']('/:id/vidaoo',auth[_0xfaca('0x13')](),controller[_0xfaca('0x19')]);var upload=multer({'storage':multer[_0xfaca('0x1a')]({'destination':function(_0x5df611,_0x5a2bd3,_0x4d8696){_0x4d8696(null,path[_0xfaca('0x1b')](config[_0xfaca('0x1c')],_0xfaca('0x1d')));},'filename':function(_0x1ffcac,_0x310151,_0x2f735a){_0x2f735a(null,util['format']('%s-%s',Date[_0xfaca('0x1e')](),_0x310151[_0xfaca('0x1f')][_0xfaca('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xfaca('0x18')](_0xfaca('0x21'),upload[_0xfaca('0x22')](_0xfaca('0x23')),controller[_0xfaca('0x24')]);router[_0xfaca('0x18')](_0xfaca('0x12'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0xfaca('0x25'),auth[_0xfaca('0x13')](),interaction[_0xfaca('0x26')](_0xfaca('0x27'),_0xfaca('0x28')),controller[_0xfaca('0x29')]);router['put'](_0xfaca('0xe'),auth[_0xfaca('0x13')](),interaction[_0xfaca('0x26')](_0xfaca('0x27'),_0xfaca('0x2a')),controller[_0xfaca('0x2b')]);router['put'](_0xfaca('0x2c'),controller[_0xfaca('0x2d')]);router[_0xfaca('0x2e')](_0xfaca('0x2f'),auth[_0xfaca('0xf')](),controller[_0xfaca('0x30')]);router[_0xfaca('0x2e')]('/:id/close',controller[_0xfaca('0x31')]);router[_0xfaca('0x32')](_0xfaca('0xe'),auth['isAuthenticated'](),interaction[_0xfaca('0x26')](_0xfaca('0x27'),_0xfaca('0x33')),controller[_0xfaca('0x34')]);router[_0xfaca('0x32')](_0xfaca('0x25'),auth[_0xfaca('0x13')](),controller[_0xfaca('0x35')]);module[_0xfaca('0x36')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 4a0fb44..c1e3078 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 _0x5571=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x424a4d,_0x2cfc94){var _0x2b043a=function(_0x3b64a4){while(--_0x3b64a4){_0x424a4d['push'](_0x424a4d['shift']());}};_0x2b043a(++_0x2cfc94);}(_0x5571,0x19c));var _0x1557=function(_0x59fc33,_0x2e182d){_0x59fc33=_0x59fc33-0x0;var _0x39066f=_0x5571[_0x59fc33];return _0x39066f;};'use strict';var Sequelize=require(_0x1557('0x0'));module[_0x1557('0x1')]={'body':{'type':Sequelize[_0x1557('0x2')](_0x1557('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1557('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xbc7a=['sequelize','exports','BOOLEAN','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbc7a,0xc4));var _0xabc7=function(_0x237f35,_0xb6aa50){_0x237f35=_0x237f35-0x0;var _0x45ea01=_0xbc7a[_0x237f35];return _0x45ea01;};'use strict';var Sequelize=require(_0xabc7('0x0'));module[_0xabc7('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xabc7('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xabc7('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 1d0aabb..75e1c8e 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 _0xe635=['lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','ChatInternalMessage','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','get','messages','lastMessageAt','createdAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe635,0x92));var _0x5e63=function(_0x3bf8ac,_0x358931){_0x3bf8ac=_0x3bf8ac-0x0;var _0x2cc39b=_0xe635[_0x3bf8ac];return _0x2cc39b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5e63('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e63('0x1'));var moment=require(_0x5e63('0x2'));var BPromise=require(_0x5e63('0x3'));var Mustache=require(_0x5e63('0x4'));var util=require(_0x5e63('0x5'));var path=require(_0x5e63('0x6'));var sox=require(_0x5e63('0x7'));var csv=require(_0x5e63('0x8'));var ejs=require(_0x5e63('0x9'));var fs=require('fs');var fs_extra=require(_0x5e63('0xa'));var _=require(_0x5e63('0xb'));var squel=require('squel');var crypto=require(_0x5e63('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e63('0x8'));var querystring=require(_0x5e63('0xd'));var Papa=require(_0x5e63('0xe'));var Redis=require(_0x5e63('0xf'));var authService=require(_0x5e63('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e63('0x11'));var hardwareService=require(_0x5e63('0x12'));var logger=require('../../config/logger')(_0x5e63('0x13'));var utils=require(_0x5e63('0x14'));var config=require(_0x5e63('0x15'));var licenseUtil=require(_0x5e63('0x16'));var db=require(_0x5e63('0x17'))['db'];config[_0x5e63('0x18')]=_[_0x5e63('0x19')](config[_0x5e63('0x18')],{'host':_0x5e63('0x1a'),'port':0x18eb});var socket=require(_0x5e63('0x1b'))(new Redis(config[_0x5e63('0x18')]));require(_0x5e63('0x1c'))[_0x5e63('0x1d')](socket);function respondWithStatusCode(_0xedb8a6,_0x8b3d47){_0x8b3d47=_0x8b3d47||0xcc;return function(_0x375260){if(_0x375260){return _0xedb8a6[_0x5e63('0x1e')](_0x8b3d47);}return _0xedb8a6[_0x5e63('0x1f')](_0x8b3d47)[_0x5e63('0x20')]();};}function respondWithResult(_0x4aa747,_0x29b7da){_0x29b7da=_0x29b7da||0xc8;return function(_0x10a874){if(_0x10a874){return _0x4aa747[_0x5e63('0x1f')](_0x29b7da)[_0x5e63('0x21')](_0x10a874);}};}function respondWithFilteredResult(_0x55f513,_0x5b959e){return function(_0x3b81c2){if(_0x3b81c2){var _0x56ad3a=typeof _0x5b959e[_0x5e63('0x22')]===_0x5e63('0x23')&&typeof _0x5b959e[_0x5e63('0x24')]===_0x5e63('0x23');var _0x27591b=_0x3b81c2[_0x5e63('0x25')];var _0x3cbc17=_0x56ad3a?0x0:_0x5b959e[_0x5e63('0x22')];var _0x2e02ed=_0x56ad3a?_0x3b81c2['count']:_0x5b959e[_0x5e63('0x22')]+_0x5b959e[_0x5e63('0x24')];var _0x4a0103;if(_0x2e02ed>=_0x27591b){_0x2e02ed=_0x27591b;_0x4a0103=0xc8;}else{_0x4a0103=0xce;}_0x55f513[_0x5e63('0x1f')](_0x4a0103);return _0x55f513[_0x5e63('0x26')](_0x5e63('0x27'),_0x3cbc17+'-'+_0x2e02ed+'/'+_0x27591b)[_0x5e63('0x21')](_0x3b81c2);}return null;};}function patchUpdates(_0x1f8113){return function(_0x2d26a5){try{jsonpatch[_0x5e63('0x28')](_0x2d26a5,_0x1f8113,!![]);}catch(_0x2d67c9){return BPromise[_0x5e63('0x29')](_0x2d67c9);}return _0x2d26a5[_0x5e63('0x2a')]();};}function saveUpdates(_0x50a646,_0x4fa277){return function(_0x25a755){if(_0x25a755){return _0x25a755[_0x5e63('0x2b')](_0x50a646)[_0x5e63('0x2c')](function(_0x46ef61){return _0x46ef61;});}return null;};}function removeEntity(_0x27ac58,_0x2c6a4a){return function(_0x3f2d57){if(_0x3f2d57){return _0x3f2d57[_0x5e63('0x2d')]()['then'](function(){_0x27ac58['status'](0xcc)[_0x5e63('0x20')]();});}};}function handleEntityNotFound(_0x2dec4d,_0x5e676c){return function(_0x2914bf){if(!_0x2914bf){_0x2dec4d[_0x5e63('0x1e')](0x194);}return _0x2914bf;};}function handleError(_0x1e55a8,_0x4b2a3b){_0x4b2a3b=_0x4b2a3b||0x1f4;return function(_0xc88538){logger['error'](_0xc88538['stack']);if(_0xc88538[_0x5e63('0x2e')]){delete _0xc88538[_0x5e63('0x2e')];}_0x1e55a8[_0x5e63('0x1f')](_0x4b2a3b)[_0x5e63('0x2f')](_0xc88538);};}exports[_0x5e63('0x30')]=function(_0x291422,_0x264e9c){var _0x168693={},_0xd33173={},_0x485ccc={'count':0x0,'rows':[]};var _0x1ec6c0=_[_0x5e63('0x31')](db['ChatInternalMessage'][_0x5e63('0x32')],function(_0x397f75){return{'name':_0x397f75['fieldName'],'type':_0x397f75[_0x5e63('0x33')][_0x5e63('0x34')]};});_0xd33173[_0x5e63('0x35')]=_[_0x5e63('0x31')](_0x1ec6c0,_0x5e63('0x2e'));_0xd33173[_0x5e63('0x36')]=_[_0x5e63('0x37')](_0x291422[_0x5e63('0x36')]);_0xd33173[_0x5e63('0x38')]=_[_0x5e63('0x39')](_0xd33173['model'],_0xd33173['query']);_0x168693[_0x5e63('0x3a')]=_['intersection'](_0xd33173['model'],qs[_0x5e63('0x3b')](_0x291422[_0x5e63('0x36')][_0x5e63('0x3b')]));_0x168693['attributes']=_0x168693[_0x5e63('0x3a')]['length']?_0x168693[_0x5e63('0x3a')]:_0xd33173[_0x5e63('0x35')];if(!_0x291422['query'][_0x5e63('0x3c')](_0x5e63('0x3d'))){_0x168693['limit']=qs['limit'](_0x291422[_0x5e63('0x36')][_0x5e63('0x24')]);_0x168693[_0x5e63('0x22')]=qs[_0x5e63('0x22')](_0x291422[_0x5e63('0x36')][_0x5e63('0x22')]);}_0x168693['order']=qs[_0x5e63('0x3e')](_0x291422[_0x5e63('0x36')]['sort']);_0x168693[_0x5e63('0x3f')]=qs[_0x5e63('0x38')](_[_0x5e63('0x40')](_0x291422[_0x5e63('0x36')],_0xd33173[_0x5e63('0x38')]),_0x1ec6c0);if(_0x291422['query']['filter']){_0x168693[_0x5e63('0x3f')]=_[_0x5e63('0x41')](_0x168693[_0x5e63('0x3f')],{'$or':_[_0x5e63('0x31')](_0x1ec6c0,function(_0x27f5ee){if(_0x27f5ee[_0x5e63('0x33')]!==_0x5e63('0x42')){var _0xb92873={};_0xb92873[_0x27f5ee[_0x5e63('0x2e')]]={'$like':'%'+_0x291422['query'][_0x5e63('0x43')]+'%'};return _0xb92873;}})});}_0x168693=_[_0x5e63('0x41')]({},_0x168693,_0x291422[_0x5e63('0x44')]);var _0x1daca0={'where':_0x168693[_0x5e63('0x3f')]};return db[_0x5e63('0x45')][_0x5e63('0x25')](_0x1daca0)['then'](function(_0x561b32){_0x485ccc[_0x5e63('0x25')]=_0x561b32;if(_0x291422[_0x5e63('0x36')]['includeAll']){_0x168693[_0x5e63('0x46')]=[{'all':!![]}];}return db[_0x5e63('0x45')][_0x5e63('0x47')](_0x168693);})[_0x5e63('0x2c')](function(_0x195e5f){_0x485ccc[_0x5e63('0x48')]=_0x195e5f;return _0x485ccc;})[_0x5e63('0x2c')](respondWithFilteredResult(_0x264e9c,_0x168693))[_0x5e63('0x49')](handleError(_0x264e9c,null));};exports[_0x5e63('0x4a')]=function(_0xe01bf6,_0x390f93){var _0x2f050a={'raw':!![],'where':{'id':_0xe01bf6[_0x5e63('0x4b')]['id']}},_0x5279fd={};_0x5279fd[_0x5e63('0x35')]=_[_0x5e63('0x37')](db[_0x5e63('0x45')][_0x5e63('0x32')]);_0x5279fd[_0x5e63('0x36')]=_[_0x5e63('0x37')](_0xe01bf6[_0x5e63('0x36')]);_0x5279fd['filters']=_[_0x5e63('0x39')](_0x5279fd[_0x5e63('0x35')],_0x5279fd['query']);_0x2f050a[_0x5e63('0x3a')]=_[_0x5e63('0x39')](_0x5279fd['model'],qs[_0x5e63('0x3b')](_0xe01bf6[_0x5e63('0x36')][_0x5e63('0x3b')]));_0x2f050a[_0x5e63('0x3a')]=_0x2f050a[_0x5e63('0x3a')][_0x5e63('0x4c')]?_0x2f050a[_0x5e63('0x3a')]:_0x5279fd[_0x5e63('0x35')];if(_0xe01bf6[_0x5e63('0x36')][_0x5e63('0x4d')]){_0x2f050a['include']=[{'all':!![]}];}_0x2f050a=_['merge']({},_0x2f050a,_0xe01bf6[_0x5e63('0x44')]);return db[_0x5e63('0x45')]['find'](_0x2f050a)['then'](handleEntityNotFound(_0x390f93,null))[_0x5e63('0x2c')](respondWithResult(_0x390f93,null))[_0x5e63('0x49')](handleError(_0x390f93,null));};exports[_0x5e63('0x4e')]=function(_0x34290f,_0x315015){return db[_0x5e63('0x45')][_0x5e63('0x4e')](_0x34290f[_0x5e63('0x4f')],{})[_0x5e63('0x2c')](respondWithResult(_0x315015,0xc9))[_0x5e63('0x49')](handleError(_0x315015,null));};exports['update']=function(_0x3d2ef5,_0x366c95){if(_0x3d2ef5[_0x5e63('0x4f')]['id']){delete _0x3d2ef5['body']['id'];}return db[_0x5e63('0x45')][_0x5e63('0x50')]({'where':{'id':_0x3d2ef5[_0x5e63('0x4b')]['id']}})[_0x5e63('0x2c')](handleEntityNotFound(_0x366c95,null))[_0x5e63('0x2c')](saveUpdates(_0x3d2ef5[_0x5e63('0x4f')],null))[_0x5e63('0x2c')](respondWithResult(_0x366c95,null))[_0x5e63('0x49')](handleError(_0x366c95,null));};exports['destroy']=function(_0x3650b6,_0x9dd966){return db[_0x5e63('0x45')][_0x5e63('0x50')]({'where':{'id':_0x3650b6[_0x5e63('0x4b')]['id']}})[_0x5e63('0x2c')](handleEntityNotFound(_0x9dd966,null))['then'](removeEntity(_0x9dd966,null))[_0x5e63('0x49')](handleError(_0x9dd966,null));};exports[_0x5e63('0x51')]=function(_0x4463d3,_0x2cdb4c){return db[_0x5e63('0x45')][_0x5e63('0x51')]()[_0x5e63('0x2c')](respondWithResult(_0x2cdb4c,null))[_0x5e63('0x49')](handleError(_0x2cdb4c,null));};function wrapUser(_0xeab5af){return function(_0x2bcd1a){var _0x5118f6=_0xeab5af[_0x5e63('0x52')]({'plain':!![]});_0x5118f6[_0x5e63('0x53')]=[];if(_0x2bcd1a){_0x5118f6[_0x5e63('0x54')]=_0x2bcd1a[_0x5e63('0x55')];_0x5118f6[_0x5e63('0x56')]=_0x2bcd1a;}else{_0x5118f6[_0x5e63('0x54')]=moment(0x0)[_0x5e63('0x57')](_0x5e63('0x58'));_0x5118f6[_0x5e63('0x56')]={};}return _0x5118f6;};}exports[_0x5e63('0x59')]=function(_0x148b8c,_0x378f04,_0x545d61){var _0x427c11=[];return db[_0x5e63('0x5a')]['findAll']({'where':{'role':[_0x5e63('0x5b'),_0x5e63('0x5c'),_0x5e63('0x5d')]},'attributes':['id','fullname',_0x5e63('0x2e'),_0x5e63('0x5e'),_0x5e63('0x5f'),'internal',_0x5e63('0x60'),_0x5e63('0x61'),_0x5e63('0x62'),_0x5e63('0x63')],'order':qs[_0x5e63('0x3e')](_0x5e63('0x64')),'include':[{'model':db[_0x5e63('0x65')],'as':_0x5e63('0x66'),'attributes':['id',_0x5e63('0x2e'),_0x5e63('0x33')],'through':{'attributes':[]}}]})[_0x5e63('0x2c')](function(_0x3a0eb8){if(_0x3a0eb8){var _0x46314b=_0x148b8c[_0x5e63('0x5d')][_0x5e63('0x52')]({'plain':!![]});if(!_0x46314b)throw new Error(_0x5e63('0x67'));if(_0x46314b['role']===_0x5e63('0x5d')){return db[_0x5e63('0x68')]['find']({'where':{'name':_0x5e63('0x69'),'userProfileId':_0x46314b['userProfileId']},'raw':!![]})[_0x5e63('0x2c')](function(_0x51c23c){if(_0x51c23c){if(_0x51c23c[_0x5e63('0x6a')]===0x0){return db[_0x5e63('0x6b')]['findAll']({'where':{'sectionId':_0x51c23c['id']},'raw':!![]})['then'](function(_0xf46a59){var _0x195aa0=[];if(_[_0x5e63('0x6c')](_0xf46a59)){_0x195aa0=_['filter'](_0x3a0eb8,function(_0x4b5f18){if(_0x4b5f18[_0x5e63('0x5e')]!==_0x5e63('0x5b')){return _0x4b5f18;}});return _0x195aa0;}else{for(var _0x2c075b=0x0;_0x2c075b<_0x3a0eb8[_0x5e63('0x4c')];_0x2c075b++){var _0x4d5369=_0x3a0eb8[_0x2c075b];if(_0x4d5369[_0x5e63('0x5e')]===_0x5e63('0x5b')){var _0x4a6d0c=_[_0x5e63('0x50')](_0xf46a59,function(_0x2e1aa9){return _0x2e1aa9[_0x5e63('0x6d')]===_0x4d5369['id'];});if(_0x4a6d0c)_0x195aa0[_0x5e63('0x6e')](_0x4d5369);}else{_0x195aa0[_0x5e63('0x6e')](_0x4d5369);}}return _0x195aa0;}});}else{return _0x3a0eb8;}}else{var _0x4243e6=_[_0x5e63('0x43')](_0x3a0eb8,function(_0x7bd452){if(_0x7bd452[_0x5e63('0x5e')]!=='agent'){return _0x7bd452;}});return _0x4243e6;}});}else{return _0x3a0eb8;}}})['then'](function(_0x57bd46){var _0x57ba41=[];if(_0x57bd46){_0x427c11=_0x57bd46;for(var _0x293158=0x0;_0x293158<_0x57bd46['length'];_0x293158+=0x1){_0x427c11[_0x293158][_0x5e63('0x53')]=[];_0x57ba41[_0x5e63('0x6e')](db[_0x5e63('0x45')][_0x5e63('0x50')]({'where':{'FromId':[_0x148b8c[_0x5e63('0x5d')]['id'],_0x57bd46[_0x293158]['id']],'ToId':[_0x148b8c[_0x5e63('0x5d')]['id'],_0x57bd46[_0x293158]['id']],'ChatGroupId':null},'attributes':['id',_0x5e63('0x55'),_0x5e63('0x6f'),_0x5e63('0x70'),_0x5e63('0x71'),'body'],'order':qs[_0x5e63('0x3e')](_0x5e63('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5e63('0x2c')](wrapUser(_0x57bd46[_0x293158])));}return BPromise[_0x5e63('0x73')](_0x57ba41);}return[];})[_0x5e63('0x2c')](function(_0x10ff41){return{'rows':_0x10ff41,'count':_0x10ff41[_0x5e63('0x4c')]};})[_0x5e63('0x2c')](respondWithResult(_0x378f04,null))[_0x5e63('0x49')](handleError(_0x378f04,null));};
\ No newline at end of file
+var _0x791e=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','name','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','ChatInternalMessage','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x35341c,_0xeaa63c){var _0x5d6c26=function(_0x3e6d95){while(--_0x3e6d95){_0x35341c['push'](_0x35341c['shift']());}};_0x5d6c26(++_0xeaa63c);}(_0x791e,0x12c));var _0xe791=function(_0x7b3852,_0x45b5ab){_0x7b3852=_0x7b3852-0x0;var _0x453416=_0x791e[_0x7b3852];return _0x453416;};'use strict';var emlformat=require(_0xe791('0x0'));var rimraf=require(_0xe791('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe791('0x2'));var rp=require('request-promise');var moment=require(_0xe791('0x3'));var BPromise=require(_0xe791('0x4'));var Mustache=require(_0xe791('0x5'));var util=require(_0xe791('0x6'));var path=require(_0xe791('0x7'));var sox=require(_0xe791('0x8'));var csv=require(_0xe791('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe791('0xa'));var crypto=require(_0xe791('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe791('0xc'));var toCsv=require(_0xe791('0x9'));var querystring=require(_0xe791('0xd'));var Papa=require(_0xe791('0xe'));var Redis=require(_0xe791('0xf'));var authService=require(_0xe791('0x10'));var qs=require(_0xe791('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe791('0x12'));var logger=require('../../config/logger')(_0xe791('0x13'));var utils=require(_0xe791('0x14'));var config=require(_0xe791('0x15'));var licenseUtil=require(_0xe791('0x16'));var db=require(_0xe791('0x17'))['db'];config[_0xe791('0x18')]=_[_0xe791('0x19')](config[_0xe791('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xe791('0x1a'))(new Redis(config[_0xe791('0x18')]));require(_0xe791('0x1b'))['register'](socket);function respondWithStatusCode(_0x5cb2ac,_0x2fd267){_0x2fd267=_0x2fd267||0xcc;return function(_0x187ba8){if(_0x187ba8){return _0x5cb2ac[_0xe791('0x1c')](_0x2fd267);}return _0x5cb2ac[_0xe791('0x1d')](_0x2fd267)[_0xe791('0x1e')]();};}function respondWithResult(_0xfa2f3b,_0x151f8c){_0x151f8c=_0x151f8c||0xc8;return function(_0x49b233){if(_0x49b233){return _0xfa2f3b[_0xe791('0x1d')](_0x151f8c)[_0xe791('0x1f')](_0x49b233);}};}function respondWithFilteredResult(_0x28cbf2,_0x54649b){return function(_0x105143){if(_0x105143){var _0x40e0b4=typeof _0x54649b[_0xe791('0x20')]===_0xe791('0x21')&&typeof _0x54649b[_0xe791('0x22')]===_0xe791('0x21');var _0xdcf77b=_0x105143[_0xe791('0x23')];var _0xd7c44a=_0x40e0b4?0x0:_0x54649b[_0xe791('0x20')];var _0x4e398c=_0x40e0b4?_0x105143[_0xe791('0x23')]:_0x54649b[_0xe791('0x20')]+_0x54649b[_0xe791('0x22')];var _0x2c92cb;if(_0x4e398c>=_0xdcf77b){_0x4e398c=_0xdcf77b;_0x2c92cb=0xc8;}else{_0x2c92cb=0xce;}_0x28cbf2[_0xe791('0x1d')](_0x2c92cb);return _0x28cbf2[_0xe791('0x24')](_0xe791('0x25'),_0xd7c44a+'-'+_0x4e398c+'/'+_0xdcf77b)['json'](_0x105143);}return null;};}function patchUpdates(_0x2df581){return function(_0x286d32){try{jsonpatch['apply'](_0x286d32,_0x2df581,!![]);}catch(_0x314173){return BPromise['reject'](_0x314173);}return _0x286d32['save']();};}function saveUpdates(_0xb1af00,_0x1b0ae2){return function(_0x5258a0){if(_0x5258a0){return _0x5258a0[_0xe791('0x26')](_0xb1af00)[_0xe791('0x27')](function(_0x56df3){return _0x56df3;});}return null;};}function removeEntity(_0x2d8063,_0x13ddeb){return function(_0x4cdf70){if(_0x4cdf70){return _0x4cdf70['destroy']()[_0xe791('0x27')](function(){_0x2d8063[_0xe791('0x1d')](0xcc)[_0xe791('0x1e')]();});}};}function handleEntityNotFound(_0x4eff12,_0x2d7cd7){return function(_0x4a0e16){if(!_0x4a0e16){_0x4eff12[_0xe791('0x1c')](0x194);}return _0x4a0e16;};}function handleError(_0x4426c5,_0xd19178){_0xd19178=_0xd19178||0x1f4;return function(_0x476703){logger['error'](_0x476703['stack']);if(_0x476703[_0xe791('0x28')]){delete _0x476703[_0xe791('0x28')];}_0x4426c5['status'](_0xd19178)['send'](_0x476703);};}exports['index']=function(_0x1b208d,_0x461f4f){var _0x5d2e6a={},_0x530d38={},_0x233b6a={'count':0x0,'rows':[]};var _0x424949=_[_0xe791('0x29')](db['ChatInternalMessage'][_0xe791('0x2a')],function(_0x563cf9){return{'name':_0x563cf9['fieldName'],'type':_0x563cf9['type'][_0xe791('0x2b')]};});_0x530d38[_0xe791('0x2c')]=_[_0xe791('0x29')](_0x424949,'name');_0x530d38[_0xe791('0x2d')]=_[_0xe791('0x2e')](_0x1b208d['query']);_0x530d38[_0xe791('0x2f')]=_[_0xe791('0x30')](_0x530d38[_0xe791('0x2c')],_0x530d38[_0xe791('0x2d')]);_0x5d2e6a[_0xe791('0x31')]=_['intersection'](_0x530d38[_0xe791('0x2c')],qs[_0xe791('0x32')](_0x1b208d[_0xe791('0x2d')][_0xe791('0x32')]));_0x5d2e6a[_0xe791('0x31')]=_0x5d2e6a[_0xe791('0x31')][_0xe791('0x33')]?_0x5d2e6a[_0xe791('0x31')]:_0x530d38['model'];if(!_0x1b208d[_0xe791('0x2d')]['hasOwnProperty'](_0xe791('0x34'))){_0x5d2e6a[_0xe791('0x22')]=qs[_0xe791('0x22')](_0x1b208d[_0xe791('0x2d')][_0xe791('0x22')]);_0x5d2e6a['offset']=qs[_0xe791('0x20')](_0x1b208d[_0xe791('0x2d')]['offset']);}_0x5d2e6a['order']=qs['sort'](_0x1b208d[_0xe791('0x2d')][_0xe791('0x35')]);_0x5d2e6a[_0xe791('0x36')]=qs[_0xe791('0x2f')](_[_0xe791('0x37')](_0x1b208d[_0xe791('0x2d')],_0x530d38[_0xe791('0x2f')]),_0x424949);if(_0x1b208d[_0xe791('0x2d')]['filter']){_0x5d2e6a[_0xe791('0x36')]=_[_0xe791('0x38')](_0x5d2e6a['where'],{'$or':_[_0xe791('0x29')](_0x424949,function(_0x5cbaaa){if(_0x5cbaaa['type']!==_0xe791('0x39')){var _0x106251={};_0x106251[_0x5cbaaa[_0xe791('0x28')]]={'$like':'%'+_0x1b208d[_0xe791('0x2d')][_0xe791('0x3a')]+'%'};return _0x106251;}})});}_0x5d2e6a=_[_0xe791('0x38')]({},_0x5d2e6a,_0x1b208d['options']);var _0x436b0d={'where':_0x5d2e6a[_0xe791('0x36')]};return db[_0xe791('0x3b')]['count'](_0x436b0d)[_0xe791('0x27')](function(_0x1744bb){_0x233b6a['count']=_0x1744bb;if(_0x1b208d['query'][_0xe791('0x3c')]){_0x5d2e6a[_0xe791('0x3d')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xe791('0x3e')](_0x5d2e6a);})[_0xe791('0x27')](function(_0x345e8f){_0x233b6a[_0xe791('0x3f')]=_0x345e8f;return _0x233b6a;})[_0xe791('0x27')](respondWithFilteredResult(_0x461f4f,_0x5d2e6a))['catch'](handleError(_0x461f4f,null));};exports[_0xe791('0x40')]=function(_0x21b5fa,_0x4cf39b){var _0x570b4b={'raw':!![],'where':{'id':_0x21b5fa[_0xe791('0x41')]['id']}},_0x5d980d={};_0x5d980d[_0xe791('0x2c')]=_[_0xe791('0x2e')](db[_0xe791('0x3b')][_0xe791('0x2a')]);_0x5d980d[_0xe791('0x2d')]=_[_0xe791('0x2e')](_0x21b5fa['query']);_0x5d980d[_0xe791('0x2f')]=_[_0xe791('0x30')](_0x5d980d[_0xe791('0x2c')],_0x5d980d['query']);_0x570b4b['attributes']=_[_0xe791('0x30')](_0x5d980d[_0xe791('0x2c')],qs[_0xe791('0x32')](_0x21b5fa[_0xe791('0x2d')]['fields']));_0x570b4b[_0xe791('0x31')]=_0x570b4b[_0xe791('0x31')][_0xe791('0x33')]?_0x570b4b[_0xe791('0x31')]:_0x5d980d[_0xe791('0x2c')];if(_0x21b5fa[_0xe791('0x2d')][_0xe791('0x3c')]){_0x570b4b[_0xe791('0x3d')]=[{'all':!![]}];}_0x570b4b=_[_0xe791('0x38')]({},_0x570b4b,_0x21b5fa[_0xe791('0x42')]);return db[_0xe791('0x3b')][_0xe791('0x43')](_0x570b4b)[_0xe791('0x27')](handleEntityNotFound(_0x4cf39b,null))[_0xe791('0x27')](respondWithResult(_0x4cf39b,null))[_0xe791('0x44')](handleError(_0x4cf39b,null));};exports[_0xe791('0x45')]=function(_0x189dd9,_0xd19aeb){return db[_0xe791('0x3b')][_0xe791('0x45')](_0x189dd9['body'],{})[_0xe791('0x27')](respondWithResult(_0xd19aeb,0xc9))[_0xe791('0x44')](handleError(_0xd19aeb,null));};exports['update']=function(_0x484403,_0x5ef391){if(_0x484403[_0xe791('0x46')]['id']){delete _0x484403[_0xe791('0x46')]['id'];}return db['ChatInternalMessage'][_0xe791('0x43')]({'where':{'id':_0x484403['params']['id']}})[_0xe791('0x27')](handleEntityNotFound(_0x5ef391,null))[_0xe791('0x27')](saveUpdates(_0x484403[_0xe791('0x46')],null))['then'](respondWithResult(_0x5ef391,null))[_0xe791('0x44')](handleError(_0x5ef391,null));};exports['destroy']=function(_0x139489,_0x575b14){return db[_0xe791('0x3b')][_0xe791('0x43')]({'where':{'id':_0x139489[_0xe791('0x41')]['id']}})['then'](handleEntityNotFound(_0x575b14,null))['then'](removeEntity(_0x575b14,null))[_0xe791('0x44')](handleError(_0x575b14,null));};exports['describe']=function(_0x2e2dfb,_0x10d247){return db[_0xe791('0x3b')][_0xe791('0x47')]()['then'](respondWithResult(_0x10d247,null))[_0xe791('0x44')](handleError(_0x10d247,null));};function wrapUser(_0x1cedad){return function(_0x2abd97){var _0x233023=_0x1cedad['get']({'plain':!![]});_0x233023[_0xe791('0x48')]=[];if(_0x2abd97){_0x233023[_0xe791('0x49')]=_0x2abd97['createdAt'];_0x233023[_0xe791('0x4a')]=_0x2abd97;}else{_0x233023[_0xe791('0x49')]=moment(0x0)[_0xe791('0x4b')](_0xe791('0x4c'));_0x233023[_0xe791('0x4a')]={};}return _0x233023;};}exports[_0xe791('0x4d')]=function(_0x496e53,_0x550b45,_0x5b8758){var _0x29f99e=[];return db[_0xe791('0x4e')][_0xe791('0x3e')]({'where':{'role':['agent',_0xe791('0x4f'),_0xe791('0x50')]},'attributes':['id',_0xe791('0x51'),_0xe791('0x28'),_0xe791('0x52'),_0xe791('0x53'),_0xe791('0x54'),_0xe791('0x55'),_0xe791('0x56'),_0xe791('0x57'),_0xe791('0x58')],'order':qs['sort'](_0xe791('0x59')),'include':[{'model':db[_0xe791('0x5a')],'as':_0xe791('0x5b'),'attributes':['id',_0xe791('0x28'),_0xe791('0x5c')],'through':{'attributes':[]}}]})[_0xe791('0x27')](function(_0x4c80b8){if(_0x4c80b8){var _0x5bb581=_0x496e53['user'][_0xe791('0x5d')]({'plain':!![]});if(!_0x5bb581)throw new Error(_0xe791('0x5e'));if(_0x5bb581[_0xe791('0x52')]==='user'){return db[_0xe791('0x5f')][_0xe791('0x43')]({'where':{'name':_0xe791('0x60'),'userProfileId':_0x5bb581['userProfileId']},'raw':!![]})[_0xe791('0x27')](function(_0x25558c){if(_0x25558c){if(_0x25558c['autoAssociation']===0x0){return db[_0xe791('0x61')]['findAll']({'where':{'sectionId':_0x25558c['id']},'raw':!![]})[_0xe791('0x27')](function(_0x56dbbc){var _0x1a0d2f=[];if(_[_0xe791('0x62')](_0x56dbbc)){_0x1a0d2f=_['filter'](_0x4c80b8,function(_0x16eb5f){if(_0x16eb5f[_0xe791('0x52')]!==_0xe791('0x63')){return _0x16eb5f;}});return _0x1a0d2f;}else{for(var _0x324bf0=0x0;_0x324bf0<_0x4c80b8['length'];_0x324bf0++){var _0xbcc645=_0x4c80b8[_0x324bf0];if(_0xbcc645['role']===_0xe791('0x63')){var _0x5c59ac=_[_0xe791('0x43')](_0x56dbbc,function(_0xcaf62b){return _0xcaf62b[_0xe791('0x64')]===_0xbcc645['id'];});if(_0x5c59ac)_0x1a0d2f['push'](_0xbcc645);}else{_0x1a0d2f[_0xe791('0x65')](_0xbcc645);}}return _0x1a0d2f;}});}else{return _0x4c80b8;}}else{var _0xdbf914=_['filter'](_0x4c80b8,function(_0x5c9574){if(_0x5c9574[_0xe791('0x52')]!==_0xe791('0x63')){return _0x5c9574;}});return _0xdbf914;}});}else{return _0x4c80b8;}}})[_0xe791('0x27')](function(_0xbc1537){var _0x2d21ed=[];if(_0xbc1537){_0x29f99e=_0xbc1537;for(var _0x389781=0x0;_0x389781<_0xbc1537[_0xe791('0x33')];_0x389781+=0x1){_0x29f99e[_0x389781][_0xe791('0x48')]=[];_0x2d21ed[_0xe791('0x65')](db[_0xe791('0x3b')]['find']({'where':{'FromId':[_0x496e53[_0xe791('0x50')]['id'],_0xbc1537[_0x389781]['id']],'ToId':[_0x496e53[_0xe791('0x50')]['id'],_0xbc1537[_0x389781]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xe791('0x66'),_0xe791('0x67'),_0xe791('0x46')],'order':qs[_0xe791('0x35')](_0xe791('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe791('0x27')](wrapUser(_0xbc1537[_0x389781])));}return BPromise[_0xe791('0x69')](_0x2d21ed);}return[];})[_0xe791('0x27')](function(_0x4bdeec){return{'rows':_0x4bdeec,'count':_0x4bdeec[_0xe791('0x33')]};})['then'](respondWithResult(_0x550b45,null))[_0xe791('0x44')](handleError(_0x550b45,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 1f46ff9..f5e5217 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 _0xbe81=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit'];(function(_0x404e3f,_0x16fe94){var _0x2883f2=function(_0x202c10){while(--_0x202c10){_0x404e3f['push'](_0x404e3f['shift']());}};_0x2883f2(++_0x16fe94);}(_0xbe81,0x1a9));var _0x1be8=function(_0x284885,_0x34b143){_0x284885=_0x284885-0x0;var _0x3a9710=_0xbe81[_0x284885];return _0x3a9710;};'use strict';var EventEmitter=require(_0x1be8('0x0'));var ChatInternalMessage=require(_0x1be8('0x1'))['db'][_0x1be8('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1be8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1be8('0x4'),'afterDestroy':_0x1be8('0x5')};function emitEvent(_0x146ae4){return function(_0x538d76,_0x112f0a,_0xf0a849){ChatInternalMessageEvents[_0x1be8('0x6')](_0x146ae4+':'+_0x538d76['id'],_0x538d76);ChatInternalMessageEvents['emit'](_0x146ae4,_0x538d76);_0xf0a849(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x1be8('0x7')](e,emitEvent(event));}}module[_0x1be8('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xd92e=['../../mysqldb','ChatInternalMessage','save','remove','emit','exports'];(function(_0x58383f,_0x3ec27a){var _0x339915=function(_0x58e57d){while(--_0x58e57d){_0x58383f['push'](_0x58383f['shift']());}};_0x339915(++_0x3ec27a);}(_0xd92e,0x1bc));var _0xed92=function(_0x57d91a,_0x3b2dc4){_0x57d91a=_0x57d91a-0x0;var _0x2a6c8d=_0xd92e[_0x57d91a];return _0x2a6c8d;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xed92('0x0'))['db'][_0xed92('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xed92('0x2'),'afterUpdate':'update','afterDestroy':_0xed92('0x3')};function emitEvent(_0x462df3){return function(_0xdae6d9,_0x5b26fe,_0x3473b8){ChatInternalMessageEvents[_0xed92('0x4')](_0x462df3+':'+_0xdae6d9['id'],_0xdae6d9);ChatInternalMessageEvents['emit'](_0x462df3,_0xdae6d9);_0x3473b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xed92('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 8dc27a2..4978d35 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 _0xcf64=['bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x2af235,_0x45f664){var _0x593c0e=function(_0x1b12d4){while(--_0x1b12d4){_0x2af235['push'](_0x2af235['shift']());}};_0x593c0e(++_0x45f664);}(_0xcf64,0x15d));var _0x4cf6=function(_0x532c48,_0x50da8d){_0x532c48=_0x532c48-0x0;var _0x40e965=_0xcf64[_0x532c48];return _0x40e965;};'use strict';var _=require(_0x4cf6('0x0'));var util=require(_0x4cf6('0x1'));var logger=require('../../config/logger')(_0x4cf6('0x2'));var moment=require('moment');var BPromise=require(_0x4cf6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4cf6('0x4'));var config=require(_0x4cf6('0x5'));var attributes=require(_0x4cf6('0x6'));module[_0x4cf6('0x7')]=function(_0x270e31,_0x1360cf){return _0x270e31[_0x4cf6('0x8')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4cf6('0x9'),'collate':_0x4cf6('0xa')});};
\ No newline at end of file
+var _0x1bd8=['request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bd8,0x101));var _0x81bd=function(_0x458072,_0x10113f){_0x458072=_0x458072-0x0;var _0x2ad34b=_0x1bd8[_0x458072];return _0x2ad34b;};'use strict';var _=require('lodash');var util=require(_0x81bd('0x0'));var logger=require(_0x81bd('0x1'))(_0x81bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x81bd('0x3'));var fs=require('fs');var path=require(_0x81bd('0x4'));var rimraf=require('rimraf');var config=require(_0x81bd('0x5'));var attributes=require(_0x81bd('0x6'));module[_0x81bd('0x7')]=function(_0x19a7eb,_0x318d9f){return _0x19a7eb[_0x81bd('0x8')](_0x81bd('0x9'),attributes,{'tableName':_0x81bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x81bd('0xb'),'collate':_0x81bd('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 9150169..d8b90a3 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 _0x309d=['rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0x309d,0x1ed));var _0xd309=function(_0x1230b2,_0x21e0f1){_0x1230b2=_0x1230b2-0x0;var _0x1902f5=_0x309d[_0x1230b2];return _0x1902f5;};'use strict';var _=require(_0xd309('0x0'));var util=require(_0xd309('0x1'));var moment=require(_0xd309('0x2'));var BPromise=require(_0xd309('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd309('0x4'));var db=require(_0xd309('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd309('0x6'))(_0xd309('0x7'));var config=require(_0xd309('0x8'));var jayson=require(_0xd309('0x9'));var client=jayson[_0xd309('0xa')][_0xd309('0xb')]({'port':0x232a});config[_0xd309('0xc')]=_['defaults'](config[_0xd309('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd309('0xd'))(new Redis(config[_0xd309('0xc')]));require(_0xd309('0xe'))['register'](socket);function respondWithRpcPromise(_0x148422,_0x4a3a5a,_0x46d643){return new BPromise(function(_0x125aae,_0x22197a){return client[_0xd309('0xf')](_0x148422,_0x46d643)[_0xd309('0x10')](function(_0x346b47){logger[_0xd309('0x11')](_0xd309('0x12'),_0x4a3a5a,_0xd309('0x13'));logger[_0xd309('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4a3a5a,_0xd309('0x13'),JSON['stringify'](_0x346b47));if(_0x346b47[_0xd309('0x15')]){if(_0x346b47[_0xd309('0x15')]['code']===0x1f4){logger[_0xd309('0x15')](_0xd309('0x12'),_0x4a3a5a,_0x346b47[_0xd309('0x15')][_0xd309('0x16')]);return _0x22197a(_0x346b47[_0xd309('0x15')][_0xd309('0x16')]);}logger[_0xd309('0x15')](_0xd309('0x12'),_0x4a3a5a,_0x346b47[_0xd309('0x15')][_0xd309('0x16')]);return _0x125aae(_0x346b47[_0xd309('0x15')][_0xd309('0x16')]);}else{logger['info'](_0xd309('0x12'),_0x4a3a5a,'request\x20sent');_0x125aae(_0x346b47[_0xd309('0x17')]['message']);}})[_0xd309('0x18')](function(_0x4d856a){logger[_0xd309('0x15')](_0xd309('0x12'),_0x4a3a5a,_0x4d856a);_0x22197a(_0x4d856a);});});}
\ No newline at end of file
+var _0x7fc4=['result','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x30f97a,_0x3aaa1d){var _0x33a768=function(_0x2fe70e){while(--_0x2fe70e){_0x30f97a['push'](_0x30f97a['shift']());}};_0x33a768(++_0x3aaa1d);}(_0x7fc4,0x1cf));var _0x47fc=function(_0x45c039,_0x34e2ff){_0x45c039=_0x45c039-0x0;var _0x3e020c=_0x7fc4[_0x45c039];return _0x3e020c;};'use strict';var _=require('lodash');var util=require(_0x47fc('0x0'));var moment=require('moment');var BPromise=require(_0x47fc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47fc('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x47fc('0x3'));var logger=require(_0x47fc('0x4'))(_0x47fc('0x5'));var config=require('../../config/environment');var jayson=require(_0x47fc('0x6'));var client=jayson[_0x47fc('0x7')][_0x47fc('0x8')]({'port':0x232a});config[_0x47fc('0x9')]=_['defaults'](config[_0x47fc('0x9')],{'host':_0x47fc('0xa'),'port':0x18eb});var socket=require(_0x47fc('0xb'))(new Redis(config[_0x47fc('0x9')]));require(_0x47fc('0xc'))[_0x47fc('0xd')](socket);function respondWithRpcPromise(_0x40cfc5,_0x12b117,_0x538a74){return new BPromise(function(_0x4c9e4c,_0x2b25e1){return client['request'](_0x40cfc5,_0x538a74)[_0x47fc('0xe')](function(_0x12880e){logger['info'](_0x47fc('0xf'),_0x12b117,_0x47fc('0x10'));logger['debug'](_0x47fc('0x11'),_0x12b117,_0x47fc('0x10'),JSON['stringify'](_0x12880e));if(_0x12880e['error']){if(_0x12880e['error']['code']===0x1f4){logger[_0x47fc('0x12')](_0x47fc('0xf'),_0x12b117,_0x12880e['error'][_0x47fc('0x13')]);return _0x2b25e1(_0x12880e[_0x47fc('0x12')][_0x47fc('0x13')]);}logger[_0x47fc('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x12b117,_0x12880e[_0x47fc('0x12')][_0x47fc('0x13')]);return _0x4c9e4c(_0x12880e[_0x47fc('0x12')]['message']);}else{logger[_0x47fc('0x14')](_0x47fc('0xf'),_0x12b117,_0x47fc('0x10'));_0x4c9e4c(_0x12880e[_0x47fc('0x15')][_0x47fc('0x13')]);}})['catch'](function(_0x38885f){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x12b117,_0x38885f);_0x2b25e1(_0x38885f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 42147db..230f8cd 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 _0xd3ed=['removeListener','register','chatInternalMessage:','remove','update','emit'];(function(_0x31b070,_0x1d3e08){var _0x3308fa=function(_0x3cbcd7){while(--_0x3cbcd7){_0x31b070['push'](_0x31b070['shift']());}};_0x3308fa(++_0x1d3e08);}(_0xd3ed,0x195));var _0xdd3e=function(_0x4bb6b8,_0x1fb197){_0x4bb6b8=_0x4bb6b8-0x0;var _0x524a57=_0xd3ed[_0x4bb6b8];return _0x524a57;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xdd3e('0x0'),_0xdd3e('0x1')];function createListener(_0x198fb7,_0x40d37e){return function(_0x3b52bc){_0x40d37e[_0xdd3e('0x2')](_0x198fb7,_0x3b52bc);};}function removeListener(_0x31e2a8,_0x211348){return function(){ChatInternalMessageEvents[_0xdd3e('0x3')](_0x31e2a8,_0x211348);};}exports[_0xdd3e('0x4')]=function(_0x2e1285){for(var _0x13e724=0x0,_0x30b9dc=events['length'];_0x13e724<_0x30b9dc;_0x13e724++){var _0xc25b26=events[_0x13e724];var _0x276143=createListener(_0xdd3e('0x5')+_0xc25b26,_0x2e1285);ChatInternalMessageEvents['on'](_0xc25b26,_0x276143);}};
\ No newline at end of file
+var _0xd5d5=['chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','removeListener','register','length'];(function(_0x52245c,_0x28e3a2){var _0x4ab58b=function(_0x3bfffe){while(--_0x3bfffe){_0x52245c['push'](_0x52245c['shift']());}};_0x4ab58b(++_0x28e3a2);}(_0xd5d5,0xe1));var _0x5d5d=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0xd5d5[_0x242a98];return _0x580999;};'use strict';var ChatInternalMessageEvents=require(_0x5d5d('0x0'));var events=[_0x5d5d('0x1'),_0x5d5d('0x2'),'update'];function createListener(_0x3b717f,_0xc73324){return function(_0x56e9bb){_0xc73324[_0x5d5d('0x3')](_0x3b717f,_0x56e9bb);};}function removeListener(_0x4f57c3,_0x35f562){return function(){ChatInternalMessageEvents[_0x5d5d('0x4')](_0x4f57c3,_0x35f562);};}exports[_0x5d5d('0x5')]=function(_0x23e9e6){for(var _0x5c6054=0x0,_0x2c4000=events[_0x5d5d('0x6')];_0x5c6054<_0x2c4000;_0x5c6054++){var _0x136962=events[_0x5c6054];var _0x578ac1=createListener(_0x5d5d('0x7')+_0x136962,_0x23e9e6);ChatInternalMessageEvents['on'](_0x136962,_0x578ac1);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index d0ed5e2..a1b4dfa 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 _0x6f90=['/users','getUsers','show','create','put','delete','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x6f90,0x198));var _0x06f9=function(_0x122949,_0x3592b1){_0x122949=_0x122949-0x0;var _0x369d1f=_0x6f90[_0x122949];return _0x369d1f;};'use strict';var multer=require('multer');var util=require(_0x06f9('0x0'));var path=require('path');var timeout=require(_0x06f9('0x1'));var express=require(_0x06f9('0x2'));var router=express[_0x06f9('0x3')]();var fs_extra=require(_0x06f9('0x4'));var auth=require(_0x06f9('0x5'));var interaction=require(_0x06f9('0x6'));var config=require(_0x06f9('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x06f9('0x8')]('/',auth[_0x06f9('0x9')](),controller[_0x06f9('0xa')]);router[_0x06f9('0x8')]('/describe',auth[_0x06f9('0x9')](),controller[_0x06f9('0xb')]);router[_0x06f9('0x8')](_0x06f9('0xc'),auth[_0x06f9('0x9')](),controller[_0x06f9('0xd')]);router[_0x06f9('0x8')]('/:id',auth[_0x06f9('0x9')](),controller[_0x06f9('0xe')]);router['post']('/',auth[_0x06f9('0x9')](),controller[_0x06f9('0xf')]);router[_0x06f9('0x10')]('/:id',controller['update']);router[_0x06f9('0x11')](_0x06f9('0x12'),auth[_0x06f9('0x9')](),controller[_0x06f9('0x13')]);module[_0x06f9('0x14')]=router;
\ No newline at end of file
+var _0xa3ad=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','create','put','delete','destroy','multer','path'];(function(_0x2845ea,_0x221cbe){var _0x41f5da=function(_0x12e302){while(--_0x12e302){_0x2845ea['push'](_0x2845ea['shift']());}};_0x41f5da(++_0x221cbe);}(_0xa3ad,0xd0));var _0xda3a=function(_0x2239da,_0xc447db){_0x2239da=_0x2239da-0x0;var _0x5d5062=_0xa3ad[_0x2239da];return _0x5d5062;};'use strict';var multer=require(_0xda3a('0x0'));var util=require('util');var path=require(_0xda3a('0x1'));var timeout=require(_0xda3a('0x2'));var express=require('express');var router=express[_0xda3a('0x3')]();var fs_extra=require(_0xda3a('0x4'));var auth=require(_0xda3a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xda3a('0x6'));var controller=require(_0xda3a('0x7'));router[_0xda3a('0x8')]('/',auth[_0xda3a('0x9')](),controller[_0xda3a('0xa')]);router[_0xda3a('0x8')](_0xda3a('0xb'),auth[_0xda3a('0x9')](),controller[_0xda3a('0xc')]);router[_0xda3a('0x8')](_0xda3a('0xd'),auth[_0xda3a('0x9')](),controller[_0xda3a('0xe')]);router[_0xda3a('0x8')](_0xda3a('0xf'),auth['isAuthenticated'](),controller[_0xda3a('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xda3a('0x11')]);router[_0xda3a('0x12')]('/:id',controller['update']);router[_0xda3a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xda3a('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 19b45c6..77116b7 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 _0xa30a=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x55fe01,_0x12ed37){var _0x5b42f0=function(_0x461191){while(--_0x461191){_0x55fe01['push'](_0x55fe01['shift']());}};_0x5b42f0(++_0x12ed37);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'body':{'type':Sequelize[_0xaa30('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xaa30('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xaa30('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa30('0x4')]('in',_0xaa30('0x5')),'defaultValue':_0xaa30('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xaa30('0x6')]},'providerName':{'type':Sequelize[_0xaa30('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8d05=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8d05,0xe8));var _0x58d0=function(_0x21f3f8,_0x566bab){_0x21f3f8=_0x21f3f8-0x0;var _0x558255=_0x8d05[_0x21f3f8];return _0x558255;};'use strict';var Sequelize=require(_0x58d0('0x0'));module[_0x58d0('0x1')]={'body':{'type':Sequelize[_0x58d0('0x2')](_0x58d0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x58d0('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x58d0('0x5')),'defaultValue':_0x58d0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x58d0('0x6')]},'providerName':{'type':Sequelize[_0x58d0('0x7')]},'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 a5a9ab7..488eaa1 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x2beb70,_0x264e7a){var _0x4975b9=function(_0x3dbce7){while(--_0x3dbce7){_0x2beb70['push'](_0x2beb70['shift']());}};_0x4975b9(++_0x264e7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x1f8f53,_0x160903){var _0x3c5e7f=function(_0x359956){while(--_0x359956){_0x1f8f53['push'](_0x1f8f53['shift']());}};_0x3c5e7f(++_0x160903);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 2cb7f71..6225c44 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 _0xe2a6=['emit','hook','exports','events','../../mysqldb','ChatMessage','save','update','remove'];(function(_0x251421,_0x34bf49){var _0xe9bbff=function(_0x522759){while(--_0x522759){_0x251421['push'](_0x251421['shift']());}};_0xe9bbff(++_0x34bf49);}(_0xe2a6,0x1d7));var _0x6e2a=function(_0x512f81,_0x4a7986){_0x512f81=_0x512f81-0x0;var _0xa15099=_0xe2a6[_0x512f81];return _0xa15099;};'use strict';var EventEmitter=require(_0x6e2a('0x0'));var ChatMessage=require(_0x6e2a('0x1'))['db'][_0x6e2a('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e2a('0x3'),'afterUpdate':_0x6e2a('0x4'),'afterDestroy':_0x6e2a('0x5')};function emitEvent(_0x2a138e){return function(_0x3115c7,_0x371275,_0x3aab8d){ChatMessageEvents['emit'](_0x2a138e+':'+_0x3115c7['id'],_0x3115c7);ChatMessageEvents[_0x6e2a('0x6')](_0x2a138e,_0x3115c7);_0x3aab8d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x6e2a('0x7')](e,emitEvent(event));}}module[_0x6e2a('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xb43e=['exports','events','../../mysqldb','ChatMessage','save','update','emit','hook'];(function(_0x16fd68,_0x3d394d){var _0x12cf8e=function(_0x4728c1){while(--_0x4728c1){_0x16fd68['push'](_0x16fd68['shift']());}};_0x12cf8e(++_0x3d394d);}(_0xb43e,0x1f1));var _0xeb43=function(_0x9d885d,_0x3cb2db){_0x9d885d=_0x9d885d-0x0;var _0x272063=_0xb43e[_0x9d885d];return _0x272063;};'use strict';var EventEmitter=require(_0xeb43('0x0'));var ChatMessage=require(_0xeb43('0x1'))['db'][_0xeb43('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb43('0x3'),'afterUpdate':_0xeb43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1fa2b7){return function(_0x48e2ad,_0x1b2380,_0x5659a2){ChatMessageEvents[_0xeb43('0x5')](_0x1fa2b7+':'+_0x48e2ad['id'],_0x48e2ad);ChatMessageEvents['emit'](_0x1fa2b7,_0x48e2ad);_0x5659a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xeb43('0x6')](e,emitEvent(event));}}module[_0xeb43('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 f701a37..39bf1d0 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 _0xf37f=['exports','ChatMessage','chat_messages','fti_chat_messages','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xf37f,0x11a));var _0xff37=function(_0x5134b8,_0x37e616){_0x5134b8=_0x5134b8-0x0;var _0xc07056=_0xf37f[_0x5134b8];return _0xc07056;};'use strict';var _=require('lodash');var util=require(_0xff37('0x0'));var logger=require('../../config/logger')(_0xff37('0x1'));var moment=require(_0xff37('0x2'));var BPromise=require('bluebird');var rp=require(_0xff37('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff37('0x4'));var config=require(_0xff37('0x5'));var attributes=require('./chatMessage.attributes');module[_0xff37('0x6')]=function(_0x414b47,_0x10ed1d){return _0x414b47['define'](_0xff37('0x7'),attributes,{'tableName':_0xff37('0x8'),'paranoid':![],'indexes':[{'name':_0xff37('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13a209,_0x317937,_0x115deb){var _0x2ee7a8=_0x414b47['models'];var _0x1ed7a9=_0x13a209[_0xff37('0xa')]({'plain':!![]});if(_0x1ed7a9[_0xff37('0xb')][_0xff37('0xc')]()==='in'||_0x1ed7a9['direction'][_0xff37('0xc')]()===_0xff37('0xd')&&!_0x1ed7a9[_0xff37('0xe')]&&!_['isNil'](_0x1ed7a9[_0xff37('0xf')])){_0x2ee7a8[_0xff37('0x10')][_0xff37('0x11')]({'where':{'id':_0x1ed7a9['ChatInteractionId']}})[_0xff37('0x12')](function(_0x2777b8){if(_0x2777b8){_0x2777b8[_0xff37('0x13')]({'lastMsgAt':_0x1ed7a9['createdAt'],'lastMsgDirection':_0x1ed7a9[_0xff37('0xb')][_0xff37('0xc')]()});}})[_0xff37('0x14')](function(_0x16641c){console[_0xff37('0x15')](_0x16641c);});}_0x115deb();}},'charset':_0xff37('0x16'),'collate':_0xff37('0x17')});};
\ No newline at end of file
+var _0x9017=['ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out','secret','ChatInteraction','findOne','ChatInteractionId','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x376195,_0x401af2){var _0x5733ef=function(_0x512e97){while(--_0x512e97){_0x376195['push'](_0x376195['shift']());}};_0x5733ef(++_0x401af2);}(_0x9017,0x123));var _0x7901=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9017[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7901('0x0'));var util=require('util');var logger=require(_0x7901('0x1'))(_0x7901('0x2'));var moment=require('moment');var BPromise=require(_0x7901('0x3'));var rp=require(_0x7901('0x4'));var fs=require('fs');var path=require(_0x7901('0x5'));var rimraf=require(_0x7901('0x6'));var config=require(_0x7901('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x13a205,_0x2d19e2){return _0x13a205[_0x7901('0x8')](_0x7901('0x9'),attributes,{'tableName':_0x7901('0xa'),'paranoid':![],'indexes':[{'name':_0x7901('0xb'),'fields':[_0x7901('0xc')],'type':_0x7901('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x159629,_0x5ab170,_0x287d16){var _0x23d111=_0x13a205['models'];var _0x474da8=_0x159629['get']({'plain':!![]});if(_0x474da8[_0x7901('0xe')][_0x7901('0xf')]()==='in'||_0x474da8[_0x7901('0xe')][_0x7901('0xf')]()===_0x7901('0x10')&&!_0x474da8[_0x7901('0x11')]&&!_['isNil'](_0x474da8['UserId'])){_0x23d111[_0x7901('0x12')][_0x7901('0x13')]({'where':{'id':_0x474da8[_0x7901('0x14')]}})['then'](function(_0x4e9542){if(_0x4e9542){_0x4e9542[_0x7901('0x15')]({'lastMsgAt':_0x474da8['createdAt'],'lastMsgDirection':_0x474da8[_0x7901('0xe')][_0x7901('0xf')]()});}})['catch'](function(_0x2a5848){console[_0x7901('0x16')](_0x2a5848);});}_0x287d16();}},'charset':_0x7901('0x17'),'collate':_0x7901('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 74b46fb..c19cc05 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 _0x123b=['message','result','CreateChatMessage','create','options','raw','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4d1965,_0x43152e){var _0xdcfade=function(_0x3d3b8a){while(--_0x3d3b8a){_0x4d1965['push'](_0x4d1965['shift']());}};_0xdcfade(++_0x43152e);}(_0x123b,0xef));var _0xb123=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x123b[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xb123('0x0'));var util=require(_0xb123('0x1'));var moment=require(_0xb123('0x2'));var BPromise=require('bluebird');var rs=require(_0xb123('0x3'));var fs=require('fs');var Redis=require(_0xb123('0x4'));var db=require(_0xb123('0x5'))['db'];var utils=require(_0xb123('0x6'));var logger=require(_0xb123('0x7'))(_0xb123('0x8'));var config=require(_0xb123('0x9'));var jayson=require(_0xb123('0xa'));var client=jayson[_0xb123('0xb')][_0xb123('0xc')]({'port':0x232a});config['redis']=_[_0xb123('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb123('0xe')]));require(_0xb123('0xf'))[_0xb123('0x10')](socket);function respondWithRpcPromise(_0x14fc31,_0x2f4629,_0x3b594a){return new BPromise(function(_0x4f7d40,_0x3ad095){return client[_0xb123('0x11')](_0x14fc31,_0x3b594a)[_0xb123('0x12')](function(_0x1a09c8){logger[_0xb123('0x13')](_0xb123('0x14'),_0x2f4629,_0xb123('0x15'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2f4629,_0xb123('0x15'),JSON[_0xb123('0x16')](_0x1a09c8));if(_0x1a09c8[_0xb123('0x17')]){if(_0x1a09c8['error'][_0xb123('0x18')]===0x1f4){logger[_0xb123('0x17')](_0xb123('0x14'),_0x2f4629,_0x1a09c8[_0xb123('0x17')]['message']);return _0x3ad095(_0x1a09c8[_0xb123('0x17')]['message']);}logger['error'](_0xb123('0x14'),_0x2f4629,_0x1a09c8[_0xb123('0x17')][_0xb123('0x19')]);return _0x4f7d40(_0x1a09c8[_0xb123('0x17')][_0xb123('0x19')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2f4629,'request\x20sent');_0x4f7d40(_0x1a09c8[_0xb123('0x1a')][_0xb123('0x19')]);}})['catch'](function(_0x43871d){logger[_0xb123('0x17')](_0xb123('0x14'),_0x2f4629,_0x43871d);_0x3ad095(_0x43871d);});});}exports[_0xb123('0x1b')]=function(_0x494a0f){var _0x4daea3=this;return new Promise(function(_0x50c642,_0x280529){return db['ChatMessage'][_0xb123('0x1c')](_0x494a0f['body'],{'raw':_0x494a0f[_0xb123('0x1d')]?_0x494a0f[_0xb123('0x1d')][_0xb123('0x1e')]===undefined?!![]:![]:!![]})[_0xb123('0x12')](function(_0x347846){logger['info'](_0xb123('0x1b'),_0x494a0f);logger[_0xb123('0x1f')](_0xb123('0x1b'),_0x494a0f,JSON[_0xb123('0x16')](_0x347846));_0x50c642(_0x347846);})[_0xb123('0x20')](function(_0x3b469a){logger[_0xb123('0x17')](_0xb123('0x1b'),_0x3b469a[_0xb123('0x19')],_0x494a0f);_0x280529(_0x4daea3[_0xb123('0x17')](0x1f4,_0x3b469a[_0xb123('0x19')]));});});};
\ No newline at end of file
+var _0xbd8e=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','CreateChatMessage','create','options','stringify','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd8e,0x1de));var _0xebd8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbd8e[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xebd8('0x0'));var util=require('util');var moment=require(_0xebd8('0x1'));var BPromise=require(_0xebd8('0x2'));var rs=require(_0xebd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xebd8('0x4'));var logger=require('../../config/logger')(_0xebd8('0x5'));var config=require('../../config/environment');var jayson=require(_0xebd8('0x6'));var client=jayson[_0xebd8('0x7')][_0xebd8('0x8')]({'port':0x232a});config[_0xebd8('0x9')]=_[_0xebd8('0xa')](config['redis'],{'host':_0xebd8('0xb'),'port':0x18eb});var socket=require(_0xebd8('0xc'))(new Redis(config[_0xebd8('0x9')]));require('./chatMessage.socket')[_0xebd8('0xd')](socket);function respondWithRpcPromise(_0x2be34e,_0x4e769d,_0x521756){return new BPromise(function(_0x4ff789,_0x10a5b5){return client[_0xebd8('0xe')](_0x2be34e,_0x521756)['then'](function(_0x560a69){logger[_0xebd8('0xf')](_0xebd8('0x10'),_0x4e769d,_0xebd8('0x11'));logger[_0xebd8('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4e769d,_0xebd8('0x11'),JSON['stringify'](_0x560a69));if(_0x560a69[_0xebd8('0x13')]){if(_0x560a69[_0xebd8('0x13')]['code']===0x1f4){logger[_0xebd8('0x13')](_0xebd8('0x10'),_0x4e769d,_0x560a69[_0xebd8('0x13')][_0xebd8('0x14')]);return _0x10a5b5(_0x560a69[_0xebd8('0x13')][_0xebd8('0x14')]);}logger[_0xebd8('0x13')](_0xebd8('0x10'),_0x4e769d,_0x560a69[_0xebd8('0x13')]['message']);return _0x4ff789(_0x560a69[_0xebd8('0x13')][_0xebd8('0x14')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x4e769d,_0xebd8('0x11'));_0x4ff789(_0x560a69['result'][_0xebd8('0x14')]);}})['catch'](function(_0xb78d0f){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4e769d,_0xb78d0f);_0x10a5b5(_0xb78d0f);});});}exports[_0xebd8('0x15')]=function(_0x5066b6){var _0x9a284=this;return new Promise(function(_0x45d9d3,_0x409fa9){return db['ChatMessage'][_0xebd8('0x16')](_0x5066b6['body'],{'raw':_0x5066b6[_0xebd8('0x17')]?_0x5066b6['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4b62d4){logger[_0xebd8('0xf')](_0xebd8('0x15'),_0x5066b6);logger[_0xebd8('0x12')]('CreateChatMessage',_0x5066b6,JSON[_0xebd8('0x18')](_0x4b62d4));_0x45d9d3(_0x4b62d4);})[_0xebd8('0x19')](function(_0x130596){logger[_0xebd8('0x13')](_0xebd8('0x15'),_0x130596[_0xebd8('0x14')],_0x5066b6);_0x409fa9(_0x9a284['error'](0x1f4,_0x130596[_0xebd8('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 22214e4..7ecc13c 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 _0x24ca=['./chatMessage.events','update','emit','removeListener','register','length','chatMessage:'];(function(_0x34155d,_0x5895cd){var _0x982507=function(_0x1bad95){while(--_0x1bad95){_0x34155d['push'](_0x34155d['shift']());}};_0x982507(++_0x5895cd);}(_0x24ca,0x8c));var _0xa24c=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0x24ca[_0x3e182f];return _0x23edc9;};'use strict';var ChatMessageEvents=require(_0xa24c('0x0'));var events=['save','remove',_0xa24c('0x1')];function createListener(_0x4e90b0,_0x155c49){return function(_0x1efd39){_0x155c49[_0xa24c('0x2')](_0x4e90b0,_0x1efd39);};}function removeListener(_0x49f276,_0x2fbcfa){return function(){ChatMessageEvents[_0xa24c('0x3')](_0x49f276,_0x2fbcfa);};}exports[_0xa24c('0x4')]=function(_0x5a37ae){for(var _0x5377ed=0x0,_0x52147a=events[_0xa24c('0x5')];_0x5377ed<_0x52147a;_0x5377ed++){var _0x3c10d9=events[_0x5377ed];var _0x1218ea=createListener(_0xa24c('0x6')+_0x3c10d9,_0x5a37ae);ChatMessageEvents['on'](_0x3c10d9,_0x1218ea);}};
\ No newline at end of file
+var _0x29d4=['removeListener','register','length','./chatMessage.events','remove','update'];(function(_0x3c03a9,_0x4caa7e){var _0x557acf=function(_0x344038){while(--_0x344038){_0x3c03a9['push'](_0x3c03a9['shift']());}};_0x557acf(++_0x4caa7e);}(_0x29d4,0x1a1));var _0x429d=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x29d4[_0x1b349a];return _0x5d1f7c;};'use strict';var ChatMessageEvents=require(_0x429d('0x0'));var events=['save',_0x429d('0x1'),_0x429d('0x2')];function createListener(_0x16ce75,_0x472fc9){return function(_0x45df1c){_0x472fc9['emit'](_0x16ce75,_0x45df1c);};}function removeListener(_0xc3989d,_0x3f43f5){return function(){ChatMessageEvents[_0x429d('0x3')](_0xc3989d,_0x3f43f5);};}exports[_0x429d('0x4')]=function(_0x1c55aa){for(var _0xa71445=0x0,_0x56aa2f=events[_0x429d('0x5')];_0xa71445<_0x56aa2f;_0xa71445++){var _0x4befb9=events[_0xa71445];var _0x9fc337=createListener('chatMessage:'+_0x4befb9,_0x1c55aa);ChatMessageEvents['on'](_0x4befb9,_0x9fc337);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index d93b230..76418e6 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 _0x01df=['/:id','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe'];(function(_0x187ee1,_0x486fdd){var _0x174752=function(_0xd96a00){while(--_0xd96a00){_0x187ee1['push'](_0x187ee1['shift']());}};_0x174752(++_0x486fdd);}(_0x01df,0x16c));var _0xf01d=function(_0xeb56e0,_0x565544){_0xeb56e0=_0xeb56e0-0x0;var _0x16642f=_0x01df[_0xeb56e0];return _0x16642f;};'use strict';var multer=require('multer');var util=require(_0xf01d('0x0'));var path=require(_0xf01d('0x1'));var timeout=require(_0xf01d('0x2'));var express=require('express');var router=express[_0xf01d('0x3')]();var fs_extra=require(_0xf01d('0x4'));var auth=require(_0xf01d('0x5'));var interaction=require(_0xf01d('0x6'));var config=require('../../config/environment');var controller=require(_0xf01d('0x7'));router[_0xf01d('0x8')]('/',auth[_0xf01d('0x9')](),controller['index']);router[_0xf01d('0x8')](_0xf01d('0xa'),auth[_0xf01d('0x9')](),controller['describe']);router[_0xf01d('0x8')](_0xf01d('0xb'),auth[_0xf01d('0x9')](),controller['show']);router['post']('/',auth[_0xf01d('0x9')](),interaction[_0xf01d('0xc')](_0xf01d('0xd'),_0xf01d('0xe')),controller[_0xf01d('0xf')]);router[_0xf01d('0x10')](_0xf01d('0xb'),controller[_0xf01d('0x11')]);router['put'](_0xf01d('0x12'),auth['isAuthenticated'](),controller[_0xf01d('0x13')]);router[_0xf01d('0x10')](_0xf01d('0x14'),auth[_0xf01d('0x9')](),controller[_0xf01d('0x15')]);router[_0xf01d('0x16')](_0xf01d('0xb'),auth[_0xf01d('0x9')](),controller[_0xf01d('0x17')]);module[_0xf01d('0x18')]=router;
\ No newline at end of file
+var _0x84ea=['post','tracked','chat','chatmessage:create','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x84ea,0x13f));var _0xa84e=function(_0x5a2583,_0x502e6a){_0x5a2583=_0x5a2583-0x0;var _0x2b1825=_0x84ea[_0x5a2583];return _0x2b1825;};'use strict';var multer=require(_0xa84e('0x0'));var util=require(_0xa84e('0x1'));var path=require(_0xa84e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa84e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa84e('0x4'));var controller=require(_0xa84e('0x5'));router[_0xa84e('0x6')]('/',auth[_0xa84e('0x7')](),controller[_0xa84e('0x8')]);router[_0xa84e('0x6')](_0xa84e('0x9'),auth[_0xa84e('0x7')](),controller['describe']);router[_0xa84e('0x6')](_0xa84e('0xa'),auth[_0xa84e('0x7')](),controller['show']);router[_0xa84e('0xb')]('/',auth[_0xa84e('0x7')](),interaction[_0xa84e('0xc')](_0xa84e('0xd'),_0xa84e('0xe')),controller['create']);router['put']('/:id',controller[_0xa84e('0xf')]);router['put'](_0xa84e('0x10'),auth[_0xa84e('0x7')](),controller['accept']);router['put'](_0xa84e('0x11'),auth[_0xa84e('0x7')](),controller[_0xa84e('0x12')]);router[_0xa84e('0x13')](_0xa84e('0xa'),auth['isAuthenticated'](),controller[_0xa84e('0x14')]);module[_0xa84e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 96be6f0..3da267f 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 _0x6c00=['exports','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c00,0x1a9));var _0x06c0=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x6c00[_0x2a5b3b];return _0xae665a;};'use strict';var Sequelize=require(_0x06c0('0x0'));module[_0x06c0('0x1')]={'body':{'type':Sequelize[_0x06c0('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x85bb=['exports','medium'];(function(_0x5c4703,_0x26d11d){var _0x59e7e5=function(_0x3eddfe){while(--_0x3eddfe){_0x5c4703['push'](_0x5c4703['shift']());}};_0x59e7e5(++_0x26d11d);}(_0x85bb,0x94));var _0xb85b=function(_0x4ea966,_0x532385){_0x4ea966=_0x4ea966-0x0;var _0x164ab4=_0x85bb[_0x4ea966];return _0x164ab4;};'use strict';var Sequelize=require('sequelize');module[_0xb85b('0x0')]={'body':{'type':Sequelize['TEXT'](_0xb85b('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 39903ce..4d4beb2 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xddf621,_0x4ac1ea){var _0x212964=function(_0x2c03e7){while(--_0x2c03e7){_0xddf621['push'](_0xddf621['shift']());}};_0x212964(++_0x4ac1ea);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x364f63,_0x5c8790){var _0x2fff70=function(_0x3c1582){while(--_0x3c1582){_0x364f63['push'](_0x364f63['shift']());}};_0x2fff70(++_0x5c8790);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 98ec120..1f6cc1b 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 _0x48e5=['moment','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x493720,_0x2e7724){var _0x3cfc8e=function(_0x1ceb74){while(--_0x1ceb74){_0x493720['push'](_0x493720['shift']());}};_0x3cfc8e(++_0x2e7724);}(_0x48e5,0x15d));var _0x548e=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x48e5[_0x4e5552];return _0x60a338;};'use strict';var _=require('lodash');var util=require(_0x548e('0x0'));var logger=require(_0x548e('0x1'))('api');var moment=require(_0x548e('0x2'));var BPromise=require(_0x548e('0x3'));var rp=require(_0x548e('0x4'));var fs=require('fs');var path=require(_0x548e('0x5'));var rimraf=require(_0x548e('0x6'));var config=require('../../config/environment');var attributes=require(_0x548e('0x7'));module[_0x548e('0x8')]=function(_0x9c6055,_0x586519){return _0x9c6055[_0x548e('0x9')](_0x548e('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x548e('0xb'),'collate':_0x548e('0xc')});};
\ No newline at end of file
+var _0x36d0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x36d0,0x19f));var _0x036d=function(_0x42cdf1,_0x3efe9d){_0x42cdf1=_0x42cdf1-0x0;var _0x2526f9=_0x36d0[_0x42cdf1];return _0x2526f9;};'use strict';var _=require(_0x036d('0x0'));var util=require(_0x036d('0x1'));var logger=require(_0x036d('0x2'))(_0x036d('0x3'));var moment=require(_0x036d('0x4'));var BPromise=require(_0x036d('0x5'));var rp=require(_0x036d('0x6'));var fs=require('fs');var path=require(_0x036d('0x7'));var rimraf=require(_0x036d('0x8'));var config=require(_0x036d('0x9'));var attributes=require(_0x036d('0xa'));module[_0x036d('0xb')]=function(_0x4ad41f,_0x57c442){return _0x4ad41f[_0x036d('0xc')](_0x036d('0xd'),attributes,{'tableName':_0x036d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x036d('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 76fb02b..58cf053 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 _0xb4a0=['code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x427885,_0x493711){var _0x3a6c06=function(_0x2336b1){while(--_0x2336b1){_0x427885['push'](_0x427885['shift']());}};_0x3a6c06(++_0x493711);}(_0xb4a0,0x1e8));var _0x0b4a=function(_0x50e066,_0x29a43a){_0x50e066=_0x50e066-0x0;var _0x3b31e3=_0xb4a0[_0x50e066];return _0x3b31e3;};'use strict';var _=require(_0x0b4a('0x0'));var util=require('util');var moment=require(_0x0b4a('0x1'));var BPromise=require(_0x0b4a('0x2'));var rs=require(_0x0b4a('0x3'));var fs=require('fs');var Redis=require(_0x0b4a('0x4'));var db=require(_0x0b4a('0x5'))['db'];var utils=require(_0x0b4a('0x6'));var logger=require(_0x0b4a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0b4a('0x8'));var client=jayson[_0x0b4a('0x9')][_0x0b4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bd469,_0x59389c,_0x351dec){return new BPromise(function(_0x513c6c,_0x3225f6){return client['request'](_0x1bd469,_0x351dec)[_0x0b4a('0xb')](function(_0x324102){logger[_0x0b4a('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x59389c,_0x0b4a('0xd'));logger[_0x0b4a('0xe')](_0x0b4a('0xf'),_0x59389c,'request\x20sent',JSON[_0x0b4a('0x10')](_0x324102));if(_0x324102[_0x0b4a('0x11')]){if(_0x324102[_0x0b4a('0x11')][_0x0b4a('0x12')]===0x1f4){logger[_0x0b4a('0x11')](_0x0b4a('0x13'),_0x59389c,_0x324102[_0x0b4a('0x11')]['message']);return _0x3225f6(_0x324102['error'][_0x0b4a('0x14')]);}logger[_0x0b4a('0x11')](_0x0b4a('0x13'),_0x59389c,_0x324102['error'][_0x0b4a('0x14')]);return _0x513c6c(_0x324102[_0x0b4a('0x11')][_0x0b4a('0x14')]);}else{logger[_0x0b4a('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x59389c,_0x0b4a('0xd'));_0x513c6c(_0x324102[_0x0b4a('0x15')]['message']);}})[_0x0b4a('0x16')](function(_0x59d4b0){logger[_0x0b4a('0x11')](_0x0b4a('0x13'),_0x59389c,_0x59d4b0);_0x3225f6(_0x59d4b0);});});}
\ No newline at end of file
+var _0xefe2=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x9be80d,_0x13f55){var _0x562e90=function(_0x2ac04a){while(--_0x2ac04a){_0x9be80d['push'](_0x9be80d['shift']());}};_0x562e90(++_0x13f55);}(_0xefe2,0x178));var _0x2efe=function(_0x5238aa,_0x3f82a9){_0x5238aa=_0x5238aa-0x0;var _0x2ca18a=_0xefe2[_0x5238aa];return _0x2ca18a;};'use strict';var _=require(_0x2efe('0x0'));var util=require(_0x2efe('0x1'));var moment=require('moment');var BPromise=require(_0x2efe('0x2'));var rs=require(_0x2efe('0x3'));var fs=require('fs');var Redis=require(_0x2efe('0x4'));var db=require(_0x2efe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2efe('0x6'))(_0x2efe('0x7'));var config=require(_0x2efe('0x8'));var jayson=require(_0x2efe('0x9'));var client=jayson[_0x2efe('0xa')][_0x2efe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cb899,_0x4afa51,_0x1447f1){return new BPromise(function(_0x3916c3,_0x5a1147){return client[_0x2efe('0xc')](_0x2cb899,_0x1447f1)[_0x2efe('0xd')](function(_0x1f12de){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x4afa51,_0x2efe('0xe'));logger[_0x2efe('0xf')](_0x2efe('0x10'),_0x4afa51,'request\x20sent',JSON[_0x2efe('0x11')](_0x1f12de));if(_0x1f12de[_0x2efe('0x12')]){if(_0x1f12de[_0x2efe('0x12')][_0x2efe('0x13')]===0x1f4){logger['error'](_0x2efe('0x14'),_0x4afa51,_0x1f12de[_0x2efe('0x12')]['message']);return _0x5a1147(_0x1f12de[_0x2efe('0x12')]['message']);}logger['error'](_0x2efe('0x14'),_0x4afa51,_0x1f12de['error'][_0x2efe('0x15')]);return _0x3916c3(_0x1f12de[_0x2efe('0x12')][_0x2efe('0x15')]);}else{logger[_0x2efe('0x16')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4afa51,_0x2efe('0xe'));_0x3916c3(_0x1f12de['result'][_0x2efe('0x15')]);}})['catch'](function(_0x4950e5){logger[_0x2efe('0x12')](_0x2efe('0x14'),_0x4afa51,_0x4950e5);_0x5a1147(_0x4950e5);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d1543c7..1861b8f 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 _0xae90=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','create','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x43424a,_0x5b7fb7){var _0x5cd9f2=function(_0x3ca07a){while(--_0x3ca07a){_0x43424a['push'](_0x43424a['shift']());}};_0x5cd9f2(++_0x5b7fb7);}(_0xae90,0x1c8));var _0x0ae9=function(_0x4d1c4a,_0x663403){_0x4d1c4a=_0x4d1c4a-0x0;var _0xf7bc3c=_0xae90[_0x4d1c4a];return _0xf7bc3c;};'use strict';var multer=require(_0x0ae9('0x0'));var util=require(_0x0ae9('0x1'));var path=require('path');var timeout=require(_0x0ae9('0x2'));var express=require(_0x0ae9('0x3'));var router=express[_0x0ae9('0x4')]();var fs_extra=require(_0x0ae9('0x5'));var auth=require(_0x0ae9('0x6'));var interaction=require(_0x0ae9('0x7'));var config=require(_0x0ae9('0x8'));var controller=require(_0x0ae9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x0ae9('0xa')]);router[_0x0ae9('0xb')](_0x0ae9('0xc'),auth[_0x0ae9('0xd')](),controller[_0x0ae9('0xe')]);router[_0x0ae9('0xb')](_0x0ae9('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0ae9('0xd')](),controller[_0x0ae9('0x10')]);router['put'](_0x0ae9('0xf'),auth[_0x0ae9('0xd')](),controller[_0x0ae9('0x11')]);router['delete'](_0x0ae9('0xf'),auth[_0x0ae9('0xd')](),controller[_0x0ae9('0x12')]);module[_0x0ae9('0x13')]=router;
\ No newline at end of file
+var _0xf4e5=['/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe'];(function(_0x5b0fd6,_0x596cab){var _0xa5b678=function(_0x49a337){while(--_0x49a337){_0x5b0fd6['push'](_0x5b0fd6['shift']());}};_0xa5b678(++_0x596cab);}(_0xf4e5,0x1d7));var _0x5f4e=function(_0x400fa2,_0x18bb9e){_0x400fa2=_0x400fa2-0x0;var _0x2a55fc=_0xf4e5[_0x400fa2];return _0x2a55fc;};'use strict';var multer=require(_0x5f4e('0x0'));var util=require('util');var path=require(_0x5f4e('0x1'));var timeout=require(_0x5f4e('0x2'));var express=require(_0x5f4e('0x3'));var router=express[_0x5f4e('0x4')]();var fs_extra=require(_0x5f4e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5f4e('0x6'));var config=require(_0x5f4e('0x7'));var controller=require(_0x5f4e('0x8'));router[_0x5f4e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5f4e('0xa'),auth['isAuthenticated'](),controller[_0x5f4e('0xb')]);router[_0x5f4e('0x9')](_0x5f4e('0xc'),auth[_0x5f4e('0xd')](),controller[_0x5f4e('0xe')]);router[_0x5f4e('0xf')]('/',auth[_0x5f4e('0xd')](),controller[_0x5f4e('0x10')]);router[_0x5f4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5f4e('0x12')]);router['delete'](_0x5f4e('0xc'),auth['isAuthenticated'](),controller[_0x5f4e('0x13')]);module[_0x5f4e('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 4e77896..4134742 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 _0xf2e4=['mouseOver','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x1789f3,_0x4672f3){var _0x59f242=function(_0x3e263d){while(--_0x3e263d){_0x1789f3['push'](_0x1789f3['shift']());}};_0x59f242(++_0x4672f3);}(_0xf2e4,0xc8));var _0x4f2e=function(_0x358968,_0x523037){_0x358968=_0x358968-0x0;var _0x4f58d2=_0xf2e4[_0x358968];return _0x4f58d2;};'use strict';var Sequelize=require(_0x4f2e('0x0'));module[_0x4f2e('0x1')]={'name':{'type':Sequelize[_0x4f2e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4f2e('0x3')](_0x4f2e('0x4'),'timeout'),'defaultValue':_0x4f2e('0x4')},'selector':{'type':Sequelize[_0x4f2e('0x2')]},'timeout':{'type':Sequelize[_0x4f2e('0x5')]}};
\ No newline at end of file
+var _0x4667=['timeout','mouseOver','STRING','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4667,0x1ba));var _0x7466=function(_0x89aedf,_0x3f9fe3){_0x89aedf=_0x89aedf-0x0;var _0x53e5cb=_0x4667[_0x89aedf];return _0x53e5cb;};'use strict';var Sequelize=require(_0x7466('0x0'));module[_0x7466('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x7466('0x2')),'defaultValue':_0x7466('0x3')},'selector':{'type':Sequelize[_0x7466('0x4')]},'timeout':{'type':Sequelize[_0x7466('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index c26daf3..96ea8b7 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 _0x0a9f=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','rawAttributes','query','keys','filters','model','intersection','fields','attributes','include','merge','options','ChatProactiveAction','find','catch','create','body','params','rimraf','zip-dir','moment','mustache','ejs','fs-extra','squel','jsforce','desk.js','querystring'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x0a9f,0x64));var _0xf0a9=function(_0x24c178,_0x2e588b){_0x24c178=_0x24c178-0x0;var _0x35a2d8=_0x0a9f[_0x24c178];return _0x35a2d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0a9('0x0'));var zipdir=require(_0xf0a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0a9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf0a9('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf0a9('0x4'));var fs=require('fs');var fs_extra=require(_0xf0a9('0x5'));var _=require('lodash');var squel=require(_0xf0a9('0x6'));var crypto=require('crypto');var jsforce=require(_0xf0a9('0x7'));var deskjs=require(_0xf0a9('0x8'));var toCsv=require('to-csv');var querystring=require(_0xf0a9('0x9'));var Papa=require(_0xf0a9('0xa'));var Redis=require(_0xf0a9('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xf0a9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0a9('0xd'));var logger=require(_0xf0a9('0xe'))(_0xf0a9('0xf'));var utils=require(_0xf0a9('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xf0a9('0x11'));var db=require(_0xf0a9('0x12'))['db'];function respondWithStatusCode(_0x6a469e,_0xde853){_0xde853=_0xde853||0xcc;return function(_0x4c8877){if(_0x4c8877){return _0x6a469e['sendStatus'](_0xde853);}return _0x6a469e[_0xf0a9('0x13')](_0xde853)[_0xf0a9('0x14')]();};}function respondWithResult(_0xe27d7e,_0x24c3c9){_0x24c3c9=_0x24c3c9||0xc8;return function(_0x437a3b){if(_0x437a3b){return _0xe27d7e[_0xf0a9('0x13')](_0x24c3c9)[_0xf0a9('0x15')](_0x437a3b);}};}function respondWithFilteredResult(_0x48cffd,_0x18e6ce){return function(_0x4bb2f2){if(_0x4bb2f2){var _0x373ba8=typeof _0x18e6ce['offset']===_0xf0a9('0x16')&&typeof _0x18e6ce['limit']===_0xf0a9('0x16');var _0x43b7f3=_0x4bb2f2[_0xf0a9('0x17')];var _0xf9f800=_0x373ba8?0x0:_0x18e6ce[_0xf0a9('0x18')];var _0x37ddab=_0x373ba8?_0x4bb2f2[_0xf0a9('0x17')]:_0x18e6ce[_0xf0a9('0x18')]+_0x18e6ce[_0xf0a9('0x19')];var _0x4ecb10;if(_0x37ddab>=_0x43b7f3){_0x37ddab=_0x43b7f3;_0x4ecb10=0xc8;}else{_0x4ecb10=0xce;}_0x48cffd[_0xf0a9('0x13')](_0x4ecb10);return _0x48cffd[_0xf0a9('0x1a')](_0xf0a9('0x1b'),_0xf9f800+'-'+_0x37ddab+'/'+_0x43b7f3)['json'](_0x4bb2f2);}return null;};}function patchUpdates(_0x42e7f3){return function(_0x5c26c1){try{jsonpatch[_0xf0a9('0x1c')](_0x5c26c1,_0x42e7f3,!![]);}catch(_0x2f57e7){return BPromise['reject'](_0x2f57e7);}return _0x5c26c1[_0xf0a9('0x1d')]();};}function saveUpdates(_0x1707c2,_0xad2291){return function(_0x52b3cf){if(_0x52b3cf){return _0x52b3cf[_0xf0a9('0x1e')](_0x1707c2)[_0xf0a9('0x1f')](function(_0x132203){return _0x132203;});}return null;};}function removeEntity(_0x453307,_0x3f1013){return function(_0x41c958){if(_0x41c958){return _0x41c958[_0xf0a9('0x20')]()['then'](function(){_0x453307['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f39a3,_0x23ed63){return function(_0x1064cf){if(!_0x1064cf){_0x3f39a3['sendStatus'](0x194);}return _0x1064cf;};}function handleError(_0x3b1377,_0x12133f){_0x12133f=_0x12133f||0x1f4;return function(_0x1d93d2){logger[_0xf0a9('0x21')](_0x1d93d2[_0xf0a9('0x22')]);if(_0x1d93d2[_0xf0a9('0x23')]){delete _0x1d93d2['name'];}_0x3b1377[_0xf0a9('0x13')](_0x12133f)[_0xf0a9('0x24')](_0x1d93d2);};}exports[_0xf0a9('0x25')]=function(_0x1f24a2,_0x153a4e){var _0x4834e0={'raw':!![],'where':{'id':_0x1f24a2['params']['id']}},_0x1c2fef={};_0x1c2fef['model']=_['keys'](db['ChatProactiveAction'][_0xf0a9('0x26')]);_0x1c2fef[_0xf0a9('0x27')]=_[_0xf0a9('0x28')](_0x1f24a2['query']);_0x1c2fef[_0xf0a9('0x29')]=_['intersection'](_0x1c2fef[_0xf0a9('0x2a')],_0x1c2fef[_0xf0a9('0x27')]);_0x4834e0['attributes']=_[_0xf0a9('0x2b')](_0x1c2fef[_0xf0a9('0x2a')],qs[_0xf0a9('0x2c')](_0x1f24a2[_0xf0a9('0x27')][_0xf0a9('0x2c')]));_0x4834e0[_0xf0a9('0x2d')]=_0x4834e0['attributes']['length']?_0x4834e0['attributes']:_0x1c2fef['model'];if(_0x1f24a2[_0xf0a9('0x27')]['includeAll']){_0x4834e0[_0xf0a9('0x2e')]=[{'all':!![]}];}_0x4834e0=_[_0xf0a9('0x2f')]({},_0x4834e0,_0x1f24a2[_0xf0a9('0x30')]);return db[_0xf0a9('0x31')][_0xf0a9('0x32')](_0x4834e0)['then'](handleEntityNotFound(_0x153a4e,null))[_0xf0a9('0x1f')](respondWithResult(_0x153a4e,null))[_0xf0a9('0x33')](handleError(_0x153a4e,null));};exports[_0xf0a9('0x34')]=function(_0x573d27,_0x19e297){return db['ChatProactiveAction'][_0xf0a9('0x34')](_0x573d27[_0xf0a9('0x35')],{})[_0xf0a9('0x1f')](respondWithResult(_0x19e297,0xc9))[_0xf0a9('0x33')](handleError(_0x19e297,null));};exports[_0xf0a9('0x1e')]=function(_0x12e4ba,_0x538ebe){if(_0x12e4ba[_0xf0a9('0x35')]['id']){delete _0x12e4ba['body']['id'];}return db[_0xf0a9('0x31')][_0xf0a9('0x32')]({'where':{'id':_0x12e4ba[_0xf0a9('0x36')]['id']}})[_0xf0a9('0x1f')](handleEntityNotFound(_0x538ebe,null))[_0xf0a9('0x1f')](saveUpdates(_0x12e4ba[_0xf0a9('0x35')],null))[_0xf0a9('0x1f')](respondWithResult(_0x538ebe,null))[_0xf0a9('0x33')](handleError(_0x538ebe,null));};exports['destroy']=function(_0x5826c2,_0x42c072){return db['ChatProactiveAction'][_0xf0a9('0x32')]({'where':{'id':_0x5826c2[_0xf0a9('0x36')]['id']}})[_0xf0a9('0x1f')](handleEntityNotFound(_0x42c072,null))['then'](removeEntity(_0x42c072,null))[_0xf0a9('0x33')](handleError(_0x42c072,null));};
\ No newline at end of file
+var _0x4f29=['includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length'];(function(_0x314dff,_0x13a2ad){var _0x4fa92c=function(_0xa14f02){while(--_0xa14f02){_0x314dff['push'](_0x314dff['shift']());}};_0x4fa92c(++_0x13a2ad);}(_0x4f29,0xfd));var _0x94f2=function(_0xd9c0ae,_0x247de7){_0xd9c0ae=_0xd9c0ae-0x0;var _0xa161fd=_0x4f29[_0xd9c0ae];return _0xa161fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94f2('0x0'));var zipdir=require(_0x94f2('0x1'));var jsonpatch=require(_0x94f2('0x2'));var rp=require(_0x94f2('0x3'));var moment=require(_0x94f2('0x4'));var BPromise=require(_0x94f2('0x5'));var Mustache=require(_0x94f2('0x6'));var util=require(_0x94f2('0x7'));var path=require(_0x94f2('0x8'));var sox=require(_0x94f2('0x9'));var csv=require(_0x94f2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94f2('0xb'));var squel=require(_0x94f2('0xc'));var crypto=require(_0x94f2('0xd'));var jsforce=require(_0x94f2('0xe'));var deskjs=require(_0x94f2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x94f2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x94f2('0x11'));var as=require(_0x94f2('0x12'));var hardwareService=require(_0x94f2('0x13'));var logger=require(_0x94f2('0x14'))('api');var utils=require(_0x94f2('0x15'));var config=require(_0x94f2('0x16'));var licenseUtil=require(_0x94f2('0x17'));var db=require(_0x94f2('0x18'))['db'];function respondWithStatusCode(_0xda205f,_0x376b04){_0x376b04=_0x376b04||0xcc;return function(_0x39a8c5){if(_0x39a8c5){return _0xda205f['sendStatus'](_0x376b04);}return _0xda205f[_0x94f2('0x19')](_0x376b04)['end']();};}function respondWithResult(_0x1f84c3,_0x7a3dc0){_0x7a3dc0=_0x7a3dc0||0xc8;return function(_0x47440c){if(_0x47440c){return _0x1f84c3['status'](_0x7a3dc0)['json'](_0x47440c);}};}function respondWithFilteredResult(_0x292953,_0x1ae29d){return function(_0x28d8a7){if(_0x28d8a7){var _0x5db427=typeof _0x1ae29d[_0x94f2('0x1a')]===_0x94f2('0x1b')&&typeof _0x1ae29d['limit']==='undefined';var _0x423aa8=_0x28d8a7[_0x94f2('0x1c')];var _0x32100c=_0x5db427?0x0:_0x1ae29d['offset'];var _0x302c00=_0x5db427?_0x28d8a7[_0x94f2('0x1c')]:_0x1ae29d[_0x94f2('0x1a')]+_0x1ae29d[_0x94f2('0x1d')];var _0x4ceba8;if(_0x302c00>=_0x423aa8){_0x302c00=_0x423aa8;_0x4ceba8=0xc8;}else{_0x4ceba8=0xce;}_0x292953[_0x94f2('0x19')](_0x4ceba8);return _0x292953[_0x94f2('0x1e')]('Content-Range',_0x32100c+'-'+_0x302c00+'/'+_0x423aa8)[_0x94f2('0x1f')](_0x28d8a7);}return null;};}function patchUpdates(_0x25bd7f){return function(_0x238983){try{jsonpatch[_0x94f2('0x20')](_0x238983,_0x25bd7f,!![]);}catch(_0x6858ba){return BPromise[_0x94f2('0x21')](_0x6858ba);}return _0x238983[_0x94f2('0x22')]();};}function saveUpdates(_0x45adbb,_0x3da505){return function(_0xed0b88){if(_0xed0b88){return _0xed0b88[_0x94f2('0x23')](_0x45adbb)[_0x94f2('0x24')](function(_0x34f7a3){return _0x34f7a3;});}return null;};}function removeEntity(_0x35b31d,_0x5057ef){return function(_0x4fec54){if(_0x4fec54){return _0x4fec54[_0x94f2('0x25')]()['then'](function(){_0x35b31d[_0x94f2('0x19')](0xcc)[_0x94f2('0x26')]();});}};}function handleEntityNotFound(_0x5955ce,_0x5f1a6a){return function(_0x497291){if(!_0x497291){_0x5955ce['sendStatus'](0x194);}return _0x497291;};}function handleError(_0x4b0cee,_0x2792bc){_0x2792bc=_0x2792bc||0x1f4;return function(_0x1252eb){logger[_0x94f2('0x27')](_0x1252eb[_0x94f2('0x28')]);if(_0x1252eb[_0x94f2('0x29')]){delete _0x1252eb['name'];}_0x4b0cee[_0x94f2('0x19')](_0x2792bc)['send'](_0x1252eb);};}exports[_0x94f2('0x2a')]=function(_0xd5b804,_0x274659){var _0x2c6463={'raw':!![],'where':{'id':_0xd5b804[_0x94f2('0x2b')]['id']}},_0x361920={};_0x361920[_0x94f2('0x2c')]=_[_0x94f2('0x2d')](db['ChatProactiveAction'][_0x94f2('0x2e')]);_0x361920[_0x94f2('0x2f')]=_[_0x94f2('0x2d')](_0xd5b804[_0x94f2('0x2f')]);_0x361920['filters']=_[_0x94f2('0x30')](_0x361920['model'],_0x361920[_0x94f2('0x2f')]);_0x2c6463[_0x94f2('0x31')]=_[_0x94f2('0x30')](_0x361920['model'],qs[_0x94f2('0x32')](_0xd5b804[_0x94f2('0x2f')][_0x94f2('0x32')]));_0x2c6463[_0x94f2('0x31')]=_0x2c6463[_0x94f2('0x31')][_0x94f2('0x33')]?_0x2c6463[_0x94f2('0x31')]:_0x361920[_0x94f2('0x2c')];if(_0xd5b804['query'][_0x94f2('0x34')]){_0x2c6463[_0x94f2('0x35')]=[{'all':!![]}];}_0x2c6463=_[_0x94f2('0x36')]({},_0x2c6463,_0xd5b804[_0x94f2('0x37')]);return db[_0x94f2('0x38')][_0x94f2('0x39')](_0x2c6463)['then'](handleEntityNotFound(_0x274659,null))[_0x94f2('0x24')](respondWithResult(_0x274659,null))[_0x94f2('0x3a')](handleError(_0x274659,null));};exports[_0x94f2('0x3b')]=function(_0x19c378,_0x206bbd){return db[_0x94f2('0x38')][_0x94f2('0x3b')](_0x19c378[_0x94f2('0x3c')],{})[_0x94f2('0x24')](respondWithResult(_0x206bbd,0xc9))['catch'](handleError(_0x206bbd,null));};exports[_0x94f2('0x23')]=function(_0x568dce,_0x2822b5){if(_0x568dce[_0x94f2('0x3c')]['id']){delete _0x568dce['body']['id'];}return db[_0x94f2('0x38')][_0x94f2('0x39')]({'where':{'id':_0x568dce[_0x94f2('0x2b')]['id']}})[_0x94f2('0x24')](handleEntityNotFound(_0x2822b5,null))[_0x94f2('0x24')](saveUpdates(_0x568dce[_0x94f2('0x3c')],null))[_0x94f2('0x24')](respondWithResult(_0x2822b5,null))[_0x94f2('0x3a')](handleError(_0x2822b5,null));};exports['destroy']=function(_0x64055e,_0x5130db){return db['ChatProactiveAction'][_0x94f2('0x39')]({'where':{'id':_0x64055e['params']['id']}})[_0x94f2('0x24')](handleEntityNotFound(_0x5130db,null))['then'](removeEntity(_0x5130db,null))['catch'](handleError(_0x5130db,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 505bfbb..1aeeb22 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 _0xd178=['./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x4f5535,_0x517bac){var _0x4e3d4b=function(_0x11133e){while(--_0x11133e){_0x4f5535['push'](_0x4f5535['shift']());}};_0x4e3d4b(++_0x517bac);}(_0xd178,0xbf));var _0x8d17=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xd178[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x8d17('0x0'));var util=require(_0x8d17('0x1'));var logger=require('../../config/logger')(_0x8d17('0x2'));var moment=require(_0x8d17('0x3'));var BPromise=require(_0x8d17('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d17('0x5'));var rimraf=require('rimraf');var config=require(_0x8d17('0x6'));var attributes=require(_0x8d17('0x7'));module[_0x8d17('0x8')]=function(_0x484fa0,_0x29f509){return _0x484fa0[_0x8d17('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x8d17('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b82=['api','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util'];(function(_0x2520f9,_0x14310d){var _0x431455=function(_0xdb60dd){while(--_0xdb60dd){_0x2520f9['push'](_0x2520f9['shift']());}};_0x431455(++_0x14310d);}(_0x4b82,0x169));var _0x24b8=function(_0x2f21c6,_0x51de35){_0x2f21c6=_0x2f21c6-0x0;var _0x32cbd5=_0x4b82[_0x2f21c6];return _0x32cbd5;};'use strict';var _=require(_0x24b8('0x0'));var util=require(_0x24b8('0x1'));var logger=require('../../config/logger')(_0x24b8('0x2'));var moment=require('moment');var BPromise=require(_0x24b8('0x3'));var rp=require(_0x24b8('0x4'));var fs=require('fs');var path=require(_0x24b8('0x5'));var rimraf=require(_0x24b8('0x6'));var config=require('../../config/environment');var attributes=require(_0x24b8('0x7'));module[_0x24b8('0x8')]=function(_0x3d2073,_0x34b886){return _0x3d2073[_0x24b8('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x24b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index b3eff47..1df9d5d 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 _0x7134=['lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4b91c4,_0x2d0a87){var _0x18e187=function(_0x4d71dc){while(--_0x4d71dc){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x18e187(++_0x2d0a87);}(_0x7134,0x85));var _0x4713=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7134[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4713('0x0'));var util=require(_0x4713('0x1'));var moment=require(_0x4713('0x2'));var BPromise=require('bluebird');var rs=require(_0x4713('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4713('0x4'))(_0x4713('0x5'));var config=require(_0x4713('0x6'));var jayson=require(_0x4713('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a219a,_0x444c5d,_0x54a842){return new BPromise(function(_0x505886,_0x37d58c){return client[_0x4713('0x8')](_0x5a219a,_0x54a842)['then'](function(_0x1482c0){logger[_0x4713('0x9')](_0x4713('0xa'),_0x444c5d,_0x4713('0xb'));logger[_0x4713('0xc')](_0x4713('0xd'),_0x444c5d,_0x4713('0xb'),JSON[_0x4713('0xe')](_0x1482c0));if(_0x1482c0[_0x4713('0xf')]){if(_0x1482c0['error'][_0x4713('0x10')]===0x1f4){logger[_0x4713('0xf')](_0x4713('0xa'),_0x444c5d,_0x1482c0['error'][_0x4713('0x11')]);return _0x37d58c(_0x1482c0[_0x4713('0xf')]['message']);}logger[_0x4713('0xf')](_0x4713('0xa'),_0x444c5d,_0x1482c0['error'][_0x4713('0x11')]);return _0x505886(_0x1482c0[_0x4713('0xf')][_0x4713('0x11')]);}else{logger[_0x4713('0x9')](_0x4713('0xa'),_0x444c5d,_0x4713('0xb'));_0x505886(_0x1482c0['result'][_0x4713('0x11')]);}})[_0x4713('0x12')](function(_0x4b9df2){logger['error'](_0x4713('0xa'),_0x444c5d,_0x4b9df2);_0x37d58c(_0x4b9df2);});});}
\ No newline at end of file
+var _0xe4bb=['../../config/utils','rpc','../../config/environment','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe4bb,0x8f));var _0xbe4b=function(_0x50305c,_0xaab63c){_0x50305c=_0x50305c-0x0;var _0x50f058=_0xe4bb[_0x50305c];return _0x50f058;};'use strict';var _=require('lodash');var util=require(_0xbe4b('0x0'));var moment=require('moment');var BPromise=require(_0xbe4b('0x1'));var rs=require(_0xbe4b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe4b('0x3'))['db'];var utils=require(_0xbe4b('0x4'));var logger=require('../../config/logger')(_0xbe4b('0x5'));var config=require(_0xbe4b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbe4b('0x7')][_0xbe4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21691b,_0x50c96d,_0x198c69){return new BPromise(function(_0x1439b9,_0x44d4b8){return client[_0xbe4b('0x9')](_0x21691b,_0x198c69)[_0xbe4b('0xa')](function(_0x338a69){logger['info'](_0xbe4b('0xb'),_0x50c96d,_0xbe4b('0xc'));logger[_0xbe4b('0xd')](_0xbe4b('0xe'),_0x50c96d,'request\x20sent',JSON['stringify'](_0x338a69));if(_0x338a69[_0xbe4b('0xf')]){if(_0x338a69['error'][_0xbe4b('0x10')]===0x1f4){logger[_0xbe4b('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x50c96d,_0x338a69[_0xbe4b('0xf')][_0xbe4b('0x11')]);return _0x44d4b8(_0x338a69[_0xbe4b('0xf')][_0xbe4b('0x11')]);}logger['error'](_0xbe4b('0xb'),_0x50c96d,_0x338a69[_0xbe4b('0xf')][_0xbe4b('0x11')]);return _0x1439b9(_0x338a69[_0xbe4b('0xf')]['message']);}else{logger[_0xbe4b('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x50c96d,_0xbe4b('0xc'));_0x1439b9(_0x338a69[_0xbe4b('0x13')][_0xbe4b('0x11')]);}})[_0xbe4b('0x14')](function(_0x23ca37){logger['error'](_0xbe4b('0xb'),_0x50c96d,_0x23ca37);_0x44d4b8(_0x23ca37);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 2f45ae4..b117189 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 _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x250ce7,_0x502ad3){var _0x416428=function(_0x46564d){while(--_0x46564d){_0x250ce7['push'](_0x250ce7['shift']());}};_0x416428(++_0x502ad3);}(_0x7da7,0x10d));var _0x77da=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x7da7[_0x6ca7f4];return _0x494fa6;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
+var _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x45d80c,_0x35c0ff){var _0x449a98=function(_0x1b5ab7){while(--_0x1b5ab7){_0x45d80c['push'](_0x45d80c['shift']());}};_0x449a98(++_0x35c0ff);}(_0x31f0,0xb7));var _0x031f=function(_0x199c61,_0xa5681){_0x199c61=_0x199c61-0x0;var _0x196766=_0x31f0[_0x199c61];return _0x196766;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x031f('0x8')]);router['post']('/',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0xb')](_0x031f('0xc'),auth['isAuthenticated'](),controller[_0x031f('0xd')]);router[_0x031f('0xe')](_0x031f('0xc'),auth[_0x031f('0x9')](),controller[_0x031f('0xf')]);module[_0x031f('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 207e19d..ec8fa9b 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 _0x5738=['STRING','name','INTEGER','rrmemory','roundrobin'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5738,0x91));var _0x8573=function(_0x1aed01,_0x3b59f3){_0x1aed01=_0x1aed01-0x0;var _0x34ccb8=_0x5738[_0x1aed01];return _0x34ccb8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8573('0x0')],'unique':_0x8573('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8573('0x0')]},'timeout':{'type':Sequelize[_0x8573('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8573('0x3'),'beepall',_0x8573('0x4'))}};
\ No newline at end of file
+var _0x7c5f=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2c0a00,_0x3548e4){var _0x119901=function(_0x2a3f40){while(--_0x2a3f40){_0x2c0a00['push'](_0x2c0a00['shift']());}};_0x119901(++_0x3548e4);}(_0x7c5f,0x1e8));var _0xf7c5=function(_0x5e0c66,_0x12ca8e){_0x5e0c66=_0x5e0c66-0x0;var _0x223c99=_0x7c5f[_0x5e0c66];return _0x223c99;};'use strict';var Sequelize=require(_0xf7c5('0x0'));module[_0xf7c5('0x1')]={'name':{'type':Sequelize[_0xf7c5('0x2')],'unique':_0xf7c5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf7c5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf7c5('0x5')](_0xf7c5('0x6'),_0xf7c5('0x7'),_0xf7c5('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 06ce054..57b1a8a 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 _0x324b=['jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','destroy','UserProfileResource','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','ChatQueue','includeAll','include','rows','show','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','getTeams','Team','addTeams','findAll','User','Agents','online','voicePause','interface','sequelize','each','findOrCreate','emit','removeTeams','ids','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','value','transaction','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket'];(function(_0x4a5c92,_0x23dfae){var _0x561e54=function(_0x3bf38c){while(--_0x3bf38c){_0x4a5c92['push'](_0x4a5c92['shift']());}};_0x561e54(++_0x23dfae);}(_0x324b,0x1a5));var _0xb324=function(_0x2c936a,_0x3e3797){_0x2c936a=_0x2c936a-0x0;var _0x53caa0=_0x324b[_0x2c936a];return _0x53caa0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb324('0x0'));var zipdir=require(_0xb324('0x1'));var jsonpatch=require(_0xb324('0x2'));var rp=require(_0xb324('0x3'));var moment=require(_0xb324('0x4'));var BPromise=require(_0xb324('0x5'));var Mustache=require(_0xb324('0x6'));var util=require(_0xb324('0x7'));var path=require('path');var sox=require(_0xb324('0x8'));var csv=require(_0xb324('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb324('0xa'));var _=require('lodash');var squel=require(_0xb324('0xb'));var crypto=require(_0xb324('0xc'));var jsforce=require(_0xb324('0xd'));var deskjs=require(_0xb324('0xe'));var toCsv=require(_0xb324('0x9'));var querystring=require(_0xb324('0xf'));var Papa=require(_0xb324('0x10'));var Redis=require(_0xb324('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb324('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb324('0x13'));var logger=require(_0xb324('0x14'))(_0xb324('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb324('0x16'));var db=require(_0xb324('0x17'))['db'];config[_0xb324('0x18')]=_[_0xb324('0x19')](config[_0xb324('0x18')],{'host':_0xb324('0x1a'),'port':0x18eb});var socket=require(_0xb324('0x1b'))(new Redis(config[_0xb324('0x18')]));require(_0xb324('0x1c'))['register'](socket);var jayson=require(_0xb324('0x1d'));var client=jayson[_0xb324('0x1e')][_0xb324('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x44b819,_0x2c55cd,_0x480793,_0x3bb4c0){return new BPromise(function(_0x90c78f,_0x4e7adf){var _0x3ecf6d=_0x3bb4c0||client;return _0x3ecf6d[_0xb324('0x20')](_0x44b819,_0x480793)[_0xb324('0x21')](function(_0x164486){logger['info'](_0xb324('0x22'),_0x2c55cd,_0xb324('0x23'));logger[_0xb324('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2c55cd,_0xb324('0x23'),JSON[_0xb324('0x25')](_0x164486));if(_0x164486[_0xb324('0x26')]){if(_0x164486[_0xb324('0x26')][_0xb324('0x27')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2c55cd,_0x164486['error'][_0xb324('0x28')]);return _0x4e7adf(_0x164486['error'][_0xb324('0x28')]);}logger[_0xb324('0x26')](_0xb324('0x22'),_0x2c55cd,_0x164486[_0xb324('0x26')]['message']);return _0x90c78f(_0x164486[_0xb324('0x26')]['message']);}else{logger[_0xb324('0x29')](_0xb324('0x22'),_0x2c55cd,_0xb324('0x23'));_0x90c78f(_0x164486[_0xb324('0x2a')][_0xb324('0x28')]);}})[_0xb324('0x2b')](function(_0x48ed1b){logger[_0xb324('0x26')](_0xb324('0x22'),_0x2c55cd,_0x48ed1b);_0x4e7adf(_0x48ed1b);});});}function respondWithStatusCode(_0x48703f,_0x45f107){_0x45f107=_0x45f107||0xcc;return function(_0x43bd50){if(_0x43bd50){return _0x48703f[_0xb324('0x2c')](_0x45f107);}return _0x48703f[_0xb324('0x2d')](_0x45f107)[_0xb324('0x2e')]();};}function respondWithResult(_0x56d28b,_0x43510b){_0x43510b=_0x43510b||0xc8;return function(_0x25162e){if(_0x25162e){return _0x56d28b[_0xb324('0x2d')](_0x43510b)[_0xb324('0x2f')](_0x25162e);}};}function respondWithFilteredResult(_0x1b6062,_0x2091c6){return function(_0x35f2b5){if(_0x35f2b5){var _0xd9df48=typeof _0x2091c6[_0xb324('0x30')]==='undefined'&&typeof _0x2091c6['limit']===_0xb324('0x31');var _0x187087=_0x35f2b5[_0xb324('0x32')];var _0x233e1c=_0xd9df48?0x0:_0x2091c6[_0xb324('0x30')];var _0x214fb1=_0xd9df48?_0x35f2b5['count']:_0x2091c6[_0xb324('0x30')]+_0x2091c6[_0xb324('0x33')];var _0x5c3b5a;if(_0x214fb1>=_0x187087){_0x214fb1=_0x187087;_0x5c3b5a=0xc8;}else{_0x5c3b5a=0xce;}_0x1b6062[_0xb324('0x2d')](_0x5c3b5a);return _0x1b6062['set'](_0xb324('0x34'),_0x233e1c+'-'+_0x214fb1+'/'+_0x187087)[_0xb324('0x2f')](_0x35f2b5);}return null;};}function patchUpdates(_0x4ae187){return function(_0x51464a){try{jsonpatch['apply'](_0x51464a,_0x4ae187,!![]);}catch(_0x1efffc){return BPromise['reject'](_0x1efffc);}return _0x51464a[_0xb324('0x35')]();};}function saveUpdates(_0xa6629e,_0x327527){return function(_0x2aa3d5){if(_0x2aa3d5){return _0x2aa3d5['update'](_0xa6629e)['then'](function(_0x427c86){return _0x427c86;});}return null;};}function removeEntity(_0x24c9c4,_0x528cab){return function(_0x4e10e1){if(_0x4e10e1){return _0x4e10e1[_0xb324('0x36')]()[_0xb324('0x21')](function(){var _0x3e1f36=_0x4e10e1['get']({'plain':!![]});var _0x25b375='ChatQueues';return db[_0xb324('0x37')][_0xb324('0x36')]({'where':{'type':_0x25b375,'resourceId':_0x3e1f36['id']}})[_0xb324('0x21')](function(){return _0x4e10e1;});})[_0xb324('0x21')](function(){_0x24c9c4[_0xb324('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6734,_0x1bac2e){return function(_0x17e2be){if(!_0x17e2be){_0x2c6734[_0xb324('0x2c')](0x194);}return _0x17e2be;};}function handleError(_0x2b0822,_0x3d9705){_0x3d9705=_0x3d9705||0x1f4;return function(_0xb08ee7){logger['error'](_0xb08ee7[_0xb324('0x38')]);if(_0xb08ee7['name']){delete _0xb08ee7['name'];}_0x2b0822[_0xb324('0x2d')](_0x3d9705)[_0xb324('0x39')](_0xb08ee7);};}exports[_0xb324('0x3a')]=function(_0x549228,_0x1ec8f4){var _0x4876f1={},_0x4c4923={},_0x15f298={'count':0x0,'rows':[]};var _0x57d925=_[_0xb324('0x3b')](db['ChatQueue'][_0xb324('0x3c')],function(_0x1c1467){return{'name':_0x1c1467[_0xb324('0x3d')],'type':_0x1c1467[_0xb324('0x3e')][_0xb324('0x3f')]};});_0x4c4923[_0xb324('0x40')]=_[_0xb324('0x3b')](_0x57d925,_0xb324('0x41'));_0x4c4923['query']=_[_0xb324('0x42')](_0x549228[_0xb324('0x43')]);_0x4c4923[_0xb324('0x44')]=_[_0xb324('0x45')](_0x4c4923[_0xb324('0x40')],_0x4c4923[_0xb324('0x43')]);_0x4876f1[_0xb324('0x46')]=_[_0xb324('0x45')](_0x4c4923[_0xb324('0x40')],qs[_0xb324('0x47')](_0x549228['query'][_0xb324('0x47')]));_0x4876f1[_0xb324('0x46')]=_0x4876f1[_0xb324('0x46')][_0xb324('0x48')]?_0x4876f1[_0xb324('0x46')]:_0x4c4923[_0xb324('0x40')];if(!_0x549228[_0xb324('0x43')]['hasOwnProperty'](_0xb324('0x49'))){_0x4876f1[_0xb324('0x33')]=qs['limit'](_0x549228[_0xb324('0x43')][_0xb324('0x33')]);_0x4876f1['offset']=qs[_0xb324('0x30')](_0x549228[_0xb324('0x43')][_0xb324('0x30')]);}_0x4876f1[_0xb324('0x4a')]=qs[_0xb324('0x4b')](_0x549228[_0xb324('0x43')][_0xb324('0x4b')]);_0x4876f1[_0xb324('0x4c')]=qs['filters'](_[_0xb324('0x4d')](_0x549228[_0xb324('0x43')],_0x4c4923[_0xb324('0x44')]),_0x57d925);if(_0x549228[_0xb324('0x43')][_0xb324('0x4e')]){_0x4876f1[_0xb324('0x4c')]=_[_0xb324('0x4f')](_0x4876f1[_0xb324('0x4c')],{'$or':_[_0xb324('0x3b')](_0x57d925,function(_0x525657){if(_0x525657['type']!=='VIRTUAL'){var _0x1b29e8={};_0x1b29e8[_0x525657['name']]={'$like':'%'+_0x549228['query'][_0xb324('0x4e')]+'%'};return _0x1b29e8;}})});}_0x4876f1=_['merge']({},_0x4876f1,_0x549228['options']);var _0xbf3221={'where':_0x4876f1[_0xb324('0x4c')]};return db[_0xb324('0x50')]['count'](_0xbf3221)[_0xb324('0x21')](function(_0x2ef424){_0x15f298[_0xb324('0x32')]=_0x2ef424;if(_0x549228['query'][_0xb324('0x51')]){_0x4876f1[_0xb324('0x52')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x4876f1);})[_0xb324('0x21')](function(_0x4d593c){_0x15f298[_0xb324('0x53')]=_0x4d593c;return _0x15f298;})[_0xb324('0x21')](respondWithFilteredResult(_0x1ec8f4,_0x4876f1))[_0xb324('0x2b')](handleError(_0x1ec8f4,null));};exports[_0xb324('0x54')]=function(_0x1b9f84,_0xe559b0){var _0x5d1272={'raw':!![],'where':{'id':_0x1b9f84[_0xb324('0x55')]['id']}},_0x1fdf65={};_0x1fdf65[_0xb324('0x40')]=_[_0xb324('0x42')](db['ChatQueue'][_0xb324('0x3c')]);_0x1fdf65[_0xb324('0x43')]=_['keys'](_0x1b9f84[_0xb324('0x43')]);_0x1fdf65['filters']=_['intersection'](_0x1fdf65[_0xb324('0x40')],_0x1fdf65[_0xb324('0x43')]);_0x5d1272[_0xb324('0x46')]=_[_0xb324('0x45')](_0x1fdf65[_0xb324('0x40')],qs[_0xb324('0x47')](_0x1b9f84['query'][_0xb324('0x47')]));_0x5d1272[_0xb324('0x46')]=_0x5d1272[_0xb324('0x46')][_0xb324('0x48')]?_0x5d1272[_0xb324('0x46')]:_0x1fdf65['model'];if(_0x1b9f84[_0xb324('0x43')][_0xb324('0x51')]){_0x5d1272['include']=[{'all':!![]}];}_0x5d1272=_[_0xb324('0x4f')]({},_0x5d1272,_0x1b9f84[_0xb324('0x56')]);return db[_0xb324('0x50')][_0xb324('0x57')](_0x5d1272)[_0xb324('0x21')](handleEntityNotFound(_0xe559b0,null))[_0xb324('0x21')](respondWithResult(_0xe559b0,null))[_0xb324('0x2b')](handleError(_0xe559b0,null));};exports[_0xb324('0x58')]=function(_0x5e16ac,_0x2272ab){return db[_0xb324('0x50')][_0xb324('0x58')](_0x5e16ac['body'],{})[_0xb324('0x21')](function(_0xd12e9c){var _0x4ee45e=_0x5e16ac[_0xb324('0x59')][_0xb324('0x5a')]({'plain':!![]});if(!_0x4ee45e)throw new Error(_0xb324('0x5b'));if(_0x4ee45e['role']===_0xb324('0x59')){var _0x33842a=_0xd12e9c[_0xb324('0x5a')]({'plain':!![]});var _0x1dca3b=_0xb324('0x5c');return db[_0xb324('0x5d')][_0xb324('0x57')]({'where':{'name':_0x1dca3b,'userProfileId':_0x4ee45e[_0xb324('0x5e')]},'raw':!![]})[_0xb324('0x21')](function(_0x3d17bb){if(_0x3d17bb&&_0x3d17bb['autoAssociation']===0x0){return db[_0xb324('0x37')][_0xb324('0x58')]({'name':_0x33842a['name'],'resourceId':_0x33842a['id'],'type':_0x3d17bb[_0xb324('0x41')],'sectionId':_0x3d17bb['id']},{})[_0xb324('0x21')](function(){return _0xd12e9c;});}else{return _0xd12e9c;}})[_0xb324('0x2b')](function(_0x561f0d){logger['error'](_0xb324('0x5f'),_0x561f0d);throw _0x561f0d;});}return _0xd12e9c;})[_0xb324('0x21')](respondWithResult(_0x2272ab,0xc9))[_0xb324('0x2b')](handleError(_0x2272ab,null));};exports['update']=function(_0x3f726d,_0x821c6e){if(_0x3f726d[_0xb324('0x60')]['id']){delete _0x3f726d[_0xb324('0x60')]['id'];}return db[_0xb324('0x50')]['find']({'where':{'id':_0x3f726d['params']['id']}})['then'](handleEntityNotFound(_0x821c6e,null))[_0xb324('0x21')](saveUpdates(_0x3f726d[_0xb324('0x60')],null))[_0xb324('0x21')](respondWithResult(_0x821c6e,null))[_0xb324('0x2b')](handleError(_0x821c6e,null));};exports[_0xb324('0x36')]=function(_0x50ec43,_0x2d4cee){return db[_0xb324('0x50')][_0xb324('0x57')]({'where':{'id':_0x50ec43[_0xb324('0x55')]['id']}})[_0xb324('0x21')](handleEntityNotFound(_0x2d4cee,null))['then'](removeEntity(_0x2d4cee,null))[_0xb324('0x2b')](handleError(_0x2d4cee,null));};exports['describe']=function(_0x540641,_0x1372e4){return db[_0xb324('0x50')]['describe']()[_0xb324('0x21')](respondWithResult(_0x1372e4,null))[_0xb324('0x2b')](handleError(_0x1372e4,null));};exports[_0xb324('0x61')]=function(_0x1638c0,_0x38a039,_0x2a8d0d){var _0x2de304={'raw':!![],'where':{}},_0x5d99cd={},_0x4ab954;return db['ChatQueue'][_0xb324('0x62')]({'where':{'id':_0x1638c0[_0xb324('0x55')]['id']}})['then'](handleEntityNotFound(_0x38a039,null))[_0xb324('0x21')](function(_0x5b7acb){if(_0x5b7acb){_0x4ab954=_0x5b7acb['get']({'plain':!![]});_0x5d99cd[_0xb324('0x40')]=_[_0xb324('0x42')](db[_0xb324('0x63')][_0xb324('0x3c')]);_0x5d99cd[_0xb324('0x43')]=_[_0xb324('0x42')](_0x1638c0['query']);_0x5d99cd[_0xb324('0x44')]=_[_0xb324('0x45')](_0x5d99cd[_0xb324('0x40')],_0x5d99cd[_0xb324('0x43')]);_0x2de304['attributes']=_['intersection'](_0x5d99cd[_0xb324('0x40')],qs['fields'](_0x1638c0[_0xb324('0x43')][_0xb324('0x47')]));_0x2de304[_0xb324('0x46')]=_0x2de304[_0xb324('0x46')]['length']?_0x2de304[_0xb324('0x46')]:_0x5d99cd['model'];if(!_0x1638c0[_0xb324('0x43')][_0xb324('0x64')](_0xb324('0x49'))){_0x2de304[_0xb324('0x33')]=qs[_0xb324('0x33')](_0x1638c0[_0xb324('0x43')]['limit']);_0x2de304[_0xb324('0x30')]=qs[_0xb324('0x30')](_0x1638c0[_0xb324('0x43')][_0xb324('0x30')]);}_0x2de304['order']=qs[_0xb324('0x4b')](_0x1638c0[_0xb324('0x43')][_0xb324('0x4b')]);_0x2de304[_0xb324('0x4c')]=qs[_0xb324('0x44')](_[_0xb324('0x4d')](_0x1638c0['query'],_0x5d99cd[_0xb324('0x44')]));_0x2de304[_0xb324('0x4c')][_0xb324('0x65')]=_0x5b7acb['id'];if(_0x1638c0[_0xb324('0x43')]['filter']){_0x2de304[_0xb324('0x4c')]=_['merge'](_0x2de304[_0xb324('0x4c')],{'$or':_['map'](_0x2de304[_0xb324('0x46')],function(_0x32263c){var _0x1eb1e8={};_0x1eb1e8[_0x32263c]={'$like':'%'+_0x1638c0[_0xb324('0x43')][_0xb324('0x4e')]+'%'};return _0x1eb1e8;})});}_0x2de304=_[_0xb324('0x4f')]({},_0x2de304,_0x1638c0[_0xb324('0x56')]);return db[_0xb324('0x63')]['findAll'](_0x2de304);}})[_0xb324('0x21')](function(_0x17507e){if(_0x17507e){return db['User'][_0xb324('0x66')]({'where':{'id':_['map'](_0x17507e,_0xb324('0x67')),'role':_0xb324('0x68')},'attributes':['id',_0xb324('0x41'),_0xb324('0x69'),_0xb324('0x6a'),_0xb324('0x6b')]});}})['then'](function(_0x2058c8){if(_0x2058c8){return{'count':_0x2058c8[_0xb324('0x32')],'rows':_[_0xb324('0x3b')](_0x2058c8[_0xb324('0x53')],function(_0x4684d4){return{'membername':_0x4684d4[_0xb324('0x41')],'UserId':_0x4684d4['id'],'queue_name':_0x4ab954[_0xb324('0x41')],'ChatQueueId':_0x4ab954['id'],'interface':util[_0xb324('0x6c')]('%s/%s','SIP',_0x4684d4[_0xb324('0x41')]),'penalty':0x0,'paused':_0x4684d4[_0xb324('0x69')],'createdAt':_0x4684d4['createdAt'],'updatedAt':_0x4684d4[_0xb324('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x38a039,_0x2de304))['catch'](handleError(_0x38a039,null));};exports[_0xb324('0x6d')]=function(_0x2fe627,_0x4a7c3a,_0x96affd){var _0x25f5f3={};var _0x411162={};var _0xf71b12;var _0x5b6a68;return db[_0xb324('0x50')]['findOne']({'where':{'id':_0x2fe627[_0xb324('0x55')]['id']}})['then'](handleEntityNotFound(_0x4a7c3a,null))['then'](function(_0xa8ada7){if(_0xa8ada7){_0xf71b12=_0xa8ada7;_0x411162[_0xb324('0x40')]=_[_0xb324('0x42')](db[_0xb324('0x6e')][_0xb324('0x3c')]);_0x411162[_0xb324('0x43')]=_[_0xb324('0x42')](_0x2fe627[_0xb324('0x43')]);_0x411162[_0xb324('0x44')]=_[_0xb324('0x45')](_0x411162['model'],_0x411162[_0xb324('0x43')]);_0x25f5f3[_0xb324('0x46')]=_['intersection'](_0x411162['model'],qs[_0xb324('0x47')](_0x2fe627[_0xb324('0x43')][_0xb324('0x47')]));_0x25f5f3[_0xb324('0x46')]=_0x25f5f3[_0xb324('0x46')]['length']?_0x25f5f3[_0xb324('0x46')]:_0x411162[_0xb324('0x40')];_0x25f5f3[_0xb324('0x4a')]=qs['sort'](_0x2fe627[_0xb324('0x43')][_0xb324('0x4b')]);_0x25f5f3[_0xb324('0x4c')]=qs[_0xb324('0x44')](_['pick'](_0x2fe627['query'],_0x411162[_0xb324('0x44')]));if(_0x2fe627[_0xb324('0x43')][_0xb324('0x4e')]){_0x25f5f3['where']=_[_0xb324('0x4f')](_0x25f5f3[_0xb324('0x4c')],{'$or':_[_0xb324('0x3b')](_0x25f5f3[_0xb324('0x46')],function(_0x3d34d8){var _0x568895={};_0x568895[_0x3d34d8]={'$like':'%'+_0x2fe627[_0xb324('0x43')][_0xb324('0x4e')]+'%'};return _0x568895;})});}_0x25f5f3=_[_0xb324('0x4f')]({},_0x25f5f3,_0x2fe627['options']);return _0xf71b12['getTeams'](_0x25f5f3);}})['then'](function(_0x187673){if(_0x187673){_0x5b6a68=_0x187673[_0xb324('0x48')];if(!_0x2fe627[_0xb324('0x43')]['hasOwnProperty'](_0xb324('0x49'))){_0x25f5f3['limit']=qs[_0xb324('0x33')](_0x2fe627[_0xb324('0x43')][_0xb324('0x33')]);_0x25f5f3['offset']=qs[_0xb324('0x30')](_0x2fe627[_0xb324('0x43')][_0xb324('0x30')]);}return _0xf71b12['getTeams'](_0x25f5f3);}})[_0xb324('0x21')](function(_0x3ceaec){if(_0x3ceaec){return _0x3ceaec?{'count':_0x5b6a68,'rows':_0x3ceaec}:null;}})[_0xb324('0x21')](respondWithResult(_0x4a7c3a,null))[_0xb324('0x2b')](handleError(_0x4a7c3a,null));};exports[_0xb324('0x6f')]=function(_0x3a28de,_0x8cb9f8,_0x1bdfab){var _0x43874e=_0x3a28de[_0xb324('0x60')]['ids'];return db[_0xb324('0x6e')][_0xb324('0x70')]({'where':{'id':_0x43874e},'attributes':['id'],'include':[{'model':db[_0xb324('0x71')],'as':_0xb324('0x72'),'attributes':['id','name',_0xb324('0x73'),_0xb324('0x74'),_0xb324('0x75')],'raw':!![]}]})['then'](function(_0x32061c){if(_0x32061c){var _0x3a2a8f=_['flatMap'](_0x32061c,function(_0x819900){var _0x4aaea3=_0x819900['get']({'plain':!![]});return _0x4aaea3[_0xb324('0x72')];});return db[_0xb324('0x50')][_0xb324('0x57')]({'where':{'id':_0x3a28de[_0xb324('0x55')]['id']}})[_0xb324('0x21')](function(_0x99f5fd){return db[_0xb324('0x76')]['transaction'](function(_0x5a0b8e){return _0x99f5fd[_0xb324('0x6f')](_0x43874e,{'transaction':_0x5a0b8e})['then'](function(){return BPromise[_0xb324('0x77')](_0x3a2a8f,function(_0x12ac67){return db[_0xb324('0x63')][_0xb324('0x78')]({'where':{'UserId':_0x12ac67['id'],'ChatQueueId':_0x3a28de[_0xb324('0x55')]['id']},'transaction':_0x5a0b8e});});})[_0xb324('0x21')](function(){_0x3a2a8f['forEach'](function(_0x4e4094){socket[_0xb324('0x79')]('userChatQueue:save',{'UserId':_0x4e4094['id'],'ChatQueueId':_0x99f5fd['id']});});});});});}})['then'](respondWithStatusCode(_0x8cb9f8,null))[_0xb324('0x2b')](handleError(_0x8cb9f8,null));};exports[_0xb324('0x7a')]=function(_0x460762,_0x52d89b,_0x5b6d6a){return db['Team'][_0xb324('0x70')]({'where':{'id':_0x460762[_0xb324('0x43')][_0xb324('0x7b')]},'attributes':['id'],'include':[{'model':db[_0xb324('0x71')],'as':_0xb324('0x72'),'attributes':['id'],'raw':!![]}]})[_0xb324('0x21')](handleEntityNotFound(_0x52d89b,null))[_0xb324('0x21')](function(_0x4eb8fa){var _0x32da50=_[_0xb324('0x3b')](_0x4eb8fa,'id');var _0x79db15=[];var _0x4143d3=[];var _0x522a72=squel['select']();_0x522a72['field'](_0xb324('0x7c'))[_0xb324('0x7d')](_0xb324('0x7e'),'tq')[_0xb324('0x7f')](_0xb324('0x80'),'ut',_0xb324('0x81'))['where'](_0xb324('0x82'),_0x460762['params']['id']);for(var _0x50ab81=0x0;_0x50ab81<_0x4eb8fa[_0xb324('0x48')];_0x50ab81+=0x1){let _0x73ec39=_0x4eb8fa[_0x50ab81];for(var _0x482ba2=0x0;_0x482ba2<_0x73ec39[_0xb324('0x72')][_0xb324('0x48')];_0x482ba2+=0x1){let _0x1c8c89=_0x73ec39[_0xb324('0x72')][_0x482ba2];var _0x23418a=_0x522a72['clone']();_0x23418a[_0xb324('0x4c')](_0xb324('0x83'),_0x1c8c89['id']);_0x4143d3['push'](db[_0xb324('0x76')][_0xb324('0x43')](_0x23418a[_0xb324('0x84')](),{'type':db['sequelize']['QueryTypes'][_0xb324('0x85')]})['then'](function(_0x3013db){if(_0x3013db[_0xb324('0x48')]===0x1){return _0x1c8c89['id'];}else{var _0x1181de=_[_0xb324('0x86')](_[_0xb324('0x3b')](_0x3013db,_0xb324('0x87')),function(_0x5f9154){return _[_0xb324('0x88')](_0x32da50,_0x5f9154);});if(_0x1181de){return _0x1c8c89['id'];}}}));}}return BPromise[_0xb324('0x89')](_0x4143d3)[_0xb324('0x21')](function(_0x218344){_0x79db15=_(_0x79db15)[_0xb324('0x8a')](_0x218344)['compact']()[_0xb324('0x8b')]();return db[_0xb324('0x50')][_0xb324('0x57')]({'where':{'id':_0x460762['params']['id']}})[_0xb324('0x21')](function(_0x2dc8f3){return db[_0xb324('0x76')][_0xb324('0x8c')](function(_0x4fc396){return _0x2dc8f3[_0xb324('0x7a')](_0x460762['query'][_0xb324('0x7b')],{'transaction':_0x4fc396})[_0xb324('0x21')](function(){if(!_['isEmpty'](_0x79db15)){return _0x2dc8f3[_0xb324('0x8d')](_0x79db15,{'transaction':_0x4fc396});}})[_0xb324('0x21')](function(){_0x79db15[_0xb324('0x8e')](function(_0x3d8f50){socket[_0xb324('0x79')](_0xb324('0x8f'),{'UserId':_0x3d8f50,'ChatQueueId':_0x2dc8f3['id']});});});});});});})[_0xb324('0x21')](respondWithStatusCode(_0x52d89b,null))[_0xb324('0x2b')](handleError(_0x52d89b,null));};exports[_0xb324('0x90')]=function(_0x457210,_0x5f0e46,_0x43ac6c){return db[_0xb324('0x50')][_0xb324('0x57')]({'where':{'id':_0x457210[_0xb324('0x55')]['id']}})[_0xb324('0x21')](handleEntityNotFound(_0x5f0e46,null))[_0xb324('0x21')](function(_0x1a5dc0){if(_0x1a5dc0){return _0x1a5dc0[_0xb324('0x90')](_0x457210[_0xb324('0x60')][_0xb324('0x7b')],_[_0xb324('0x91')](_0x457210['body'],['ids','id'])||{})[_0xb324('0x92')](function(_0x506161){for(var _0x242856=0x0;_0x242856<_0x457210[_0xb324('0x60')][_0xb324('0x7b')][_0xb324('0x48')];_0x242856+=0x1){socket[_0xb324('0x79')](_0xb324('0x93'),{'UserId':Number(_0x457210[_0xb324('0x60')][_0xb324('0x7b')][_0x242856]),'ChatQueueId':Number(_0x457210[_0xb324('0x55')]['id'])});}return _0x506161;});}})['then'](respondWithResult(_0x5f0e46,null))[_0xb324('0x2b')](handleError(_0x5f0e46,null));};exports[_0xb324('0x8d')]=function(_0xef4b4a,_0x263daa,_0x2cf777){return db[_0xb324('0x50')][_0xb324('0x57')]({'where':{'id':_0xef4b4a[_0xb324('0x55')]['id']}})[_0xb324('0x21')](handleEntityNotFound(_0x263daa,null))['then'](function(_0x4f2a06){if(_0x4f2a06){return _0x4f2a06['removeAgents'](_0xef4b4a[_0xb324('0x43')][_0xb324('0x7b')])[_0xb324('0x21')](function(){if(_[_0xb324('0x94')](_0xef4b4a['query']['ids'])){for(var _0xa3295b=0x0;_0xa3295b<_0xef4b4a[_0xb324('0x43')][_0xb324('0x7b')][_0xb324('0x48')];_0xa3295b+=0x1){socket['emit'](_0xb324('0x8f'),{'UserId':Number(_0xef4b4a[_0xb324('0x43')][_0xb324('0x7b')][_0xa3295b]),'ChatQueueId':Number(_0xef4b4a[_0xb324('0x55')]['id'])});}}else{socket[_0xb324('0x79')](_0xb324('0x8f'),{'UserId':Number(_0xef4b4a['query'][_0xb324('0x7b')]),'ChatQueueId':Number(_0xef4b4a[_0xb324('0x55')]['id'])});}});}})[_0xb324('0x21')](respondWithStatusCode(_0x263daa,null))[_0xb324('0x2b')](handleError(_0x263daa,null));};exports[_0xb324('0x95')]=function(_0x294ede,_0xf1dc9,_0x105205){var _0x726128={};var _0x9dd867={};var _0xc9b7bc;var _0xab84dd;return db['ChatQueue'][_0xb324('0x62')]({'where':{'id':_0x294ede[_0xb324('0x55')]['id']}})[_0xb324('0x21')](handleEntityNotFound(_0xf1dc9,null))[_0xb324('0x21')](function(_0x19bad1){if(_0x19bad1){_0xc9b7bc=_0x19bad1;_0x9dd867['model']=_[_0xb324('0x42')](db['User'][_0xb324('0x3c')]);_0x9dd867['query']=_[_0xb324('0x42')](_0x294ede[_0xb324('0x43')]);_0x9dd867['filters']=_[_0xb324('0x45')](_0x9dd867[_0xb324('0x40')],_0x9dd867[_0xb324('0x43')]);_0x726128[_0xb324('0x46')]=_[_0xb324('0x45')](_0x9dd867[_0xb324('0x40')],qs[_0xb324('0x47')](_0x294ede[_0xb324('0x43')][_0xb324('0x47')]));_0x726128[_0xb324('0x46')]=_0x726128[_0xb324('0x46')][_0xb324('0x48')]?_0x726128[_0xb324('0x46')]:_0x9dd867[_0xb324('0x40')];_0x726128[_0xb324('0x4a')]=qs['sort'](_0x294ede[_0xb324('0x43')][_0xb324('0x4b')]);_0x726128['where']=qs[_0xb324('0x44')](_[_0xb324('0x4d')](_0x294ede[_0xb324('0x43')],_0x9dd867[_0xb324('0x44')]));if(_0x294ede['query'][_0xb324('0x4e')]){_0x726128[_0xb324('0x4c')]=_['merge'](_0x726128['where'],{'$or':_[_0xb324('0x3b')](_0x726128[_0xb324('0x46')],function(_0xec190b){var _0x1025ec={};_0x1025ec[_0xec190b]={'$like':'%'+_0x294ede[_0xb324('0x43')]['filter']+'%'};return _0x1025ec;})});}_0x726128=_[_0xb324('0x4f')]({},_0x726128,_0x294ede[_0xb324('0x56')]);return _0xc9b7bc[_0xb324('0x95')](_0x726128);}})[_0xb324('0x21')](function(_0x5aa977){if(_0x5aa977){_0xab84dd=_0x5aa977[_0xb324('0x48')];if(!_0x294ede[_0xb324('0x43')][_0xb324('0x64')]('nolimit')){_0x726128['limit']=qs[_0xb324('0x33')](_0x294ede[_0xb324('0x43')][_0xb324('0x33')]);_0x726128[_0xb324('0x30')]=qs[_0xb324('0x30')](_0x294ede[_0xb324('0x43')][_0xb324('0x30')]);}return _0xc9b7bc[_0xb324('0x95')](_0x726128);}})[_0xb324('0x21')](function(_0x59c0cf){if(_0x59c0cf){return _0x59c0cf?{'count':_0xab84dd,'rows':_0x59c0cf}:null;}})[_0xb324('0x21')](respondWithResult(_0xf1dc9,null))[_0xb324('0x2b')](handleError(_0xf1dc9,null));};
\ No newline at end of file
+var _0x8212=['flatMap','sequelize','addTeams','findOrCreate','forEach','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','push','QueryTypes','includes','all','union','compact','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','send','index','map','ChatQueue','rawAttributes','fieldName','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','count','include','findAll','rows','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','ids','Team','User','Agents','online','voicePause','interface'];(function(_0x252782,_0x5b7839){var _0x5123ea=function(_0xbace4b){while(--_0xbace4b){_0x252782['push'](_0x252782['shift']());}};_0x5123ea(++_0x5b7839);}(_0x8212,0xb3));var _0x2821=function(_0x4bb32f,_0x2217e){_0x4bb32f=_0x4bb32f-0x0;var _0x2dd6e6=_0x8212[_0x4bb32f];return _0x2dd6e6;};'use strict';var emlformat=require(_0x2821('0x0'));var rimraf=require(_0x2821('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2821('0x2'));var rp=require(_0x2821('0x3'));var moment=require(_0x2821('0x4'));var BPromise=require(_0x2821('0x5'));var Mustache=require(_0x2821('0x6'));var util=require(_0x2821('0x7'));var path=require(_0x2821('0x8'));var sox=require(_0x2821('0x9'));var csv=require('to-csv');var ejs=require(_0x2821('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2821('0xb'));var squel=require(_0x2821('0xc'));var crypto=require('crypto');var jsforce=require(_0x2821('0xd'));var deskjs=require(_0x2821('0xe'));var toCsv=require(_0x2821('0xf'));var querystring=require(_0x2821('0x10'));var Papa=require(_0x2821('0x11'));var Redis=require(_0x2821('0x12'));var authService=require(_0x2821('0x13'));var qs=require(_0x2821('0x14'));var as=require(_0x2821('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2821('0x16'))(_0x2821('0x17'));var utils=require(_0x2821('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2821('0x19')](config[_0x2821('0x1a')],{'host':_0x2821('0x1b'),'port':0x18eb});var socket=require(_0x2821('0x1c'))(new Redis(config[_0x2821('0x1a')]));require(_0x2821('0x1d'))['register'](socket);var jayson=require(_0x2821('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4142f1,_0xe30acf,_0x243c46,_0x472238){return new BPromise(function(_0x4bba07,_0x155811){var _0x5c2aa7=_0x472238||client;return _0x5c2aa7[_0x2821('0x1f')](_0x4142f1,_0x243c46)[_0x2821('0x20')](function(_0x41f30b){logger[_0x2821('0x21')](_0x2821('0x22'),_0xe30acf,_0x2821('0x23'));logger[_0x2821('0x24')](_0x2821('0x25'),_0xe30acf,'request\x20sent',JSON[_0x2821('0x26')](_0x41f30b));if(_0x41f30b['error']){if(_0x41f30b[_0x2821('0x27')][_0x2821('0x28')]===0x1f4){logger[_0x2821('0x27')](_0x2821('0x22'),_0xe30acf,_0x41f30b[_0x2821('0x27')][_0x2821('0x29')]);return _0x155811(_0x41f30b[_0x2821('0x27')][_0x2821('0x29')]);}logger[_0x2821('0x27')](_0x2821('0x22'),_0xe30acf,_0x41f30b[_0x2821('0x27')]['message']);return _0x4bba07(_0x41f30b['error'][_0x2821('0x29')]);}else{logger[_0x2821('0x21')](_0x2821('0x22'),_0xe30acf,_0x2821('0x23'));_0x4bba07(_0x41f30b[_0x2821('0x2a')][_0x2821('0x29')]);}})[_0x2821('0x2b')](function(_0x3f032d){logger[_0x2821('0x27')](_0x2821('0x22'),_0xe30acf,_0x3f032d);_0x155811(_0x3f032d);});});}function respondWithStatusCode(_0x7a49da,_0x1d2c8f){_0x1d2c8f=_0x1d2c8f||0xcc;return function(_0x1cf0d9){if(_0x1cf0d9){return _0x7a49da[_0x2821('0x2c')](_0x1d2c8f);}return _0x7a49da[_0x2821('0x2d')](_0x1d2c8f)[_0x2821('0x2e')]();};}function respondWithResult(_0xf9161d,_0x3db876){_0x3db876=_0x3db876||0xc8;return function(_0x340741){if(_0x340741){return _0xf9161d[_0x2821('0x2d')](_0x3db876)['json'](_0x340741);}};}function respondWithFilteredResult(_0x13a5c7,_0x4d2b42){return function(_0x109262){if(_0x109262){var _0x4402ea=typeof _0x4d2b42[_0x2821('0x2f')]===_0x2821('0x30')&&typeof _0x4d2b42['limit']===_0x2821('0x30');var _0x265894=_0x109262['count'];var _0x13447a=_0x4402ea?0x0:_0x4d2b42[_0x2821('0x2f')];var _0x3d2d07=_0x4402ea?_0x109262['count']:_0x4d2b42[_0x2821('0x2f')]+_0x4d2b42[_0x2821('0x31')];var _0x36dd8a;if(_0x3d2d07>=_0x265894){_0x3d2d07=_0x265894;_0x36dd8a=0xc8;}else{_0x36dd8a=0xce;}_0x13a5c7[_0x2821('0x2d')](_0x36dd8a);return _0x13a5c7[_0x2821('0x32')](_0x2821('0x33'),_0x13447a+'-'+_0x3d2d07+'/'+_0x265894)[_0x2821('0x34')](_0x109262);}return null;};}function patchUpdates(_0x4fd3b4){return function(_0x427c0a){try{jsonpatch[_0x2821('0x35')](_0x427c0a,_0x4fd3b4,!![]);}catch(_0x30203e){return BPromise[_0x2821('0x36')](_0x30203e);}return _0x427c0a[_0x2821('0x37')]();};}function saveUpdates(_0x31d9e3,_0x1cb61a){return function(_0x2c3846){if(_0x2c3846){return _0x2c3846[_0x2821('0x38')](_0x31d9e3)[_0x2821('0x20')](function(_0x352e27){return _0x352e27;});}return null;};}function removeEntity(_0x5e9194,_0x1880f6){return function(_0x132893){if(_0x132893){return _0x132893[_0x2821('0x39')]()[_0x2821('0x20')](function(){var _0x5df104=_0x132893[_0x2821('0x3a')]({'plain':!![]});var _0x3a0df7=_0x2821('0x3b');return db[_0x2821('0x3c')][_0x2821('0x39')]({'where':{'type':_0x3a0df7,'resourceId':_0x5df104['id']}})[_0x2821('0x20')](function(){return _0x132893;});})[_0x2821('0x20')](function(){_0x5e9194[_0x2821('0x2d')](0xcc)[_0x2821('0x2e')]();});}};}function handleEntityNotFound(_0x369bd1,_0x4bc4d9){return function(_0x45d70c){if(!_0x45d70c){_0x369bd1[_0x2821('0x2c')](0x194);}return _0x45d70c;};}function handleError(_0x36e868,_0x347d57){_0x347d57=_0x347d57||0x1f4;return function(_0x357953){logger['error'](_0x357953[_0x2821('0x3d')]);if(_0x357953['name']){delete _0x357953['name'];}_0x36e868[_0x2821('0x2d')](_0x347d57)[_0x2821('0x3e')](_0x357953);};}exports[_0x2821('0x3f')]=function(_0x276edc,_0x9d77eb){var _0x12cace={},_0x210c60={},_0x58ad7f={'count':0x0,'rows':[]};var _0x559517=_[_0x2821('0x40')](db[_0x2821('0x41')][_0x2821('0x42')],function(_0x2737a7){return{'name':_0x2737a7[_0x2821('0x43')],'type':_0x2737a7['type']['key']};});_0x210c60[_0x2821('0x44')]=_[_0x2821('0x40')](_0x559517,_0x2821('0x45'));_0x210c60[_0x2821('0x46')]=_[_0x2821('0x47')](_0x276edc[_0x2821('0x46')]);_0x210c60['filters']=_[_0x2821('0x48')](_0x210c60[_0x2821('0x44')],_0x210c60['query']);_0x12cace[_0x2821('0x49')]=_[_0x2821('0x48')](_0x210c60[_0x2821('0x44')],qs[_0x2821('0x4a')](_0x276edc[_0x2821('0x46')]['fields']));_0x12cace[_0x2821('0x49')]=_0x12cace[_0x2821('0x49')][_0x2821('0x4b')]?_0x12cace[_0x2821('0x49')]:_0x210c60['model'];if(!_0x276edc['query'][_0x2821('0x4c')](_0x2821('0x4d'))){_0x12cace[_0x2821('0x31')]=qs[_0x2821('0x31')](_0x276edc[_0x2821('0x46')][_0x2821('0x31')]);_0x12cace[_0x2821('0x2f')]=qs['offset'](_0x276edc['query'][_0x2821('0x2f')]);}_0x12cace['order']=qs[_0x2821('0x4e')](_0x276edc[_0x2821('0x46')][_0x2821('0x4e')]);_0x12cace[_0x2821('0x4f')]=qs[_0x2821('0x50')](_[_0x2821('0x51')](_0x276edc[_0x2821('0x46')],_0x210c60['filters']),_0x559517);if(_0x276edc[_0x2821('0x46')][_0x2821('0x52')]){_0x12cace[_0x2821('0x4f')]=_[_0x2821('0x53')](_0x12cace[_0x2821('0x4f')],{'$or':_[_0x2821('0x40')](_0x559517,function(_0x2b5b97){if(_0x2b5b97[_0x2821('0x54')]!=='VIRTUAL'){var _0x191ae2={};_0x191ae2[_0x2b5b97[_0x2821('0x45')]]={'$like':'%'+_0x276edc[_0x2821('0x46')][_0x2821('0x52')]+'%'};return _0x191ae2;}})});}_0x12cace=_['merge']({},_0x12cace,_0x276edc[_0x2821('0x55')]);var _0x125e41={'where':_0x12cace[_0x2821('0x4f')]};return db['ChatQueue']['count'](_0x125e41)['then'](function(_0x9721){_0x58ad7f[_0x2821('0x56')]=_0x9721;if(_0x276edc[_0x2821('0x46')]['includeAll']){_0x12cace[_0x2821('0x57')]=[{'all':!![]}];}return db[_0x2821('0x41')][_0x2821('0x58')](_0x12cace);})[_0x2821('0x20')](function(_0x228906){_0x58ad7f[_0x2821('0x59')]=_0x228906;return _0x58ad7f;})['then'](respondWithFilteredResult(_0x9d77eb,_0x12cace))['catch'](handleError(_0x9d77eb,null));};exports[_0x2821('0x5a')]=function(_0x39fcc9,_0x482c89){var _0x4177ec={'raw':!![],'where':{'id':_0x39fcc9[_0x2821('0x5b')]['id']}},_0x4421c5={};_0x4421c5[_0x2821('0x44')]=_[_0x2821('0x47')](db[_0x2821('0x41')][_0x2821('0x42')]);_0x4421c5[_0x2821('0x46')]=_[_0x2821('0x47')](_0x39fcc9['query']);_0x4421c5['filters']=_['intersection'](_0x4421c5['model'],_0x4421c5['query']);_0x4177ec['attributes']=_[_0x2821('0x48')](_0x4421c5[_0x2821('0x44')],qs[_0x2821('0x4a')](_0x39fcc9[_0x2821('0x46')][_0x2821('0x4a')]));_0x4177ec[_0x2821('0x49')]=_0x4177ec[_0x2821('0x49')]['length']?_0x4177ec[_0x2821('0x49')]:_0x4421c5[_0x2821('0x44')];if(_0x39fcc9['query'][_0x2821('0x5c')]){_0x4177ec[_0x2821('0x57')]=[{'all':!![]}];}_0x4177ec=_[_0x2821('0x53')]({},_0x4177ec,_0x39fcc9['options']);return db['ChatQueue'][_0x2821('0x5d')](_0x4177ec)[_0x2821('0x20')](handleEntityNotFound(_0x482c89,null))[_0x2821('0x20')](respondWithResult(_0x482c89,null))[_0x2821('0x2b')](handleError(_0x482c89,null));};exports[_0x2821('0x5e')]=function(_0x277e7f,_0x538bb8){return db[_0x2821('0x41')][_0x2821('0x5e')](_0x277e7f[_0x2821('0x5f')],{})[_0x2821('0x20')](function(_0x31d5f6){var _0x218c65=_0x277e7f[_0x2821('0x60')][_0x2821('0x3a')]({'plain':!![]});if(!_0x218c65)throw new Error(_0x2821('0x61'));if(_0x218c65[_0x2821('0x62')]===_0x2821('0x60')){var _0x4e6042=_0x31d5f6[_0x2821('0x3a')]({'plain':!![]});var _0x1b2301=_0x2821('0x3b');return db['UserProfileSection'][_0x2821('0x5d')]({'where':{'name':_0x1b2301,'userProfileId':_0x218c65['userProfileId']},'raw':!![]})[_0x2821('0x20')](function(_0x3d21ee){if(_0x3d21ee&&_0x3d21ee[_0x2821('0x63')]===0x0){return db[_0x2821('0x3c')][_0x2821('0x5e')]({'name':_0x4e6042[_0x2821('0x45')],'resourceId':_0x4e6042['id'],'type':_0x3d21ee['name'],'sectionId':_0x3d21ee['id']},{})[_0x2821('0x20')](function(){return _0x31d5f6;});}else{return _0x31d5f6;}})[_0x2821('0x2b')](function(_0x1ff709){logger[_0x2821('0x27')](_0x2821('0x64'),_0x1ff709);throw _0x1ff709;});}return _0x31d5f6;})[_0x2821('0x20')](respondWithResult(_0x538bb8,0xc9))['catch'](handleError(_0x538bb8,null));};exports[_0x2821('0x38')]=function(_0x37384d,_0x45f5d3){if(_0x37384d['body']['id']){delete _0x37384d[_0x2821('0x5f')]['id'];}return db[_0x2821('0x41')][_0x2821('0x5d')]({'where':{'id':_0x37384d[_0x2821('0x5b')]['id']}})[_0x2821('0x20')](handleEntityNotFound(_0x45f5d3,null))[_0x2821('0x20')](saveUpdates(_0x37384d[_0x2821('0x5f')],null))[_0x2821('0x20')](respondWithResult(_0x45f5d3,null))['catch'](handleError(_0x45f5d3,null));};exports[_0x2821('0x39')]=function(_0x3c114a,_0x4783e7){return db[_0x2821('0x41')][_0x2821('0x5d')]({'where':{'id':_0x3c114a[_0x2821('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4783e7,null))['then'](removeEntity(_0x4783e7,null))[_0x2821('0x2b')](handleError(_0x4783e7,null));};exports[_0x2821('0x65')]=function(_0x24e488,_0xcc4f07){return db['ChatQueue'][_0x2821('0x65')]()[_0x2821('0x20')](respondWithResult(_0xcc4f07,null))[_0x2821('0x2b')](handleError(_0xcc4f07,null));};exports['getMembers']=function(_0x576354,_0x314418,_0x22e093){var _0x5bb173={'raw':!![],'where':{}},_0x2ee54b={},_0x294712;return db[_0x2821('0x41')][_0x2821('0x66')]({'where':{'id':_0x576354['params']['id']}})[_0x2821('0x20')](handleEntityNotFound(_0x314418,null))[_0x2821('0x20')](function(_0x44761e){if(_0x44761e){_0x294712=_0x44761e[_0x2821('0x3a')]({'plain':!![]});_0x2ee54b['model']=_['keys'](db[_0x2821('0x67')]['rawAttributes']);_0x2ee54b[_0x2821('0x46')]=_['keys'](_0x576354[_0x2821('0x46')]);_0x2ee54b['filters']=_[_0x2821('0x48')](_0x2ee54b[_0x2821('0x44')],_0x2ee54b[_0x2821('0x46')]);_0x5bb173[_0x2821('0x49')]=_[_0x2821('0x48')](_0x2ee54b[_0x2821('0x44')],qs[_0x2821('0x4a')](_0x576354['query'][_0x2821('0x4a')]));_0x5bb173[_0x2821('0x49')]=_0x5bb173[_0x2821('0x49')][_0x2821('0x4b')]?_0x5bb173[_0x2821('0x49')]:_0x2ee54b['model'];if(!_0x576354['query'][_0x2821('0x4c')](_0x2821('0x4d'))){_0x5bb173[_0x2821('0x31')]=qs[_0x2821('0x31')](_0x576354[_0x2821('0x46')][_0x2821('0x31')]);_0x5bb173['offset']=qs[_0x2821('0x2f')](_0x576354['query'][_0x2821('0x2f')]);}_0x5bb173[_0x2821('0x68')]=qs['sort'](_0x576354[_0x2821('0x46')][_0x2821('0x4e')]);_0x5bb173['where']=qs[_0x2821('0x50')](_[_0x2821('0x51')](_0x576354[_0x2821('0x46')],_0x2ee54b['filters']));_0x5bb173[_0x2821('0x4f')][_0x2821('0x69')]=_0x44761e['id'];if(_0x576354[_0x2821('0x46')][_0x2821('0x52')]){_0x5bb173['where']=_[_0x2821('0x53')](_0x5bb173['where'],{'$or':_[_0x2821('0x40')](_0x5bb173['attributes'],function(_0x5b3d31){var _0x285d0a={};_0x285d0a[_0x5b3d31]={'$like':'%'+_0x576354[_0x2821('0x46')]['filter']+'%'};return _0x285d0a;})});}_0x5bb173=_[_0x2821('0x53')]({},_0x5bb173,_0x576354['options']);return db[_0x2821('0x67')][_0x2821('0x58')](_0x5bb173);}})[_0x2821('0x20')](function(_0xc58687){if(_0xc58687){return db['User'][_0x2821('0x6a')]({'where':{'id':_[_0x2821('0x40')](_0xc58687,_0x2821('0x6b')),'role':_0x2821('0x6c')},'attributes':['id',_0x2821('0x45'),_0x2821('0x6d'),_0x2821('0x6e'),'createdAt']});}})[_0x2821('0x20')](function(_0x4c79a8){if(_0x4c79a8){return{'count':_0x4c79a8[_0x2821('0x56')],'rows':_[_0x2821('0x40')](_0x4c79a8[_0x2821('0x59')],function(_0x4eb9ad){return{'membername':_0x4eb9ad['name'],'UserId':_0x4eb9ad['id'],'queue_name':_0x294712[_0x2821('0x45')],'ChatQueueId':_0x294712['id'],'interface':util[_0x2821('0x6f')](_0x2821('0x70'),_0x2821('0x71'),_0x4eb9ad['name']),'penalty':0x0,'paused':_0x4eb9ad['chatPause'],'createdAt':_0x4eb9ad[_0x2821('0x72')],'updatedAt':_0x4eb9ad['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x314418,_0x5bb173))['catch'](handleError(_0x314418,null));};exports['getTeams']=function(_0x583b91,_0x4cffc4,_0x139942){var _0x2c316d={};var _0x36ec34={};var _0x2502b4;var _0x2d1ee4;return db[_0x2821('0x41')]['findOne']({'where':{'id':_0x583b91[_0x2821('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4cffc4,null))[_0x2821('0x20')](function(_0x492f87){if(_0x492f87){_0x2502b4=_0x492f87;_0x36ec34['model']=_[_0x2821('0x47')](db['Team']['rawAttributes']);_0x36ec34['query']=_[_0x2821('0x47')](_0x583b91['query']);_0x36ec34['filters']=_[_0x2821('0x48')](_0x36ec34['model'],_0x36ec34[_0x2821('0x46')]);_0x2c316d[_0x2821('0x49')]=_['intersection'](_0x36ec34['model'],qs[_0x2821('0x4a')](_0x583b91[_0x2821('0x46')][_0x2821('0x4a')]));_0x2c316d[_0x2821('0x49')]=_0x2c316d[_0x2821('0x49')][_0x2821('0x4b')]?_0x2c316d[_0x2821('0x49')]:_0x36ec34[_0x2821('0x44')];_0x2c316d['order']=qs['sort'](_0x583b91['query'][_0x2821('0x4e')]);_0x2c316d[_0x2821('0x4f')]=qs['filters'](_[_0x2821('0x51')](_0x583b91[_0x2821('0x46')],_0x36ec34[_0x2821('0x50')]));if(_0x583b91[_0x2821('0x46')][_0x2821('0x52')]){_0x2c316d['where']=_['merge'](_0x2c316d[_0x2821('0x4f')],{'$or':_['map'](_0x2c316d['attributes'],function(_0x42e370){var _0x225cbf={};_0x225cbf[_0x42e370]={'$like':'%'+_0x583b91[_0x2821('0x46')][_0x2821('0x52')]+'%'};return _0x225cbf;})});}_0x2c316d=_['merge']({},_0x2c316d,_0x583b91[_0x2821('0x55')]);return _0x2502b4[_0x2821('0x73')](_0x2c316d);}})[_0x2821('0x20')](function(_0x897ce1){if(_0x897ce1){_0x2d1ee4=_0x897ce1[_0x2821('0x4b')];if(!_0x583b91[_0x2821('0x46')][_0x2821('0x4c')](_0x2821('0x4d'))){_0x2c316d[_0x2821('0x31')]=qs[_0x2821('0x31')](_0x583b91[_0x2821('0x46')][_0x2821('0x31')]);_0x2c316d[_0x2821('0x2f')]=qs['offset'](_0x583b91[_0x2821('0x46')][_0x2821('0x2f')]);}return _0x2502b4[_0x2821('0x73')](_0x2c316d);}})[_0x2821('0x20')](function(_0x56bb9e){if(_0x56bb9e){return _0x56bb9e?{'count':_0x2d1ee4,'rows':_0x56bb9e}:null;}})[_0x2821('0x20')](respondWithResult(_0x4cffc4,null))['catch'](handleError(_0x4cffc4,null));};exports['addTeams']=function(_0x20b3e7,_0x54b4f5,_0x52c400){var _0x42d52a=_0x20b3e7[_0x2821('0x5f')][_0x2821('0x74')];return db[_0x2821('0x75')][_0x2821('0x58')]({'where':{'id':_0x42d52a},'attributes':['id'],'include':[{'model':db[_0x2821('0x76')],'as':_0x2821('0x77'),'attributes':['id',_0x2821('0x45'),_0x2821('0x78'),_0x2821('0x79'),_0x2821('0x7a')],'raw':!![]}]})[_0x2821('0x20')](function(_0x48b9c0){if(_0x48b9c0){var _0x141623=_[_0x2821('0x7b')](_0x48b9c0,function(_0x1a174b){var _0x4d668d=_0x1a174b[_0x2821('0x3a')]({'plain':!![]});return _0x4d668d[_0x2821('0x77')];});return db[_0x2821('0x41')][_0x2821('0x5d')]({'where':{'id':_0x20b3e7[_0x2821('0x5b')]['id']}})[_0x2821('0x20')](function(_0x241d36){return db[_0x2821('0x7c')]['transaction'](function(_0x1fa7d2){return _0x241d36[_0x2821('0x7d')](_0x42d52a,{'transaction':_0x1fa7d2})['then'](function(){return BPromise['each'](_0x141623,function(_0x3a9e14){return db[_0x2821('0x67')][_0x2821('0x7e')]({'where':{'UserId':_0x3a9e14['id'],'ChatQueueId':_0x20b3e7[_0x2821('0x5b')]['id']},'transaction':_0x1fa7d2});});})[_0x2821('0x20')](function(){_0x141623[_0x2821('0x7f')](function(_0x3faff6){socket['emit'](_0x2821('0x80'),{'UserId':_0x3faff6['id'],'ChatQueueId':_0x241d36['id']});});});});});}})[_0x2821('0x20')](respondWithStatusCode(_0x54b4f5,null))[_0x2821('0x2b')](handleError(_0x54b4f5,null));};exports[_0x2821('0x81')]=function(_0x2fb663,_0x1e94cf,_0x3c9a8a){return db[_0x2821('0x75')]['findAll']({'where':{'id':_0x2fb663[_0x2821('0x46')][_0x2821('0x74')]},'attributes':['id'],'include':[{'model':db[_0x2821('0x76')],'as':_0x2821('0x77'),'attributes':['id'],'raw':!![]}]})[_0x2821('0x20')](handleEntityNotFound(_0x1e94cf,null))[_0x2821('0x20')](function(_0x43073c){var _0x1dc05b=_['map'](_0x43073c,'id');var _0x17c7a7=[];var _0x1794f0=[];var _0x5dad4a=squel[_0x2821('0x82')]();_0x5dad4a['field'](_0x2821('0x83'))['from'](_0x2821('0x84'),'tq')[_0x2821('0x85')](_0x2821('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2821('0x4f')](_0x2821('0x87'),_0x2fb663[_0x2821('0x5b')]['id']);for(var _0x42d4b7=0x0;_0x42d4b7<_0x43073c[_0x2821('0x4b')];_0x42d4b7+=0x1){let _0x5d2c32=_0x43073c[_0x42d4b7];for(var _0x37b0f4=0x0;_0x37b0f4<_0x5d2c32[_0x2821('0x77')]['length'];_0x37b0f4+=0x1){let _0x37b62e=_0x5d2c32[_0x2821('0x77')][_0x37b0f4];var _0x4759c7=_0x5dad4a[_0x2821('0x88')]();_0x4759c7[_0x2821('0x4f')]('ut.UserId\x20=\x20?',_0x37b62e['id']);_0x1794f0[_0x2821('0x89')](db[_0x2821('0x7c')][_0x2821('0x46')](_0x4759c7['toString'](),{'type':db['sequelize'][_0x2821('0x8a')]['SELECT']})[_0x2821('0x20')](function(_0x7f6291){if(_0x7f6291[_0x2821('0x4b')]===0x1){return _0x37b62e['id'];}else{var _0xf4c549=_['every'](_[_0x2821('0x40')](_0x7f6291,'TeamId'),function(_0x3204bd){return _[_0x2821('0x8b')](_0x1dc05b,_0x3204bd);});if(_0xf4c549){return _0x37b62e['id'];}}}));}}return BPromise[_0x2821('0x8c')](_0x1794f0)[_0x2821('0x20')](function(_0x122681){_0x17c7a7=_(_0x17c7a7)[_0x2821('0x8d')](_0x122681)[_0x2821('0x8e')]()['value']();return db[_0x2821('0x41')][_0x2821('0x5d')]({'where':{'id':_0x2fb663[_0x2821('0x5b')]['id']}})[_0x2821('0x20')](function(_0x153875){return db['sequelize'][_0x2821('0x8f')](function(_0x2693ce){return _0x153875['removeTeams'](_0x2fb663[_0x2821('0x46')][_0x2821('0x74')],{'transaction':_0x2693ce})['then'](function(){if(!_[_0x2821('0x90')](_0x17c7a7)){return _0x153875[_0x2821('0x91')](_0x17c7a7,{'transaction':_0x2693ce});}})[_0x2821('0x20')](function(){_0x17c7a7[_0x2821('0x7f')](function(_0x51c467){socket['emit'](_0x2821('0x92'),{'UserId':_0x51c467,'ChatQueueId':_0x153875['id']});});});});});});})['then'](respondWithStatusCode(_0x1e94cf,null))[_0x2821('0x2b')](handleError(_0x1e94cf,null));};exports['addAgents']=function(_0x6db532,_0x2a934f,_0x24eea7){return db['ChatQueue']['find']({'where':{'id':_0x6db532['params']['id']}})['then'](handleEntityNotFound(_0x2a934f,null))['then'](function(_0x181d58){if(_0x181d58){return _0x181d58[_0x2821('0x93')](_0x6db532['body'][_0x2821('0x74')],_[_0x2821('0x94')](_0x6db532[_0x2821('0x5f')],[_0x2821('0x74'),'id'])||{})['spread'](function(_0x53bef6){for(var _0x4a9cc0=0x0;_0x4a9cc0<_0x6db532['body'][_0x2821('0x74')][_0x2821('0x4b')];_0x4a9cc0+=0x1){socket[_0x2821('0x95')](_0x2821('0x80'),{'UserId':Number(_0x6db532[_0x2821('0x5f')][_0x2821('0x74')][_0x4a9cc0]),'ChatQueueId':Number(_0x6db532[_0x2821('0x5b')]['id'])});}return _0x53bef6;});}})[_0x2821('0x20')](respondWithResult(_0x2a934f,null))['catch'](handleError(_0x2a934f,null));};exports[_0x2821('0x91')]=function(_0x22110a,_0x3e7176,_0x102e9f){return db[_0x2821('0x41')][_0x2821('0x5d')]({'where':{'id':_0x22110a[_0x2821('0x5b')]['id']}})[_0x2821('0x20')](handleEntityNotFound(_0x3e7176,null))[_0x2821('0x20')](function(_0x4ffcae){if(_0x4ffcae){return _0x4ffcae[_0x2821('0x91')](_0x22110a['query'][_0x2821('0x74')])[_0x2821('0x20')](function(){if(_['isArray'](_0x22110a[_0x2821('0x46')]['ids'])){for(var _0x36c4e9=0x0;_0x36c4e9<_0x22110a[_0x2821('0x46')][_0x2821('0x74')]['length'];_0x36c4e9+=0x1){socket[_0x2821('0x95')]('userChatQueue:remove',{'UserId':Number(_0x22110a[_0x2821('0x46')]['ids'][_0x36c4e9]),'ChatQueueId':Number(_0x22110a[_0x2821('0x5b')]['id'])});}}else{socket[_0x2821('0x95')]('userChatQueue:remove',{'UserId':Number(_0x22110a['query'][_0x2821('0x74')]),'ChatQueueId':Number(_0x22110a[_0x2821('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e7176,null))[_0x2821('0x2b')](handleError(_0x3e7176,null));};exports[_0x2821('0x96')]=function(_0x227e94,_0x1c50c3,_0x122a7b){var _0x33e972={};var _0x2c6dc6={};var _0x4cabb3;var _0x10993d;return db[_0x2821('0x41')][_0x2821('0x66')]({'where':{'id':_0x227e94[_0x2821('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1c50c3,null))[_0x2821('0x20')](function(_0x19e0b4){if(_0x19e0b4){_0x4cabb3=_0x19e0b4;_0x2c6dc6[_0x2821('0x44')]=_['keys'](db['User'][_0x2821('0x42')]);_0x2c6dc6[_0x2821('0x46')]=_[_0x2821('0x47')](_0x227e94[_0x2821('0x46')]);_0x2c6dc6[_0x2821('0x50')]=_['intersection'](_0x2c6dc6['model'],_0x2c6dc6[_0x2821('0x46')]);_0x33e972[_0x2821('0x49')]=_['intersection'](_0x2c6dc6[_0x2821('0x44')],qs['fields'](_0x227e94[_0x2821('0x46')][_0x2821('0x4a')]));_0x33e972[_0x2821('0x49')]=_0x33e972[_0x2821('0x49')][_0x2821('0x4b')]?_0x33e972[_0x2821('0x49')]:_0x2c6dc6[_0x2821('0x44')];_0x33e972['order']=qs[_0x2821('0x4e')](_0x227e94[_0x2821('0x46')][_0x2821('0x4e')]);_0x33e972[_0x2821('0x4f')]=qs['filters'](_['pick'](_0x227e94[_0x2821('0x46')],_0x2c6dc6[_0x2821('0x50')]));if(_0x227e94['query'][_0x2821('0x52')]){_0x33e972[_0x2821('0x4f')]=_[_0x2821('0x53')](_0x33e972[_0x2821('0x4f')],{'$or':_['map'](_0x33e972[_0x2821('0x49')],function(_0x18f900){var _0x14a788={};_0x14a788[_0x18f900]={'$like':'%'+_0x227e94[_0x2821('0x46')]['filter']+'%'};return _0x14a788;})});}_0x33e972=_['merge']({},_0x33e972,_0x227e94[_0x2821('0x55')]);return _0x4cabb3[_0x2821('0x96')](_0x33e972);}})[_0x2821('0x20')](function(_0x42fc14){if(_0x42fc14){_0x10993d=_0x42fc14['length'];if(!_0x227e94['query']['hasOwnProperty'](_0x2821('0x4d'))){_0x33e972[_0x2821('0x31')]=qs[_0x2821('0x31')](_0x227e94[_0x2821('0x46')][_0x2821('0x31')]);_0x33e972[_0x2821('0x2f')]=qs[_0x2821('0x2f')](_0x227e94['query']['offset']);}return _0x4cabb3['getAgents'](_0x33e972);}})[_0x2821('0x20')](function(_0x299b7c){if(_0x299b7c){return _0x299b7c?{'count':_0x10993d,'rows':_0x299b7c}:null;}})['then'](respondWithResult(_0x1c50c3,null))['catch'](handleError(_0x1c50c3,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 62c8754..4f49ebc 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 _0x6dd0=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x6dd0,0xae));var _0x06dd=function(_0x3a5856,_0xaefeff){_0x3a5856=_0x3a5856-0x0;var _0x267816=_0x6dd0[_0x3a5856];return _0x267816;};'use strict';var EventEmitter=require(_0x06dd('0x0'));var ChatQueue=require(_0x06dd('0x1'))['db'][_0x06dd('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x06dd('0x3')](0x0);var events={'afterCreate':_0x06dd('0x4'),'afterUpdate':_0x06dd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x53f3da){return function(_0x1e9379,_0x41b4d5,_0x10bfb5){ChatQueueEvents[_0x06dd('0x6')](_0x53f3da+':'+_0x1e9379['id'],_0x1e9379);ChatQueueEvents[_0x06dd('0x6')](_0x53f3da,_0x1e9379);_0x10bfb5(null);};}for(var e in events){if(events[_0x06dd('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x06dd('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe49f=['hook','events','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x103c4c,_0x285348){var _0x3fc15e=function(_0x40e0e6){while(--_0x40e0e6){_0x103c4c['push'](_0x103c4c['shift']());}};_0x3fc15e(++_0x285348);}(_0xe49f,0x17b));var _0xfe49=function(_0x5dedf3,_0x20f0df){_0x5dedf3=_0x5dedf3-0x0;var _0x275b39=_0xe49f[_0x5dedf3];return _0x275b39;};'use strict';var EventEmitter=require(_0xfe49('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xfe49('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xfe49('0x2')](0x0);var events={'afterCreate':_0xfe49('0x3'),'afterUpdate':_0xfe49('0x4'),'afterDestroy':_0xfe49('0x5')};function emitEvent(_0x267126){return function(_0x36713e,_0x1b4862,_0xa378b9){ChatQueueEvents['emit'](_0x267126+':'+_0x36713e['id'],_0x36713e);ChatQueueEvents[_0xfe49('0x6')](_0x267126,_0x36713e);_0xa378b9(null);};}for(var e in events){if(events[_0xfe49('0x7')](e)){var event=events[e];ChatQueue[_0xfe49('0x8')](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 2367bf6..4c5c357 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 _0x8da2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x1b7add,_0x4a67cb){var _0x5ad180=function(_0x5556ae){while(--_0x5556ae){_0x1b7add['push'](_0x1b7add['shift']());}};_0x5ad180(++_0x4a67cb);}(_0x8da2,0x75));var _0x28da=function(_0x316ba4,_0x19d4cb){_0x316ba4=_0x316ba4-0x0;var _0x129152=_0x8da2[_0x316ba4];return _0x129152;};'use strict';var _=require(_0x28da('0x0'));var util=require(_0x28da('0x1'));var logger=require(_0x28da('0x2'))(_0x28da('0x3'));var moment=require(_0x28da('0x4'));var BPromise=require(_0x28da('0x5'));var rp=require(_0x28da('0x6'));var fs=require('fs');var path=require(_0x28da('0x7'));var rimraf=require(_0x28da('0x8'));var config=require(_0x28da('0x9'));var attributes=require(_0x28da('0xa'));module[_0x28da('0xb')]=function(_0x4292fd,_0x45844b){return _0x4292fd[_0x28da('0xc')](_0x28da('0xd'),attributes,{'tableName':_0x28da('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe518=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','ChatQueue'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xe518,0x168));var _0x8e51=function(_0x3e81c1,_0x4969a9){_0x3e81c1=_0x3e81c1-0x0;var _0x1edc3f=_0xe518[_0x3e81c1];return _0x1edc3f;};'use strict';var _=require(_0x8e51('0x0'));var util=require(_0x8e51('0x1'));var logger=require(_0x8e51('0x2'))('api');var moment=require(_0x8e51('0x3'));var BPromise=require(_0x8e51('0x4'));var rp=require(_0x8e51('0x5'));var fs=require('fs');var path=require(_0x8e51('0x6'));var rimraf=require(_0x8e51('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x8e51('0x8')]=function(_0x47ce46,_0x1dc798){return _0x47ce46['define'](_0x8e51('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 40bd6dd..2e5fd47 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 _0xbc87=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowChatQueue','find','then','lodash'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0xbc87,0x1cd));var _0x7bc8=function(_0x226b60,_0x4fac70){_0x226b60=_0x226b60-0x0;var _0x3d566e=_0xbc87[_0x226b60];return _0x3d566e;};'use strict';var _=require(_0x7bc8('0x0'));var util=require(_0x7bc8('0x1'));var moment=require('moment');var BPromise=require(_0x7bc8('0x2'));var rs=require(_0x7bc8('0x3'));var fs=require('fs');var Redis=require(_0x7bc8('0x4'));var db=require(_0x7bc8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bc8('0x6'))(_0x7bc8('0x7'));var config=require(_0x7bc8('0x8'));var jayson=require(_0x7bc8('0x9'));var client=jayson[_0x7bc8('0xa')]['http']({'port':0x232a});config['redis']=_[_0x7bc8('0xb')](config[_0x7bc8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bc8('0xd'))(new Redis(config['redis']));require(_0x7bc8('0xe'))[_0x7bc8('0xf')](socket);function respondWithRpcPromise(_0x4898d1,_0x451288,_0x25456a){return new BPromise(function(_0x331fde,_0x1b6b16){return client[_0x7bc8('0x10')](_0x4898d1,_0x25456a)['then'](function(_0xb08fdc){logger[_0x7bc8('0x11')](_0x7bc8('0x12'),_0x451288,_0x7bc8('0x13'));logger[_0x7bc8('0x14')](_0x7bc8('0x15'),_0x451288,_0x7bc8('0x13'),JSON[_0x7bc8('0x16')](_0xb08fdc));if(_0xb08fdc[_0x7bc8('0x17')]){if(_0xb08fdc[_0x7bc8('0x17')][_0x7bc8('0x18')]===0x1f4){logger['error'](_0x7bc8('0x12'),_0x451288,_0xb08fdc[_0x7bc8('0x17')][_0x7bc8('0x19')]);return _0x1b6b16(_0xb08fdc[_0x7bc8('0x17')]['message']);}logger[_0x7bc8('0x17')]('ChatQueue,\x20%s,\x20%s',_0x451288,_0xb08fdc[_0x7bc8('0x17')][_0x7bc8('0x19')]);return _0x331fde(_0xb08fdc[_0x7bc8('0x17')][_0x7bc8('0x19')]);}else{logger[_0x7bc8('0x11')]('ChatQueue,\x20%s,\x20%s',_0x451288,_0x7bc8('0x13'));_0x331fde(_0xb08fdc[_0x7bc8('0x1a')][_0x7bc8('0x19')]);}})[_0x7bc8('0x1b')](function(_0x28fbf8){logger[_0x7bc8('0x17')](_0x7bc8('0x12'),_0x451288,_0x28fbf8);_0x1b6b16(_0x28fbf8);});});}exports[_0x7bc8('0x1c')]=function(_0x5cc4af){var _0x1f4329=this;return new Promise(function(_0x5d0791,_0x3a3e51){return db[_0x7bc8('0x1d')][_0x7bc8('0x1e')]({'raw':_0x5cc4af[_0x7bc8('0x1f')]?_0x5cc4af[_0x7bc8('0x1f')][_0x7bc8('0x20')]===undefined?!![]:![]:!![],'where':_0x5cc4af['options']?_0x5cc4af[_0x7bc8('0x1f')][_0x7bc8('0x21')]||null:null,'attributes':_0x5cc4af[_0x7bc8('0x1f')]?_0x5cc4af[_0x7bc8('0x1f')][_0x7bc8('0x22')]||null:null,'limit':_0x5cc4af[_0x7bc8('0x1f')]?_0x5cc4af[_0x7bc8('0x1f')][_0x7bc8('0x23')]||null:null,'include':_0x5cc4af[_0x7bc8('0x1f')]?_0x5cc4af[_0x7bc8('0x1f')][_0x7bc8('0x24')]?_['map'](_0x5cc4af[_0x7bc8('0x1f')][_0x7bc8('0x24')],function(_0x2133eb){return{'model':db[_0x2133eb[_0x7bc8('0x25')]],'as':_0x2133eb['as'],'attributes':_0x2133eb['attributes'],'include':_0x2133eb['include']?_['map'](_0x2133eb[_0x7bc8('0x24')],function(_0x402f17){return{'model':db[_0x402f17[_0x7bc8('0x25')]],'as':_0x402f17['as'],'attributes':_0x402f17[_0x7bc8('0x22')],'include':_0x402f17['include']?_[_0x7bc8('0x26')](_0x402f17[_0x7bc8('0x24')],function(_0x212515){return{'model':db[_0x212515['model']],'as':_0x212515['as'],'attributes':_0x212515[_0x7bc8('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x104a2f){logger[_0x7bc8('0x11')](_0x7bc8('0x1c'),_0x5cc4af);logger[_0x7bc8('0x14')](_0x7bc8('0x1c'),_0x5cc4af,JSON[_0x7bc8('0x16')](_0x104a2f));_0x5d0791(_0x104a2f);})[_0x7bc8('0x1b')](function(_0xbe46e2){logger[_0x7bc8('0x17')](_0x7bc8('0x1c'),_0xbe46e2[_0x7bc8('0x19')],_0x5cc4af);_0x3a3e51(_0x1f4329[_0x7bc8('0x17')](0x1f4,_0xbe46e2[_0x7bc8('0x19')]));});});};exports[_0x7bc8('0x27')]=function(_0x56496d){var _0x27cd9f=this;return new Promise(function(_0xca3acd,_0x29c709){return db['ChatQueue'][_0x7bc8('0x28')]({'raw':_0x56496d['options']?_0x56496d[_0x7bc8('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x56496d[_0x7bc8('0x1f')]?_0x56496d[_0x7bc8('0x1f')][_0x7bc8('0x21')]||null:null,'attributes':_0x56496d[_0x7bc8('0x1f')]?_0x56496d[_0x7bc8('0x1f')]['attributes']||null:null,'include':_0x56496d[_0x7bc8('0x1f')]?_0x56496d[_0x7bc8('0x1f')][_0x7bc8('0x24')]?_[_0x7bc8('0x26')](_0x56496d[_0x7bc8('0x1f')][_0x7bc8('0x24')],function(_0x2fa4db){return{'model':db[_0x2fa4db[_0x7bc8('0x25')]],'as':_0x2fa4db['as'],'attributes':_0x2fa4db[_0x7bc8('0x22')],'include':_0x2fa4db[_0x7bc8('0x24')]?_[_0x7bc8('0x26')](_0x2fa4db[_0x7bc8('0x24')],function(_0x16b5eb){return{'model':db[_0x16b5eb[_0x7bc8('0x25')]],'as':_0x16b5eb['as'],'attributes':_0x16b5eb['attributes'],'include':_0x16b5eb[_0x7bc8('0x24')]?_[_0x7bc8('0x26')](_0x16b5eb[_0x7bc8('0x24')],function(_0x359b5c){return{'model':db[_0x359b5c[_0x7bc8('0x25')]],'as':_0x359b5c['as'],'attributes':_0x359b5c[_0x7bc8('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7bc8('0x29')](function(_0x188721){logger[_0x7bc8('0x11')](_0x7bc8('0x27'),_0x56496d);logger[_0x7bc8('0x14')](_0x7bc8('0x27'),_0x56496d,JSON[_0x7bc8('0x16')](_0x188721));_0xca3acd(_0x188721);})[_0x7bc8('0x1b')](function(_0x191a5e){logger[_0x7bc8('0x17')]('ShowChatQueue',_0x191a5e['message'],_0x56496d);_0x29c709(_0x27cd9f[_0x7bc8('0x17')](0x1f4,_0x191a5e[_0x7bc8('0x19')]));});});};
\ No newline at end of file
+var _0x0d74=['jayson/promise','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x417a46,_0xb6327a){var _0xa3b9=function(_0x33a0e3){while(--_0x33a0e3){_0x417a46['push'](_0x417a46['shift']());}};_0xa3b9(++_0xb6327a);}(_0x0d74,0x146));var _0x40d7=function(_0x411758,_0x1ed7a3){_0x411758=_0x411758-0x0;var _0x283ea2=_0x0d74[_0x411758];return _0x283ea2;};'use strict';var _=require(_0x40d7('0x0'));var util=require(_0x40d7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x40d7('0x2'));var fs=require('fs');var Redis=require(_0x40d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x40d7('0x4'))(_0x40d7('0x5'));var config=require(_0x40d7('0x6'));var jayson=require(_0x40d7('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x40d7('0x8')](config['redis'],{'host':_0x40d7('0x9'),'port':0x18eb});var socket=require(_0x40d7('0xa'))(new Redis(config['redis']));require(_0x40d7('0xb'))[_0x40d7('0xc')](socket);function respondWithRpcPromise(_0x354f80,_0x2bae78,_0xcb37e3){return new BPromise(function(_0x517d88,_0x5208be){return client[_0x40d7('0xd')](_0x354f80,_0xcb37e3)[_0x40d7('0xe')](function(_0x229937){logger[_0x40d7('0xf')](_0x40d7('0x10'),_0x2bae78,'request\x20sent');logger[_0x40d7('0x11')](_0x40d7('0x12'),_0x2bae78,_0x40d7('0x13'),JSON[_0x40d7('0x14')](_0x229937));if(_0x229937['error']){if(_0x229937[_0x40d7('0x15')][_0x40d7('0x16')]===0x1f4){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);return _0x5208be(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}logger[_0x40d7('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x229937['error']['message']);return _0x517d88(_0x229937[_0x40d7('0x15')][_0x40d7('0x17')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2bae78,_0x40d7('0x13'));_0x517d88(_0x229937['result']['message']);}})[_0x40d7('0x18')](function(_0x22de5a){logger[_0x40d7('0x15')](_0x40d7('0x10'),_0x2bae78,_0x22de5a);_0x5208be(_0x22de5a);});});}exports[_0x40d7('0x19')]=function(_0x28bbc0){var _0x3d2afa=this;return new Promise(function(_0x3ec437,_0x5eb3c1){return db['ChatQueue']['findAll']({'raw':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1d')]||null:null,'limit':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1e')]||null:null,'include':_0x28bbc0[_0x40d7('0x1a')]?_0x28bbc0['options'][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x28bbc0[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x528ab5){return{'model':db[_0x528ab5['model']],'as':_0x528ab5['as'],'attributes':_0x528ab5[_0x40d7('0x1d')],'include':_0x528ab5['include']?_['map'](_0x528ab5[_0x40d7('0x1f')],function(_0x1ef074){return{'model':db[_0x1ef074[_0x40d7('0x21')]],'as':_0x1ef074['as'],'attributes':_0x1ef074[_0x40d7('0x1d')],'include':_0x1ef074['include']?_['map'](_0x1ef074[_0x40d7('0x1f')],function(_0x2b5f11){return{'model':db[_0x2b5f11[_0x40d7('0x21')]],'as':_0x2b5f11['as'],'attributes':_0x2b5f11['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1102d3){logger[_0x40d7('0xf')]('GetChatQueue',_0x28bbc0);logger[_0x40d7('0x11')](_0x40d7('0x19'),_0x28bbc0,JSON[_0x40d7('0x14')](_0x1102d3));_0x3ec437(_0x1102d3);})[_0x40d7('0x18')](function(_0x555a3b){logger['error'](_0x40d7('0x19'),_0x555a3b[_0x40d7('0x17')],_0x28bbc0);_0x5eb3c1(_0x3d2afa[_0x40d7('0x15')](0x1f4,_0x555a3b[_0x40d7('0x17')]));});});};exports[_0x40d7('0x22')]=function(_0x4a2bc2){var _0x23e560=this;return new Promise(function(_0x5af456,_0x22edd1){return db[_0x40d7('0x23')][_0x40d7('0x24')]({'raw':_0x4a2bc2['options']?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1c')]||null:null,'attributes':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')]['attributes']||null:null,'include':_0x4a2bc2[_0x40d7('0x1a')]?_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')]?_[_0x40d7('0x20')](_0x4a2bc2[_0x40d7('0x1a')][_0x40d7('0x1f')],function(_0x1e6f08){return{'model':db[_0x1e6f08[_0x40d7('0x21')]],'as':_0x1e6f08['as'],'attributes':_0x1e6f08['attributes'],'include':_0x1e6f08['include']?_[_0x40d7('0x20')](_0x1e6f08[_0x40d7('0x1f')],function(_0x4902a1){return{'model':db[_0x4902a1['model']],'as':_0x4902a1['as'],'attributes':_0x4902a1['attributes'],'include':_0x4902a1[_0x40d7('0x1f')]?_['map'](_0x4902a1[_0x40d7('0x1f')],function(_0x56b17c){return{'model':db[_0x56b17c[_0x40d7('0x21')]],'as':_0x56b17c['as'],'attributes':_0x56b17c[_0x40d7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x40d7('0xe')](function(_0x2e4ccb){logger[_0x40d7('0xf')]('ShowChatQueue',_0x4a2bc2);logger[_0x40d7('0x11')](_0x40d7('0x22'),_0x4a2bc2,JSON[_0x40d7('0x14')](_0x2e4ccb));_0x5af456(_0x2e4ccb);})[_0x40d7('0x18')](function(_0x21a675){logger['error']('ShowChatQueue',_0x21a675['message'],_0x4a2bc2);_0x22edd1(_0x23e560[_0x40d7('0x15')](0x1f4,_0x21a675['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 1dc5ec0..a4b1f7f 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x72b1,0x16e));var _0x172b=function(_0x102b25,_0x2e752a){_0x102b25=_0x102b25-0x0;var _0x13fe61=_0x72b1[_0x102b25];return _0x13fe61;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
+var _0xd6d6=['chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5b4271,_0x2f1e5d){var _0x10127e=function(_0x29ea27){while(--_0x29ea27){_0x5b4271['push'](_0x5b4271['shift']());}};_0x10127e(++_0x2f1e5d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4036b1,_0x1ee915){_0x4036b1=_0x4036b1-0x0;var _0x16260f=_0xd6d6[_0x4036b1];return _0x16260f;};'use strict';var ChatQueueEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatQueueEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatQueueEvents['on'](_0x18f824,_0xd49f57);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 718ca7c..cd772e1 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5a5216,_0x58f544){var _0x1aa577=function(_0x1e0781){while(--_0x1e0781){_0x5a5216['push'](_0x5a5216['shift']());}};_0x1aa577(++_0x58f544);}(_0xe14b,0x93));var _0xbe14=function(_0x5eee08,_0x301c49){_0x5eee08=_0x5eee08-0x0;var _0xe7e906=_0xe14b[_0x5eee08];return _0xe7e906;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x585554,_0x1413db){var _0x4eabed=function(_0x42cd75){while(--_0x42cd75){_0x585554['push'](_0x585554['shift']());}};_0x4eabed(++_0x1413db);}(_0x55ca,0x126));var _0xa55c=function(_0x2c34ff,_0x1e8bee){_0x2c34ff=_0x2c34ff-0x0;var _0x476508=_0x55ca[_0x2c34ff];return _0x476508;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 0bd7f8d..8c2a5e6 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 _0xed66=['STRING','DATE'];(function(_0x331cad,_0x50aec0){var _0x55db9e=function(_0x5e3459){while(--_0x5e3459){_0x331cad['push'](_0x331cad['shift']());}};_0x55db9e(++_0x50aec0);}(_0xed66,0xf2));var _0x6ed6=function(_0x50abc4,_0x558d64){_0x50abc4=_0x50abc4-0x0;var _0x5a745d=_0xed66[_0x50abc4];return _0x5a745d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6ed6('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x6ed6('0x0')]},'joinAt':{'type':Sequelize[_0x6ed6('0x1')]},'leaveAt':{'type':Sequelize[_0x6ed6('0x1')]},'acceptAt':{'type':Sequelize[_0x6ed6('0x1')]},'exitAt':{'type':Sequelize[_0x6ed6('0x1')]},'reason':{'type':Sequelize[_0x6ed6('0x0')]}};
\ No newline at end of file
+var _0x167a=['exports','STRING','DATE','sequelize'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0x167a,0x1ab));var _0xa167=function(_0x28bf2c,_0x248fa0){_0x28bf2c=_0x28bf2c-0x0;var _0x69dac6=_0x167a[_0x28bf2c];return _0x69dac6;};'use strict';var moment=require('moment');var Sequelize=require(_0xa167('0x0'));module[_0xa167('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa167('0x2')]},'joinAt':{'type':Sequelize[_0xa167('0x3')]},'leaveAt':{'type':Sequelize[_0xa167('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa167('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 708fe4c..4c4b71e 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 _0xef66=['pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','merge','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2d4b41,_0x268fbe){var _0x19470b=function(_0x2dcdea){while(--_0x2dcdea){_0x2d4b41['push'](_0x2d4b41['shift']());}};_0x19470b(++_0x268fbe);}(_0xef66,0x1db));var _0x6ef6=function(_0xcfd35b,_0xa94bd2){_0xcfd35b=_0xcfd35b-0x0;var _0x1867bf=_0xef66[_0xcfd35b];return _0x1867bf;};'use strict';var emlformat=require(_0x6ef6('0x0'));var rimraf=require(_0x6ef6('0x1'));var zipdir=require(_0x6ef6('0x2'));var jsonpatch=require(_0x6ef6('0x3'));var rp=require(_0x6ef6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6ef6('0x5'));var util=require(_0x6ef6('0x6'));var path=require(_0x6ef6('0x7'));var sox=require(_0x6ef6('0x8'));var csv=require(_0x6ef6('0x9'));var ejs=require(_0x6ef6('0xa'));var fs=require('fs');var fs_extra=require(_0x6ef6('0xb'));var _=require(_0x6ef6('0xc'));var squel=require(_0x6ef6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ef6('0xe'));var toCsv=require(_0x6ef6('0x9'));var querystring=require(_0x6ef6('0xf'));var Papa=require(_0x6ef6('0x10'));var Redis=require(_0x6ef6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6ef6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef6('0x13'))('api');var utils=require(_0x6ef6('0x14'));var config=require(_0x6ef6('0x15'));var licenseUtil=require(_0x6ef6('0x16'));var db=require(_0x6ef6('0x17'))['db'];function respondWithStatusCode(_0x596b91,_0x3aa045){_0x3aa045=_0x3aa045||0xcc;return function(_0x22b44e){if(_0x22b44e){return _0x596b91[_0x6ef6('0x18')](_0x3aa045);}return _0x596b91[_0x6ef6('0x19')](_0x3aa045)['end']();};}function respondWithResult(_0x265583,_0x5845b7){_0x5845b7=_0x5845b7||0xc8;return function(_0x40d198){if(_0x40d198){return _0x265583[_0x6ef6('0x19')](_0x5845b7)['json'](_0x40d198);}};}function respondWithFilteredResult(_0x248ab3,_0x1f4c3d){return function(_0x453aa3){if(_0x453aa3){var _0x3f0a84=typeof _0x1f4c3d[_0x6ef6('0x1a')]===_0x6ef6('0x1b')&&typeof _0x1f4c3d[_0x6ef6('0x1c')]===_0x6ef6('0x1b');var _0x1ed381=_0x453aa3[_0x6ef6('0x1d')];var _0x53586d=_0x3f0a84?0x0:_0x1f4c3d[_0x6ef6('0x1a')];var _0x2510be=_0x3f0a84?_0x453aa3[_0x6ef6('0x1d')]:_0x1f4c3d[_0x6ef6('0x1a')]+_0x1f4c3d[_0x6ef6('0x1c')];var _0x2e6e52;if(_0x2510be>=_0x1ed381){_0x2510be=_0x1ed381;_0x2e6e52=0xc8;}else{_0x2e6e52=0xce;}_0x248ab3[_0x6ef6('0x19')](_0x2e6e52);return _0x248ab3['set'](_0x6ef6('0x1e'),_0x53586d+'-'+_0x2510be+'/'+_0x1ed381)[_0x6ef6('0x1f')](_0x453aa3);}return null;};}function patchUpdates(_0x2903ea){return function(_0x11ade5){try{jsonpatch['apply'](_0x11ade5,_0x2903ea,!![]);}catch(_0x164ed9){return BPromise[_0x6ef6('0x20')](_0x164ed9);}return _0x11ade5[_0x6ef6('0x21')]();};}function saveUpdates(_0x4f6df6,_0x4257d8){return function(_0x1096de){if(_0x1096de){return _0x1096de['update'](_0x4f6df6)[_0x6ef6('0x22')](function(_0x3c225f){return _0x3c225f;});}return null;};}function removeEntity(_0x4d7f90,_0x366f2c){return function(_0xb1c6b0){if(_0xb1c6b0){return _0xb1c6b0[_0x6ef6('0x23')]()[_0x6ef6('0x22')](function(){_0x4d7f90[_0x6ef6('0x19')](0xcc)[_0x6ef6('0x24')]();});}};}function handleEntityNotFound(_0x1cd549,_0x499d4f){return function(_0x2e5059){if(!_0x2e5059){_0x1cd549['sendStatus'](0x194);}return _0x2e5059;};}function handleError(_0x39d3cc,_0x692c3d){_0x692c3d=_0x692c3d||0x1f4;return function(_0x443ded){logger[_0x6ef6('0x25')](_0x443ded[_0x6ef6('0x26')]);if(_0x443ded[_0x6ef6('0x27')]){delete _0x443ded[_0x6ef6('0x27')];}_0x39d3cc[_0x6ef6('0x19')](_0x692c3d)[_0x6ef6('0x28')](_0x443ded);};}exports[_0x6ef6('0x29')]=function(_0x136d20,_0x2d87a8){var _0x483f4d={},_0x40f9f6={},_0x295616={'count':0x0,'rows':[]};var _0x2e4bed=_[_0x6ef6('0x2a')](db[_0x6ef6('0x2b')][_0x6ef6('0x2c')],function(_0x23f979){return{'name':_0x23f979['fieldName'],'type':_0x23f979[_0x6ef6('0x2d')]['key']};});_0x40f9f6[_0x6ef6('0x2e')]=_[_0x6ef6('0x2a')](_0x2e4bed,_0x6ef6('0x27'));_0x40f9f6['query']=_['keys'](_0x136d20[_0x6ef6('0x2f')]);_0x40f9f6[_0x6ef6('0x30')]=_[_0x6ef6('0x31')](_0x40f9f6['model'],_0x40f9f6[_0x6ef6('0x2f')]);_0x483f4d['attributes']=_[_0x6ef6('0x31')](_0x40f9f6[_0x6ef6('0x2e')],qs['fields'](_0x136d20['query'][_0x6ef6('0x32')]));_0x483f4d['attributes']=_0x483f4d[_0x6ef6('0x33')]['length']?_0x483f4d[_0x6ef6('0x33')]:_0x40f9f6['model'];if(!_0x136d20['query'][_0x6ef6('0x34')](_0x6ef6('0x35'))){_0x483f4d['limit']=qs[_0x6ef6('0x1c')](_0x136d20['query'][_0x6ef6('0x1c')]);_0x483f4d['offset']=qs[_0x6ef6('0x1a')](_0x136d20['query'][_0x6ef6('0x1a')]);}_0x483f4d[_0x6ef6('0x36')]=qs[_0x6ef6('0x37')](_0x136d20['query']['sort']);_0x483f4d[_0x6ef6('0x38')]=qs[_0x6ef6('0x30')](_[_0x6ef6('0x39')](_0x136d20[_0x6ef6('0x2f')],_0x40f9f6['filters']),_0x2e4bed);if(_0x136d20['query'][_0x6ef6('0x3a')]){_0x483f4d['where']=_['merge'](_0x483f4d[_0x6ef6('0x38')],{'$or':_['map'](_0x2e4bed,function(_0x38969c){if(_0x38969c[_0x6ef6('0x2d')]!==_0x6ef6('0x3b')){var _0x31facc={};_0x31facc[_0x38969c[_0x6ef6('0x27')]]={'$like':'%'+_0x136d20[_0x6ef6('0x2f')][_0x6ef6('0x3a')]+'%'};return _0x31facc;}})});}_0x483f4d=_['merge']({},_0x483f4d,_0x136d20[_0x6ef6('0x3c')]);var _0x58fed8={'where':_0x483f4d['where']};return db[_0x6ef6('0x2b')][_0x6ef6('0x1d')](_0x58fed8)[_0x6ef6('0x22')](function(_0x4da800){_0x295616[_0x6ef6('0x1d')]=_0x4da800;if(_0x136d20[_0x6ef6('0x2f')][_0x6ef6('0x3d')]){_0x483f4d['include']=[{'all':!![]}];}return db[_0x6ef6('0x2b')][_0x6ef6('0x3e')](_0x483f4d);})[_0x6ef6('0x22')](function(_0x1bf2af){_0x295616[_0x6ef6('0x3f')]=_0x1bf2af;return _0x295616;})[_0x6ef6('0x22')](respondWithFilteredResult(_0x2d87a8,_0x483f4d))[_0x6ef6('0x40')](handleError(_0x2d87a8,null));};exports[_0x6ef6('0x41')]=function(_0x2c03a7,_0x230f30){var _0x51b0a1={'raw':!![],'where':{'id':_0x2c03a7[_0x6ef6('0x42')]['id']}},_0xf46913={};_0xf46913[_0x6ef6('0x2e')]=_[_0x6ef6('0x43')](db[_0x6ef6('0x2b')][_0x6ef6('0x2c')]);_0xf46913[_0x6ef6('0x2f')]=_[_0x6ef6('0x43')](_0x2c03a7[_0x6ef6('0x2f')]);_0xf46913[_0x6ef6('0x30')]=_[_0x6ef6('0x31')](_0xf46913['model'],_0xf46913[_0x6ef6('0x2f')]);_0x51b0a1['attributes']=_[_0x6ef6('0x31')](_0xf46913['model'],qs[_0x6ef6('0x32')](_0x2c03a7[_0x6ef6('0x2f')]['fields']));_0x51b0a1[_0x6ef6('0x33')]=_0x51b0a1[_0x6ef6('0x33')][_0x6ef6('0x44')]?_0x51b0a1[_0x6ef6('0x33')]:_0xf46913[_0x6ef6('0x2e')];if(_0x2c03a7['query'][_0x6ef6('0x3d')]){_0x51b0a1[_0x6ef6('0x45')]=[{'all':!![]}];}_0x51b0a1=_[_0x6ef6('0x46')]({},_0x51b0a1,_0x2c03a7[_0x6ef6('0x3c')]);return db[_0x6ef6('0x2b')][_0x6ef6('0x47')](_0x51b0a1)[_0x6ef6('0x22')](handleEntityNotFound(_0x230f30,null))[_0x6ef6('0x22')](respondWithResult(_0x230f30,null))['catch'](handleError(_0x230f30,null));};exports[_0x6ef6('0x48')]=function(_0x2d54c0,_0x52e93f){return db['ChatQueueReport'][_0x6ef6('0x48')](_0x2d54c0['body'],{})[_0x6ef6('0x22')](respondWithResult(_0x52e93f,0xc9))['catch'](handleError(_0x52e93f,null));};exports[_0x6ef6('0x49')]=function(_0x712015,_0x23edde){if(_0x712015[_0x6ef6('0x4a')]['id']){delete _0x712015['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x712015['params']['id']}})[_0x6ef6('0x22')](handleEntityNotFound(_0x23edde,null))[_0x6ef6('0x22')](saveUpdates(_0x712015[_0x6ef6('0x4a')],null))['then'](respondWithResult(_0x23edde,null))[_0x6ef6('0x40')](handleError(_0x23edde,null));};exports[_0x6ef6('0x23')]=function(_0x30a2a5,_0x43fda4){return db[_0x6ef6('0x2b')][_0x6ef6('0x47')]({'where':{'id':_0x30a2a5[_0x6ef6('0x42')]['id']}})['then'](handleEntityNotFound(_0x43fda4,null))[_0x6ef6('0x22')](removeEntity(_0x43fda4,null))['catch'](handleError(_0x43fda4,null));};exports[_0x6ef6('0x4b')]=function(_0x3549e9,_0x511a43){return db['ChatQueueReport'][_0x6ef6('0x4b')]()[_0x6ef6('0x22')](respondWithResult(_0x511a43,null))[_0x6ef6('0x40')](handleError(_0x511a43,null));};
\ No newline at end of file
+var _0x44ff=['show','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch'];(function(_0xc691d8,_0x69a50a){var _0x307e60=function(_0x40c734){while(--_0x40c734){_0xc691d8['push'](_0xc691d8['shift']());}};_0x307e60(++_0x69a50a);}(_0x44ff,0x1c3));var _0xf44f=function(_0x46121a,_0xd44bc0){_0x46121a=_0x46121a-0x0;var _0x126d1c=_0x44ff[_0x46121a];return _0x126d1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf44f('0x0'));var zipdir=require(_0xf44f('0x1'));var jsonpatch=require(_0xf44f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf44f('0x3'));var path=require(_0xf44f('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf44f('0x5'));var fs=require('fs');var fs_extra=require(_0xf44f('0x6'));var _=require(_0xf44f('0x7'));var squel=require('squel');var crypto=require(_0xf44f('0x8'));var jsforce=require(_0xf44f('0x9'));var deskjs=require(_0xf44f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xf44f('0xb'));var Papa=require(_0xf44f('0xc'));var Redis=require(_0xf44f('0xd'));var authService=require(_0xf44f('0xe'));var qs=require(_0xf44f('0xf'));var as=require(_0xf44f('0x10'));var hardwareService=require(_0xf44f('0x11'));var logger=require(_0xf44f('0x12'))(_0xf44f('0x13'));var utils=require(_0xf44f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf44f('0x15'));var db=require(_0xf44f('0x16'))['db'];function respondWithStatusCode(_0x23b73a,_0x34d3da){_0x34d3da=_0x34d3da||0xcc;return function(_0x10176f){if(_0x10176f){return _0x23b73a[_0xf44f('0x17')](_0x34d3da);}return _0x23b73a[_0xf44f('0x18')](_0x34d3da)['end']();};}function respondWithResult(_0x5d2b86,_0x17e828){_0x17e828=_0x17e828||0xc8;return function(_0x5f20aa){if(_0x5f20aa){return _0x5d2b86['status'](_0x17e828)['json'](_0x5f20aa);}};}function respondWithFilteredResult(_0x3aa2b8,_0x1d2d77){return function(_0x409907){if(_0x409907){var _0x1a5ce4=typeof _0x1d2d77['offset']===_0xf44f('0x19')&&typeof _0x1d2d77['limit']===_0xf44f('0x19');var _0x40e414=_0x409907[_0xf44f('0x1a')];var _0x15e5b6=_0x1a5ce4?0x0:_0x1d2d77['offset'];var _0x4f0338=_0x1a5ce4?_0x409907['count']:_0x1d2d77['offset']+_0x1d2d77[_0xf44f('0x1b')];var _0x4f0292;if(_0x4f0338>=_0x40e414){_0x4f0338=_0x40e414;_0x4f0292=0xc8;}else{_0x4f0292=0xce;}_0x3aa2b8['status'](_0x4f0292);return _0x3aa2b8[_0xf44f('0x1c')](_0xf44f('0x1d'),_0x15e5b6+'-'+_0x4f0338+'/'+_0x40e414)[_0xf44f('0x1e')](_0x409907);}return null;};}function patchUpdates(_0x515ea6){return function(_0x1c317e){try{jsonpatch[_0xf44f('0x1f')](_0x1c317e,_0x515ea6,!![]);}catch(_0x5eb768){return BPromise[_0xf44f('0x20')](_0x5eb768);}return _0x1c317e['save']();};}function saveUpdates(_0x1cc24e,_0x166acd){return function(_0x3e0b9c){if(_0x3e0b9c){return _0x3e0b9c['update'](_0x1cc24e)[_0xf44f('0x21')](function(_0x1b9dc9){return _0x1b9dc9;});}return null;};}function removeEntity(_0x329ed3,_0x58d4af){return function(_0x1ba9c0){if(_0x1ba9c0){return _0x1ba9c0[_0xf44f('0x22')]()[_0xf44f('0x21')](function(){_0x329ed3[_0xf44f('0x18')](0xcc)[_0xf44f('0x23')]();});}};}function handleEntityNotFound(_0x5313f5,_0x3c04fe){return function(_0x2a17e0){if(!_0x2a17e0){_0x5313f5[_0xf44f('0x17')](0x194);}return _0x2a17e0;};}function handleError(_0x2fe533,_0x5b9c45){_0x5b9c45=_0x5b9c45||0x1f4;return function(_0x1af2a2){logger[_0xf44f('0x24')](_0x1af2a2[_0xf44f('0x25')]);if(_0x1af2a2[_0xf44f('0x26')]){delete _0x1af2a2[_0xf44f('0x26')];}_0x2fe533[_0xf44f('0x18')](_0x5b9c45)['send'](_0x1af2a2);};}exports[_0xf44f('0x27')]=function(_0x5255eb,_0x2f5075){var _0x14e6cf={},_0x5a5a83={},_0x544f32={'count':0x0,'rows':[]};var _0x11d199=_[_0xf44f('0x28')](db[_0xf44f('0x29')][_0xf44f('0x2a')],function(_0x549fdd){return{'name':_0x549fdd[_0xf44f('0x2b')],'type':_0x549fdd[_0xf44f('0x2c')]['key']};});_0x5a5a83[_0xf44f('0x2d')]=_[_0xf44f('0x28')](_0x11d199,_0xf44f('0x26'));_0x5a5a83[_0xf44f('0x2e')]=_[_0xf44f('0x2f')](_0x5255eb[_0xf44f('0x2e')]);_0x5a5a83[_0xf44f('0x30')]=_[_0xf44f('0x31')](_0x5a5a83[_0xf44f('0x2d')],_0x5a5a83[_0xf44f('0x2e')]);_0x14e6cf['attributes']=_[_0xf44f('0x31')](_0x5a5a83[_0xf44f('0x2d')],qs['fields'](_0x5255eb[_0xf44f('0x2e')][_0xf44f('0x32')]));_0x14e6cf[_0xf44f('0x33')]=_0x14e6cf[_0xf44f('0x33')][_0xf44f('0x34')]?_0x14e6cf['attributes']:_0x5a5a83[_0xf44f('0x2d')];if(!_0x5255eb[_0xf44f('0x2e')][_0xf44f('0x35')](_0xf44f('0x36'))){_0x14e6cf[_0xf44f('0x1b')]=qs[_0xf44f('0x1b')](_0x5255eb[_0xf44f('0x2e')][_0xf44f('0x1b')]);_0x14e6cf[_0xf44f('0x37')]=qs['offset'](_0x5255eb[_0xf44f('0x2e')][_0xf44f('0x37')]);}_0x14e6cf[_0xf44f('0x38')]=qs[_0xf44f('0x39')](_0x5255eb[_0xf44f('0x2e')][_0xf44f('0x39')]);_0x14e6cf[_0xf44f('0x3a')]=qs[_0xf44f('0x30')](_[_0xf44f('0x3b')](_0x5255eb[_0xf44f('0x2e')],_0x5a5a83[_0xf44f('0x30')]),_0x11d199);if(_0x5255eb[_0xf44f('0x2e')][_0xf44f('0x3c')]){_0x14e6cf[_0xf44f('0x3a')]=_[_0xf44f('0x3d')](_0x14e6cf[_0xf44f('0x3a')],{'$or':_[_0xf44f('0x28')](_0x11d199,function(_0x37f274){if(_0x37f274[_0xf44f('0x2c')]!==_0xf44f('0x3e')){var _0x460308={};_0x460308[_0x37f274[_0xf44f('0x26')]]={'$like':'%'+_0x5255eb[_0xf44f('0x2e')]['filter']+'%'};return _0x460308;}})});}_0x14e6cf=_[_0xf44f('0x3d')]({},_0x14e6cf,_0x5255eb[_0xf44f('0x3f')]);var _0x1df436={'where':_0x14e6cf[_0xf44f('0x3a')]};return db['ChatQueueReport'][_0xf44f('0x1a')](_0x1df436)['then'](function(_0x54fd2f){_0x544f32[_0xf44f('0x1a')]=_0x54fd2f;if(_0x5255eb[_0xf44f('0x2e')][_0xf44f('0x40')]){_0x14e6cf[_0xf44f('0x41')]=[{'all':!![]}];}return db[_0xf44f('0x29')]['findAll'](_0x14e6cf);})[_0xf44f('0x21')](function(_0x32e8e0){_0x544f32['rows']=_0x32e8e0;return _0x544f32;})[_0xf44f('0x21')](respondWithFilteredResult(_0x2f5075,_0x14e6cf))[_0xf44f('0x42')](handleError(_0x2f5075,null));};exports[_0xf44f('0x43')]=function(_0x524d57,_0x11c508){var _0x502a21={'raw':!![],'where':{'id':_0x524d57[_0xf44f('0x44')]['id']}},_0x28717a={};_0x28717a['model']=_[_0xf44f('0x2f')](db[_0xf44f('0x29')][_0xf44f('0x2a')]);_0x28717a[_0xf44f('0x2e')]=_[_0xf44f('0x2f')](_0x524d57[_0xf44f('0x2e')]);_0x28717a[_0xf44f('0x30')]=_[_0xf44f('0x31')](_0x28717a['model'],_0x28717a[_0xf44f('0x2e')]);_0x502a21[_0xf44f('0x33')]=_[_0xf44f('0x31')](_0x28717a[_0xf44f('0x2d')],qs[_0xf44f('0x32')](_0x524d57[_0xf44f('0x2e')]['fields']));_0x502a21[_0xf44f('0x33')]=_0x502a21[_0xf44f('0x33')][_0xf44f('0x34')]?_0x502a21['attributes']:_0x28717a[_0xf44f('0x2d')];if(_0x524d57['query'][_0xf44f('0x40')]){_0x502a21[_0xf44f('0x41')]=[{'all':!![]}];}_0x502a21=_[_0xf44f('0x3d')]({},_0x502a21,_0x524d57['options']);return db[_0xf44f('0x29')][_0xf44f('0x45')](_0x502a21)[_0xf44f('0x21')](handleEntityNotFound(_0x11c508,null))['then'](respondWithResult(_0x11c508,null))['catch'](handleError(_0x11c508,null));};exports[_0xf44f('0x46')]=function(_0x2cb20c,_0x193dbd){return db[_0xf44f('0x29')][_0xf44f('0x46')](_0x2cb20c[_0xf44f('0x47')],{})[_0xf44f('0x21')](respondWithResult(_0x193dbd,0xc9))['catch'](handleError(_0x193dbd,null));};exports[_0xf44f('0x48')]=function(_0x30e382,_0x5a80fc){if(_0x30e382['body']['id']){delete _0x30e382['body']['id'];}return db[_0xf44f('0x29')][_0xf44f('0x45')]({'where':{'id':_0x30e382[_0xf44f('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a80fc,null))['then'](saveUpdates(_0x30e382[_0xf44f('0x47')],null))[_0xf44f('0x21')](respondWithResult(_0x5a80fc,null))[_0xf44f('0x42')](handleError(_0x5a80fc,null));};exports[_0xf44f('0x22')]=function(_0x1ecff0,_0x55a038){return db[_0xf44f('0x29')][_0xf44f('0x45')]({'where':{'id':_0x1ecff0['params']['id']}})[_0xf44f('0x21')](handleEntityNotFound(_0x55a038,null))['then'](removeEntity(_0x55a038,null))[_0xf44f('0x42')](handleError(_0x55a038,null));};exports[_0xf44f('0x49')]=function(_0x300fe0,_0x26ea85){return db[_0xf44f('0x29')][_0xf44f('0x49')]()[_0xf44f('0x21')](respondWithResult(_0x26ea85,null))['catch'](handleError(_0x26ea85,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 0acbcfe..ab3f945 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x414b13,_0x378308){var _0x2ec68a=function(_0x25a872){while(--_0x25a872){_0x414b13['push'](_0x414b13['shift']());}};_0x2ec68a(++_0x378308);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5edbfc,_0x47c0aa){var _0x3911d2=function(_0x33cdcc){while(--_0x33cdcc){_0x5edbfc['push'](_0x5edbfc['shift']());}};_0x3911d2(++_0x47c0aa);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 1a45a7c..6d67994 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 _0x5b78=['UpdateChatQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug'];(function(_0x29d082,_0x9da22c){var _0x5e5f78=function(_0x1dec27){while(--_0x1dec27){_0x29d082['push'](_0x29d082['shift']());}};_0x5e5f78(++_0x9da22c);}(_0x5b78,0x18f));var _0x85b7=function(_0x28f648,_0x5a4140){_0x28f648=_0x28f648-0x0;var _0x223692=_0x5b78[_0x28f648];return _0x223692;};'use strict';var _=require(_0x85b7('0x0'));var util=require(_0x85b7('0x1'));var moment=require(_0x85b7('0x2'));var BPromise=require(_0x85b7('0x3'));var rs=require(_0x85b7('0x4'));var fs=require('fs');var Redis=require(_0x85b7('0x5'));var db=require(_0x85b7('0x6'))['db'];var utils=require(_0x85b7('0x7'));var logger=require('../../config/logger')(_0x85b7('0x8'));var config=require(_0x85b7('0x9'));var jayson=require(_0x85b7('0xa'));var client=jayson['client'][_0x85b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x585614,_0x166b72,_0xcdf1bf){return new BPromise(function(_0xfc94c3,_0x5858f1){return client[_0x85b7('0xc')](_0x585614,_0xcdf1bf)[_0x85b7('0xd')](function(_0x19372e){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x166b72,_0x85b7('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x166b72,'request\x20sent',JSON[_0x85b7('0xf')](_0x19372e));if(_0x19372e[_0x85b7('0x10')]){if(_0x19372e[_0x85b7('0x10')][_0x85b7('0x11')]===0x1f4){logger[_0x85b7('0x10')](_0x85b7('0x12'),_0x166b72,_0x19372e['error'][_0x85b7('0x13')]);return _0x5858f1(_0x19372e[_0x85b7('0x10')][_0x85b7('0x13')]);}logger[_0x85b7('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x166b72,_0x19372e['error'][_0x85b7('0x13')]);return _0xfc94c3(_0x19372e['error'][_0x85b7('0x13')]);}else{logger[_0x85b7('0x14')](_0x85b7('0x12'),_0x166b72,_0x85b7('0xe'));_0xfc94c3(_0x19372e[_0x85b7('0x15')][_0x85b7('0x13')]);}})[_0x85b7('0x16')](function(_0x248c86){logger[_0x85b7('0x10')](_0x85b7('0x12'),_0x166b72,_0x248c86);_0x5858f1(_0x248c86);});});}exports[_0x85b7('0x17')]=function(_0x3d6662){var _0x59ac61=this;return new Promise(function(_0x1744b7,_0x4b12c9){return db[_0x85b7('0x18')][_0x85b7('0x19')](_0x3d6662[_0x85b7('0x1a')],{'raw':_0x3d6662[_0x85b7('0x1b')]?_0x3d6662[_0x85b7('0x1b')][_0x85b7('0x1c')]===undefined?!![]:![]:!![]})[_0x85b7('0xd')](function(_0x315841){logger[_0x85b7('0x14')](_0x85b7('0x17'),_0x3d6662);logger[_0x85b7('0x1d')](_0x85b7('0x17'),_0x3d6662,JSON[_0x85b7('0xf')](_0x315841));_0x1744b7(_0x315841);})[_0x85b7('0x16')](function(_0x549aca){logger[_0x85b7('0x10')]('CreateChatQueueReport',_0x549aca[_0x85b7('0x13')],_0x3d6662);_0x4b12c9(_0x59ac61['error'](0x1f4,_0x549aca[_0x85b7('0x13')]));});});};exports[_0x85b7('0x1e')]=function(_0x5ec1d0){var _0x34328b=this;return new Promise(function(_0x2990dc,_0x40d3e6){return db['ChatQueueReport'][_0x85b7('0x1f')](_0x5ec1d0['body'],{'raw':_0x5ec1d0[_0x85b7('0x1b')]?_0x5ec1d0[_0x85b7('0x1b')][_0x85b7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec1d0[_0x85b7('0x1b')]?_0x5ec1d0[_0x85b7('0x1b')]['where']||null:null,'attributes':_0x5ec1d0[_0x85b7('0x1b')]?_0x5ec1d0['options']['attributes']||null:null,'limit':_0x5ec1d0[_0x85b7('0x1b')]?_0x5ec1d0[_0x85b7('0x1b')][_0x85b7('0x20')]||null:null})[_0x85b7('0xd')](function(_0x4b01c0){logger[_0x85b7('0x14')](_0x85b7('0x1e'),_0x5ec1d0);logger[_0x85b7('0x1d')](_0x85b7('0x1e'),_0x5ec1d0,JSON[_0x85b7('0xf')](_0x4b01c0));_0x2990dc(_0x4b01c0);})['catch'](function(_0x142e15){logger[_0x85b7('0x10')]('UpdateChatQueueReport',_0x142e15['message'],_0x5ec1d0);_0x40d3e6(_0x34328b['error'](0x1f4,_0x142e15[_0x85b7('0x13')]));});});};
\ No newline at end of file
+var _0xd233=['request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','where','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dc2ac,_0xe92856){var _0x424d79=function(_0x416d89){while(--_0x416d89){_0x3dc2ac['push'](_0x3dc2ac['shift']());}};_0x424d79(++_0xe92856);}(_0xd233,0xdc));var _0x3d23=function(_0x4f8434,_0x562ed5){_0x4f8434=_0x4f8434-0x0;var _0x5bd5e4=_0xd233[_0x4f8434];return _0x5bd5e4;};'use strict';var _=require(_0x3d23('0x0'));var util=require(_0x3d23('0x1'));var moment=require(_0x3d23('0x2'));var BPromise=require(_0x3d23('0x3'));var rs=require(_0x3d23('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d23('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d23('0x6'))(_0x3d23('0x7'));var config=require(_0x3d23('0x8'));var jayson=require(_0x3d23('0x9'));var client=jayson['client'][_0x3d23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3a30,_0x4323f1,_0xb65d83){return new BPromise(function(_0x1a8220,_0xf1886){return client[_0x3d23('0xb')](_0x3e3a30,_0xb65d83)[_0x3d23('0xc')](function(_0x2a8181){logger['info'](_0x3d23('0xd'),_0x4323f1,_0x3d23('0xe'));logger[_0x3d23('0xf')](_0x3d23('0x10'),_0x4323f1,'request\x20sent',JSON[_0x3d23('0x11')](_0x2a8181));if(_0x2a8181[_0x3d23('0x12')]){if(_0x2a8181[_0x3d23('0x12')][_0x3d23('0x13')]===0x1f4){logger[_0x3d23('0x12')](_0x3d23('0xd'),_0x4323f1,_0x2a8181['error'][_0x3d23('0x14')]);return _0xf1886(_0x2a8181['error'][_0x3d23('0x14')]);}logger['error'](_0x3d23('0xd'),_0x4323f1,_0x2a8181[_0x3d23('0x12')][_0x3d23('0x14')]);return _0x1a8220(_0x2a8181[_0x3d23('0x12')][_0x3d23('0x14')]);}else{logger[_0x3d23('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x4323f1,'request\x20sent');_0x1a8220(_0x2a8181[_0x3d23('0x16')][_0x3d23('0x14')]);}})[_0x3d23('0x17')](function(_0x2b8b10){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4323f1,_0x2b8b10);_0xf1886(_0x2b8b10);});});}exports[_0x3d23('0x18')]=function(_0x407e61){var _0x585fad=this;return new Promise(function(_0xc73536,_0x1b5c1e){return db[_0x3d23('0x19')][_0x3d23('0x1a')](_0x407e61[_0x3d23('0x1b')],{'raw':_0x407e61[_0x3d23('0x1c')]?_0x407e61[_0x3d23('0x1c')][_0x3d23('0x1d')]===undefined?!![]:![]:!![]})[_0x3d23('0xc')](function(_0x35e740){logger[_0x3d23('0x15')](_0x3d23('0x18'),_0x407e61);logger[_0x3d23('0xf')](_0x3d23('0x18'),_0x407e61,JSON[_0x3d23('0x11')](_0x35e740));_0xc73536(_0x35e740);})['catch'](function(_0x42a98c){logger[_0x3d23('0x12')](_0x3d23('0x18'),_0x42a98c[_0x3d23('0x14')],_0x407e61);_0x1b5c1e(_0x585fad[_0x3d23('0x12')](0x1f4,_0x42a98c[_0x3d23('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2a5077){var _0x2a2214=this;return new Promise(function(_0x3fe7e5,_0x2f8ad6){return db['ChatQueueReport'][_0x3d23('0x1e')](_0x2a5077[_0x3d23('0x1b')],{'raw':_0x2a5077['options']?_0x2a5077[_0x3d23('0x1c')][_0x3d23('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a5077['options']?_0x2a5077[_0x3d23('0x1c')][_0x3d23('0x1f')]||null:null,'attributes':_0x2a5077['options']?_0x2a5077[_0x3d23('0x1c')]['attributes']||null:null,'limit':_0x2a5077[_0x3d23('0x1c')]?_0x2a5077[_0x3d23('0x1c')]['limit']||null:null})['then'](function(_0x43ef32){logger[_0x3d23('0x15')](_0x3d23('0x20'),_0x2a5077);logger[_0x3d23('0xf')](_0x3d23('0x20'),_0x2a5077,JSON['stringify'](_0x43ef32));_0x3fe7e5(_0x43ef32);})[_0x3d23('0x17')](function(_0x4233ff){logger[_0x3d23('0x12')](_0x3d23('0x20'),_0x4233ff[_0x3d23('0x14')],_0x2a5077);_0x2f8ad6(_0x2a2214[_0x3d23('0x12')](0x1f4,_0x4233ff[_0x3d23('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 711e67e..f853647 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 _0x05b9=['connect-timeout','Router','fs-extra','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x503e25,_0xb8a860){var _0x47c27a=function(_0x5e4449){while(--_0x5e4449){_0x503e25['push'](_0x503e25['shift']());}};_0x47c27a(++_0xb8a860);}(_0x05b9,0x9f));var _0x905b=function(_0x20463f,_0x4cc37a){_0x20463f=_0x20463f-0x0;var _0x143ee4=_0x05b9[_0x20463f];return _0x143ee4;};'use strict';var multer=require(_0x905b('0x0'));var util=require(_0x905b('0x1'));var path=require(_0x905b('0x2'));var timeout=require(_0x905b('0x3'));var express=require('express');var router=express[_0x905b('0x4')]();var fs_extra=require(_0x905b('0x5'));var auth=require(_0x905b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x905b('0x7'));router[_0x905b('0x8')]('/',auth[_0x905b('0x9')](),controller[_0x905b('0xa')]);router['get'](_0x905b('0xb'),auth[_0x905b('0x9')](),controller['describe']);router[_0x905b('0x8')]('/:id',auth[_0x905b('0x9')](),controller[_0x905b('0xc')]);router[_0x905b('0xd')]('/',auth[_0x905b('0x9')](),controller[_0x905b('0xe')]);router['put']('/:id',auth[_0x905b('0x9')](),controller[_0x905b('0xf')]);router[_0x905b('0x10')]('/:id',auth[_0x905b('0x9')](),controller[_0x905b('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x0b29=['/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x0b29,0x19b));var _0x90b2=function(_0x286e14,_0x4ec12e){_0x286e14=_0x286e14-0x0;var _0x51c558=_0x0b29[_0x286e14];return _0x51c558;};'use strict';var multer=require('multer');var util=require(_0x90b2('0x0'));var path=require('path');var timeout=require(_0x90b2('0x1'));var express=require(_0x90b2('0x2'));var router=express[_0x90b2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x90b2('0x4'));var config=require(_0x90b2('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x90b2('0x6')](),controller['index']);router[_0x90b2('0x7')]('/describe',auth[_0x90b2('0x6')](),controller[_0x90b2('0x8')]);router[_0x90b2('0x7')](_0x90b2('0x9'),auth[_0x90b2('0x6')](),controller[_0x90b2('0xa')]);router['post']('/',auth[_0x90b2('0x6')](),controller[_0x90b2('0xb')]);router[_0x90b2('0xc')](_0x90b2('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x90b2('0xd')]('/:id',auth[_0x90b2('0x6')](),controller[_0x90b2('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 274b6c3..a2afc63 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x9bde,0xe1));var _0xe9bd=function(_0x387ff4,_0x3f2ce4){_0x387ff4=_0x387ff4-0x0;var _0x5cf83a=_0x9bde[_0x387ff4];return _0x5cf83a;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x210c3b,_0x48e64f){var _0x544f02=function(_0x2f7394){while(--_0x2f7394){_0x210c3b['push'](_0x210c3b['shift']());}};_0x544f02(++_0x48e64f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x00bb[_0x56482c];return _0x5aae7a;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 34afcf8..4bf3bc6 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 _0x716e=['send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','create','body','params','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name'];(function(_0x336e44,_0x3fb0ef){var _0x44c0db=function(_0x214c14){while(--_0x214c14){_0x336e44['push'](_0x336e44['shift']());}};_0x44c0db(++_0x3fb0ef);}(_0x716e,0x14b));var _0xe716=function(_0x12859f,_0x79de98){_0x12859f=_0x12859f-0x0;var _0x168184=_0x716e[_0x12859f];return _0x168184;};'use strict';var emlformat=require(_0xe716('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe716('0x1'));var jsonpatch=require(_0xe716('0x2'));var rp=require(_0xe716('0x3'));var moment=require(_0xe716('0x4'));var BPromise=require(_0xe716('0x5'));var Mustache=require(_0xe716('0x6'));var util=require(_0xe716('0x7'));var path=require('path');var sox=require(_0xe716('0x8'));var csv=require(_0xe716('0x9'));var ejs=require(_0xe716('0xa'));var fs=require('fs');var fs_extra=require(_0xe716('0xb'));var _=require(_0xe716('0xc'));var squel=require(_0xe716('0xd'));var crypto=require('crypto');var jsforce=require(_0xe716('0xe'));var deskjs=require(_0xe716('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe716('0x10'));var authService=require(_0xe716('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe716('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xe716('0x13'));var config=require(_0xe716('0x14'));var licenseUtil=require(_0xe716('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2887d5,_0x291759){_0x291759=_0x291759||0xcc;return function(_0x105c90){if(_0x105c90){return _0x2887d5[_0xe716('0x16')](_0x291759);}return _0x2887d5[_0xe716('0x17')](_0x291759)[_0xe716('0x18')]();};}function respondWithResult(_0x8c7536,_0x1dca4c){_0x1dca4c=_0x1dca4c||0xc8;return function(_0x10e908){if(_0x10e908){return _0x8c7536[_0xe716('0x17')](_0x1dca4c)[_0xe716('0x19')](_0x10e908);}};}function respondWithFilteredResult(_0x546bc9,_0x60d3ab){return function(_0x1630a3){if(_0x1630a3){var _0x2c0f8f=typeof _0x60d3ab['offset']==='undefined'&&typeof _0x60d3ab['limit']===_0xe716('0x1a');var _0x3b619d=_0x1630a3[_0xe716('0x1b')];var _0x12a8d1=_0x2c0f8f?0x0:_0x60d3ab[_0xe716('0x1c')];var _0x48db91=_0x2c0f8f?_0x1630a3[_0xe716('0x1b')]:_0x60d3ab[_0xe716('0x1c')]+_0x60d3ab[_0xe716('0x1d')];var _0x53a52b;if(_0x48db91>=_0x3b619d){_0x48db91=_0x3b619d;_0x53a52b=0xc8;}else{_0x53a52b=0xce;}_0x546bc9[_0xe716('0x17')](_0x53a52b);return _0x546bc9[_0xe716('0x1e')]('Content-Range',_0x12a8d1+'-'+_0x48db91+'/'+_0x3b619d)[_0xe716('0x19')](_0x1630a3);}return null;};}function patchUpdates(_0x296cca){return function(_0x2a15a3){try{jsonpatch['apply'](_0x2a15a3,_0x296cca,!![]);}catch(_0x3d9308){return BPromise[_0xe716('0x1f')](_0x3d9308);}return _0x2a15a3[_0xe716('0x20')]();};}function saveUpdates(_0x17bf7a,_0x1e1a19){return function(_0x4fbadf){if(_0x4fbadf){return _0x4fbadf[_0xe716('0x21')](_0x17bf7a)[_0xe716('0x22')](function(_0x5268cc){return _0x5268cc;});}return null;};}function removeEntity(_0x5c4284,_0x5b92de){return function(_0x1d3f0c){if(_0x1d3f0c){return _0x1d3f0c[_0xe716('0x23')]()[_0xe716('0x22')](function(){_0x5c4284['status'](0xcc)[_0xe716('0x18')]();});}};}function handleEntityNotFound(_0x478489,_0x40b89f){return function(_0x21ffb8){if(!_0x21ffb8){_0x478489[_0xe716('0x16')](0x194);}return _0x21ffb8;};}function handleError(_0x44c7ff,_0x5b405f){_0x5b405f=_0x5b405f||0x1f4;return function(_0x238603){logger[_0xe716('0x24')](_0x238603[_0xe716('0x25')]);if(_0x238603[_0xe716('0x26')]){delete _0x238603[_0xe716('0x26')];}_0x44c7ff[_0xe716('0x17')](_0x5b405f)[_0xe716('0x27')](_0x238603);};}exports[_0xe716('0x28')]=function(_0xe001c8,_0x425e65){var _0x20c613={},_0x430cca={},_0x354235={'count':0x0,'rows':[]};var _0x12335d=_[_0xe716('0x29')](db[_0xe716('0x2a')][_0xe716('0x2b')],function(_0x409de2){return{'name':_0x409de2[_0xe716('0x2c')],'type':_0x409de2['type'][_0xe716('0x2d')]};});_0x430cca[_0xe716('0x2e')]=_[_0xe716('0x29')](_0x12335d,_0xe716('0x26'));_0x430cca['query']=_[_0xe716('0x2f')](_0xe001c8[_0xe716('0x30')]);_0x430cca[_0xe716('0x31')]=_[_0xe716('0x32')](_0x430cca['model'],_0x430cca['query']);_0x20c613[_0xe716('0x33')]=_[_0xe716('0x32')](_0x430cca[_0xe716('0x2e')],qs[_0xe716('0x34')](_0xe001c8[_0xe716('0x30')]['fields']));_0x20c613[_0xe716('0x33')]=_0x20c613[_0xe716('0x33')][_0xe716('0x35')]?_0x20c613[_0xe716('0x33')]:_0x430cca[_0xe716('0x2e')];if(!_0xe001c8[_0xe716('0x30')]['hasOwnProperty'](_0xe716('0x36'))){_0x20c613[_0xe716('0x1d')]=qs[_0xe716('0x1d')](_0xe001c8[_0xe716('0x30')]['limit']);_0x20c613[_0xe716('0x1c')]=qs[_0xe716('0x1c')](_0xe001c8[_0xe716('0x30')][_0xe716('0x1c')]);}_0x20c613[_0xe716('0x37')]=qs['sort'](_0xe001c8[_0xe716('0x30')][_0xe716('0x38')]);_0x20c613[_0xe716('0x39')]=qs[_0xe716('0x31')](_[_0xe716('0x3a')](_0xe001c8['query'],_0x430cca[_0xe716('0x31')]),_0x12335d);if(_0xe001c8[_0xe716('0x30')]['filter']){_0x20c613['where']=_[_0xe716('0x3b')](_0x20c613[_0xe716('0x39')],{'$or':_['map'](_0x12335d,function(_0x4a6079){if(_0x4a6079[_0xe716('0x3c')]!==_0xe716('0x3d')){var _0x41c63a={};_0x41c63a[_0x4a6079[_0xe716('0x26')]]={'$like':'%'+_0xe001c8[_0xe716('0x30')][_0xe716('0x3e')]+'%'};return _0x41c63a;}})});}_0x20c613=_[_0xe716('0x3b')]({},_0x20c613,_0xe001c8[_0xe716('0x3f')]);var _0x2941a0={'where':_0x20c613['where']};return db[_0xe716('0x2a')][_0xe716('0x1b')](_0x2941a0)[_0xe716('0x22')](function(_0x27afc5){_0x354235[_0xe716('0x1b')]=_0x27afc5;if(_0xe001c8[_0xe716('0x30')][_0xe716('0x40')]){_0x20c613[_0xe716('0x41')]=[{'all':!![]}];}return db[_0xe716('0x2a')][_0xe716('0x42')](_0x20c613);})['then'](function(_0x2dfd36){_0x354235[_0xe716('0x43')]=_0x2dfd36;return _0x354235;})[_0xe716('0x22')](respondWithFilteredResult(_0x425e65,_0x20c613))['catch'](handleError(_0x425e65,null));};exports['show']=function(_0x4c5674,_0x2f77e4){var _0xd3c5d5={'raw':!![],'where':{'id':_0x4c5674['params']['id']}},_0x44a70a={};_0x44a70a[_0xe716('0x2e')]=_['keys'](db[_0xe716('0x2a')][_0xe716('0x2b')]);_0x44a70a[_0xe716('0x30')]=_[_0xe716('0x2f')](_0x4c5674[_0xe716('0x30')]);_0x44a70a[_0xe716('0x31')]=_['intersection'](_0x44a70a['model'],_0x44a70a[_0xe716('0x30')]);_0xd3c5d5['attributes']=_[_0xe716('0x32')](_0x44a70a[_0xe716('0x2e')],qs[_0xe716('0x34')](_0x4c5674[_0xe716('0x30')][_0xe716('0x34')]));_0xd3c5d5[_0xe716('0x33')]=_0xd3c5d5[_0xe716('0x33')][_0xe716('0x35')]?_0xd3c5d5[_0xe716('0x33')]:_0x44a70a['model'];if(_0x4c5674[_0xe716('0x30')][_0xe716('0x40')]){_0xd3c5d5['include']=[{'all':!![]}];}_0xd3c5d5=_[_0xe716('0x3b')]({},_0xd3c5d5,_0x4c5674[_0xe716('0x3f')]);return db[_0xe716('0x2a')]['find'](_0xd3c5d5)[_0xe716('0x22')](handleEntityNotFound(_0x2f77e4,null))[_0xe716('0x22')](respondWithResult(_0x2f77e4,null))[_0xe716('0x44')](handleError(_0x2f77e4,null));};exports[_0xe716('0x45')]=function(_0x5d59b9,_0x17e2ea){return db[_0xe716('0x2a')][_0xe716('0x45')](_0x5d59b9['body'],{})[_0xe716('0x22')](respondWithResult(_0x17e2ea,0xc9))[_0xe716('0x44')](handleError(_0x17e2ea,null));};exports['update']=function(_0x27e0e6,_0x31923e){if(_0x27e0e6[_0xe716('0x46')]['id']){delete _0x27e0e6['body']['id'];}return db[_0xe716('0x2a')]['find']({'where':{'id':_0x27e0e6[_0xe716('0x47')]['id']}})['then'](handleEntityNotFound(_0x31923e,null))[_0xe716('0x22')](saveUpdates(_0x27e0e6[_0xe716('0x46')],null))[_0xe716('0x22')](respondWithResult(_0x31923e,null))[_0xe716('0x44')](handleError(_0x31923e,null));};exports[_0xe716('0x23')]=function(_0x3ecd93,_0x1cc8c8){return db[_0xe716('0x2a')][_0xe716('0x48')]({'where':{'id':_0x3ecd93[_0xe716('0x47')]['id']}})['then'](handleEntityNotFound(_0x1cc8c8,null))[_0xe716('0x22')](removeEntity(_0x1cc8c8,null))[_0xe716('0x44')](handleError(_0x1cc8c8,null));};exports[_0xe716('0x49')]=function(_0x5d7e60,_0x4201bc){return db['ChatTransferReport'][_0xe716('0x49')]()[_0xe716('0x22')](respondWithResult(_0x4201bc,null))[_0xe716('0x44')](handleError(_0x4201bc,null));};
\ No newline at end of file
+var _0xd287=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','status','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','include','find','catch','create','body','params'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xd287,0xe8));var _0x7d28=function(_0x5bda41,_0x2ae00e){_0x5bda41=_0x5bda41-0x0;var _0x5a85d9=_0xd287[_0x5bda41];return _0x5a85d9;};'use strict';var emlformat=require(_0x7d28('0x0'));var rimraf=require(_0x7d28('0x1'));var zipdir=require(_0x7d28('0x2'));var jsonpatch=require(_0x7d28('0x3'));var rp=require(_0x7d28('0x4'));var moment=require('moment');var BPromise=require(_0x7d28('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7d28('0x6'));var sox=require(_0x7d28('0x7'));var csv=require(_0x7d28('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d28('0x9'));var _=require(_0x7d28('0xa'));var squel=require(_0x7d28('0xb'));var crypto=require(_0x7d28('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7d28('0xd'));var toCsv=require(_0x7d28('0x8'));var querystring=require(_0x7d28('0xe'));var Papa=require(_0x7d28('0xf'));var Redis=require('ioredis');var authService=require(_0x7d28('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7d28('0x11'));var hardwareService=require(_0x7d28('0x12'));var logger=require(_0x7d28('0x13'))(_0x7d28('0x14'));var utils=require(_0x7d28('0x15'));var config=require(_0x7d28('0x16'));var licenseUtil=require(_0x7d28('0x17'));var db=require(_0x7d28('0x18'))['db'];function respondWithStatusCode(_0x581ddd,_0x459459){_0x459459=_0x459459||0xcc;return function(_0x56df4d){if(_0x56df4d){return _0x581ddd[_0x7d28('0x19')](_0x459459);}return _0x581ddd['status'](_0x459459)[_0x7d28('0x1a')]();};}function respondWithResult(_0x24d43a,_0x4016f9){_0x4016f9=_0x4016f9||0xc8;return function(_0x52ed89){if(_0x52ed89){return _0x24d43a['status'](_0x4016f9)[_0x7d28('0x1b')](_0x52ed89);}};}function respondWithFilteredResult(_0x11f8b4,_0x4d7cb7){return function(_0x2cb022){if(_0x2cb022){var _0x44d3a6=typeof _0x4d7cb7[_0x7d28('0x1c')]==='undefined'&&typeof _0x4d7cb7['limit']==='undefined';var _0x36b124=_0x2cb022[_0x7d28('0x1d')];var _0x157a20=_0x44d3a6?0x0:_0x4d7cb7[_0x7d28('0x1c')];var _0x2e4eae=_0x44d3a6?_0x2cb022[_0x7d28('0x1d')]:_0x4d7cb7[_0x7d28('0x1c')]+_0x4d7cb7[_0x7d28('0x1e')];var _0x45d27b;if(_0x2e4eae>=_0x36b124){_0x2e4eae=_0x36b124;_0x45d27b=0xc8;}else{_0x45d27b=0xce;}_0x11f8b4['status'](_0x45d27b);return _0x11f8b4[_0x7d28('0x1f')](_0x7d28('0x20'),_0x157a20+'-'+_0x2e4eae+'/'+_0x36b124)[_0x7d28('0x1b')](_0x2cb022);}return null;};}function patchUpdates(_0x20d8b7){return function(_0x539424){try{jsonpatch[_0x7d28('0x21')](_0x539424,_0x20d8b7,!![]);}catch(_0xef284a){return BPromise[_0x7d28('0x22')](_0xef284a);}return _0x539424['save']();};}function saveUpdates(_0x15250e,_0x13d388){return function(_0x26d0a0){if(_0x26d0a0){return _0x26d0a0[_0x7d28('0x23')](_0x15250e)[_0x7d28('0x24')](function(_0x47da39){return _0x47da39;});}return null;};}function removeEntity(_0x3f4184,_0x13c060){return function(_0x4007d2){if(_0x4007d2){return _0x4007d2[_0x7d28('0x25')]()[_0x7d28('0x24')](function(){_0x3f4184[_0x7d28('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f7a76,_0x29e0ed){return function(_0x45026b){if(!_0x45026b){_0x1f7a76[_0x7d28('0x19')](0x194);}return _0x45026b;};}function handleError(_0x4b1445,_0x3bdb9d){_0x3bdb9d=_0x3bdb9d||0x1f4;return function(_0x24d04e){logger[_0x7d28('0x27')](_0x24d04e[_0x7d28('0x28')]);if(_0x24d04e[_0x7d28('0x29')]){delete _0x24d04e[_0x7d28('0x29')];}_0x4b1445[_0x7d28('0x26')](_0x3bdb9d)[_0x7d28('0x2a')](_0x24d04e);};}exports[_0x7d28('0x2b')]=function(_0x5d3b5b,_0x4d18a6){var _0x5e352c={},_0x3a519f={},_0x240fc5={'count':0x0,'rows':[]};var _0x32525e=_[_0x7d28('0x2c')](db[_0x7d28('0x2d')][_0x7d28('0x2e')],function(_0x223b3c){return{'name':_0x223b3c[_0x7d28('0x2f')],'type':_0x223b3c[_0x7d28('0x30')][_0x7d28('0x31')]};});_0x3a519f[_0x7d28('0x32')]=_[_0x7d28('0x2c')](_0x32525e,'name');_0x3a519f[_0x7d28('0x33')]=_[_0x7d28('0x34')](_0x5d3b5b[_0x7d28('0x33')]);_0x3a519f[_0x7d28('0x35')]=_[_0x7d28('0x36')](_0x3a519f[_0x7d28('0x32')],_0x3a519f['query']);_0x5e352c[_0x7d28('0x37')]=_[_0x7d28('0x36')](_0x3a519f[_0x7d28('0x32')],qs[_0x7d28('0x38')](_0x5d3b5b[_0x7d28('0x33')][_0x7d28('0x38')]));_0x5e352c['attributes']=_0x5e352c[_0x7d28('0x37')][_0x7d28('0x39')]?_0x5e352c['attributes']:_0x3a519f[_0x7d28('0x32')];if(!_0x5d3b5b[_0x7d28('0x33')][_0x7d28('0x3a')](_0x7d28('0x3b'))){_0x5e352c[_0x7d28('0x1e')]=qs[_0x7d28('0x1e')](_0x5d3b5b['query'][_0x7d28('0x1e')]);_0x5e352c[_0x7d28('0x1c')]=qs[_0x7d28('0x1c')](_0x5d3b5b[_0x7d28('0x33')][_0x7d28('0x1c')]);}_0x5e352c[_0x7d28('0x3c')]=qs[_0x7d28('0x3d')](_0x5d3b5b['query'][_0x7d28('0x3d')]);_0x5e352c[_0x7d28('0x3e')]=qs['filters'](_[_0x7d28('0x3f')](_0x5d3b5b[_0x7d28('0x33')],_0x3a519f[_0x7d28('0x35')]),_0x32525e);if(_0x5d3b5b[_0x7d28('0x33')]['filter']){_0x5e352c['where']=_[_0x7d28('0x40')](_0x5e352c[_0x7d28('0x3e')],{'$or':_[_0x7d28('0x2c')](_0x32525e,function(_0x41b272){if(_0x41b272['type']!==_0x7d28('0x41')){var _0x26055b={};_0x26055b[_0x41b272['name']]={'$like':'%'+_0x5d3b5b[_0x7d28('0x33')]['filter']+'%'};return _0x26055b;}})});}_0x5e352c=_[_0x7d28('0x40')]({},_0x5e352c,_0x5d3b5b[_0x7d28('0x42')]);var _0x202080={'where':_0x5e352c[_0x7d28('0x3e')]};return db[_0x7d28('0x2d')][_0x7d28('0x1d')](_0x202080)[_0x7d28('0x24')](function(_0x173346){_0x240fc5[_0x7d28('0x1d')]=_0x173346;if(_0x5d3b5b['query'][_0x7d28('0x43')]){_0x5e352c['include']=[{'all':!![]}];}return db[_0x7d28('0x2d')][_0x7d28('0x44')](_0x5e352c);})[_0x7d28('0x24')](function(_0xaff340){_0x240fc5[_0x7d28('0x45')]=_0xaff340;return _0x240fc5;})[_0x7d28('0x24')](respondWithFilteredResult(_0x4d18a6,_0x5e352c))['catch'](handleError(_0x4d18a6,null));};exports['show']=function(_0x30b602,_0x5e08bf){var _0x5229b5={'raw':!![],'where':{'id':_0x30b602['params']['id']}},_0x44c46a={};_0x44c46a[_0x7d28('0x32')]=_['keys'](db[_0x7d28('0x2d')]['rawAttributes']);_0x44c46a[_0x7d28('0x33')]=_[_0x7d28('0x34')](_0x30b602[_0x7d28('0x33')]);_0x44c46a[_0x7d28('0x35')]=_[_0x7d28('0x36')](_0x44c46a[_0x7d28('0x32')],_0x44c46a[_0x7d28('0x33')]);_0x5229b5['attributes']=_[_0x7d28('0x36')](_0x44c46a['model'],qs[_0x7d28('0x38')](_0x30b602['query']['fields']));_0x5229b5['attributes']=_0x5229b5[_0x7d28('0x37')][_0x7d28('0x39')]?_0x5229b5[_0x7d28('0x37')]:_0x44c46a['model'];if(_0x30b602['query'][_0x7d28('0x43')]){_0x5229b5[_0x7d28('0x46')]=[{'all':!![]}];}_0x5229b5=_[_0x7d28('0x40')]({},_0x5229b5,_0x30b602['options']);return db[_0x7d28('0x2d')][_0x7d28('0x47')](_0x5229b5)['then'](handleEntityNotFound(_0x5e08bf,null))[_0x7d28('0x24')](respondWithResult(_0x5e08bf,null))[_0x7d28('0x48')](handleError(_0x5e08bf,null));};exports[_0x7d28('0x49')]=function(_0x2c1073,_0xc4c056){return db['ChatTransferReport']['create'](_0x2c1073[_0x7d28('0x4a')],{})[_0x7d28('0x24')](respondWithResult(_0xc4c056,0xc9))[_0x7d28('0x48')](handleError(_0xc4c056,null));};exports['update']=function(_0x12d127,_0x21faaf){if(_0x12d127[_0x7d28('0x4a')]['id']){delete _0x12d127[_0x7d28('0x4a')]['id'];}return db[_0x7d28('0x2d')][_0x7d28('0x47')]({'where':{'id':_0x12d127[_0x7d28('0x4b')]['id']}})[_0x7d28('0x24')](handleEntityNotFound(_0x21faaf,null))[_0x7d28('0x24')](saveUpdates(_0x12d127[_0x7d28('0x4a')],null))[_0x7d28('0x24')](respondWithResult(_0x21faaf,null))['catch'](handleError(_0x21faaf,null));};exports[_0x7d28('0x25')]=function(_0x4e4780,_0x1c569f){return db[_0x7d28('0x2d')]['find']({'where':{'id':_0x4e4780[_0x7d28('0x4b')]['id']}})[_0x7d28('0x24')](handleEntityNotFound(_0x1c569f,null))['then'](removeEntity(_0x1c569f,null))[_0x7d28('0x48')](handleError(_0x1c569f,null));};exports[_0x7d28('0x4c')]=function(_0x31a20f,_0x1bb91d){return db[_0x7d28('0x2d')][_0x7d28('0x4c')]()[_0x7d28('0x24')](respondWithResult(_0x1bb91d,null))[_0x7d28('0x48')](handleError(_0x1bb91d,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 648594e..91eee6d 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 _0x4817=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x28dcef,_0x3664be){var _0x56c687=function(_0x2a98f5){while(--_0x2a98f5){_0x28dcef['push'](_0x28dcef['shift']());}};_0x56c687(++_0x3664be);}(_0x4817,0x136));var _0x7481=function(_0x128f3b,_0x582556){_0x128f3b=_0x128f3b-0x0;var _0x25ed6a=_0x4817[_0x128f3b];return _0x25ed6a;};'use strict';var _=require('lodash');var util=require(_0x7481('0x0'));var logger=require(_0x7481('0x1'))(_0x7481('0x2'));var moment=require(_0x7481('0x3'));var BPromise=require(_0x7481('0x4'));var rp=require(_0x7481('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7481('0x6'));var config=require(_0x7481('0x7'));var attributes=require(_0x7481('0x8'));module[_0x7481('0x9')]=function(_0x41c951,_0x4fec93){return _0x41c951['define'](_0x7481('0xa'),attributes,{'tableName':_0x7481('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7481('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xed9f=['./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','path','rimraf','../../config/environment'];(function(_0x297b4e,_0x139e0f){var _0x37882a=function(_0x25f7f4){while(--_0x25f7f4){_0x297b4e['push'](_0x297b4e['shift']());}};_0x37882a(++_0x139e0f);}(_0xed9f,0x118));var _0xfed9=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0xed9f[_0x5f0501];return _0x3c2c45;};'use strict';var _=require(_0xfed9('0x0'));var util=require(_0xfed9('0x1'));var logger=require(_0xfed9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfed9('0x3'));var rimraf=require(_0xfed9('0x4'));var config=require(_0xfed9('0x5'));var attributes=require(_0xfed9('0x6'));module[_0xfed9('0x7')]=function(_0x32376a,_0x1249d9){return _0x32376a[_0xfed9('0x8')](_0xfed9('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xfed9('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 62ed873..d7d468c 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 _0x4ec8=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x4ec8,0x119));var _0x84ec=function(_0x3c1f22,_0x479ed1){_0x3c1f22=_0x3c1f22-0x0;var _0x22f5f2=_0x4ec8[_0x3c1f22];return _0x22f5f2;};'use strict';var _=require('lodash');var util=require(_0x84ec('0x0'));var moment=require(_0x84ec('0x1'));var BPromise=require(_0x84ec('0x2'));var rs=require(_0x84ec('0x3'));var fs=require('fs');var Redis=require(_0x84ec('0x4'));var db=require(_0x84ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x84ec('0x6'))(_0x84ec('0x7'));var config=require(_0x84ec('0x8'));var jayson=require(_0x84ec('0x9'));var client=jayson[_0x84ec('0xa')][_0x84ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c944,_0x5d65b8,_0x2a3fa6){return new BPromise(function(_0x36818e,_0x449c78){return client[_0x84ec('0xc')](_0x29c944,_0x2a3fa6)[_0x84ec('0xd')](function(_0x133e11){logger[_0x84ec('0xe')](_0x84ec('0xf'),_0x5d65b8,_0x84ec('0x10'));logger[_0x84ec('0x11')](_0x84ec('0x12'),_0x5d65b8,'request\x20sent',JSON[_0x84ec('0x13')](_0x133e11));if(_0x133e11[_0x84ec('0x14')]){if(_0x133e11[_0x84ec('0x14')][_0x84ec('0x15')]===0x1f4){logger['error'](_0x84ec('0xf'),_0x5d65b8,_0x133e11[_0x84ec('0x14')]['message']);return _0x449c78(_0x133e11[_0x84ec('0x14')][_0x84ec('0x16')]);}logger[_0x84ec('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x5d65b8,_0x133e11['error'][_0x84ec('0x16')]);return _0x36818e(_0x133e11['error']['message']);}else{logger[_0x84ec('0xe')](_0x84ec('0xf'),_0x5d65b8,_0x84ec('0x10'));_0x36818e(_0x133e11[_0x84ec('0x17')]['message']);}})[_0x84ec('0x18')](function(_0x463810){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5d65b8,_0x463810);_0x449c78(_0x463810);});});}
\ No newline at end of file
+var _0x1582=['request','ChatTransferReport,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','util','bluebird','ioredis','../../config/logger','jayson/promise','client','http'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x1582,0x12b));var _0x2158=function(_0x4b33d1,_0x2414e1){_0x4b33d1=_0x4b33d1-0x0;var _0x9e7221=_0x1582[_0x4b33d1];return _0x9e7221;};'use strict';var _=require('lodash');var util=require(_0x2158('0x0'));var moment=require('moment');var BPromise=require(_0x2158('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2158('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2158('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2158('0x4'));var client=jayson[_0x2158('0x5')][_0x2158('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x187e59,_0x755b30,_0x5da59f){return new BPromise(function(_0x437461,_0x15fc6b){return client[_0x2158('0x7')](_0x187e59,_0x5da59f)['then'](function(_0x212f6f){logger['info'](_0x2158('0x8'),_0x755b30,'request\x20sent');logger[_0x2158('0x9')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x755b30,'request\x20sent',JSON[_0x2158('0xa')](_0x212f6f));if(_0x212f6f[_0x2158('0xb')]){if(_0x212f6f[_0x2158('0xb')]['code']===0x1f4){logger[_0x2158('0xb')](_0x2158('0x8'),_0x755b30,_0x212f6f['error']['message']);return _0x15fc6b(_0x212f6f[_0x2158('0xb')][_0x2158('0xc')]);}logger[_0x2158('0xb')](_0x2158('0x8'),_0x755b30,_0x212f6f[_0x2158('0xb')][_0x2158('0xc')]);return _0x437461(_0x212f6f['error']['message']);}else{logger[_0x2158('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x755b30,_0x2158('0xe'));_0x437461(_0x212f6f[_0x2158('0xf')][_0x2158('0xc')]);}})[_0x2158('0x10')](function(_0x4eb27d){logger['error'](_0x2158('0x8'),_0x755b30,_0x4eb27d);_0x15fc6b(_0x4eb27d);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index c953e4b..abf078d 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 _0x98b7=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','show','post','create','update','delete','/:id','destroy','exports'];(function(_0xe7fc2d,_0x9e4b85){var _0x150c7a=function(_0x3ea47e){while(--_0x3ea47e){_0xe7fc2d['push'](_0xe7fc2d['shift']());}};_0x150c7a(++_0x9e4b85);}(_0x98b7,0x1a4));var _0x798b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x98b7[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x798b('0x0'));var util=require(_0x798b('0x1'));var path=require(_0x798b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x798b('0x3')]();var fs_extra=require(_0x798b('0x4'));var auth=require(_0x798b('0x5'));var interaction=require(_0x798b('0x6'));var config=require(_0x798b('0x7'));var controller=require(_0x798b('0x8'));router[_0x798b('0x9')]('/',auth[_0x798b('0xa')](),controller[_0x798b('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x798b('0xc')]);router[_0x798b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x798b('0xd')]);router[_0x798b('0xe')]('/',auth['isAuthenticated'](),controller[_0x798b('0xf')]);router['put']('/:id',auth[_0x798b('0xa')](),controller[_0x798b('0x10')]);router[_0x798b('0x11')](_0x798b('0x12'),auth[_0x798b('0xa')](),controller[_0x798b('0x13')]);module[_0x798b('0x14')]=router;
\ No newline at end of file
+var _0x8aff=['get','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x8aff,0x11c));var _0xf8af=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8aff[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xf8af('0x0'));var util=require(_0xf8af('0x1'));var path=require(_0xf8af('0x2'));var timeout=require(_0xf8af('0x3'));var express=require(_0xf8af('0x4'));var router=express['Router']();var fs_extra=require(_0xf8af('0x5'));var auth=require(_0xf8af('0x6'));var interaction=require(_0xf8af('0x7'));var config=require(_0xf8af('0x8'));var controller=require(_0xf8af('0x9'));router[_0xf8af('0xa')]('/',auth['isAuthenticated'](),controller[_0xf8af('0xb')]);router[_0xf8af('0xa')](_0xf8af('0xc'),auth['isAuthenticated'](),controller[_0xf8af('0xd')]);router[_0xf8af('0xa')](_0xf8af('0xe'),auth['isAuthenticated'](),controller[_0xf8af('0xf')]);router[_0xf8af('0x10')]('/',auth['isAuthenticated'](),controller[_0xf8af('0x11')]);router[_0xf8af('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf8af('0x13')](_0xf8af('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xf8af('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 19222a8..52ed1ab 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 _0x6545=['Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','stringify','input','name','text','onlineForm','parse','setDataValue','textarea','Comments','getDataValue','offlineForm','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x6545,0x17e));var _0x5654=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6545[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x5654('0x0')],'allowNull':![]},'address':{'type':Sequelize[_0x5654('0x0')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x5654('0x1')},'mapKeyOffline':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x1')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5654('0x0')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x5654('0x0')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5654('0x0')],'allowNull':![],'defaultValue':_0x5654('0x2'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5654('0x0')],'allowNull':![],'defaultValue':_0x5654('0x2'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5654('0x0')],'allowNull':![],'defaultValue':_0x5654('0x3'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5654('0x4')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5654('0x0')]},'animation':{'type':Sequelize[_0x5654('0x5')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5654('0x6')](_0x5654('0x7'),_0x5654('0x8')),'defaultValue':_0x5654('0x7')},'header_online':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x9')},'start_chat_button':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0xa')},'offline_chat_button':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0xb')},'header_offline':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5654('0x0')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5654('0xd')]},'closingQuestion':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x10')},'noteTitle':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x11')},'placeholderMessage':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x12')},'closingMessage':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x13')},'closingMessageButton':{'type':Sequelize[_0x5654('0x0')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x5654('0x0')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':_0x5654('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x5654('0x4')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x5654('0x15')]({'items':[{'type':_0x5654('0x16'),'variable':null,'config':{'placeholder':_0x5654('0x17'),'type':_0x5654('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x5654('0x16'),'props':{'title':_0x5654('0x1'),'helpText':''},'config':{'required':!![],'placeholder':_0x5654('0x1'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x5654('0x19'))?JSON[_0x5654('0x1a')](this['getDataValue']('onlineForm')):{};},'set':function(_0x5740a0){return this[_0x5654('0x1b')](_0x5654('0x19'),JSON[_0x5654('0x15')](_0x5740a0));}},'offlineForm':{'type':Sequelize[_0x5654('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x5654('0x1'),'helpText':''},'config':{'required':!![],'placeholder':_0x5654('0x1'),'type':_0x5654('0x1')},'variable':null},{'type':_0x5654('0x1c'),'config':{'placeholder':_0x5654('0x1d')},'props':{'title':_0x5654('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x5654('0x1e')](_0x5654('0x1f'))?JSON['parse'](this[_0x5654('0x1e')](_0x5654('0x1f'))):{};},'set':function(_0x2ecd79){return this[_0x5654('0x1b')](_0x5654('0x1f'),JSON[_0x5654('0x15')](_0x2ecd79));}},'token':{'type':Sequelize[_0x5654('0x0')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x5654('0x5')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5654('0x0')]},'forwardOffline':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5654('0x0')]},'waitingTitle':{'type':Sequelize[_0x5654('0x0')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x5654('0x0')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x20')},'offlineMessageBody':{'type':Sequelize[_0x5654('0x0')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x5654('0x5')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x21')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5654('0x22')},'sendUnmanaged':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5654('0x0')]},'notificationTemplate':{'type':Sequelize[_0x5654('0xd')],'defaultValue':function(){return _0x5654('0x23');}},'notificationSound':{'type':Sequelize[_0x5654('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5654('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x25')},'verticalAlignment':{'type':Sequelize[_0x5654('0x4')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x5654('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5654('0x4')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5654('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5654('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5654('0x0')],'defaultValue':_0x5654('0x28')},'systemAvatar':{'type':Sequelize[_0x5654('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5654('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x22b267){if(!_0x22b267)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x5654('0x1b')](_0x5654('0x2a'),_0x22b267);}},'vidaooEscalation':{'type':Sequelize[_0x5654('0x5')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5654('0x0')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x5654('0x0')],'defaultValue':function(){return _0x5654('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0x5654('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5654('0xd')]}};
\ No newline at end of file
+var _0xa6c6=['BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','star','stringify','input','name','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','randomstring','exports','address','STRING','email','Agent','#011F6A','INTEGER'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa6c6,0x87));var _0x6a6c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa6c6[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x6a6c('0x0'));var rs=require(_0x6a6c('0x1'));module[_0x6a6c('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6a6c('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x5')},'key':{'type':Sequelize[_0x6a6c('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6a6c('0x4')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6a6c('0x4')],'allowNull':![],'defaultValue':_0x6a6c('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6a6c('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6a6c('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6a6c('0xa')](_0x6a6c('0xb'),'squared'),'defaultValue':_0x6a6c('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6a6c('0xc')},'start_chat_button':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6a6c('0xe')},'header_offline':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6a6c('0x10')]},'closingQuestion':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6a6c('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x13')},'noteTitle':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x14')},'placeholderMessage':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6a6c('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x6a6c('0x17'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6a6c('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6a6c('0x10')],'defaultValue':function(){return JSON[_0x6a6c('0x18')]({'items':[{'type':_0x6a6c('0x19'),'variable':null,'config':{'placeholder':_0x6a6c('0x1a'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6a6c('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6a6c('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6a6c('0x1b')]('onlineForm')?JSON[_0x6a6c('0x1c')](this['getDataValue'](_0x6a6c('0x1d'))):{};},'set':function(_0x4f861e){return this[_0x6a6c('0x1e')]('onlineForm',JSON[_0x6a6c('0x18')](_0x4f861e));}},'offlineForm':{'type':Sequelize[_0x6a6c('0x10')],'defaultValue':function(){return JSON[_0x6a6c('0x18')]({'items':[{'type':_0x6a6c('0x19'),'props':{'title':_0x6a6c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6a6c('0x5'),'type':'email'},'variable':null},{'type':_0x6a6c('0x1f'),'config':{'placeholder':_0x6a6c('0x20')},'props':{'title':_0x6a6c('0x20'),'helpText':_0x6a6c('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x6a6c('0x1b')](_0x6a6c('0x22'))?JSON[_0x6a6c('0x1c')](this[_0x6a6c('0x1b')]('offlineForm')):{};},'set':function(_0xab2f6e){return this[_0x6a6c('0x1e')](_0x6a6c('0x22'),JSON[_0x6a6c('0x18')](_0xab2f6e));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6a6c('0x23')]();}},'autoclose':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6a6c('0x4')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6a6c('0x4')]},'waitingTitle':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x24')},'waitingMessage':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6a6c('0x27')},'skipUnmanaged':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x28')},'sendUnmanaged':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6a6c('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6a6c('0x4')]},'notificationTemplate':{'type':Sequelize[_0x6a6c('0x10')],'defaultValue':function(){return _0x6a6c('0x29');}},'notificationSound':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x6a6c('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x2b')},'defaultTitle':{'type':Sequelize[_0x6a6c('0x4')]},'customerAvatar':{'type':Sequelize[_0x6a6c('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6a6c('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6a6c('0x4')],'allowNull':![],'defaultValue':_0x6a6c('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6a6c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':_0x6a6c('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6a6c('0x8')],'comment':_0x6a6c('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x7437aa){if(!_0x7437aa)this[_0x6a6c('0x1e')]('mandatoryDispositionPauseId',null);this[_0x6a6c('0x1e')](_0x6a6c('0x2f'),_0x7437aa);}},'vidaooEscalation':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6a6c('0x4')]},'vidaooTopic':{'type':Sequelize[_0x6a6c('0x4')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x6a6c('0x4')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x6a6c('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6a6c('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6a6c('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 47837c5..76878b4 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 _0xa4a6=['List','account','list','applications','orderBy','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','difference','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','virtual','License','increment','chatLicenseExceeded','Intervals','all','remote','remoteAddress','replace','alignment','verticalAlignment','color','color_button','addApplications','findAndCountAll','priority','getApplications','chatProactiveAction','getProactiveActions','getFields','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','get','ChatWebsites','destroy','stack','name','send','index','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','VIRTUAL','filter','options','findAll','rows','catch','show','params','Pause','mandatoryDispositionPause','include','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','nolimit','includeAll','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','ChatApplication','Applications'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0xa4a6,0x8b));var _0x6a4a=function(_0x10e896,_0x4136d9){_0x10e896=_0x10e896-0x0;var _0x33cda4=_0xa4a6[_0x10e896];return _0x33cda4;};'use strict';var emlformat=require(_0x6a4a('0x0'));var rimraf=require(_0x6a4a('0x1'));var zipdir=require(_0x6a4a('0x2'));var jsonpatch=require(_0x6a4a('0x3'));var rp=require('request-promise');var moment=require(_0x6a4a('0x4'));var BPromise=require(_0x6a4a('0x5'));var Mustache=require(_0x6a4a('0x6'));var util=require(_0x6a4a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6a4a('0x8'));var ejs=require(_0x6a4a('0x9'));var fs=require('fs');var fs_extra=require(_0x6a4a('0xa'));var _=require(_0x6a4a('0xb'));var squel=require(_0x6a4a('0xc'));var crypto=require(_0x6a4a('0xd'));var jsforce=require(_0x6a4a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6a4a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a4a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6a4a('0x10'));var hardwareService=require(_0x6a4a('0x11'));var logger=require(_0x6a4a('0x12'))(_0x6a4a('0x13'));var utils=require(_0x6a4a('0x14'));var config=require(_0x6a4a('0x15'));var licenseUtil=require(_0x6a4a('0x16'));var db=require(_0x6a4a('0x17'))['db'];config[_0x6a4a('0x18')]=_['defaults'](config['redis'],{'host':_0x6a4a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x6a4a('0x1a'));var client=jayson[_0x6a4a('0x1b')][_0x6a4a('0x1c')]({'port':0x232c});var client9002=jayson[_0x6a4a('0x1b')][_0x6a4a('0x1c')]({'port':0x232a});var client9003=jayson['client'][_0x6a4a('0x1c')]({'port':0x232b});var client9001=jayson[_0x6a4a('0x1b')][_0x6a4a('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x1ce87a,_0x48959b,_0x32d151,_0x14a1d3){return new BPromise(function(_0x97b251,_0x3b6002){var _0x5a68ea=_0x14a1d3||client;return _0x5a68ea['request'](_0x1ce87a,_0x32d151)[_0x6a4a('0x1d')](function(_0x314b39){logger[_0x6a4a('0x1e')](_0x6a4a('0x1f'),_0x48959b,_0x6a4a('0x20'));logger[_0x6a4a('0x21')](_0x6a4a('0x22'),_0x48959b,_0x6a4a('0x20'),JSON[_0x6a4a('0x23')](_0x314b39));if(_0x314b39[_0x6a4a('0x24')]){if(_0x314b39[_0x6a4a('0x24')][_0x6a4a('0x25')]===0x1f4){logger[_0x6a4a('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x48959b,_0x314b39['error'][_0x6a4a('0x26')]);return _0x3b6002(_0x314b39[_0x6a4a('0x24')][_0x6a4a('0x26')]);}logger[_0x6a4a('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x48959b,_0x314b39[_0x6a4a('0x24')][_0x6a4a('0x26')]);return _0x97b251(_0x314b39[_0x6a4a('0x24')][_0x6a4a('0x26')]);}else{logger[_0x6a4a('0x1e')](_0x6a4a('0x1f'),_0x48959b,'request\x20sent');_0x97b251(_0x314b39['result'][_0x6a4a('0x26')]);}})['catch'](function(_0x8b5542){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x48959b,_0x8b5542);_0x3b6002(_0x8b5542);});});}function respondWithStatusCode(_0x4d43eb,_0x42b678){_0x42b678=_0x42b678||0xcc;return function(_0x1cf262){if(_0x1cf262){return _0x4d43eb[_0x6a4a('0x27')](_0x42b678);}return _0x4d43eb[_0x6a4a('0x28')](_0x42b678)[_0x6a4a('0x29')]();};}function respondWithResult(_0x1701ac,_0x1139ab){_0x1139ab=_0x1139ab||0xc8;return function(_0x1098ea){if(_0x1098ea){return _0x1701ac['status'](_0x1139ab)[_0x6a4a('0x2a')](_0x1098ea);}};}function respondWithFilteredResult(_0x5274f1,_0x2ccfa6){return function(_0x289aa7){if(_0x289aa7){var _0x214241=typeof _0x2ccfa6['offset']===_0x6a4a('0x2b')&&typeof _0x2ccfa6[_0x6a4a('0x2c')]===_0x6a4a('0x2b');var _0x17bb1b=_0x289aa7[_0x6a4a('0x2d')];var _0x17b988=_0x214241?0x0:_0x2ccfa6['offset'];var _0x424c88=_0x214241?_0x289aa7['count']:_0x2ccfa6[_0x6a4a('0x2e')]+_0x2ccfa6[_0x6a4a('0x2c')];var _0x51f095;if(_0x424c88>=_0x17bb1b){_0x424c88=_0x17bb1b;_0x51f095=0xc8;}else{_0x51f095=0xce;}_0x5274f1['status'](_0x51f095);return _0x5274f1[_0x6a4a('0x2f')](_0x6a4a('0x30'),_0x17b988+'-'+_0x424c88+'/'+_0x17bb1b)[_0x6a4a('0x2a')](_0x289aa7);}return null;};}function patchUpdates(_0x15e7f9){return function(_0x3c3cc4){try{jsonpatch[_0x6a4a('0x31')](_0x3c3cc4,_0x15e7f9,!![]);}catch(_0x52ca3f){return BPromise['reject'](_0x52ca3f);}return _0x3c3cc4[_0x6a4a('0x32')]();};}function saveUpdates(_0x1d0352,_0x5ec1e8){return function(_0x5f4dea){if(_0x5f4dea){return _0x5f4dea['update'](_0x1d0352)['then'](function(_0x12a028){return _0x12a028;});}return null;};}function removeEntity(_0x4b6562,_0x533760){return function(_0x126d49){if(_0x126d49){return _0x126d49['destroy']()[_0x6a4a('0x1d')](function(){var _0x300500=_0x126d49[_0x6a4a('0x33')]({'plain':!![]});var _0x47b3fc=_0x6a4a('0x34');return db['UserProfileResource'][_0x6a4a('0x35')]({'where':{'type':_0x47b3fc,'resourceId':_0x300500['id']}})['then'](function(){return _0x126d49;});})['then'](function(){_0x4b6562[_0x6a4a('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x199d6c,_0x24a9c1){return function(_0x597297){if(!_0x597297){_0x199d6c[_0x6a4a('0x27')](0x194);}return _0x597297;};}function handleError(_0x2fb28,_0xfb007c){_0xfb007c=_0xfb007c||0x1f4;return function(_0x520e6e){logger[_0x6a4a('0x24')](_0x520e6e[_0x6a4a('0x36')]);if(_0x520e6e[_0x6a4a('0x37')]){delete _0x520e6e[_0x6a4a('0x37')];}_0x2fb28[_0x6a4a('0x28')](_0xfb007c)[_0x6a4a('0x38')](_0x520e6e);};}exports[_0x6a4a('0x39')]=function(_0xa6abf8,_0x54ea7d){var _0x5705b={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x10e5ba={},_0x402135={'count':0x0,'rows':[]};var _0x2fd0a5=_['map'](db[_0x6a4a('0x3a')][_0x6a4a('0x3b')],function(_0x4143ae){return{'name':_0x4143ae['fieldName'],'type':_0x4143ae[_0x6a4a('0x3c')][_0x6a4a('0x3d')]};});_0x10e5ba[_0x6a4a('0x3e')]=_['map'](_0x2fd0a5,_0x6a4a('0x37'));_0x10e5ba[_0x6a4a('0x3f')]=_[_0x6a4a('0x40')](_0xa6abf8['query']);_0x10e5ba[_0x6a4a('0x41')]=_[_0x6a4a('0x42')](_0x10e5ba[_0x6a4a('0x3e')],_0x10e5ba[_0x6a4a('0x3f')]);_0x5705b[_0x6a4a('0x43')]=_[_0x6a4a('0x42')](_0x10e5ba['model'],qs[_0x6a4a('0x44')](_0xa6abf8[_0x6a4a('0x3f')][_0x6a4a('0x44')]));_0x5705b[_0x6a4a('0x43')]=_0x5705b['attributes'][_0x6a4a('0x45')]?_0x5705b[_0x6a4a('0x43')]:_0x10e5ba[_0x6a4a('0x3e')];if(!_0xa6abf8['query'][_0x6a4a('0x46')]('nolimit')){_0x5705b[_0x6a4a('0x2c')]=qs[_0x6a4a('0x2c')](_0xa6abf8[_0x6a4a('0x3f')][_0x6a4a('0x2c')]);_0x5705b[_0x6a4a('0x2e')]=qs[_0x6a4a('0x2e')](_0xa6abf8[_0x6a4a('0x3f')][_0x6a4a('0x2e')]);}_0x5705b[_0x6a4a('0x47')]=qs['sort'](_0xa6abf8[_0x6a4a('0x3f')][_0x6a4a('0x48')]);_0x5705b[_0x6a4a('0x49')]=qs[_0x6a4a('0x41')](_[_0x6a4a('0x4a')](_0xa6abf8['query'],_0x10e5ba[_0x6a4a('0x41')]),_0x2fd0a5);if(_0xa6abf8[_0x6a4a('0x3f')]['filter']){_0x5705b[_0x6a4a('0x49')]=_['merge'](_0x5705b[_0x6a4a('0x49')],{'$or':_[_0x6a4a('0x4b')](_0x2fd0a5,function(_0x5b7fc3){if(_0x5b7fc3[_0x6a4a('0x3c')]!==_0x6a4a('0x4c')){var _0x20b5ec={};_0x20b5ec[_0x5b7fc3[_0x6a4a('0x37')]]={'$like':'%'+_0xa6abf8['query'][_0x6a4a('0x4d')]+'%'};return _0x20b5ec;}})});}_0x5705b=_['merge']({},_0x5705b,_0xa6abf8[_0x6a4a('0x4e')]);var _0x773e57={'where':_0x5705b['where']};return db[_0x6a4a('0x3a')][_0x6a4a('0x2d')](_0x773e57)[_0x6a4a('0x1d')](function(_0x2fad92){_0x402135['count']=_0x2fad92;if(_0xa6abf8[_0x6a4a('0x3f')]['includeAll']){_0x5705b['include']=[{'all':!![]}];}return db[_0x6a4a('0x3a')][_0x6a4a('0x4f')](_0x5705b);})[_0x6a4a('0x1d')](function(_0x2da668){_0x402135[_0x6a4a('0x50')]=_0x2da668;return _0x402135;})[_0x6a4a('0x1d')](respondWithFilteredResult(_0x54ea7d,_0x5705b))[_0x6a4a('0x51')](handleError(_0x54ea7d,null));};exports[_0x6a4a('0x52')]=function(_0x2336f7,_0x25b6ce){var _0x14c75f={'raw':![],'where':{'id':_0x2336f7[_0x6a4a('0x53')]['id']},'include':[{'model':db[_0x6a4a('0x54')],'as':_0x6a4a('0x55')}]},_0x3a9361={};_0x3a9361[_0x6a4a('0x3e')]=_[_0x6a4a('0x40')](db['ChatWebsite'][_0x6a4a('0x3b')]);_0x3a9361[_0x6a4a('0x3f')]=_[_0x6a4a('0x40')](_0x2336f7[_0x6a4a('0x3f')]);_0x3a9361[_0x6a4a('0x41')]=_[_0x6a4a('0x42')](_0x3a9361[_0x6a4a('0x3e')],_0x3a9361[_0x6a4a('0x3f')]);_0x14c75f[_0x6a4a('0x43')]=_['intersection'](_0x3a9361[_0x6a4a('0x3e')],qs[_0x6a4a('0x44')](_0x2336f7['query'][_0x6a4a('0x44')]));_0x14c75f[_0x6a4a('0x43')]=_0x14c75f[_0x6a4a('0x43')][_0x6a4a('0x45')]?_0x14c75f[_0x6a4a('0x43')]:_0x3a9361['model'];if(_0x2336f7['query']['includeAll']){_0x14c75f[_0x6a4a('0x56')]=[{'all':!![]}];}_0x14c75f=_[_0x6a4a('0x57')]({},_0x14c75f,_0x2336f7[_0x6a4a('0x4e')]);return db[_0x6a4a('0x3a')][_0x6a4a('0x58')](_0x14c75f)['then'](handleEntityNotFound(_0x25b6ce,null))[_0x6a4a('0x1d')](respondWithResult(_0x25b6ce,null))[_0x6a4a('0x51')](handleError(_0x25b6ce,null));};exports[_0x6a4a('0x59')]=function(_0x2c8dc6,_0x3792de){return db[_0x6a4a('0x3a')][_0x6a4a('0x59')](_0x2c8dc6[_0x6a4a('0x5a')],{})['then'](function(_0x59c3b4){var _0x1b461e=_0x2c8dc6['user'][_0x6a4a('0x33')]({'plain':!![]});if(!_0x1b461e)throw new Error(_0x6a4a('0x5b'));if(_0x1b461e[_0x6a4a('0x5c')]===_0x6a4a('0x5d')){var _0x2dfeb7=_0x59c3b4[_0x6a4a('0x33')]({'plain':!![]});var _0x14a850=_0x6a4a('0x34');return db[_0x6a4a('0x5e')][_0x6a4a('0x58')]({'where':{'name':_0x14a850,'userProfileId':_0x1b461e[_0x6a4a('0x5f')]},'raw':!![]})[_0x6a4a('0x1d')](function(_0x40411c){if(_0x40411c&&_0x40411c[_0x6a4a('0x60')]===0x0){return db[_0x6a4a('0x61')][_0x6a4a('0x59')]({'name':_0x2dfeb7[_0x6a4a('0x37')],'resourceId':_0x2dfeb7['id'],'type':_0x40411c[_0x6a4a('0x37')],'sectionId':_0x40411c['id']},{})[_0x6a4a('0x1d')](function(){return _0x59c3b4;});}else{return _0x59c3b4;}})['catch'](function(_0x57f60e){logger[_0x6a4a('0x24')](_0x6a4a('0x62'),_0x57f60e);throw _0x57f60e;});}return _0x59c3b4;})['then'](respondWithResult(_0x3792de,0xc9))[_0x6a4a('0x51')](handleError(_0x3792de,null));};exports[_0x6a4a('0x63')]=function(_0x4e6f11,_0x5afbe2){if(_0x4e6f11[_0x6a4a('0x5a')]['id']){delete _0x4e6f11['body']['id'];}return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x4e6f11[_0x6a4a('0x53')]['id']},'include':[{'model':db[_0x6a4a('0x54')],'as':'mandatoryDispositionPause'}]})[_0x6a4a('0x1d')](handleEntityNotFound(_0x5afbe2,null))['then'](saveUpdates(_0x4e6f11[_0x6a4a('0x5a')],null))[_0x6a4a('0x1d')](respondWithResult(_0x5afbe2,null))[_0x6a4a('0x51')](handleError(_0x5afbe2,null));};exports['destroy']=function(_0xc2677d,_0x515df2){return db[_0x6a4a('0x3a')]['find']({'where':{'id':_0xc2677d[_0x6a4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x515df2,null))['then'](removeEntity(_0x515df2,null))[_0x6a4a('0x51')](handleError(_0x515df2,null));};exports[_0x6a4a('0x64')]=function(_0x4cb2c6,_0x29c931){return db[_0x6a4a('0x3a')][_0x6a4a('0x64')]()['then'](respondWithResult(_0x29c931,null))[_0x6a4a('0x51')](handleError(_0x29c931,null));};exports['addDisposition']=function(_0x110cb7,_0x436842,_0x39c886){if(_0x110cb7[_0x6a4a('0x5a')]['id']){delete _0x110cb7['body']['id'];}return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x110cb7[_0x6a4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x436842,null))['then'](function(_0x534d8c){if(_0x534d8c){_0x110cb7[_0x6a4a('0x5a')][_0x6a4a('0x65')]=_0x534d8c['id'];return db[_0x6a4a('0x66')][_0x6a4a('0x59')](_0x110cb7[_0x6a4a('0x5a')]);}})[_0x6a4a('0x1d')](respondWithResult(_0x436842,null))[_0x6a4a('0x51')](handleError(_0x436842,null));};exports[_0x6a4a('0x67')]=function(_0x384583,_0x14f02c,_0x8edd0e){var _0x2282ae={'raw':![],'where':{}};var _0x55ed45={};var _0x52d5f7={'count':0x0,'rows':[]};return db[_0x6a4a('0x3a')][_0x6a4a('0x68')]({'where':{'id':_0x384583[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x14f02c,null))[_0x6a4a('0x1d')](function(_0x6885b2){if(_0x6885b2){_0x55ed45[_0x6a4a('0x3e')]=_[_0x6a4a('0x40')](db[_0x6a4a('0x66')][_0x6a4a('0x3b')]);_0x55ed45['query']=_['keys'](_0x384583[_0x6a4a('0x3f')]);_0x55ed45[_0x6a4a('0x41')]=_[_0x6a4a('0x42')](_0x55ed45['model'],_0x55ed45[_0x6a4a('0x3f')]);_0x2282ae[_0x6a4a('0x43')]=_['intersection'](_0x55ed45[_0x6a4a('0x3e')],qs[_0x6a4a('0x44')](_0x384583['query'][_0x6a4a('0x44')]));_0x2282ae[_0x6a4a('0x43')]=_0x2282ae[_0x6a4a('0x43')][_0x6a4a('0x45')]?_0x2282ae[_0x6a4a('0x43')]:_0x55ed45[_0x6a4a('0x3e')];if(!_0x384583[_0x6a4a('0x3f')][_0x6a4a('0x46')]('nolimit')){_0x2282ae[_0x6a4a('0x2c')]=qs[_0x6a4a('0x2c')](_0x384583['query'][_0x6a4a('0x2c')]);_0x2282ae['offset']=qs[_0x6a4a('0x2e')](_0x384583[_0x6a4a('0x3f')][_0x6a4a('0x2e')]);}_0x2282ae['order']=qs[_0x6a4a('0x48')](_0x384583['query'][_0x6a4a('0x48')]);_0x2282ae[_0x6a4a('0x49')]=qs[_0x6a4a('0x41')](_[_0x6a4a('0x4a')](_0x384583[_0x6a4a('0x3f')],_0x55ed45['filters']));_0x2282ae[_0x6a4a('0x49')][_0x6a4a('0x65')]=_0x6885b2['id'];if(_0x384583[_0x6a4a('0x3f')][_0x6a4a('0x4d')]){_0x2282ae['where']=_[_0x6a4a('0x57')](_0x2282ae['where'],{'$or':_['map'](_0x2282ae[_0x6a4a('0x43')],function(_0x184412){var _0xe320ee={};_0xe320ee[_0x184412]={'$like':'%'+_0x384583['query'][_0x6a4a('0x4d')]+'%'};return _0xe320ee;})});}_0x2282ae=_[_0x6a4a('0x57')]({},_0x2282ae,_0x384583[_0x6a4a('0x4e')]);return db[_0x6a4a('0x66')][_0x6a4a('0x2d')]({'where':_0x2282ae[_0x6a4a('0x49')]})['then'](function(_0x381135){_0x52d5f7[_0x6a4a('0x2d')]=_0x381135;if(_0x384583['query']['includeAll']){_0x2282ae['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2282ae);})[_0x6a4a('0x1d')](function(_0x62d575){_0x52d5f7[_0x6a4a('0x50')]=_0x62d575;return _0x52d5f7;});}})[_0x6a4a('0x1d')](respondWithFilteredResult(_0x14f02c,_0x2282ae))['catch'](handleError(_0x14f02c,null));};exports[_0x6a4a('0x69')]=function(_0x455901,_0x31e566,_0x335c75){return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x455901['params']['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x31e566,null))[_0x6a4a('0x1d')](function(_0x355ab9){if(_0x355ab9){return _0x355ab9[_0x6a4a('0x69')](_0x455901[_0x6a4a('0x3f')]['ids']);}})[_0x6a4a('0x1d')](respondWithStatusCode(_0x31e566,null))[_0x6a4a('0x51')](handleError(_0x31e566,null));};exports[_0x6a4a('0x6a')]=function(_0x2e506b,_0x54e540,_0x41cad3){if(_0x2e506b[_0x6a4a('0x5a')]['id']){delete _0x2e506b[_0x6a4a('0x5a')]['id'];}return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x2e506b[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x54e540,null))[_0x6a4a('0x1d')](function(_0x3a55a3){if(_0x3a55a3){_0x2e506b[_0x6a4a('0x5a')]['ChatWebsiteId']=_0x3a55a3['id'];return db['CannedAnswer']['create'](_0x2e506b[_0x6a4a('0x5a')]);}})[_0x6a4a('0x1d')](respondWithResult(_0x54e540,null))['catch'](handleError(_0x54e540,null));};exports['getAnswers']=function(_0x16d0d,_0x17b9e8,_0x51785e){var _0x318109={'raw':![],'where':{}};var _0x27c068={};var _0x403841={'count':0x0,'rows':[]};return db[_0x6a4a('0x3a')][_0x6a4a('0x68')]({'where':{'id':_0x16d0d[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x17b9e8,null))[_0x6a4a('0x1d')](function(_0x26af77){if(_0x26af77){_0x27c068[_0x6a4a('0x3e')]=_[_0x6a4a('0x40')](db['CannedAnswer'][_0x6a4a('0x3b')]);_0x27c068['query']=_['keys'](_0x16d0d[_0x6a4a('0x3f')]);_0x27c068['filters']=_['intersection'](_0x27c068[_0x6a4a('0x3e')],_0x27c068[_0x6a4a('0x3f')]);_0x318109[_0x6a4a('0x43')]=_[_0x6a4a('0x42')](_0x27c068[_0x6a4a('0x3e')],qs[_0x6a4a('0x44')](_0x16d0d['query'][_0x6a4a('0x44')]));_0x318109[_0x6a4a('0x43')]=_0x318109[_0x6a4a('0x43')][_0x6a4a('0x45')]?_0x318109[_0x6a4a('0x43')]:_0x27c068['model'];if(!_0x16d0d[_0x6a4a('0x3f')][_0x6a4a('0x46')](_0x6a4a('0x6b'))){_0x318109[_0x6a4a('0x2c')]=qs[_0x6a4a('0x2c')](_0x16d0d[_0x6a4a('0x3f')][_0x6a4a('0x2c')]);_0x318109[_0x6a4a('0x2e')]=qs['offset'](_0x16d0d[_0x6a4a('0x3f')][_0x6a4a('0x2e')]);}_0x318109[_0x6a4a('0x47')]=qs[_0x6a4a('0x48')](_0x16d0d[_0x6a4a('0x3f')][_0x6a4a('0x48')]);_0x318109['where']=qs['filters'](_[_0x6a4a('0x4a')](_0x16d0d[_0x6a4a('0x3f')],_0x27c068[_0x6a4a('0x41')]));_0x318109[_0x6a4a('0x49')][_0x6a4a('0x65')]=_0x26af77['id'];if(_0x16d0d[_0x6a4a('0x3f')][_0x6a4a('0x4d')]){_0x318109[_0x6a4a('0x49')]=_[_0x6a4a('0x57')](_0x318109[_0x6a4a('0x49')],{'$or':_[_0x6a4a('0x4b')](_0x318109[_0x6a4a('0x43')],function(_0x5e4d90){var _0x3f464a={};_0x3f464a[_0x5e4d90]={'$like':'%'+_0x16d0d[_0x6a4a('0x3f')][_0x6a4a('0x4d')]+'%'};return _0x3f464a;})});}_0x318109=_['merge']({},_0x318109,_0x16d0d[_0x6a4a('0x4e')]);return db['CannedAnswer'][_0x6a4a('0x2d')]({'where':_0x318109[_0x6a4a('0x49')]})['then'](function(_0x449882){_0x403841[_0x6a4a('0x2d')]=_0x449882;if(_0x16d0d['query'][_0x6a4a('0x6c')]){_0x318109[_0x6a4a('0x56')]=[{'all':!![]}];}return db[_0x6a4a('0x6d')][_0x6a4a('0x4f')](_0x318109);})[_0x6a4a('0x1d')](function(_0x1ec814){_0x403841[_0x6a4a('0x50')]=_0x1ec814;return _0x403841;});}})['then'](respondWithFilteredResult(_0x17b9e8,_0x318109))[_0x6a4a('0x51')](handleError(_0x17b9e8,null));};exports[_0x6a4a('0x6e')]=function(_0x470858,_0x22077f,_0x94f52a){return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x470858[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x22077f,null))[_0x6a4a('0x1d')](function(_0x161c1e){if(_0x161c1e){return _0x161c1e['removeAnswers'](_0x470858[_0x6a4a('0x3f')][_0x6a4a('0x6f')]);}})['then'](respondWithStatusCode(_0x22077f,null))['catch'](handleError(_0x22077f,null));};exports[_0x6a4a('0x70')]=function(_0x3583ee,_0x45fdfb,_0xb42f50){_0x3583ee['body'][_0x6a4a('0x71')]=_0x3583ee[_0x6a4a('0x72')][_0x6a4a('0x73')];return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x3583ee[_0x6a4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x45fdfb,null))[_0x6a4a('0x1d')](saveUpdates(_0x3583ee['body'],null))['then'](respondWithResult(_0x45fdfb,null))[_0x6a4a('0x51')](handleError(_0x45fdfb,null));};exports['addAvatar']=function(_0x49824e,_0x394235,_0x308c29){_0x49824e[_0x6a4a('0x5a')][_0x6a4a('0x74')]=_0x49824e[_0x6a4a('0x72')][_0x6a4a('0x73')];return db[_0x6a4a('0x3a')]['find']({'where':{'id':_0x49824e[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x394235,null))[_0x6a4a('0x1d')](saveUpdates(_0x49824e[_0x6a4a('0x5a')],null))[_0x6a4a('0x1d')](respondWithResult(_0x394235,null))['catch'](handleError(_0x394235,null));};exports[_0x6a4a('0x75')]=function(_0x711299,_0x7e8be4,_0x387ed5){_0x711299[_0x6a4a('0x5a')][_0x6a4a('0x76')]=_0x711299['file']['filename'];return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x711299[_0x6a4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x7e8be4,null))[_0x6a4a('0x1d')](saveUpdates(_0x711299['body'],null))[_0x6a4a('0x1d')](respondWithResult(_0x7e8be4,null))[_0x6a4a('0x51')](handleError(_0x7e8be4,null));};exports[_0x6a4a('0x77')]=function(_0x52bba1,_0x23ea85,_0x3941d2){_0x52bba1[_0x6a4a('0x5a')][_0x6a4a('0x78')]=_0x52bba1[_0x6a4a('0x72')]['filename'];return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x52bba1[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x23ea85,null))[_0x6a4a('0x1d')](saveUpdates(_0x52bba1[_0x6a4a('0x5a')],null))[_0x6a4a('0x1d')](respondWithResult(_0x23ea85,null))[_0x6a4a('0x51')](handleError(_0x23ea85,null));};exports[_0x6a4a('0x79')]=function(_0x30b42c,_0x4326d0,_0x1348cc){var _0x6262ff=path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],_0x6a4a('0x7c'));var _0x51e6ae={'where':{'id':_0x30b42c['params']['id']},'attributes':['id',_0x6a4a('0x71')],'raw':!![]};var _0x115650=![];return require(_0x6a4a('0x16'))[_0x6a4a('0x7d')]()['then'](function(_0x5e6c8f){if(_0x5e6c8f){_0x115650=_0x5e6c8f[_0x6a4a('0x7e')];}})[_0x6a4a('0x1d')](function(){return db[_0x6a4a('0x3a')]['find'](_0x51e6ae);})[_0x6a4a('0x1d')](handleEntityNotFound(_0x4326d0,null))[_0x6a4a('0x1d')](function(_0x5bc7a6){if(_0x5bc7a6){if(!_[_0x6a4a('0x7f')](_0x5bc7a6[_0x6a4a('0x71')])){if(fs['existsSync'](path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],_0x6a4a('0x80'),_0x5bc7a6[_0x6a4a('0x71')]))&&_0x115650){_0x6262ff=path[_0x6a4a('0x7a')](config['root'],_0x6a4a('0x80'),_0x5bc7a6[_0x6a4a('0x71')]);}}return _0x4326d0[_0x6a4a('0x81')](_0x6262ff);}})[_0x6a4a('0x51')](handleError(_0x4326d0,null));};exports[_0x6a4a('0x82')]=function(_0xfa164f,_0x2883cf,_0x1f1676){var _0x78e586=path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],_0x6a4a('0x83'));var _0x6c2721={'where':{'id':_0xfa164f[_0x6a4a('0x53')]['id']},'attributes':['id',_0x6a4a('0x74')],'raw':!![]};return db[_0x6a4a('0x3a')][_0x6a4a('0x58')](_0x6c2721)[_0x6a4a('0x1d')](handleEntityNotFound(_0x2883cf,null))[_0x6a4a('0x1d')](function(_0x1a5f5a){if(_0x1a5f5a){if(!_[_0x6a4a('0x7f')](_0x1a5f5a[_0x6a4a('0x74')])){if(fs['existsSync'](path[_0x6a4a('0x7a')](config['root'],_0x6a4a('0x84'),_0x1a5f5a[_0x6a4a('0x74')]))){_0x78e586=path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],'server/files/images/avatars/',_0x1a5f5a['agentAvatar']);}}return _0x2883cf[_0x6a4a('0x81')](_0x78e586);}})[_0x6a4a('0x51')](handleError(_0x2883cf,null));};exports[_0x6a4a('0x85')]=function(_0x5f8d13,_0x1590f4,_0x4c34ee){var _0x1d1d23=path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],'server/files/images/avatars/customer_avatar.png');var _0x38ce10={'where':{'id':_0x5f8d13[_0x6a4a('0x53')]['id']},'attributes':['id',_0x6a4a('0x76'),_0x6a4a('0x86')],'raw':!![]};return db[_0x6a4a('0x3a')]['find'](_0x38ce10)['then'](handleEntityNotFound(_0x1590f4,null))[_0x6a4a('0x1d')](function(_0x33dd36){if(_0x33dd36){if(!_[_0x6a4a('0x7f')](_0x33dd36[_0x6a4a('0x76')])){if(fs[_0x6a4a('0x87')](path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],_0x6a4a('0x84'),_0x33dd36[_0x6a4a('0x76')]))&&_0x33dd36[_0x6a4a('0x86')]){_0x1d1d23=path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],_0x6a4a('0x84'),_0x33dd36['customerAvatar']);}}return _0x1590f4[_0x6a4a('0x81')](_0x1d1d23);}})[_0x6a4a('0x51')](handleError(_0x1590f4,null));};exports[_0x6a4a('0x88')]=function(_0x5b2aba,_0x2a308c,_0x3a6879){var _0x231ce5=path['join'](config['root'],_0x6a4a('0x89'));var _0x16248a={'where':{'id':_0x5b2aba['params']['id']},'attributes':['id',_0x6a4a('0x78')],'raw':!![]};return db['ChatWebsite']['find'](_0x16248a)[_0x6a4a('0x1d')](handleEntityNotFound(_0x2a308c,null))['then'](function(_0x15c3d3){if(_0x15c3d3){if(!_[_0x6a4a('0x7f')](_0x15c3d3['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0x6a4a('0x7b')],_0x6a4a('0x84'),_0x15c3d3[_0x6a4a('0x78')]))){_0x231ce5=path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],'server/files/images/avatars/',_0x15c3d3[_0x6a4a('0x78')]);}}return _0x2a308c['download'](_0x231ce5);}})[_0x6a4a('0x51')](handleError(_0x2a308c,null));};exports[_0x6a4a('0x8a')]=function(_0x39cc1d,_0x29570f,_0x4fe2d3){var _0x71ec80=require(_0x6a4a('0x8b'));var _0x55d18c=new _0x71ec80();var _0x1d3b99=_0x55d18c[_0x6a4a('0x8c')](_0x39cc1d[_0x6a4a('0x8d')]['user-agent'])['getResult']();var _0x18bcd7={'body':_0x39cc1d[_0x6a4a('0x5a')],'channel':'chat'};var _0x3ae017=[];var _0x456430=[];var _0x17bac9={};var _0x1eb4f3=![];return db['CmContact'][_0x6a4a('0x64')]()['then'](function(_0x26694c){if(!_0x26694c){throw new db[(_0x6a4a('0x8e'))][(_0x6a4a('0x8f'))](_0x6a4a('0x90'));}_0x3ae017=_['difference'](_[_0x6a4a('0x40')](_0x26694c),[_0x6a4a('0x91'),_0x6a4a('0x92')]);_0x456430=_['difference'](_[_0x6a4a('0x40')](_0x26694c),[_0x6a4a('0x91'),'updatedAt',_0x6a4a('0x93'),_0x6a4a('0x94')]);if(_0x39cc1d['body']['id']){delete _0x39cc1d[_0x6a4a('0x5a')]['id'];}if(_['isNil'](_0x39cc1d['body']['from'])){throw new db[(_0x6a4a('0x8e'))][(_0x6a4a('0x8f'))](_0x6a4a('0x95'));}if(_[_0x6a4a('0x7f')](_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0x5a')])||_0x39cc1d[_0x6a4a('0x5a')]['body']===''){throw new db[(_0x6a4a('0x8e'))]['ValidationError'](_0x6a4a('0x96'));}if(_['isNil'](_0x39cc1d[_0x6a4a('0x5a')]['mapKey'])){throw new db[(_0x6a4a('0x8e'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x456430);}if(!_['includes'](_0x456430,_0x39cc1d['body'][_0x6a4a('0x97')])){throw new db[(_0x6a4a('0x8e'))][(_0x6a4a('0x8f'))](_0x6a4a('0x98')+_0x456430);}_0x17bac9[_0x39cc1d[_0x6a4a('0x5a')]['mapKey']]=_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0x99')];})[_0x6a4a('0x1d')](function(){return db['ChatWebsite'][_0x6a4a('0x58')]({'where':{'id':_0x39cc1d[_0x6a4a('0x53')]['id']},'include':[{'model':db[_0x6a4a('0x9a')],'as':'List','include':[{'model':db[_0x6a4a('0x9b')],'as':_0x6a4a('0x9c'),'where':_0x17bac9,'limit':0x1,'order':[[_0x6a4a('0x92'),'DESC']]}]},{'model':db[_0x6a4a('0x9d')],'as':_0x6a4a('0x9e')}]});})[_0x6a4a('0x1d')](handleEntityNotFound(_0x29570f,null))[_0x6a4a('0x1d')](function(_0x3e47a2){if(_0x3e47a2&&_0x3e47a2[_0x6a4a('0x9f')]){_0x18bcd7[_0x6a4a('0xa0')]=_0x3e47a2;_0x18bcd7['applications']=_0x3e47a2['Applications'];_0x18bcd7[_0x6a4a('0xa1')]=_0x3e47a2[_0x6a4a('0x9f')];_0x18bcd7[_0x6a4a('0xa2')]=_[_0x6a4a('0xa3')](_0x18bcd7[_0x6a4a('0xa2')],['priority'],[_0x6a4a('0xa4')]);if(_0x18bcd7['account'][_0x6a4a('0x9e')]){delete _0x18bcd7['account'][_0x6a4a('0x9e')];}if(_0x18bcd7[_0x6a4a('0xa0')][_0x6a4a('0x9f')]&&_0x18bcd7[_0x6a4a('0xa0')][_0x6a4a('0x9f')][_0x6a4a('0x9c')][_0x6a4a('0x45')]){return _0x18bcd7['account'][_0x6a4a('0x9f')][_0x6a4a('0x9c')][0x0];}var _0x22a405=_[_0x6a4a('0xa5')](_0x39cc1d[_0x6a4a('0x5a')],{'firstName':_0x39cc1d['body'][_0x6a4a('0x99')],'ListId':_0x3e47a2[_0x6a4a('0x94')]});_0x22a405[_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0x97')]]=_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0x99')];return db[_0x6a4a('0x9b')]['create'](_0x22a405,{'fields':_0x3ae017,'raw':!![]});}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x29570f,null))[_0x6a4a('0x1d')](function(_0x4daef3){_0x18bcd7[_0x6a4a('0xa6')]=_0x4daef3;var _0x5882ad=_0x39cc1d['body'][_0x6a4a('0xa7')];if(_0x39cc1d[_0x6a4a('0x8d')]['cf-connecting-ip']){_0x5882ad=_0x39cc1d[_0x6a4a('0x8d')][_0x6a4a('0xa8')];}else if(_0x39cc1d[_0x6a4a('0x8d')][_0x6a4a('0xa9')]){_0x5882ad=_[_0x6a4a('0xaa')](_0x39cc1d[_0x6a4a('0x8d')][_0x6a4a('0xa9')][_0x6a4a('0xab')](','));}if(_0x4daef3){var _0x5e3257={'ContactId':_0x4daef3['id'],'ChatWebsiteId':_0x39cc1d[_0x6a4a('0x53')]['id'],'from':(_0x4daef3[_0x6a4a('0xac')]||'')+'\x20'+(_0x4daef3[_0x6a4a('0xad')]||''),'customerIp':_0x5882ad,'customerPort':_0x39cc1d[_0x6a4a('0x8d')][_0x6a4a('0xae')]?_0x39cc1d[_0x6a4a('0x8d')][_0x6a4a('0xae')]:null,'referer':_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0xaf')],'browserName':_0x1d3b99[_0x6a4a('0xb0')][_0x6a4a('0x37')]&&_0x1d3b99['browser']['version']?util[_0x6a4a('0xb1')](_0x6a4a('0xb2'),_0x1d3b99[_0x6a4a('0xb0')][_0x6a4a('0x37')],_0x1d3b99[_0x6a4a('0xb0')][_0x6a4a('0xb3')]):_0x6a4a('0xb4'),'browserVersion':_0x1d3b99[_0x6a4a('0xb0')]['version']||_0x6a4a('0xb4'),'osName':util[_0x6a4a('0xb1')]('%s\x20%s',_0x1d3b99['os']['name'],_0x1d3b99['os'][_0x6a4a('0xb3')]),'osVersion':_0x1d3b99['os'][_0x6a4a('0xb3')],'deviceModel':_0x1d3b99['device'][_0x6a4a('0x3e')]&&_0x1d3b99[_0x6a4a('0xb5')][_0x6a4a('0xb6')]?util[_0x6a4a('0xb1')](_0x6a4a('0xb7'),_0x1d3b99[_0x6a4a('0xb5')][_0x6a4a('0x3e')],_0x1d3b99[_0x6a4a('0xb5')][_0x6a4a('0xb6')],_0x1d3b99[_0x6a4a('0xb5')][_0x6a4a('0x3c')]):null,'deviceVendor':_0x1d3b99[_0x6a4a('0xb5')][_0x6a4a('0xb6')],'deviceType':_0x1d3b99[_0x6a4a('0xb5')][_0x6a4a('0x3c')],'formData':JSON[_0x6a4a('0x23')](_0x39cc1d[_0x6a4a('0x5a')])};var _0x58d41d={'ChatWebsiteId':_0x39cc1d['params']['id'],'closed':![]};if(_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0xb8')]){_0x58d41d[_0x6a4a('0xb8')]=_0x39cc1d['body'][_0x6a4a('0xb8')];return db['ChatInteraction'][_0x6a4a('0x58')]({'where':_0x58d41d})['then'](function(_0x15265e){if(_0x15265e){return[_0x15265e,![]];}_0x5e3257['threadId']=_0x39cc1d[_0x6a4a('0x5a')]['threadId'];_0x5e3257['externalUrl']=_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0xb9')];return db[_0x6a4a('0xba')][_0x6a4a('0x59')](_0x5e3257)[_0x6a4a('0x1d')](function(_0x1970cd){return[_0x1970cd,!![]];});});}_0x58d41d[_0x6a4a('0xbb')]=_0x4daef3['id'];if(_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0xbc')]&&_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0xbc')]['id']){_0x58d41d['id']=_0x39cc1d[_0x6a4a('0x5a')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x58d41d})[_0x6a4a('0x1d')](function(_0x38675d){if(_0x38675d){return[_0x38675d,![]];}return db[_0x6a4a('0xba')][_0x6a4a('0x59')](_0x5e3257)[_0x6a4a('0x1d')](function(_0x2c27b0){return[_0x2c27b0,!![]];});});}return db[_0x6a4a('0xba')][_0x6a4a('0x59')](_0x5e3257)[_0x6a4a('0x1d')](function(_0x2e5e84){return[_0x2e5e84,!![]];});}})[_0x6a4a('0xbd')](function(_0x59ca75,_0x18ff0a){if(_0x59ca75){_0x1eb4f3=_0x18ff0a;if(!_0x18ff0a){var _0x48e7ac={'from':(_0x18bcd7[_0x6a4a('0xa6')]['firstName']||'')+'\x20'+(_0x18bcd7[_0x6a4a('0xa6')][_0x6a4a('0xad')]||'')};if(_0x39cc1d[_0x6a4a('0x5a')]['threadId']&&_0x39cc1d[_0x6a4a('0x5a')]['messageId']&&_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0xb8')]!=_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0xbe')]){_0x48e7ac['threadId']=_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0xbe')];}return _0x59ca75['update'](_0x48e7ac);}else{return _0x59ca75;}}})[_0x6a4a('0x1d')](function(_0x510bcc){_0x18bcd7[_0x6a4a('0xbc')]=_0x510bcc[_0x6a4a('0x33')]({'plain':!![]});_0x18bcd7['interaction'][_0x6a4a('0xbf')]=_0x1eb4f3;if(_0x18bcd7[_0x6a4a('0xbc')]['created']){if(_0x18bcd7[_0x6a4a('0xa0')][_0x6a4a('0xc0')]){_0x18bcd7[_0x6a4a('0xa2')]['push']({'id':0x0,'priority':_0x18bcd7[_0x6a4a('0xa2')]['length']+0x1,'app':_0x6a4a('0xc1'),'appdata':_0x6a4a('0xc2'),'interval':'*,*,*,*'});}}return db[_0x6a4a('0xc3')][_0x6a4a('0x59')]({'body':_0x39cc1d[_0x6a4a('0x5a')][_0x6a4a('0x5a')],'ChatWebsiteId':_0x39cc1d[_0x6a4a('0x53')]['id'],'ChatInteractionId':_0x510bcc['id'],'direction':'in','ContactId':_0x18bcd7['contact']['id'],'AttachmentId':_0x39cc1d['body']['AttachmentId']});})[_0x6a4a('0x1d')](function(_0x31447e){_0x18bcd7['message']=_0x31447e;if(_0x18bcd7[_0x6a4a('0xbc')][_0x6a4a('0xc4')]){return db['User'][_0x6a4a('0x58')]({'attributes':['id',_0x6a4a('0x37')],'where':{'id':_0x18bcd7['interaction'][_0x6a4a('0xc4')]}})['then'](function(_0x25a22f){if(_0x25a22f){_0x18bcd7[_0x6a4a('0xa2')][_0x6a4a('0xc5')]({'id':0x0,'priority':0x0,'app':_0x6a4a('0xc6'),'appdata':_0x25a22f['name']+','+(_0x18bcd7[_0x6a4a('0xa0')][_0x6a4a('0xc7')]||0xa),'interval':'*,*,*,*'});_0x18bcd7[_0x6a4a('0xc8')]=!![];}return respondWithRpcPromise(_0x6a4a('0xc9'),'startRouting',_0x18bcd7);});}return respondWithRpcPromise('Start',_0x6a4a('0xca'),_0x18bcd7);})[_0x6a4a('0x1d')](function(_0x48f8e3){respondWithRpcPromise('EventManager',_0x6a4a('0xcb'),{'event':'notify','message':_0x48f8e3},client9002);return _0x48f8e3;})[_0x6a4a('0x1d')](respondWithResult(_0x29570f,null))['catch'](handleError(_0x29570f,null));};exports['offline']=function(_0x15f2ed,_0x32edb5,_0x261bf5){var _0x52bbf5,_0x246844,_0x20f6e3;var _0x2324f8=[];var _0x1d5691=[];var _0x399460={};var _0x5bd247=_0x15f2ed[_0x6a4a('0xcc')]||[];var _0x336bb4=[];var _0x5d9ee0;return db[_0x6a4a('0x9b')][_0x6a4a('0x64')]()[_0x6a4a('0x1d')](function(_0x1ecca2){if(!_0x1ecca2){throw new db[(_0x6a4a('0x8e'))][(_0x6a4a('0x8f'))]('no\x20available\x20attributes');}_0x1d5691=_['difference'](_[_0x6a4a('0x40')](_0x1ecca2),[_0x6a4a('0x91'),_0x6a4a('0x92')]);_0x2324f8=_[_0x6a4a('0xcd')](_[_0x6a4a('0x40')](_0x1ecca2),[_0x6a4a('0x91'),_0x6a4a('0x92'),'CompanyId','ListId']);if(_0x15f2ed[_0x6a4a('0x5a')]['id']){delete _0x15f2ed[_0x6a4a('0x5a')]['id'];}if(_[_0x6a4a('0x7f')](_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0x99')])){throw _0x32edb5[_0x6a4a('0x28')](0x1f4)[_0x6a4a('0x38')](new db['Sequelize']['ValidationError'](_0x6a4a('0x95')));}if(_[_0x6a4a('0x7f')](_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0x5a')])||_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0x5a')]===''){throw _0x32edb5['status'](0x1f4)[_0x6a4a('0x38')](new db[(_0x6a4a('0x8e'))][(_0x6a4a('0x8f'))](_0x6a4a('0x96')));}if(_[_0x6a4a('0x7f')](_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0xce')])){throw _0x32edb5[_0x6a4a('0x28')](0x1f4)[_0x6a4a('0x38')](new db[(_0x6a4a('0x8e'))][(_0x6a4a('0x8f'))](_0x6a4a('0xcf')+_0x2324f8));}if(!_[_0x6a4a('0xd0')](_0x2324f8,_0x15f2ed['body'][_0x6a4a('0xce')])){throw _0x32edb5[_0x6a4a('0x28')](0x1f4)['send'](new db[(_0x6a4a('0x8e'))][(_0x6a4a('0x8f'))](_0x6a4a('0xd1')+_0x2324f8));}_0x399460[_0x15f2ed['body'][_0x6a4a('0xce')]]=_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0x99')];})[_0x6a4a('0x1d')](function(){return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x15f2ed[_0x6a4a('0x53')]['id']},'include':[{'model':db[_0x6a4a('0x9a')],'as':_0x6a4a('0x9f')},{'model':db[_0x6a4a('0xd2')],'as':_0x6a4a('0xd2')}]});})[_0x6a4a('0x1d')](handleEntityNotFound(_0x32edb5,null))[_0x6a4a('0x1d')](function(_0x4a3893){if(_0x4a3893&&_0x4a3893[_0x6a4a('0x9f')]){_0x246844=_0x4a3893;var _0x26ae8e=_[_0x6a4a('0xa5')](_0x15f2ed['body'],{'firstName':_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0x99')],'phone':_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0x99')],'ListId':_0x4a3893['ListId']});_0x26ae8e[_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0xce')]]=_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0x99')];return db['CmContact']['findOrCreate']({'where':_0x399460,'defaults':_0x26ae8e});}})[_0x6a4a('0xbd')](function(_0x17f24e){if(_0x17f24e){_0x20f6e3=_0x17f24e;var _0x500fde=fs[_0x6a4a('0xd3')](path[_0x6a4a('0x7a')](config[_0x6a4a('0x7b')],'server/files/templates/chatOfflineMessage.ejs'),_0x6a4a('0xd4'));var _0x1d11e2=ejs[_0x6a4a('0xd5')](_0x500fde,{'body':_[_0x6a4a('0xd6')](_0x15f2ed[_0x6a4a('0x5a')][_0x6a4a('0x5a')]),'bodyTitle':_0x246844[_0x6a4a('0xd7')]});return db[_0x6a4a('0xd8')][_0x6a4a('0x59')]({'body':_0x1d11e2,'ContactId':_0x17f24e['id'],'ChatWebsiteId':_0x246844['id']});}})[_0x6a4a('0x1d')](function(_0x46c31e){_0x5d9ee0=_0x46c31e;if(_0x5bd247[_0x6a4a('0x45')]){var _0x270716=_0x5bd247[_0x6a4a('0x4b')](function(_0x37882d){return{'name':_0x37882d[_0x6a4a('0xd9')],'basename':_0x37882d[_0x6a4a('0x73')],'type':_0x37882d[_0x6a4a('0xda')],'ChatOfflineMessageId':_0x46c31e['id']};});_0x336bb4=_0x270716['map'](_0x52fe6a=>{var _0x5cba45={'filename':_0x52fe6a['name'],'path':path[_0x6a4a('0x7a')](config['root'],'server','files',_0x6a4a('0xdb'),_0x6a4a('0xdc'),_0x52fe6a[_0x6a4a('0xdd')])};return _0x5cba45;});if(!_0x246844[_0x6a4a('0xde')]){return db[_0x6a4a('0xdf')][_0x6a4a('0xe0')](function(_0x1784ba){return db['Attachment'][_0x6a4a('0xe1')](_0x270716,{'transaction':_0x1784ba});});}}})['then'](function(){if(_0x5d9ee0){_0x52bbf5=_0x5d9ee0;return db[_0x6a4a('0xd2')][_0x6a4a('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0x6a4a('0xe2')],'as':_0x6a4a('0xe3'),'raw':!![]}]});}})[_0x6a4a('0x1d')](function(_0x5984c5){if(_0x5984c5&&_0x5984c5['Smtp']&&_0x246844[_0x6a4a('0xe4')]&&_0x246844[_0x6a4a('0xe5')]){var _0x23c31c={'tls':{'rejectUnauthorized':![]}};if(_0x5984c5[_0x6a4a('0xe3')][_0x6a4a('0xe6')]){_0x23c31c[_0x6a4a('0xe6')]=_0x5984c5[_0x6a4a('0xe3')][_0x6a4a('0xe6')];}else{_0x23c31c[_0x6a4a('0xe7')]=_0x5984c5[_0x6a4a('0xe3')][_0x6a4a('0xe7')];_0x23c31c[_0x6a4a('0xe8')]=_0x5984c5[_0x6a4a('0xe3')][_0x6a4a('0xe8')];_0x23c31c[_0x6a4a('0xe9')]=_0x5984c5[_0x6a4a('0xe3')][_0x6a4a('0xe9')];}if(_0x5984c5[_0x6a4a('0xe3')][_0x6a4a('0xea')]){_0x23c31c[_0x6a4a('0xeb')]={'user':_0x5984c5['Smtp']['user'],'pass':_0x5984c5['Smtp']['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x23c31c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x5984c5[_0x6a4a('0x37')],_0x5984c5[_0x6a4a('0xec')]||_0x5984c5[_0x6a4a('0xe3')]['user']),'to':_0x246844[_0x6a4a('0xe5')],'subject':_0x246844[_0x6a4a('0xed')],'html':_0x52bbf5['body'],'attachments':_0x336bb4}},client9003)[_0x6a4a('0x1d')](function(){return _0x52bbf5;})[_0x6a4a('0x51')](function(_0x355620){console['error'](_0x355620);});}})['then'](function(){if(_0x246844&&_0x246844[_0x6a4a('0xde')]&&_0x246844[_0x6a4a('0xee')]){var _0x4e8bf3=[];if(_0x5bd247[_0x6a4a('0x45')]){_0x4e8bf3=_0x5bd247['map'](function(_0x395691){return{'name':_0x395691[_0x6a4a('0xd9')],'basename':_0x395691[_0x6a4a('0x73')],'type':_0x395691[_0x6a4a('0xda')],'ChatOfflineMessageId':_0x5d9ee0['id']};});}var _0x3e775a;if(!_[_0x6a4a('0x7f')](_0x246844[_0x6a4a('0xef')])){var _0x2659ee=_['map'](_0x15f2ed[_0x6a4a('0x5a')],function(_0x3f437f){return _0x3f437f;});var _0x286b0b=_['toPairsIn'](_0x2659ee)[0x0];var _0x23b4a5=_[_0x6a4a('0xf0')](_0x286b0b,function(_0xa93ae4){return _0xa93ae4;});_0x3e775a=_0x23b4a5[0x1][_0x246844['subjectOffline']];}var _0x1f7d22={'from':_0x20f6e3[_0x6a4a('0xec')],'firstName':_0x20f6e3[_0x6a4a('0xac')],'lastName':_0x20f6e3[_0x6a4a('0xad')],'mapKey':'email','message':{'from':_0x20f6e3[_0x6a4a('0xec')],'to':_0x246844['MailAccount'][_0x6a4a('0xec')],'cc':'','subject':_[_0x6a4a('0x7f')](_0x3e775a)?_0x246844[_0x6a4a('0xed')]:_0x3e775a,'messageId':'','sentAt':new Date(),'attach':_0x4e8bf3[_0x6a4a('0x45')],'attachments':_0x4e8bf3,'originChannel':_0x6a4a('0xf1'),'ChatWebsiteId':_0x246844['id'],'ChatOfflineMessageId':_0x52bbf5['id'],'originTo':_0x246844[_0x6a4a('0xd2')][_0x6a4a('0xec')]},'body':_0x52bbf5[_0x6a4a('0x5a')]};var _0x136b81={'account':{'id':_0x246844[_0x6a4a('0xee')]},'body':_0x1f7d22,'log':_0x6a4a('0xf2')};return respondWithRpcPromise(_0x6a4a('0xf2'),'notifyMail',_0x136b81,client9001)[_0x6a4a('0x1d')](function(){return _0x52bbf5;})[_0x6a4a('0x51')](function(_0x5787a9){console[_0x6a4a('0x24')](_0x5787a9);});}return;})[_0x6a4a('0x1d')](function(){if(_0x52bbf5){return _0x52bbf5;}})[_0x6a4a('0x1d')](respondWithResult(_0x32edb5,null))[_0x6a4a('0x51')](function(_0x3fb66b){console[_0x6a4a('0x24')](_0x6a4a('0x51'),_0x3fb66b);for(var _0x4aa35b of _0x5bd247){var _0x54be4b=path['join'](config[_0x6a4a('0x7b')],_0x6a4a('0xf3'),_0x6a4a('0xcc'),_0x6a4a('0xdb'),_0x6a4a('0xdc'),_0x4aa35b[_0x6a4a('0x73')]);fs_extra[_0x6a4a('0xf4')](_0x54be4b)['catch'](function(_0x50229e){console['error'](_0x6a4a('0xf5'),_0x54be4b,_0x50229e);});}});};exports['addInteraction']=function(_0x48150e,_0x229aa8,_0x58cde3){return db['ChatInteraction'][_0x6a4a('0x58')]({'where':{'id':_0x48150e[_0x6a4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x229aa8,null))[_0x6a4a('0x1d')](function(_0x48c104){if(_0x48c104){return _0x48c104[_0x6a4a('0xf6')](_0x48150e[_0x6a4a('0x5a')][_0x6a4a('0x6f')],_[_0x6a4a('0xf7')](_0x48150e[_0x6a4a('0x5a')],[_0x6a4a('0x6f'),'id'])||{});}})[_0x6a4a('0x1d')](respondWithResult(_0x229aa8,null))[_0x6a4a('0x51')](handleError(_0x229aa8,null));};exports[_0x6a4a('0xf8')]=function(_0x4b0759,_0x29261b,_0x146625){var _0x303a58={'raw':![],'where':{}};var _0x1b8ab4={};var _0x5d4925={'count':0x0,'rows':[]};return db[_0x6a4a('0x3a')]['findOne']({'where':{'id':_0x4b0759['params']['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x29261b,null))[_0x6a4a('0x1d')](function(_0x5155c2){if(_0x5155c2){_0x1b8ab4[_0x6a4a('0x3e')]=_[_0x6a4a('0x40')](db['ChatInteraction'][_0x6a4a('0x3b')]);_0x1b8ab4[_0x6a4a('0x3f')]=_['keys'](_0x4b0759[_0x6a4a('0x3f')]);_0x1b8ab4['filters']=_[_0x6a4a('0x42')](_0x1b8ab4[_0x6a4a('0x3e')],_0x1b8ab4['query']);_0x303a58[_0x6a4a('0x43')]=_[_0x6a4a('0x42')](_0x1b8ab4['model'],qs[_0x6a4a('0x44')](_0x4b0759[_0x6a4a('0x3f')]['fields']));_0x303a58[_0x6a4a('0x43')]=_0x303a58[_0x6a4a('0x43')]['length']?_0x303a58[_0x6a4a('0x43')]:_0x1b8ab4[_0x6a4a('0x3e')];if(!_0x4b0759[_0x6a4a('0x3f')][_0x6a4a('0x46')](_0x6a4a('0x6b'))){_0x303a58[_0x6a4a('0x2c')]=qs['limit'](_0x4b0759[_0x6a4a('0x3f')][_0x6a4a('0x2c')]);_0x303a58[_0x6a4a('0x2e')]=qs[_0x6a4a('0x2e')](_0x4b0759['query'][_0x6a4a('0x2e')]);}_0x303a58[_0x6a4a('0x47')]=qs['sort'](_0x4b0759['query']['sort']);_0x303a58[_0x6a4a('0x49')]=qs[_0x6a4a('0x41')](_[_0x6a4a('0x4a')](_0x4b0759[_0x6a4a('0x3f')],_0x1b8ab4[_0x6a4a('0x41')]));_0x303a58[_0x6a4a('0x49')][_0x6a4a('0x65')]=_0x5155c2['id'];if(_0x4b0759['query'][_0x6a4a('0x4d')]){_0x303a58['where']=_[_0x6a4a('0x57')](_0x303a58[_0x6a4a('0x49')],{'$or':_['map'](_0x303a58[_0x6a4a('0x43')],function(_0x11555b){var _0x35e3c6={};_0x35e3c6[_0x11555b]={'$like':'%'+_0x4b0759[_0x6a4a('0x3f')]['filter']+'%'};return _0x35e3c6;})});}_0x303a58=_[_0x6a4a('0x57')]({},_0x303a58,_0x4b0759[_0x6a4a('0x4e')]);return db['ChatInteraction'][_0x6a4a('0x2d')]({'where':_0x303a58['where']})[_0x6a4a('0x1d')](function(_0x2cac66){_0x5d4925['count']=_0x2cac66;if(_0x4b0759[_0x6a4a('0x3f')][_0x6a4a('0x6c')]){_0x303a58[_0x6a4a('0x56')]=[{'model':db[_0x6a4a('0x9b')],'as':_0x6a4a('0xf9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x6a4a('0x37'),'fullname',_0x6a4a('0xfa')],'required':![]},{'model':db[_0x6a4a('0xfb')],'as':_0x6a4a('0xfc'),'attributes':['id',_0x6a4a('0x37'),'color'],'where':_0x4b0759[_0x6a4a('0x3f')]['tag']?{'id':_0x4b0759[_0x6a4a('0x3f')]['tag']}:undefined,'required':_0x4b0759[_0x6a4a('0x3f')][_0x6a4a('0xfd')]?!![]:![]}];}return db[_0x6a4a('0xba')][_0x6a4a('0x4f')](_0x303a58);})['then'](function(_0x4758fb){_0x5d4925['rows']=_0x4758fb;return _0x5d4925;});}})['then'](respondWithFilteredResult(_0x29261b,_0x303a58))[_0x6a4a('0x51')](handleError(_0x29261b,null));};function iftimePromise(_0x5e3ab3,_0x3692c7){return respondWithRpcPromise(_0x6a4a('0xfe'),_0x6a4a('0xff'),{'command':_0x3692c7[_0x6a4a('0x100')]?util[_0x6a4a('0xb1')](_0x6a4a('0x101'),_0x5e3ab3[_0x6a4a('0x102')],_0x3692c7[_0x6a4a('0x100')]):util['format'](_0x6a4a('0x103'),_0x5e3ab3['interval'])},client9002)[_0x6a4a('0x1d')](function(_0x17838a){var _0x4832bc=_0x17838a&&_0x17838a[_0x6a4a('0x104')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3692c7['id'],_0x5e3ab3['id'],_0x5e3ab3[_0x6a4a('0x102')],_0x4832bc?'ONLINE':_0x6a4a('0x105'),_0x3692c7[_0x6a4a('0x100')]?_0x3692c7['timezone']:'No\x20timezone');return _0x4832bc;})[_0x6a4a('0x51')](function(_0x4f2129){logger[_0x6a4a('0x24')](_0x6a4a('0x106'),_0x3692c7['id'],_0x5e3ab3['id'],_0x5e3ab3[_0x6a4a('0x102')],util[_0x6a4a('0x107')](_0x4f2129,{'showHidden':![],'depth':null}),_0x3692c7[_0x6a4a('0x100')]?_0x3692c7['timezone']:_0x6a4a('0x108'));return![];});}exports['getSnippet']=function(_0x9a38c2,_0x1b4568,_0x39eac4){var _0x276f3d=0x0;var _0x482ac2=0x0;var _0x25aca7=![];var _0x1642b7;var _0x219699;return db[_0x6a4a('0x3a')]['find']({'where':{'id':_0x9a38c2[_0x6a4a('0x53')]['id']},'include':[{'model':db[_0x6a4a('0x109')],'as':_0x6a4a('0x109'),'include':[{'model':db[_0x6a4a('0x109')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1b4568,null))['then'](function(_0x14783d){if(_0x14783d){_0x1642b7=_0x14783d;return _0x14783d['getProactiveActions']({'raw':!![]});}})['then'](function(_0x5f5cc0){if(_0x1642b7){if(_0x5f5cc0){_0x219699=_0x5f5cc0;}}return require('../../config/license/util')[_0x6a4a('0x7d')]();})[_0x6a4a('0x1d')](function(_0x46f827){if(_0x46f827){_0x482ac2=_0x46f827[_0x6a4a('0x10a')];_0x25aca7=_0x46f827[_0x6a4a('0x7e')];}})[_0x6a4a('0x1d')](function(){return db[_0x6a4a('0xba')][_0x6a4a('0x2d')]({'where':{'closed':![]}});})[_0x6a4a('0x1d')](function(_0x4e7b84){_0x276f3d=_0x4e7b84;if(_0x482ac2&&_0x4e7b84>_0x482ac2){return db[_0x6a4a('0x10b')][_0x6a4a('0x68')]({'where':{'id':0x1}})[_0x6a4a('0x1d')](function(_0x1fc6eb){if(_0x1fc6eb){_0x1fc6eb[_0x6a4a('0x10c')](_0x6a4a('0x10d'));}});}})[_0x6a4a('0x1d')](function(){if(_0x1642b7[_0x6a4a('0x109')]&&_0x1642b7[_0x6a4a('0x109')][_0x6a4a('0x10e')]){var _0x2e6d93=[];for(var _0x31cbe4=0x0;_0x31cbe4<_0x1642b7[_0x6a4a('0x109')]['Intervals'][_0x6a4a('0x45')];_0x31cbe4++){var _0x2a71ed=_0x1642b7[_0x6a4a('0x109')][_0x6a4a('0x10e')][_0x31cbe4][_0x6a4a('0x33')]({'plain':!![]});_0x2e6d93['push'](iftimePromise(_0x2a71ed,_0x1642b7));}return BPromise[_0x6a4a('0x10f')](_0x2e6d93)['then'](function(_0x161a31){return _['some'](_0x161a31);});}else{return!![];}})[_0x6a4a('0x1d')](function(_0x66b0bc){var _0x15e8aa=fs['readFileSync'](path[_0x6a4a('0x7a')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0x2d1fdc={'remote':_0x1642b7[_0x6a4a('0x110')],'query':querystring[_0x6a4a('0x23')](_['merge'](_0x1642b7['get']({'plain':!![]}),{'customerIp':_0x9a38c2[_0x6a4a('0x8d')][_0x6a4a('0xa9')]||_0x9a38c2[_0x6a4a('0x8d')]['x-real-ip']||_0x9a38c2['connection'][_0x6a4a('0x111')]||_0x9a38c2['ip'],'referer':_0x9a38c2[_0x6a4a('0x8d')][_0x6a4a('0xaf')],'openedInteractions':_0x276f3d,'maxInteractions':_0x482ac2,'virtual':_0x25aca7[_0x6a4a('0x10a')],'online':_0x66b0bc,'custom':_0x25aca7}))[_0x6a4a('0x112')](/'/g,'\x5c\x27')};_0x1b4568[_0x6a4a('0x38')](ejs[_0x6a4a('0xd5')](Mustache[_0x6a4a('0xd5')](_0x15e8aa,_0x2d1fdc),{'proactiveActions':_0x219699,'alignment':_0x1642b7[_0x6a4a('0x113')],'verticalAlignment':_0x1642b7[_0x6a4a('0x114')],'div_color':_0x1642b7[_0x6a4a('0x115')],'text_color':_0x1642b7['textColor'],'button_color':_0x1642b7[_0x6a4a('0x116')],'background_color':_0x1642b7['backgroundColor']}));})[_0x6a4a('0x51')](handleError(_0x1b4568,null));};exports[_0x6a4a('0x117')]=function(_0x98cbd1,_0x1e2c6e,_0x2640f1){return db['ChatWebsite'][_0x6a4a('0x68')]({'where':{'id':_0x98cbd1[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x1e2c6e,null))[_0x6a4a('0x1d')](function(_0x56dbbb){if(_0x56dbbb){return db['sequelize'][_0x6a4a('0xe0')](function(_0x3dadaf){return db['ChatApplication'][_0x6a4a('0x35')]({'where':{'ChatWebsiteId':_0x98cbd1[_0x6a4a('0x53')]['id']},'transaction':_0x3dadaf})[_0x6a4a('0x1d')](function(_0x4737de){var _0x45ec8e=_[_0x6a4a('0x4b')](_0x98cbd1[_0x6a4a('0x5a')],function(_0x5502d7){_0x5502d7[_0x6a4a('0x65')]=_0x98cbd1[_0x6a4a('0x53')]['id'];return _0x5502d7;});return db[_0x6a4a('0x9d')][_0x6a4a('0xe1')](_0x45ec8e,{'transaction':_0x3dadaf});});})[_0x6a4a('0x1d')](function(){return db[_0x6a4a('0x9d')][_0x6a4a('0x118')]({'where':{'ChatWebsiteId':_0x98cbd1[_0x6a4a('0x53')]['id']},'order':_0x6a4a('0x119')});});}})[_0x6a4a('0x1d')](respondWithResult(_0x1e2c6e,null))['catch'](handleError(_0x1e2c6e,null));};exports[_0x6a4a('0x11a')]=function(_0x44e6d6,_0x5a31eb,_0x1420e4){var _0x15d235={};var _0x2e9820={};var _0x40ea5f;var _0x2c4e82;return db[_0x6a4a('0x3a')][_0x6a4a('0x68')]({'where':{'id':_0x44e6d6['params']['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x5a31eb,null))['then'](function(_0x3db622){if(_0x3db622){_0x40ea5f=_0x3db622;_0x2e9820[_0x6a4a('0x3e')]=_[_0x6a4a('0x40')](db[_0x6a4a('0x9d')][_0x6a4a('0x3b')]);_0x2e9820[_0x6a4a('0x3f')]=_[_0x6a4a('0x40')](_0x44e6d6[_0x6a4a('0x3f')]);_0x2e9820[_0x6a4a('0x41')]=_['intersection'](_0x2e9820[_0x6a4a('0x3e')],_0x2e9820[_0x6a4a('0x3f')]);_0x15d235['attributes']=_[_0x6a4a('0x42')](_0x2e9820[_0x6a4a('0x3e')],qs[_0x6a4a('0x44')](_0x44e6d6[_0x6a4a('0x3f')]['fields']));_0x15d235[_0x6a4a('0x43')]=_0x15d235['attributes'][_0x6a4a('0x45')]?_0x15d235[_0x6a4a('0x43')]:_0x2e9820[_0x6a4a('0x3e')];_0x15d235[_0x6a4a('0x47')]=qs['sort'](_0x44e6d6[_0x6a4a('0x3f')][_0x6a4a('0x48')]);_0x15d235[_0x6a4a('0x49')]=qs[_0x6a4a('0x41')](_['pick'](_0x44e6d6[_0x6a4a('0x3f')],_0x2e9820['filters']));if(_0x44e6d6[_0x6a4a('0x3f')][_0x6a4a('0x4d')]){_0x15d235[_0x6a4a('0x49')]=_[_0x6a4a('0x57')](_0x15d235[_0x6a4a('0x49')],{'$or':_[_0x6a4a('0x4b')](_0x15d235[_0x6a4a('0x43')],function(_0x5b7844){var _0x309f20={};_0x309f20[_0x5b7844]={'$like':'%'+_0x44e6d6[_0x6a4a('0x3f')][_0x6a4a('0x4d')]+'%'};return _0x309f20;})});}_0x15d235=_['merge']({},_0x15d235,_0x44e6d6[_0x6a4a('0x4e')]);return _0x40ea5f[_0x6a4a('0x11a')](_0x15d235);}})[_0x6a4a('0x1d')](function(_0x5ac606){if(_0x5ac606){_0x2c4e82=_0x5ac606[_0x6a4a('0x45')];if(!_0x44e6d6[_0x6a4a('0x3f')][_0x6a4a('0x46')]('nolimit')){_0x15d235[_0x6a4a('0x2c')]=qs[_0x6a4a('0x2c')](_0x44e6d6['query'][_0x6a4a('0x2c')]);_0x15d235[_0x6a4a('0x2e')]=qs['offset'](_0x44e6d6['query'][_0x6a4a('0x2e')]);}return _0x40ea5f[_0x6a4a('0x11a')](_0x15d235);}})[_0x6a4a('0x1d')](function(_0x445085){if(_0x445085){return _0x445085?{'count':_0x2c4e82,'rows':_0x445085}:null;}})['then'](respondWithResult(_0x5a31eb,null))[_0x6a4a('0x51')](handleError(_0x5a31eb,null));};exports['addProactiveActions']=function(_0x181889,_0x57e4f2,_0x1ddf6e){return db[_0x6a4a('0x11b')]['find']({'where':{'id':_0x181889['params']['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x57e4f2,null))[_0x6a4a('0x1d')](function(_0x5f4406){if(_0x5f4406){return _0x5f4406['addProactiveActions'](_0x181889[_0x6a4a('0x5a')][_0x6a4a('0x6f')],_[_0x6a4a('0xf7')](_0x181889[_0x6a4a('0x5a')],[_0x6a4a('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x57e4f2,null))[_0x6a4a('0x51')](handleError(_0x57e4f2,null));};exports['getProactiveActions']=function(_0x18f861,_0x524cc0,_0x964158){var _0x48b3fd={};var _0x52adac={};var _0x49aebd;var _0x447d44;return db[_0x6a4a('0x3a')][_0x6a4a('0x68')]({'where':{'id':_0x18f861[_0x6a4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x524cc0,null))[_0x6a4a('0x1d')](function(_0x2ccc54){if(_0x2ccc54){_0x49aebd=_0x2ccc54;_0x52adac[_0x6a4a('0x3e')]=_[_0x6a4a('0x40')](db['ChatProactiveAction']['rawAttributes']);_0x52adac[_0x6a4a('0x3f')]=_['keys'](_0x18f861[_0x6a4a('0x3f')]);_0x52adac[_0x6a4a('0x41')]=_[_0x6a4a('0x42')](_0x52adac[_0x6a4a('0x3e')],_0x52adac[_0x6a4a('0x3f')]);_0x48b3fd[_0x6a4a('0x43')]=_[_0x6a4a('0x42')](_0x52adac[_0x6a4a('0x3e')],qs['fields'](_0x18f861[_0x6a4a('0x3f')][_0x6a4a('0x44')]));_0x48b3fd[_0x6a4a('0x43')]=_0x48b3fd[_0x6a4a('0x43')]['length']?_0x48b3fd[_0x6a4a('0x43')]:_0x52adac['model'];_0x48b3fd['order']=qs[_0x6a4a('0x48')](_0x18f861[_0x6a4a('0x3f')]['sort']);_0x48b3fd[_0x6a4a('0x49')]=qs['filters'](_['pick'](_0x18f861[_0x6a4a('0x3f')],_0x52adac['filters']));if(_0x18f861['query'][_0x6a4a('0x4d')]){_0x48b3fd['where']=_[_0x6a4a('0x57')](_0x48b3fd['where'],{'$or':_[_0x6a4a('0x4b')](_0x48b3fd['attributes'],function(_0x15b094){var _0x395c0a={};_0x395c0a[_0x15b094]={'$like':'%'+_0x18f861[_0x6a4a('0x3f')]['filter']+'%'};return _0x395c0a;})});}_0x48b3fd=_[_0x6a4a('0x57')]({},_0x48b3fd,_0x18f861[_0x6a4a('0x4e')]);return _0x49aebd[_0x6a4a('0x11c')](_0x48b3fd);}})[_0x6a4a('0x1d')](function(_0x4f4515){if(_0x4f4515){_0x447d44=_0x4f4515['length'];if(!_0x18f861['query'][_0x6a4a('0x46')]('nolimit')){_0x48b3fd[_0x6a4a('0x2c')]=qs[_0x6a4a('0x2c')](_0x18f861[_0x6a4a('0x3f')][_0x6a4a('0x2c')]);_0x48b3fd[_0x6a4a('0x2e')]=qs['offset'](_0x18f861[_0x6a4a('0x3f')][_0x6a4a('0x2e')]);}return _0x49aebd[_0x6a4a('0x11c')](_0x48b3fd);}})[_0x6a4a('0x1d')](function(_0x388220){if(_0x388220){return _0x388220?{'count':_0x447d44,'rows':_0x388220}:null;}})[_0x6a4a('0x1d')](respondWithResult(_0x524cc0,null))['catch'](handleError(_0x524cc0,null));};exports[_0x6a4a('0x11d')]=function(_0x3fdd73,_0x559843,_0x303dcf){var _0x7c27c3=_0x3fdd73[_0x6a4a('0x3f')]['online']==='false'?_0x6a4a('0x11e'):_0x6a4a('0x11f');return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'attributes':['id',_0x7c27c3],'where':{'id':_0x3fdd73['params']['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x559843,null))[_0x6a4a('0x1d')](function(_0xbd76a8){if(_0xbd76a8){var _0x273497=_0xbd76a8[_0x7c27c3];var _0x19bd52=_0x273497&&_0x273497[_0x6a4a('0x120')]?_0x273497[_0x6a4a('0x120')]:[];_0x559843[_0x6a4a('0x38')]({'fromKey':_[_0x6a4a('0x7f')](_0x273497['fromKey'])?undefined:_0x273497[_0x6a4a('0x121')],'count':_0x19bd52[_0x6a4a('0x45')],'rows':_0x19bd52});}})['catch'](handleError(_0x559843,null));};exports['getOfflineMessages']=function(_0x59bc97,_0x31b4e3,_0x4688c5){var _0x5b958f={'raw':![],'where':{}};var _0x2593c0={};var _0x36a1d9={'count':0x0,'rows':[]};return db[_0x6a4a('0x3a')][_0x6a4a('0x68')]({'where':{'id':_0x59bc97[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x31b4e3,null))['then'](function(_0x3c77de){if(_0x3c77de){_0x2593c0[_0x6a4a('0x3e')]=_[_0x6a4a('0x40')](db[_0x6a4a('0xd8')]['rawAttributes']);_0x2593c0['query']=_[_0x6a4a('0x40')](_0x59bc97[_0x6a4a('0x3f')]);_0x2593c0[_0x6a4a('0x41')]=_[_0x6a4a('0x42')](_0x2593c0[_0x6a4a('0x3e')],_0x2593c0[_0x6a4a('0x3f')]);_0x5b958f[_0x6a4a('0x43')]=_[_0x6a4a('0x42')](_0x2593c0['model'],qs[_0x6a4a('0x44')](_0x59bc97['query'][_0x6a4a('0x44')]));_0x5b958f['attributes']=_0x5b958f[_0x6a4a('0x43')][_0x6a4a('0x45')]?_0x5b958f['attributes']:_0x2593c0[_0x6a4a('0x3e')];if(!_0x59bc97[_0x6a4a('0x3f')][_0x6a4a('0x46')](_0x6a4a('0x6b'))){_0x5b958f[_0x6a4a('0x2c')]=qs[_0x6a4a('0x2c')](_0x59bc97[_0x6a4a('0x3f')][_0x6a4a('0x2c')]);_0x5b958f[_0x6a4a('0x2e')]=qs[_0x6a4a('0x2e')](_0x59bc97[_0x6a4a('0x3f')][_0x6a4a('0x2e')]);}_0x5b958f[_0x6a4a('0x47')]=qs[_0x6a4a('0x48')](_0x59bc97[_0x6a4a('0x3f')][_0x6a4a('0x48')]);_0x5b958f[_0x6a4a('0x49')]=qs['filters'](_[_0x6a4a('0x4a')](_0x59bc97[_0x6a4a('0x3f')],_0x2593c0['filters']));_0x5b958f['where']['ChatWebsiteId']=_0x3c77de['id'];if(_0x59bc97[_0x6a4a('0x3f')][_0x6a4a('0x4d')]){_0x5b958f[_0x6a4a('0x49')]=_['merge'](_0x5b958f[_0x6a4a('0x49')],{'$or':_[_0x6a4a('0x4b')](_0x5b958f[_0x6a4a('0x43')],function(_0x52b8e2){var _0x41f7d9={};_0x41f7d9[_0x52b8e2]={'$like':'%'+_0x59bc97['query'][_0x6a4a('0x4d')]+'%'};return _0x41f7d9;})});}_0x5b958f=_[_0x6a4a('0x57')]({},_0x5b958f,_0x59bc97[_0x6a4a('0x4e')]);return db['ChatOfflineMessage']['count']({'where':_0x5b958f[_0x6a4a('0x49')]})['then'](function(_0x497166){_0x36a1d9[_0x6a4a('0x2d')]=_0x497166;if(_0x59bc97[_0x6a4a('0x3f')][_0x6a4a('0x6c')]){_0x5b958f[_0x6a4a('0x56')]=[{'all':!![]}];}else{_0x5b958f[_0x6a4a('0x56')]=[{'model':db[_0x6a4a('0x9b')],'as':_0x6a4a('0xf9'),'required':![]},{'model':db['Attachment'],'as':_0x6a4a('0x122'),'required':![]}];}return db[_0x6a4a('0xd8')][_0x6a4a('0x4f')](_0x5b958f);})['then'](function(_0x910a9d){_0x36a1d9[_0x6a4a('0x50')]=_0x910a9d;return _0x36a1d9;});}})[_0x6a4a('0x1d')](respondWithFilteredResult(_0x31b4e3,_0x5b958f))[_0x6a4a('0x51')](handleError(_0x31b4e3,null));};exports['addAgents']=function(_0x4d78b7,_0x14ca5a,_0x41eb7d){return db['ChatWebsite'][_0x6a4a('0x58')]({'where':{'id':_0x4d78b7[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x14ca5a,null))[_0x6a4a('0x1d')](function(_0x143716){if(_0x143716){return _0x143716[_0x6a4a('0x123')](_0x4d78b7[_0x6a4a('0x5a')]['ids'],_['omit'](_0x4d78b7[_0x6a4a('0x5a')],[_0x6a4a('0x6f'),'id'])||{})[_0x6a4a('0xbd')](function(_0x59d700){for(var _0x5d5bdb=0x0;_0x5d5bdb<_0x4d78b7[_0x6a4a('0x5a')][_0x6a4a('0x6f')][_0x6a4a('0x45')];_0x5d5bdb+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x4d78b7[_0x6a4a('0x5a')][_0x6a4a('0x6f')][_0x5d5bdb]),'ChatWebsiteId':Number(_0x4d78b7[_0x6a4a('0x53')]['id'])});}return _0x59d700;});}})[_0x6a4a('0x1d')](respondWithResult(_0x14ca5a,null))[_0x6a4a('0x51')](handleError(_0x14ca5a,null));};exports[_0x6a4a('0x124')]=function(_0x27f4b2,_0x5b4bdf,_0x424ebf){return db[_0x6a4a('0x3a')][_0x6a4a('0x58')]({'where':{'id':_0x27f4b2[_0x6a4a('0x53')]['id']}})[_0x6a4a('0x1d')](handleEntityNotFound(_0x5b4bdf,null))[_0x6a4a('0x1d')](function(_0x217c3b){if(_0x217c3b){return _0x217c3b['removeAgents'](_0x27f4b2[_0x6a4a('0x3f')][_0x6a4a('0x6f')])['then'](function(){if(_[_0x6a4a('0x125')](_0x27f4b2[_0x6a4a('0x3f')][_0x6a4a('0x6f')])){for(var _0x466571=0x0;_0x466571<_0x27f4b2[_0x6a4a('0x3f')]['ids'][_0x6a4a('0x45')];_0x466571+=0x1){socket[_0x6a4a('0x126')](_0x6a4a('0x127'),{'UserId':Number(_0x27f4b2[_0x6a4a('0x3f')][_0x6a4a('0x6f')][_0x466571]),'ChatWebsiteId':Number(_0x27f4b2[_0x6a4a('0x53')]['id'])});}}else{socket['emit'](_0x6a4a('0x127'),{'UserId':Number(_0x27f4b2[_0x6a4a('0x3f')][_0x6a4a('0x6f')]),'ChatWebsiteId':Number(_0x27f4b2[_0x6a4a('0x53')]['id'])});}});}})[_0x6a4a('0x1d')](respondWithStatusCode(_0x5b4bdf,null))[_0x6a4a('0x51')](handleError(_0x5b4bdf,null));};exports['getAgents']=function(_0x17db2b,_0x3b80aa,_0xfc27ec){var _0x15bd74={};var _0x361d8f={};var _0x1c1ecd;var _0x457d83;return db['ChatWebsite'][_0x6a4a('0x68')]({'where':{'id':_0x17db2b[_0x6a4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b80aa,null))[_0x6a4a('0x1d')](function(_0xdeb1cc){if(_0xdeb1cc){_0x1c1ecd=_0xdeb1cc;_0x361d8f[_0x6a4a('0x3e')]=_[_0x6a4a('0x40')](db[_0x6a4a('0x128')][_0x6a4a('0x3b')]);_0x361d8f[_0x6a4a('0x3f')]=_[_0x6a4a('0x40')](_0x17db2b[_0x6a4a('0x3f')]);_0x361d8f[_0x6a4a('0x41')]=_[_0x6a4a('0x42')](_0x361d8f[_0x6a4a('0x3e')],_0x361d8f['query']);_0x15bd74[_0x6a4a('0x43')]=_[_0x6a4a('0x42')](_0x361d8f[_0x6a4a('0x3e')],qs[_0x6a4a('0x44')](_0x17db2b[_0x6a4a('0x3f')][_0x6a4a('0x44')]));_0x15bd74[_0x6a4a('0x43')]=_0x15bd74['attributes']['length']?_0x15bd74[_0x6a4a('0x43')]:_0x361d8f[_0x6a4a('0x3e')];_0x15bd74[_0x6a4a('0x47')]=qs['sort'](_0x17db2b[_0x6a4a('0x3f')][_0x6a4a('0x48')]);_0x15bd74[_0x6a4a('0x49')]=qs[_0x6a4a('0x41')](_[_0x6a4a('0x4a')](_0x17db2b['query'],_0x361d8f[_0x6a4a('0x41')]));if(_0x17db2b[_0x6a4a('0x3f')][_0x6a4a('0x4d')]){_0x15bd74[_0x6a4a('0x49')]=_[_0x6a4a('0x57')](_0x15bd74['where'],{'$or':_['map'](_0x15bd74[_0x6a4a('0x43')],function(_0x262cb3){var _0x12ac9c={};_0x12ac9c[_0x262cb3]={'$like':'%'+_0x17db2b[_0x6a4a('0x3f')][_0x6a4a('0x4d')]+'%'};return _0x12ac9c;})});}_0x15bd74=_[_0x6a4a('0x57')]({},_0x15bd74,_0x17db2b[_0x6a4a('0x4e')]);return _0x1c1ecd[_0x6a4a('0x129')](_0x15bd74);}})[_0x6a4a('0x1d')](function(_0x1f9b35){if(_0x1f9b35){_0x457d83=_0x1f9b35['length'];if(!_0x17db2b[_0x6a4a('0x3f')][_0x6a4a('0x46')]('nolimit')){_0x15bd74[_0x6a4a('0x2c')]=qs['limit'](_0x17db2b[_0x6a4a('0x3f')]['limit']);_0x15bd74[_0x6a4a('0x2e')]=qs[_0x6a4a('0x2e')](_0x17db2b[_0x6a4a('0x3f')][_0x6a4a('0x2e')]);}return _0x1c1ecd[_0x6a4a('0x129')](_0x15bd74);}})['then'](function(_0x345e75){if(_0x345e75){return _0x345e75?{'count':_0x457d83,'rows':_0x345e75}:null;}})['then'](respondWithResult(_0x3b80aa,null))[_0x6a4a('0x51')](handleError(_0x3b80aa,null));};
\ No newline at end of file
+var _0x8c72=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','ChatWebsiteId','Disposition','rows','removeDispositions','CannedAnswer','findOne','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','chat','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','color_button','addApplications','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','get','ChatWebsites','destroy','end','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','params','length','find','create','body','user'];(function(_0x2e76e3,_0x2ea7f4){var _0x37a119=function(_0x4f8827){while(--_0x4f8827){_0x2e76e3['push'](_0x2e76e3['shift']());}};_0x37a119(++_0x2ea7f4);}(_0x8c72,0xd5));var _0x28c7=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0x8c72[_0x286bfb];return _0x52b683;};'use strict';var emlformat=require(_0x28c7('0x0'));var rimraf=require(_0x28c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x28c7('0x2'));var moment=require(_0x28c7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x28c7('0x4'));var util=require('util');var path=require(_0x28c7('0x5'));var sox=require('sox');var csv=require(_0x28c7('0x6'));var ejs=require(_0x28c7('0x7'));var fs=require('fs');var fs_extra=require(_0x28c7('0x8'));var _=require(_0x28c7('0x9'));var squel=require(_0x28c7('0xa'));var crypto=require(_0x28c7('0xb'));var jsforce=require(_0x28c7('0xc'));var deskjs=require(_0x28c7('0xd'));var toCsv=require(_0x28c7('0x6'));var querystring=require('querystring');var Papa=require(_0x28c7('0xe'));var Redis=require(_0x28c7('0xf'));var authService=require(_0x28c7('0x10'));var qs=require(_0x28c7('0x11'));var as=require(_0x28c7('0x12'));var hardwareService=require(_0x28c7('0x13'));var logger=require(_0x28c7('0x14'))(_0x28c7('0x15'));var utils=require(_0x28c7('0x16'));var config=require(_0x28c7('0x17'));var licenseUtil=require(_0x28c7('0x18'));var db=require('../../mysqldb')['db'];config[_0x28c7('0x19')]=_[_0x28c7('0x1a')](config[_0x28c7('0x19')],{'host':_0x28c7('0x1b'),'port':0x18eb});var socket=require(_0x28c7('0x1c'))(new Redis(config['redis']));require(_0x28c7('0x1d'))[_0x28c7('0x1e')](socket);var jayson=require(_0x28c7('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x28c7('0x20')]['http']({'port':0x232a});var client9003=jayson[_0x28c7('0x20')][_0x28c7('0x21')]({'port':0x232b});var client9001=jayson[_0x28c7('0x20')]['http']({'port':0x2329});function respondWithRpcPromise(_0x58e8a1,_0x442d7f,_0x2f48f8,_0x47109e){return new BPromise(function(_0x2f3346,_0xe16381){var _0x3fd134=_0x47109e||client;return _0x3fd134[_0x28c7('0x22')](_0x58e8a1,_0x2f48f8)[_0x28c7('0x23')](function(_0x419f27){logger[_0x28c7('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x442d7f,_0x28c7('0x25'));logger[_0x28c7('0x26')](_0x28c7('0x27'),_0x442d7f,'request\x20sent',JSON['stringify'](_0x419f27));if(_0x419f27[_0x28c7('0x28')]){if(_0x419f27[_0x28c7('0x28')][_0x28c7('0x29')]===0x1f4){logger[_0x28c7('0x28')](_0x28c7('0x2a'),_0x442d7f,_0x419f27['error']['message']);return _0xe16381(_0x419f27[_0x28c7('0x28')][_0x28c7('0x2b')]);}logger[_0x28c7('0x28')](_0x28c7('0x2a'),_0x442d7f,_0x419f27[_0x28c7('0x28')]['message']);return _0x2f3346(_0x419f27['error'][_0x28c7('0x2b')]);}else{logger['info'](_0x28c7('0x2a'),_0x442d7f,_0x28c7('0x25'));_0x2f3346(_0x419f27[_0x28c7('0x2c')][_0x28c7('0x2b')]);}})[_0x28c7('0x2d')](function(_0x4ecd19){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x442d7f,_0x4ecd19);_0xe16381(_0x4ecd19);});});}function respondWithStatusCode(_0x57fa91,_0x30c0aa){_0x30c0aa=_0x30c0aa||0xcc;return function(_0x42377f){if(_0x42377f){return _0x57fa91[_0x28c7('0x2e')](_0x30c0aa);}return _0x57fa91[_0x28c7('0x2f')](_0x30c0aa)['end']();};}function respondWithResult(_0xaafc13,_0x16c70b){_0x16c70b=_0x16c70b||0xc8;return function(_0x10a3c2){if(_0x10a3c2){return _0xaafc13[_0x28c7('0x2f')](_0x16c70b)[_0x28c7('0x30')](_0x10a3c2);}};}function respondWithFilteredResult(_0x159202,_0x1dc049){return function(_0x12e097){if(_0x12e097){var _0xacaea2=typeof _0x1dc049[_0x28c7('0x31')]===_0x28c7('0x32')&&typeof _0x1dc049[_0x28c7('0x33')]==='undefined';var _0x1763ca=_0x12e097[_0x28c7('0x34')];var _0x5b6bbb=_0xacaea2?0x0:_0x1dc049['offset'];var _0x3a2d63=_0xacaea2?_0x12e097[_0x28c7('0x34')]:_0x1dc049[_0x28c7('0x31')]+_0x1dc049['limit'];var _0x2d16b5;if(_0x3a2d63>=_0x1763ca){_0x3a2d63=_0x1763ca;_0x2d16b5=0xc8;}else{_0x2d16b5=0xce;}_0x159202[_0x28c7('0x2f')](_0x2d16b5);return _0x159202['set']('Content-Range',_0x5b6bbb+'-'+_0x3a2d63+'/'+_0x1763ca)[_0x28c7('0x30')](_0x12e097);}return null;};}function patchUpdates(_0x50e2fd){return function(_0x17e7c9){try{jsonpatch[_0x28c7('0x35')](_0x17e7c9,_0x50e2fd,!![]);}catch(_0x5e8802){return BPromise['reject'](_0x5e8802);}return _0x17e7c9[_0x28c7('0x36')]();};}function saveUpdates(_0x27ad2c,_0xce2738){return function(_0x3792d3){if(_0x3792d3){return _0x3792d3[_0x28c7('0x37')](_0x27ad2c)['then'](function(_0x4c9753){return _0x4c9753;});}return null;};}function removeEntity(_0x56c9f0,_0x289ab9){return function(_0x379aa4){if(_0x379aa4){return _0x379aa4['destroy']()[_0x28c7('0x23')](function(){var _0x414a6e=_0x379aa4[_0x28c7('0x38')]({'plain':!![]});var _0xd90180=_0x28c7('0x39');return db['UserProfileResource'][_0x28c7('0x3a')]({'where':{'type':_0xd90180,'resourceId':_0x414a6e['id']}})['then'](function(){return _0x379aa4;});})[_0x28c7('0x23')](function(){_0x56c9f0['status'](0xcc)[_0x28c7('0x3b')]();});}};}function handleEntityNotFound(_0x201baf,_0x18eaac){return function(_0xad0b3f){if(!_0xad0b3f){_0x201baf[_0x28c7('0x2e')](0x194);}return _0xad0b3f;};}function handleError(_0x419d4d,_0x4438d2){_0x4438d2=_0x4438d2||0x1f4;return function(_0x2ecebe){logger[_0x28c7('0x28')](_0x2ecebe[_0x28c7('0x3c')]);if(_0x2ecebe[_0x28c7('0x3d')]){delete _0x2ecebe[_0x28c7('0x3d')];}_0x419d4d['status'](_0x4438d2)[_0x28c7('0x3e')](_0x2ecebe);};}exports[_0x28c7('0x3f')]=function(_0x3523da,_0x4bfa22){var _0x1da00a={'include':[{'model':db[_0x28c7('0x40')],'as':'mandatoryDispositionPause'}]},_0x51f907={},_0x394307={'count':0x0,'rows':[]};var _0x59d5fa=_[_0x28c7('0x41')](db[_0x28c7('0x42')][_0x28c7('0x43')],function(_0x5011a5){return{'name':_0x5011a5[_0x28c7('0x44')],'type':_0x5011a5['type'][_0x28c7('0x45')]};});_0x51f907[_0x28c7('0x46')]=_[_0x28c7('0x41')](_0x59d5fa,_0x28c7('0x3d'));_0x51f907[_0x28c7('0x47')]=_[_0x28c7('0x48')](_0x3523da['query']);_0x51f907[_0x28c7('0x49')]=_[_0x28c7('0x4a')](_0x51f907[_0x28c7('0x46')],_0x51f907['query']);_0x1da00a[_0x28c7('0x4b')]=_[_0x28c7('0x4a')](_0x51f907[_0x28c7('0x46')],qs['fields'](_0x3523da[_0x28c7('0x47')][_0x28c7('0x4c')]));_0x1da00a[_0x28c7('0x4b')]=_0x1da00a[_0x28c7('0x4b')]['length']?_0x1da00a[_0x28c7('0x4b')]:_0x51f907[_0x28c7('0x46')];if(!_0x3523da[_0x28c7('0x47')][_0x28c7('0x4d')](_0x28c7('0x4e'))){_0x1da00a[_0x28c7('0x33')]=qs[_0x28c7('0x33')](_0x3523da[_0x28c7('0x47')]['limit']);_0x1da00a['offset']=qs['offset'](_0x3523da[_0x28c7('0x47')]['offset']);}_0x1da00a[_0x28c7('0x4f')]=qs[_0x28c7('0x50')](_0x3523da[_0x28c7('0x47')]['sort']);_0x1da00a[_0x28c7('0x51')]=qs[_0x28c7('0x49')](_[_0x28c7('0x52')](_0x3523da[_0x28c7('0x47')],_0x51f907[_0x28c7('0x49')]),_0x59d5fa);if(_0x3523da[_0x28c7('0x47')]['filter']){_0x1da00a['where']=_[_0x28c7('0x53')](_0x1da00a[_0x28c7('0x51')],{'$or':_[_0x28c7('0x41')](_0x59d5fa,function(_0xd308dd){if(_0xd308dd[_0x28c7('0x54')]!==_0x28c7('0x55')){var _0x20033a={};_0x20033a[_0xd308dd[_0x28c7('0x3d')]]={'$like':'%'+_0x3523da[_0x28c7('0x47')][_0x28c7('0x56')]+'%'};return _0x20033a;}})});}_0x1da00a=_[_0x28c7('0x53')]({},_0x1da00a,_0x3523da[_0x28c7('0x57')]);var _0x2a5e18={'where':_0x1da00a[_0x28c7('0x51')]};return db['ChatWebsite']['count'](_0x2a5e18)['then'](function(_0x3ea9a9){_0x394307[_0x28c7('0x34')]=_0x3ea9a9;if(_0x3523da[_0x28c7('0x47')][_0x28c7('0x58')]){_0x1da00a[_0x28c7('0x59')]=[{'all':!![]}];}return db[_0x28c7('0x42')][_0x28c7('0x5a')](_0x1da00a);})[_0x28c7('0x23')](function(_0x3dbe47){_0x394307['rows']=_0x3dbe47;return _0x394307;})['then'](respondWithFilteredResult(_0x4bfa22,_0x1da00a))['catch'](handleError(_0x4bfa22,null));};exports['show']=function(_0x31a44a,_0x1987d8){var _0x14ff60={'raw':![],'where':{'id':_0x31a44a[_0x28c7('0x5b')]['id']},'include':[{'model':db[_0x28c7('0x40')],'as':'mandatoryDispositionPause'}]},_0x301061={};_0x301061[_0x28c7('0x46')]=_[_0x28c7('0x48')](db[_0x28c7('0x42')]['rawAttributes']);_0x301061[_0x28c7('0x47')]=_[_0x28c7('0x48')](_0x31a44a[_0x28c7('0x47')]);_0x301061[_0x28c7('0x49')]=_['intersection'](_0x301061['model'],_0x301061[_0x28c7('0x47')]);_0x14ff60[_0x28c7('0x4b')]=_['intersection'](_0x301061[_0x28c7('0x46')],qs[_0x28c7('0x4c')](_0x31a44a[_0x28c7('0x47')][_0x28c7('0x4c')]));_0x14ff60['attributes']=_0x14ff60[_0x28c7('0x4b')][_0x28c7('0x5c')]?_0x14ff60[_0x28c7('0x4b')]:_0x301061[_0x28c7('0x46')];if(_0x31a44a[_0x28c7('0x47')][_0x28c7('0x58')]){_0x14ff60[_0x28c7('0x59')]=[{'all':!![]}];}_0x14ff60=_[_0x28c7('0x53')]({},_0x14ff60,_0x31a44a['options']);return db[_0x28c7('0x42')][_0x28c7('0x5d')](_0x14ff60)['then'](handleEntityNotFound(_0x1987d8,null))['then'](respondWithResult(_0x1987d8,null))['catch'](handleError(_0x1987d8,null));};exports['create']=function(_0x4e21f2,_0x2b7167){return db['ChatWebsite'][_0x28c7('0x5e')](_0x4e21f2[_0x28c7('0x5f')],{})[_0x28c7('0x23')](function(_0x5edd13){var _0xf0f5d0=_0x4e21f2[_0x28c7('0x60')]['get']({'plain':!![]});if(!_0xf0f5d0)throw new Error(_0x28c7('0x61'));if(_0xf0f5d0[_0x28c7('0x62')]===_0x28c7('0x60')){var _0x4ff964=_0x5edd13[_0x28c7('0x38')]({'plain':!![]});var _0x113686=_0x28c7('0x39');return db['UserProfileSection'][_0x28c7('0x5d')]({'where':{'name':_0x113686,'userProfileId':_0xf0f5d0[_0x28c7('0x63')]},'raw':!![]})[_0x28c7('0x23')](function(_0x1d1e17){if(_0x1d1e17&&_0x1d1e17[_0x28c7('0x64')]===0x0){return db[_0x28c7('0x65')][_0x28c7('0x5e')]({'name':_0x4ff964['name'],'resourceId':_0x4ff964['id'],'type':_0x1d1e17[_0x28c7('0x3d')],'sectionId':_0x1d1e17['id']},{})[_0x28c7('0x23')](function(){return _0x5edd13;});}else{return _0x5edd13;}})[_0x28c7('0x2d')](function(_0x4110d9){logger['error'](_0x28c7('0x66'),_0x4110d9);throw _0x4110d9;});}return _0x5edd13;})['then'](respondWithResult(_0x2b7167,0xc9))[_0x28c7('0x2d')](handleError(_0x2b7167,null));};exports[_0x28c7('0x37')]=function(_0x1a482d,_0x1cad7e){if(_0x1a482d['body']['id']){delete _0x1a482d[_0x28c7('0x5f')]['id'];}return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x1a482d[_0x28c7('0x5b')]['id']},'include':[{'model':db[_0x28c7('0x40')],'as':_0x28c7('0x67')}]})['then'](handleEntityNotFound(_0x1cad7e,null))['then'](saveUpdates(_0x1a482d['body'],null))[_0x28c7('0x23')](respondWithResult(_0x1cad7e,null))[_0x28c7('0x2d')](handleError(_0x1cad7e,null));};exports[_0x28c7('0x3a')]=function(_0x2db69b,_0x67674b){return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x2db69b[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x67674b,null))[_0x28c7('0x23')](removeEntity(_0x67674b,null))[_0x28c7('0x2d')](handleError(_0x67674b,null));};exports[_0x28c7('0x68')]=function(_0x38421a,_0x431418){return db[_0x28c7('0x42')][_0x28c7('0x68')]()[_0x28c7('0x23')](respondWithResult(_0x431418,null))[_0x28c7('0x2d')](handleError(_0x431418,null));};exports['addDisposition']=function(_0x3675e8,_0x2741e4,_0x2a5cdb){if(_0x3675e8[_0x28c7('0x5f')]['id']){delete _0x3675e8[_0x28c7('0x5f')]['id'];}return db['ChatWebsite'][_0x28c7('0x5d')]({'where':{'id':_0x3675e8[_0x28c7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2741e4,null))['then'](function(_0x4721de){if(_0x4721de){_0x3675e8[_0x28c7('0x5f')][_0x28c7('0x69')]=_0x4721de['id'];return db[_0x28c7('0x6a')][_0x28c7('0x5e')](_0x3675e8['body']);}})[_0x28c7('0x23')](respondWithResult(_0x2741e4,null))[_0x28c7('0x2d')](handleError(_0x2741e4,null));};exports['getDispositions']=function(_0xc1a6f7,_0x2716a2,_0x487291){var _0x252ed0={'raw':![],'where':{}};var _0x2b78e3={};var _0x167b72={'count':0x0,'rows':[]};return db[_0x28c7('0x42')]['findOne']({'where':{'id':_0xc1a6f7[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x2716a2,null))['then'](function(_0x4d1305){if(_0x4d1305){_0x2b78e3[_0x28c7('0x46')]=_[_0x28c7('0x48')](db[_0x28c7('0x6a')][_0x28c7('0x43')]);_0x2b78e3[_0x28c7('0x47')]=_[_0x28c7('0x48')](_0xc1a6f7[_0x28c7('0x47')]);_0x2b78e3[_0x28c7('0x49')]=_['intersection'](_0x2b78e3[_0x28c7('0x46')],_0x2b78e3[_0x28c7('0x47')]);_0x252ed0[_0x28c7('0x4b')]=_[_0x28c7('0x4a')](_0x2b78e3['model'],qs[_0x28c7('0x4c')](_0xc1a6f7['query']['fields']));_0x252ed0[_0x28c7('0x4b')]=_0x252ed0[_0x28c7('0x4b')][_0x28c7('0x5c')]?_0x252ed0[_0x28c7('0x4b')]:_0x2b78e3['model'];if(!_0xc1a6f7['query'][_0x28c7('0x4d')](_0x28c7('0x4e'))){_0x252ed0[_0x28c7('0x33')]=qs[_0x28c7('0x33')](_0xc1a6f7[_0x28c7('0x47')][_0x28c7('0x33')]);_0x252ed0[_0x28c7('0x31')]=qs[_0x28c7('0x31')](_0xc1a6f7[_0x28c7('0x47')]['offset']);}_0x252ed0[_0x28c7('0x4f')]=qs[_0x28c7('0x50')](_0xc1a6f7[_0x28c7('0x47')][_0x28c7('0x50')]);_0x252ed0[_0x28c7('0x51')]=qs[_0x28c7('0x49')](_[_0x28c7('0x52')](_0xc1a6f7[_0x28c7('0x47')],_0x2b78e3[_0x28c7('0x49')]));_0x252ed0[_0x28c7('0x51')][_0x28c7('0x69')]=_0x4d1305['id'];if(_0xc1a6f7[_0x28c7('0x47')]['filter']){_0x252ed0['where']=_['merge'](_0x252ed0[_0x28c7('0x51')],{'$or':_[_0x28c7('0x41')](_0x252ed0[_0x28c7('0x4b')],function(_0x9ec6d2){var _0x1c1062={};_0x1c1062[_0x9ec6d2]={'$like':'%'+_0xc1a6f7[_0x28c7('0x47')][_0x28c7('0x56')]+'%'};return _0x1c1062;})});}_0x252ed0=_[_0x28c7('0x53')]({},_0x252ed0,_0xc1a6f7['options']);return db[_0x28c7('0x6a')][_0x28c7('0x34')]({'where':_0x252ed0[_0x28c7('0x51')]})['then'](function(_0x19243e){_0x167b72[_0x28c7('0x34')]=_0x19243e;if(_0xc1a6f7[_0x28c7('0x47')][_0x28c7('0x58')]){_0x252ed0['include']=[{'all':!![]}];}return db[_0x28c7('0x6a')][_0x28c7('0x5a')](_0x252ed0);})['then'](function(_0x5e7c9b){_0x167b72[_0x28c7('0x6b')]=_0x5e7c9b;return _0x167b72;});}})[_0x28c7('0x23')](respondWithFilteredResult(_0x2716a2,_0x252ed0))['catch'](handleError(_0x2716a2,null));};exports[_0x28c7('0x6c')]=function(_0x5266da,_0x3ab8c7,_0x2aa105){return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x5266da[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x3ab8c7,null))[_0x28c7('0x23')](function(_0x40ae0d){if(_0x40ae0d){return _0x40ae0d[_0x28c7('0x6c')](_0x5266da[_0x28c7('0x47')]['ids']);}})[_0x28c7('0x23')](respondWithStatusCode(_0x3ab8c7,null))[_0x28c7('0x2d')](handleError(_0x3ab8c7,null));};exports['addAnswer']=function(_0x3d44d0,_0x4ba03f,_0x3dd140){if(_0x3d44d0['body']['id']){delete _0x3d44d0[_0x28c7('0x5f')]['id'];}return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x3d44d0['params']['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x4ba03f,null))[_0x28c7('0x23')](function(_0x4ba5cd){if(_0x4ba5cd){_0x3d44d0['body'][_0x28c7('0x69')]=_0x4ba5cd['id'];return db[_0x28c7('0x6d')][_0x28c7('0x5e')](_0x3d44d0[_0x28c7('0x5f')]);}})[_0x28c7('0x23')](respondWithResult(_0x4ba03f,null))[_0x28c7('0x2d')](handleError(_0x4ba03f,null));};exports['getAnswers']=function(_0xdff11,_0x2e8afa,_0xf1d494){var _0x2994c6={'raw':![],'where':{}};var _0x332716={};var _0x1d3c3d={'count':0x0,'rows':[]};return db[_0x28c7('0x42')][_0x28c7('0x6e')]({'where':{'id':_0xdff11[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x2e8afa,null))[_0x28c7('0x23')](function(_0x446696){if(_0x446696){_0x332716[_0x28c7('0x46')]=_['keys'](db[_0x28c7('0x6d')][_0x28c7('0x43')]);_0x332716[_0x28c7('0x47')]=_[_0x28c7('0x48')](_0xdff11[_0x28c7('0x47')]);_0x332716['filters']=_[_0x28c7('0x4a')](_0x332716[_0x28c7('0x46')],_0x332716[_0x28c7('0x47')]);_0x2994c6[_0x28c7('0x4b')]=_[_0x28c7('0x4a')](_0x332716[_0x28c7('0x46')],qs[_0x28c7('0x4c')](_0xdff11['query'][_0x28c7('0x4c')]));_0x2994c6[_0x28c7('0x4b')]=_0x2994c6[_0x28c7('0x4b')][_0x28c7('0x5c')]?_0x2994c6[_0x28c7('0x4b')]:_0x332716[_0x28c7('0x46')];if(!_0xdff11[_0x28c7('0x47')][_0x28c7('0x4d')](_0x28c7('0x4e'))){_0x2994c6[_0x28c7('0x33')]=qs[_0x28c7('0x33')](_0xdff11[_0x28c7('0x47')][_0x28c7('0x33')]);_0x2994c6[_0x28c7('0x31')]=qs[_0x28c7('0x31')](_0xdff11[_0x28c7('0x47')][_0x28c7('0x31')]);}_0x2994c6[_0x28c7('0x4f')]=qs[_0x28c7('0x50')](_0xdff11[_0x28c7('0x47')][_0x28c7('0x50')]);_0x2994c6['where']=qs[_0x28c7('0x49')](_['pick'](_0xdff11['query'],_0x332716[_0x28c7('0x49')]));_0x2994c6[_0x28c7('0x51')][_0x28c7('0x69')]=_0x446696['id'];if(_0xdff11[_0x28c7('0x47')][_0x28c7('0x56')]){_0x2994c6[_0x28c7('0x51')]=_[_0x28c7('0x53')](_0x2994c6['where'],{'$or':_['map'](_0x2994c6[_0x28c7('0x4b')],function(_0x24646a){var _0x149f81={};_0x149f81[_0x24646a]={'$like':'%'+_0xdff11[_0x28c7('0x47')][_0x28c7('0x56')]+'%'};return _0x149f81;})});}_0x2994c6=_[_0x28c7('0x53')]({},_0x2994c6,_0xdff11[_0x28c7('0x57')]);return db['CannedAnswer'][_0x28c7('0x34')]({'where':_0x2994c6[_0x28c7('0x51')]})[_0x28c7('0x23')](function(_0x2b3735){_0x1d3c3d[_0x28c7('0x34')]=_0x2b3735;if(_0xdff11[_0x28c7('0x47')][_0x28c7('0x58')]){_0x2994c6[_0x28c7('0x59')]=[{'all':!![]}];}return db[_0x28c7('0x6d')][_0x28c7('0x5a')](_0x2994c6);})[_0x28c7('0x23')](function(_0x3f980f){_0x1d3c3d['rows']=_0x3f980f;return _0x1d3c3d;});}})['then'](respondWithFilteredResult(_0x2e8afa,_0x2994c6))['catch'](handleError(_0x2e8afa,null));};exports['removeAnswers']=function(_0x512cc4,_0x349e7c,_0x169ca0){return db['ChatWebsite'][_0x28c7('0x5d')]({'where':{'id':_0x512cc4[_0x28c7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x349e7c,null))['then'](function(_0x45b4e4){if(_0x45b4e4){return _0x45b4e4[_0x28c7('0x6f')](_0x512cc4[_0x28c7('0x47')][_0x28c7('0x70')]);}})[_0x28c7('0x23')](respondWithStatusCode(_0x349e7c,null))['catch'](handleError(_0x349e7c,null));};exports[_0x28c7('0x71')]=function(_0x80e2fb,_0xfdab7d,_0x25c705){_0x80e2fb[_0x28c7('0x5f')][_0x28c7('0x72')]=_0x80e2fb[_0x28c7('0x73')][_0x28c7('0x74')];return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x80e2fb['params']['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0xfdab7d,null))[_0x28c7('0x23')](saveUpdates(_0x80e2fb[_0x28c7('0x5f')],null))[_0x28c7('0x23')](respondWithResult(_0xfdab7d,null))[_0x28c7('0x2d')](handleError(_0xfdab7d,null));};exports[_0x28c7('0x75')]=function(_0x41eaff,_0x193995,_0x26c6bb){_0x41eaff[_0x28c7('0x5f')][_0x28c7('0x76')]=_0x41eaff[_0x28c7('0x73')][_0x28c7('0x74')];return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x41eaff[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x193995,null))[_0x28c7('0x23')](saveUpdates(_0x41eaff[_0x28c7('0x5f')],null))[_0x28c7('0x23')](respondWithResult(_0x193995,null))[_0x28c7('0x2d')](handleError(_0x193995,null));};exports[_0x28c7('0x77')]=function(_0x413791,_0x5b24f1,_0x6838cd){_0x413791['body'][_0x28c7('0x78')]=_0x413791[_0x28c7('0x73')][_0x28c7('0x74')];return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x413791[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x5b24f1,null))['then'](saveUpdates(_0x413791[_0x28c7('0x5f')],null))[_0x28c7('0x23')](respondWithResult(_0x5b24f1,null))[_0x28c7('0x2d')](handleError(_0x5b24f1,null));};exports[_0x28c7('0x79')]=function(_0x2f8dd5,_0x1e9ba3,_0x17c453){_0x2f8dd5['body'][_0x28c7('0x7a')]=_0x2f8dd5[_0x28c7('0x73')][_0x28c7('0x74')];return db['ChatWebsite'][_0x28c7('0x5d')]({'where':{'id':_0x2f8dd5[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x1e9ba3,null))[_0x28c7('0x23')](saveUpdates(_0x2f8dd5[_0x28c7('0x5f')],null))['then'](respondWithResult(_0x1e9ba3,null))[_0x28c7('0x2d')](handleError(_0x1e9ba3,null));};exports['getLogo']=function(_0x47ce45,_0x486745,_0x516f69){var _0x448475=path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0x7d'));var _0x22aced={'where':{'id':_0x47ce45[_0x28c7('0x5b')]['id']},'attributes':['id',_0x28c7('0x72')],'raw':!![]};var _0x5a083c=![];return require(_0x28c7('0x18'))[_0x28c7('0x7e')]()[_0x28c7('0x23')](function(_0x5e2951){if(_0x5e2951){_0x5a083c=_0x5e2951['custom'];}})[_0x28c7('0x23')](function(){return db['ChatWebsite']['find'](_0x22aced);})[_0x28c7('0x23')](handleEntityNotFound(_0x486745,null))[_0x28c7('0x23')](function(_0x1fde4f){if(_0x1fde4f){if(!_[_0x28c7('0x7f')](_0x1fde4f[_0x28c7('0x72')])){if(fs[_0x28c7('0x80')](path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0x81'),_0x1fde4f[_0x28c7('0x72')]))&&_0x5a083c){_0x448475=path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],'server/files/images/logos/',_0x1fde4f['sitepic']);}}return _0x486745[_0x28c7('0x82')](_0x448475);}})[_0x28c7('0x2d')](handleError(_0x486745,null));};exports[_0x28c7('0x83')]=function(_0x374ac8,_0xcdbaf5,_0x486844){var _0x5dc468=path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],'server/files/images/avatars/default_avatar.png');var _0x5f0261={'where':{'id':_0x374ac8[_0x28c7('0x5b')]['id']},'attributes':['id',_0x28c7('0x76')],'raw':!![]};return db[_0x28c7('0x42')][_0x28c7('0x5d')](_0x5f0261)['then'](handleEntityNotFound(_0xcdbaf5,null))[_0x28c7('0x23')](function(_0x49fc55){if(_0x49fc55){if(!_[_0x28c7('0x7f')](_0x49fc55['agentAvatar'])){if(fs['existsSync'](path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],'server/files/images/avatars/',_0x49fc55['agentAvatar']))){_0x5dc468=path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],'server/files/images/avatars/',_0x49fc55['agentAvatar']);}}return _0xcdbaf5[_0x28c7('0x82')](_0x5dc468);}})[_0x28c7('0x2d')](handleError(_0xcdbaf5,null));};exports[_0x28c7('0x84')]=function(_0x2b2333,_0xc03bcb,_0x2e16b9){var _0x1fd5ba=path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0x85'));var _0x174a17={'where':{'id':_0x2b2333[_0x28c7('0x5b')]['id']},'attributes':['id',_0x28c7('0x78'),_0x28c7('0x86')],'raw':!![]};return db[_0x28c7('0x42')]['find'](_0x174a17)[_0x28c7('0x23')](handleEntityNotFound(_0xc03bcb,null))[_0x28c7('0x23')](function(_0x4d32e0){if(_0x4d32e0){if(!_[_0x28c7('0x7f')](_0x4d32e0[_0x28c7('0x78')])){if(fs[_0x28c7('0x80')](path['join'](config[_0x28c7('0x7c')],_0x28c7('0x87'),_0x4d32e0['customerAvatar']))&&_0x4d32e0[_0x28c7('0x86')]){_0x1fd5ba=path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0x87'),_0x4d32e0[_0x28c7('0x78')]);}}return _0xc03bcb[_0x28c7('0x82')](_0x1fd5ba);}})[_0x28c7('0x2d')](handleError(_0xc03bcb,null));};exports[_0x28c7('0x88')]=function(_0x45e1e5,_0x189f96,_0xb3a97a){var _0x19003f=path['join'](config[_0x28c7('0x7c')],_0x28c7('0x89'));var _0x3b725e={'where':{'id':_0x45e1e5[_0x28c7('0x5b')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x28c7('0x42')][_0x28c7('0x5d')](_0x3b725e)[_0x28c7('0x23')](handleEntityNotFound(_0x189f96,null))[_0x28c7('0x23')](function(_0x37dc00){if(_0x37dc00){if(!_[_0x28c7('0x7f')](_0x37dc00[_0x28c7('0x7a')])){if(fs[_0x28c7('0x80')](path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0x87'),_0x37dc00['systemAvatar']))){_0x19003f=path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0x87'),_0x37dc00[_0x28c7('0x7a')]);}}return _0x189f96[_0x28c7('0x82')](_0x19003f);}})[_0x28c7('0x2d')](handleError(_0x189f96,null));};exports[_0x28c7('0x8a')]=function(_0x4b3804,_0x4a3f94,_0x3d9ab3){var _0x4ee991=require('user-agent-parser');var _0x3a4b52=new _0x4ee991();var _0x24c654=_0x3a4b52[_0x28c7('0x8b')](_0x4b3804[_0x28c7('0x8c')]['user-agent'])['getResult']();var _0x154f7a={'body':_0x4b3804[_0x28c7('0x5f')],'channel':_0x28c7('0x8d')};var _0x428ef5=[];var _0x25a201=[];var _0x4f8ea0={};var _0x205620=![];return db['CmContact'][_0x28c7('0x68')]()[_0x28c7('0x23')](function(_0x2960fc){if(!_0x2960fc){throw new db[(_0x28c7('0x8e'))]['ValidationError'](_0x28c7('0x8f'));}_0x428ef5=_[_0x28c7('0x90')](_['keys'](_0x2960fc),[_0x28c7('0x91'),_0x28c7('0x92')]);_0x25a201=_[_0x28c7('0x90')](_['keys'](_0x2960fc),[_0x28c7('0x91'),_0x28c7('0x92'),'CompanyId',_0x28c7('0x93')]);if(_0x4b3804[_0x28c7('0x5f')]['id']){delete _0x4b3804[_0x28c7('0x5f')]['id'];}if(_[_0x28c7('0x7f')](_0x4b3804[_0x28c7('0x5f')][_0x28c7('0x94')])){throw new db[(_0x28c7('0x8e'))][(_0x28c7('0x95'))](_0x28c7('0x96'));}if(_[_0x28c7('0x7f')](_0x4b3804[_0x28c7('0x5f')]['body'])||_0x4b3804[_0x28c7('0x5f')][_0x28c7('0x5f')]===''){throw new db[(_0x28c7('0x8e'))]['ValidationError'](_0x28c7('0x97'));}if(_[_0x28c7('0x7f')](_0x4b3804['body'][_0x28c7('0x98')])){throw new db['Sequelize'][(_0x28c7('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25a201);}if(!_[_0x28c7('0x99')](_0x25a201,_0x4b3804['body'][_0x28c7('0x98')])){throw new db[(_0x28c7('0x8e'))][(_0x28c7('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25a201);}_0x4f8ea0[_0x4b3804['body']['mapKey']]=_0x4b3804[_0x28c7('0x5f')][_0x28c7('0x94')];})[_0x28c7('0x23')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4b3804[_0x28c7('0x5b')]['id']},'include':[{'model':db[_0x28c7('0x9a')],'as':_0x28c7('0x9b'),'include':[{'model':db[_0x28c7('0x9c')],'as':_0x28c7('0x9d'),'where':_0x4f8ea0,'limit':0x1,'order':[['updatedAt',_0x28c7('0x9e')]]}]},{'model':db[_0x28c7('0x9f')],'as':_0x28c7('0xa0')}]});})[_0x28c7('0x23')](handleEntityNotFound(_0x4a3f94,null))[_0x28c7('0x23')](function(_0x283733){if(_0x283733&&_0x283733[_0x28c7('0x9b')]){_0x154f7a[_0x28c7('0xa1')]=_0x283733;_0x154f7a['applications']=_0x283733[_0x28c7('0xa0')];_0x154f7a[_0x28c7('0xa2')]=_0x283733['List'];_0x154f7a[_0x28c7('0xa3')]=_[_0x28c7('0xa4')](_0x154f7a[_0x28c7('0xa3')],[_0x28c7('0xa5')],[_0x28c7('0xa6')]);if(_0x154f7a[_0x28c7('0xa1')][_0x28c7('0xa0')]){delete _0x154f7a['account'][_0x28c7('0xa0')];}if(_0x154f7a['account']['List']&&_0x154f7a[_0x28c7('0xa1')][_0x28c7('0x9b')][_0x28c7('0x9d')][_0x28c7('0x5c')]){return _0x154f7a[_0x28c7('0xa1')][_0x28c7('0x9b')]['Contacts'][0x0];}var _0x2db437=_['defaults'](_0x4b3804[_0x28c7('0x5f')],{'firstName':_0x4b3804[_0x28c7('0x5f')][_0x28c7('0x94')],'ListId':_0x283733[_0x28c7('0x93')]});_0x2db437[_0x4b3804[_0x28c7('0x5f')]['mapKey']]=_0x4b3804[_0x28c7('0x5f')][_0x28c7('0x94')];return db[_0x28c7('0x9c')][_0x28c7('0x5e')](_0x2db437,{'fields':_0x428ef5,'raw':!![]});}})[_0x28c7('0x23')](handleEntityNotFound(_0x4a3f94,null))[_0x28c7('0x23')](function(_0x1e6de4){_0x154f7a['contact']=_0x1e6de4;var _0x3c0ed6=_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xa7')];if(_0x4b3804[_0x28c7('0x8c')][_0x28c7('0xa8')]){_0x3c0ed6=_0x4b3804[_0x28c7('0x8c')][_0x28c7('0xa8')];}else if(_0x4b3804[_0x28c7('0x8c')][_0x28c7('0xa9')]){_0x3c0ed6=_[_0x28c7('0xaa')](_0x4b3804[_0x28c7('0x8c')][_0x28c7('0xa9')]['split'](','));}if(_0x1e6de4){var _0x48412f={'ContactId':_0x1e6de4['id'],'ChatWebsiteId':_0x4b3804[_0x28c7('0x5b')]['id'],'from':(_0x1e6de4[_0x28c7('0xab')]||'')+'\x20'+(_0x1e6de4[_0x28c7('0xac')]||''),'customerIp':_0x3c0ed6,'customerPort':_0x4b3804[_0x28c7('0x8c')][_0x28c7('0xad')]?_0x4b3804['headers'][_0x28c7('0xad')]:null,'referer':_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xae')],'browserName':_0x24c654[_0x28c7('0xaf')][_0x28c7('0x3d')]&&_0x24c654[_0x28c7('0xaf')][_0x28c7('0xb0')]?util[_0x28c7('0xb1')](_0x28c7('0xb2'),_0x24c654[_0x28c7('0xaf')][_0x28c7('0x3d')],_0x24c654[_0x28c7('0xaf')][_0x28c7('0xb0')]):_0x28c7('0xb3'),'browserVersion':_0x24c654[_0x28c7('0xaf')]['version']||'unknown','osName':util[_0x28c7('0xb1')](_0x28c7('0xb2'),_0x24c654['os'][_0x28c7('0x3d')],_0x24c654['os'][_0x28c7('0xb0')]),'osVersion':_0x24c654['os'][_0x28c7('0xb0')],'deviceModel':_0x24c654[_0x28c7('0xb4')][_0x28c7('0x46')]&&_0x24c654[_0x28c7('0xb4')][_0x28c7('0xb5')]?util[_0x28c7('0xb1')](_0x28c7('0xb6'),_0x24c654[_0x28c7('0xb4')][_0x28c7('0x46')],_0x24c654['device'][_0x28c7('0xb5')],_0x24c654[_0x28c7('0xb4')]['type']):null,'deviceVendor':_0x24c654['device']['vendor'],'deviceType':_0x24c654[_0x28c7('0xb4')]['type'],'formData':JSON['stringify'](_0x4b3804[_0x28c7('0x5f')])};var _0x505c35={'ChatWebsiteId':_0x4b3804[_0x28c7('0x5b')]['id'],'closed':![]};if(_0x4b3804[_0x28c7('0x5f')]['threadId']){_0x505c35[_0x28c7('0xb7')]=_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xb7')];return db[_0x28c7('0xb8')][_0x28c7('0x5d')]({'where':_0x505c35})[_0x28c7('0x23')](function(_0x2a3d5d){if(_0x2a3d5d){return[_0x2a3d5d,![]];}_0x48412f['threadId']=_0x4b3804[_0x28c7('0x5f')]['threadId'];_0x48412f[_0x28c7('0xb9')]=_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xb9')];return db['ChatInteraction']['create'](_0x48412f)[_0x28c7('0x23')](function(_0x1398de){return[_0x1398de,!![]];});});}_0x505c35[_0x28c7('0xba')]=_0x1e6de4['id'];if(_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xbb')]&&_0x4b3804[_0x28c7('0x5f')]['interaction']['id']){_0x505c35['id']=_0x4b3804['body'][_0x28c7('0xbb')]['id'];return db[_0x28c7('0xb8')]['find']({'where':_0x505c35})['then'](function(_0x4d4cb9){if(_0x4d4cb9){return[_0x4d4cb9,![]];}return db[_0x28c7('0xb8')][_0x28c7('0x5e')](_0x48412f)[_0x28c7('0x23')](function(_0x32c079){return[_0x32c079,!![]];});});}return db[_0x28c7('0xb8')][_0x28c7('0x5e')](_0x48412f)[_0x28c7('0x23')](function(_0x1946e0){return[_0x1946e0,!![]];});}})[_0x28c7('0xbc')](function(_0x285bff,_0xf94a02){if(_0x285bff){_0x205620=_0xf94a02;if(!_0xf94a02){var _0x3c3fbf={'from':(_0x154f7a[_0x28c7('0xbd')]['firstName']||'')+'\x20'+(_0x154f7a['contact'][_0x28c7('0xac')]||'')};if(_0x4b3804['body']['threadId']&&_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xbe')]&&_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xb7')]!=_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xbe')]){_0x3c3fbf[_0x28c7('0xb7')]=_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xbe')];}return _0x285bff[_0x28c7('0x37')](_0x3c3fbf);}else{return _0x285bff;}}})[_0x28c7('0x23')](function(_0x2cc673){_0x154f7a[_0x28c7('0xbb')]=_0x2cc673[_0x28c7('0x38')]({'plain':!![]});_0x154f7a[_0x28c7('0xbb')]['created']=_0x205620;if(_0x154f7a[_0x28c7('0xbb')][_0x28c7('0xbf')]){if(_0x154f7a[_0x28c7('0xa1')][_0x28c7('0xc0')]){_0x154f7a[_0x28c7('0xa3')][_0x28c7('0xc1')]({'id':0x0,'priority':_0x154f7a[_0x28c7('0xa3')][_0x28c7('0x5c')]+0x1,'app':_0x28c7('0xc2'),'appdata':_0x28c7('0xc3'),'interval':_0x28c7('0xc4')});}}return db['ChatMessage'][_0x28c7('0x5e')]({'body':_0x4b3804[_0x28c7('0x5f')][_0x28c7('0x5f')],'ChatWebsiteId':_0x4b3804[_0x28c7('0x5b')]['id'],'ChatInteractionId':_0x2cc673['id'],'direction':'in','ContactId':_0x154f7a[_0x28c7('0xbd')]['id'],'AttachmentId':_0x4b3804[_0x28c7('0x5f')][_0x28c7('0xc5')]});})[_0x28c7('0x23')](function(_0x1b976e){_0x154f7a['message']=_0x1b976e;if(_0x154f7a[_0x28c7('0xbb')][_0x28c7('0xc6')]){return db[_0x28c7('0xc7')][_0x28c7('0x5d')]({'attributes':['id',_0x28c7('0x3d')],'where':{'id':_0x154f7a[_0x28c7('0xbb')][_0x28c7('0xc6')]}})[_0x28c7('0x23')](function(_0x20002b){if(_0x20002b){_0x154f7a['applications'][_0x28c7('0xc8')]({'id':0x0,'priority':0x0,'app':_0x28c7('0xc9'),'appdata':_0x20002b['name']+','+(_0x154f7a['account'][_0x28c7('0xca')]||0xa),'interval':'*,*,*,*'});_0x154f7a['forcedOwnership']=!![];}return respondWithRpcPromise(_0x28c7('0xcb'),_0x28c7('0xcc'),_0x154f7a);});}return respondWithRpcPromise(_0x28c7('0xcb'),_0x28c7('0xcc'),_0x154f7a);})[_0x28c7('0x23')](function(_0x488264){respondWithRpcPromise(_0x28c7('0xcd'),_0x28c7('0xcd'),{'event':'notify','message':_0x488264},client9002);return _0x488264;})[_0x28c7('0x23')](respondWithResult(_0x4a3f94,null))[_0x28c7('0x2d')](handleError(_0x4a3f94,null));};exports[_0x28c7('0xce')]=function(_0xf7165a,_0x374596,_0x4d23f7){var _0x1cdcfe,_0x55398f,_0x48bfc1;var _0x163871=[];var _0x513c20=[];var _0x12a000={};var _0x8bf061=_0xf7165a[_0x28c7('0xcf')]||[];var _0x2fd4da=[];var _0xb18d22;return db['CmContact'][_0x28c7('0x68')]()[_0x28c7('0x23')](function(_0x45cd61){if(!_0x45cd61){throw new db['Sequelize']['ValidationError'](_0x28c7('0x8f'));}_0x513c20=_[_0x28c7('0x90')](_[_0x28c7('0x48')](_0x45cd61),[_0x28c7('0x91'),'updatedAt']);_0x163871=_['difference'](_[_0x28c7('0x48')](_0x45cd61),[_0x28c7('0x91'),'updatedAt',_0x28c7('0xd0'),_0x28c7('0x93')]);if(_0xf7165a[_0x28c7('0x5f')]['id']){delete _0xf7165a[_0x28c7('0x5f')]['id'];}if(_[_0x28c7('0x7f')](_0xf7165a[_0x28c7('0x5f')]['from'])){throw _0x374596[_0x28c7('0x2f')](0x1f4)['send'](new db[(_0x28c7('0x8e'))]['ValidationError'](_0x28c7('0x96')));}if(_[_0x28c7('0x7f')](_0xf7165a[_0x28c7('0x5f')][_0x28c7('0x5f')])||_0xf7165a[_0x28c7('0x5f')]['body']===''){throw _0x374596['status'](0x1f4)[_0x28c7('0x3e')](new db[(_0x28c7('0x8e'))][(_0x28c7('0x95'))](_0x28c7('0x97')));}if(_[_0x28c7('0x7f')](_0xf7165a[_0x28c7('0x5f')][_0x28c7('0xd1')])){throw _0x374596[_0x28c7('0x2f')](0x1f4)[_0x28c7('0x3e')](new db[(_0x28c7('0x8e'))][(_0x28c7('0x95'))](_0x28c7('0xd2')+_0x163871));}if(!_['includes'](_0x163871,_0xf7165a[_0x28c7('0x5f')][_0x28c7('0xd1')])){throw _0x374596[_0x28c7('0x2f')](0x1f4)['send'](new db[(_0x28c7('0x8e'))][(_0x28c7('0x95'))](_0x28c7('0xd3')+_0x163871));}_0x12a000[_0xf7165a[_0x28c7('0x5f')][_0x28c7('0xd1')]]=_0xf7165a[_0x28c7('0x5f')][_0x28c7('0x94')];})[_0x28c7('0x23')](function(){return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0xf7165a[_0x28c7('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0x28c7('0xd4')}]});})[_0x28c7('0x23')](handleEntityNotFound(_0x374596,null))[_0x28c7('0x23')](function(_0x461a7c){if(_0x461a7c&&_0x461a7c[_0x28c7('0x9b')]){_0x55398f=_0x461a7c;var _0x3cbf3c=_[_0x28c7('0x1a')](_0xf7165a[_0x28c7('0x5f')],{'firstName':_0xf7165a[_0x28c7('0x5f')][_0x28c7('0x94')],'phone':_0xf7165a[_0x28c7('0x5f')][_0x28c7('0x94')],'ListId':_0x461a7c[_0x28c7('0x93')]});_0x3cbf3c[_0xf7165a[_0x28c7('0x5f')][_0x28c7('0xd1')]]=_0xf7165a['body'][_0x28c7('0x94')];return db[_0x28c7('0x9c')][_0x28c7('0xd5')]({'where':_0x12a000,'defaults':_0x3cbf3c});}})[_0x28c7('0xbc')](function(_0x4e0aca){if(_0x4e0aca){_0x48bfc1=_0x4e0aca;var _0x5e3589=fs['readFileSync'](path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0xd6')),_0x28c7('0xd7'));var _0x4c4a9d=ejs[_0x28c7('0xd8')](_0x5e3589,{'body':_['toPairs'](_0xf7165a['body'][_0x28c7('0x5f')]),'bodyTitle':_0x55398f[_0x28c7('0xd9')]});return db['ChatOfflineMessage']['create']({'body':_0x4c4a9d,'ContactId':_0x4e0aca['id'],'ChatWebsiteId':_0x55398f['id']});}})[_0x28c7('0x23')](function(_0x5042bb){_0xb18d22=_0x5042bb;if(_0x8bf061[_0x28c7('0x5c')]){var _0x568710=_0x8bf061[_0x28c7('0x41')](function(_0x53b3b5){return{'name':_0x53b3b5['originalname'],'basename':_0x53b3b5[_0x28c7('0x74')],'type':_0x53b3b5[_0x28c7('0xda')],'ChatOfflineMessageId':_0x5042bb['id']};});_0x2fd4da=_0x568710[_0x28c7('0x41')](_0x4f6950=>{var _0xbca2e9={'filename':_0x4f6950[_0x28c7('0x3d')],'path':path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0xdb'),_0x28c7('0xcf'),_0x28c7('0xdc'),'offline-chat',_0x4f6950[_0x28c7('0xdd')])};return _0xbca2e9;});if(!_0x55398f[_0x28c7('0xde')]){return db[_0x28c7('0xdf')][_0x28c7('0xe0')](function(_0x4f8726){return db[_0x28c7('0xe1')]['bulkCreate'](_0x568710,{'transaction':_0x4f8726});});}}})[_0x28c7('0x23')](function(){if(_0xb18d22){_0x1cdcfe=_0xb18d22;return db['MailAccount'][_0x28c7('0x6e')]({'where':{'active':!![]},'include':[{'model':db[_0x28c7('0xe2')],'as':_0x28c7('0xe3'),'raw':!![]}]});}})[_0x28c7('0x23')](function(_0x35b3eb){if(_0x35b3eb&&_0x35b3eb['Smtp']&&_0x55398f[_0x28c7('0xe4')]&&_0x55398f[_0x28c7('0xe5')]){var _0x2ccecd={'tls':{'rejectUnauthorized':![]}};if(_0x35b3eb[_0x28c7('0xe3')]['service']){_0x2ccecd[_0x28c7('0xe6')]=_0x35b3eb[_0x28c7('0xe3')]['service'];}else{_0x2ccecd[_0x28c7('0xe7')]=_0x35b3eb[_0x28c7('0xe3')][_0x28c7('0xe7')];_0x2ccecd[_0x28c7('0xe8')]=_0x35b3eb[_0x28c7('0xe3')]['port'];_0x2ccecd[_0x28c7('0xe9')]=_0x35b3eb['Smtp'][_0x28c7('0xe9')];}if(_0x35b3eb[_0x28c7('0xe3')][_0x28c7('0xea')]){_0x2ccecd[_0x28c7('0xeb')]={'user':_0x35b3eb['Smtp'][_0x28c7('0x60')],'pass':_0x35b3eb['Smtp'][_0x28c7('0xec')]};}return respondWithRpcPromise(_0x28c7('0xed'),'sendMail',{'account':_0x2ccecd,'message':{'from':util[_0x28c7('0xb1')](_0x28c7('0xee'),_0x35b3eb[_0x28c7('0x3d')],_0x35b3eb[_0x28c7('0xef')]||_0x35b3eb[_0x28c7('0xe3')][_0x28c7('0x60')]),'to':_0x55398f[_0x28c7('0xe5')],'subject':_0x55398f['offlineMessageSubject'],'html':_0x1cdcfe['body'],'attachments':_0x2fd4da}},client9003)['then'](function(){return _0x1cdcfe;})[_0x28c7('0x2d')](function(_0x98cfbf){console[_0x28c7('0x28')](_0x98cfbf);});}})[_0x28c7('0x23')](function(){if(_0x55398f&&_0x55398f[_0x28c7('0xde')]&&_0x55398f[_0x28c7('0xf0')]){var _0xf96550=[];if(_0x8bf061['length']){_0xf96550=_0x8bf061[_0x28c7('0x41')](function(_0x4d884e){return{'name':_0x4d884e[_0x28c7('0xf1')],'basename':_0x4d884e[_0x28c7('0x74')],'type':_0x4d884e[_0x28c7('0xda')],'ChatOfflineMessageId':_0xb18d22['id']};});}var _0x1b033b;if(!_[_0x28c7('0x7f')](_0x55398f[_0x28c7('0xf2')])){var _0x3c0919=_[_0x28c7('0x41')](_0xf7165a[_0x28c7('0x5f')],function(_0x5efbea){return _0x5efbea;});var _0x3b97d5=_['toPairsIn'](_0x3c0919)[0x0];var _0x5baa8a=_[_0x28c7('0xf3')](_0x3b97d5,function(_0x11ad3f){return _0x11ad3f;});_0x1b033b=_0x5baa8a[0x1][_0x55398f['subjectOffline']];}var _0x293188={'from':_0x48bfc1['email'],'firstName':_0x48bfc1[_0x28c7('0xab')],'lastName':_0x48bfc1[_0x28c7('0xac')],'mapKey':'email','message':{'from':_0x48bfc1[_0x28c7('0xef')],'to':_0x55398f['MailAccount'][_0x28c7('0xef')],'cc':'','subject':_['isNil'](_0x1b033b)?_0x55398f['offlineMessageSubject']:_0x1b033b,'messageId':'','sentAt':new Date(),'attach':_0xf96550[_0x28c7('0x5c')],'attachments':_0xf96550,'originChannel':_0x28c7('0xf4'),'ChatWebsiteId':_0x55398f['id'],'ChatOfflineMessageId':_0x1cdcfe['id'],'originTo':_0x55398f[_0x28c7('0xd4')][_0x28c7('0xef')]},'body':_0x1cdcfe[_0x28c7('0x5f')]};var _0x189152={'account':{'id':_0x55398f[_0x28c7('0xf0')]},'body':_0x293188,'log':_0x28c7('0xf5')};return respondWithRpcPromise(_0x28c7('0xf5'),_0x28c7('0xf6'),_0x189152,client9001)[_0x28c7('0x23')](function(){return _0x1cdcfe;})['catch'](function(_0x28e01b){console[_0x28c7('0x28')](_0x28e01b);});}return;})[_0x28c7('0x23')](function(){if(_0x1cdcfe){return _0x1cdcfe;}})['then'](respondWithResult(_0x374596,null))['catch'](function(_0x3fb352){console[_0x28c7('0x28')]('catch',_0x3fb352);for(var _0x5bfdfb of _0x8bf061){var _0xf2cc46=path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0xdb'),_0x28c7('0xcf'),_0x28c7('0xdc'),_0x28c7('0xf7'),_0x5bfdfb['filename']);fs_extra[_0x28c7('0xf8')](_0xf2cc46)[_0x28c7('0x2d')](function(_0x1c9329){console[_0x28c7('0x28')](_0x28c7('0xf9'),_0xf2cc46,_0x1c9329);});}});};exports[_0x28c7('0xfa')]=function(_0x35d268,_0x190b90,_0xe6eaea){return db[_0x28c7('0xb8')][_0x28c7('0x5d')]({'where':{'id':_0x35d268[_0x28c7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x190b90,null))[_0x28c7('0x23')](function(_0x191350){if(_0x191350){return _0x191350[_0x28c7('0xfa')](_0x35d268[_0x28c7('0x5f')][_0x28c7('0x70')],_[_0x28c7('0xfb')](_0x35d268[_0x28c7('0x5f')],['ids','id'])||{});}})[_0x28c7('0x23')](respondWithResult(_0x190b90,null))[_0x28c7('0x2d')](handleError(_0x190b90,null));};exports[_0x28c7('0xfc')]=function(_0x1db580,_0x469f5c,_0x103eaf){var _0x21505b={'raw':![],'where':{}};var _0x3aeb93={};var _0x12dfc8={'count':0x0,'rows':[]};return db[_0x28c7('0x42')][_0x28c7('0x6e')]({'where':{'id':_0x1db580['params']['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x469f5c,null))[_0x28c7('0x23')](function(_0x17cfd4){if(_0x17cfd4){_0x3aeb93[_0x28c7('0x46')]=_[_0x28c7('0x48')](db['ChatInteraction'][_0x28c7('0x43')]);_0x3aeb93['query']=_[_0x28c7('0x48')](_0x1db580['query']);_0x3aeb93[_0x28c7('0x49')]=_[_0x28c7('0x4a')](_0x3aeb93[_0x28c7('0x46')],_0x3aeb93[_0x28c7('0x47')]);_0x21505b[_0x28c7('0x4b')]=_['intersection'](_0x3aeb93[_0x28c7('0x46')],qs[_0x28c7('0x4c')](_0x1db580[_0x28c7('0x47')][_0x28c7('0x4c')]));_0x21505b[_0x28c7('0x4b')]=_0x21505b[_0x28c7('0x4b')][_0x28c7('0x5c')]?_0x21505b[_0x28c7('0x4b')]:_0x3aeb93[_0x28c7('0x46')];if(!_0x1db580['query'][_0x28c7('0x4d')](_0x28c7('0x4e'))){_0x21505b[_0x28c7('0x33')]=qs[_0x28c7('0x33')](_0x1db580[_0x28c7('0x47')][_0x28c7('0x33')]);_0x21505b[_0x28c7('0x31')]=qs['offset'](_0x1db580[_0x28c7('0x47')][_0x28c7('0x31')]);}_0x21505b[_0x28c7('0x4f')]=qs[_0x28c7('0x50')](_0x1db580[_0x28c7('0x47')][_0x28c7('0x50')]);_0x21505b[_0x28c7('0x51')]=qs[_0x28c7('0x49')](_[_0x28c7('0x52')](_0x1db580[_0x28c7('0x47')],_0x3aeb93[_0x28c7('0x49')]));_0x21505b['where'][_0x28c7('0x69')]=_0x17cfd4['id'];if(_0x1db580[_0x28c7('0x47')]['filter']){_0x21505b[_0x28c7('0x51')]=_[_0x28c7('0x53')](_0x21505b['where'],{'$or':_[_0x28c7('0x41')](_0x21505b[_0x28c7('0x4b')],function(_0x41814c){var _0x1881f2={};_0x1881f2[_0x41814c]={'$like':'%'+_0x1db580[_0x28c7('0x47')]['filter']+'%'};return _0x1881f2;})});}_0x21505b=_['merge']({},_0x21505b,_0x1db580[_0x28c7('0x57')]);return db[_0x28c7('0xb8')][_0x28c7('0x34')]({'where':_0x21505b[_0x28c7('0x51')]})['then'](function(_0x3388f5){_0x12dfc8[_0x28c7('0x34')]=_0x3388f5;if(_0x1db580[_0x28c7('0x47')]['includeAll']){_0x21505b['include']=[{'model':db[_0x28c7('0x9c')],'as':_0x28c7('0xfd'),'required':![]},{'model':db[_0x28c7('0xc7')],'as':'Owner','attributes':[_0x28c7('0x3d'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x28c7('0xfe'),'attributes':['id',_0x28c7('0x3d'),_0x28c7('0xff')],'where':_0x1db580['query'][_0x28c7('0x100')]?{'id':_0x1db580[_0x28c7('0x47')]['tag']}:undefined,'required':_0x1db580[_0x28c7('0x47')][_0x28c7('0x100')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x21505b);})[_0x28c7('0x23')](function(_0x10c656){_0x12dfc8[_0x28c7('0x6b')]=_0x10c656;return _0x12dfc8;});}})[_0x28c7('0x23')](respondWithFilteredResult(_0x469f5c,_0x21505b))[_0x28c7('0x2d')](handleError(_0x469f5c,null));};function iftimePromise(_0x4c62c6,_0xd0fb8d){return respondWithRpcPromise(_0x28c7('0x101'),_0x28c7('0x102'),{'command':_0xd0fb8d[_0x28c7('0x103')]?util[_0x28c7('0xb1')](_0x28c7('0x104'),_0x4c62c6[_0x28c7('0x105')],_0xd0fb8d[_0x28c7('0x103')]):util[_0x28c7('0xb1')](_0x28c7('0x106'),_0x4c62c6[_0x28c7('0x105')])},client9002)[_0x28c7('0x23')](function(_0x5df1b7){var _0x1c4db2=_0x5df1b7&&_0x5df1b7['indexOf'](_0x28c7('0x107'))>=0x0?!![]:![];logger[_0x28c7('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xd0fb8d['id'],_0x4c62c6['id'],_0x4c62c6[_0x28c7('0x105')],_0x1c4db2?_0x28c7('0x108'):_0x28c7('0x109'),_0xd0fb8d[_0x28c7('0x103')]?_0xd0fb8d[_0x28c7('0x103')]:_0x28c7('0x10a'));return _0x1c4db2;})['catch'](function(_0x1943b6){logger['error'](_0x28c7('0x10b'),_0xd0fb8d['id'],_0x4c62c6['id'],_0x4c62c6[_0x28c7('0x105')],util[_0x28c7('0x10c')](_0x1943b6,{'showHidden':![],'depth':null}),_0xd0fb8d[_0x28c7('0x103')]?_0xd0fb8d[_0x28c7('0x103')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x20b8c4,_0xcd5eb6,_0x2318fc){var _0x508048=0x0;var _0x55b6fb=0x0;var _0x539304=![];var _0x29940e;var _0x3ac2b7;return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x20b8c4['params']['id']},'include':[{'model':db['Interval'],'as':_0x28c7('0x10d'),'include':[{'model':db[_0x28c7('0x10d')],'as':_0x28c7('0x10e'),'attributes':['id',_0x28c7('0x105')],'raw':!![]}]}]})[_0x28c7('0x23')](handleEntityNotFound(_0xcd5eb6,null))[_0x28c7('0x23')](function(_0x40ae8d){if(_0x40ae8d){_0x29940e=_0x40ae8d;return _0x40ae8d[_0x28c7('0x10f')]({'raw':!![]});}})[_0x28c7('0x23')](function(_0xa3bd82){if(_0x29940e){if(_0xa3bd82){_0x3ac2b7=_0xa3bd82;}}return require(_0x28c7('0x18'))['getLicense']();})[_0x28c7('0x23')](function(_0x2e0d4a){if(_0x2e0d4a){_0x55b6fb=_0x2e0d4a[_0x28c7('0x110')];_0x539304=_0x2e0d4a[_0x28c7('0x111')];}})[_0x28c7('0x23')](function(){return db[_0x28c7('0xb8')][_0x28c7('0x34')]({'where':{'closed':![]}});})[_0x28c7('0x23')](function(_0x378091){_0x508048=_0x378091;if(_0x55b6fb&&_0x378091>_0x55b6fb){return db[_0x28c7('0x112')][_0x28c7('0x6e')]({'where':{'id':0x1}})[_0x28c7('0x23')](function(_0x1cc516){if(_0x1cc516){_0x1cc516['increment'](_0x28c7('0x113'));}});}})[_0x28c7('0x23')](function(){if(_0x29940e['Interval']&&_0x29940e['Interval'][_0x28c7('0x10e')]){var _0x4d4ea9=[];for(var _0x366fd8=0x0;_0x366fd8<_0x29940e[_0x28c7('0x10d')]['Intervals'][_0x28c7('0x5c')];_0x366fd8++){var _0x5ae0aa=_0x29940e[_0x28c7('0x10d')]['Intervals'][_0x366fd8][_0x28c7('0x38')]({'plain':!![]});_0x4d4ea9[_0x28c7('0xc1')](iftimePromise(_0x5ae0aa,_0x29940e));}return BPromise[_0x28c7('0x114')](_0x4d4ea9)[_0x28c7('0x23')](function(_0x13b7c8){return _[_0x28c7('0x115')](_0x13b7c8);});}else{return!![];}})[_0x28c7('0x23')](function(_0x130bad){var _0x5252fc=fs[_0x28c7('0x116')](path[_0x28c7('0x7b')](config[_0x28c7('0x7c')],_0x28c7('0x117')),_0x28c7('0xd7'));var _0x1f0bdd={'remote':_0x29940e[_0x28c7('0x118')],'query':querystring['stringify'](_['merge'](_0x29940e['get']({'plain':!![]}),{'customerIp':_0x20b8c4['headers'][_0x28c7('0xa9')]||_0x20b8c4[_0x28c7('0x8c')][_0x28c7('0x119')]||_0x20b8c4[_0x28c7('0x11a')][_0x28c7('0x11b')]||_0x20b8c4['ip'],'referer':_0x20b8c4[_0x28c7('0x8c')][_0x28c7('0xae')],'openedInteractions':_0x508048,'maxInteractions':_0x55b6fb,'virtual':_0x539304[_0x28c7('0x110')],'online':_0x130bad,'custom':_0x539304}))[_0x28c7('0x11c')](/'/g,'\x5c\x27')};_0xcd5eb6[_0x28c7('0x3e')](ejs[_0x28c7('0xd8')](Mustache[_0x28c7('0xd8')](_0x5252fc,_0x1f0bdd),{'proactiveActions':_0x3ac2b7,'alignment':_0x29940e[_0x28c7('0x11d')],'verticalAlignment':_0x29940e['verticalAlignment'],'div_color':_0x29940e['color'],'text_color':_0x29940e[_0x28c7('0x11e')],'button_color':_0x29940e[_0x28c7('0x11f')],'background_color':_0x29940e['backgroundColor']}));})['catch'](handleError(_0xcd5eb6,null));};exports[_0x28c7('0x120')]=function(_0x5e9137,_0x3fe098,_0x4d5923){return db[_0x28c7('0x42')][_0x28c7('0x6e')]({'where':{'id':_0x5e9137[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x3fe098,null))[_0x28c7('0x23')](function(_0x3753c3){if(_0x3753c3){return db[_0x28c7('0xdf')][_0x28c7('0xe0')](function(_0x511b5b){return db[_0x28c7('0x9f')][_0x28c7('0x3a')]({'where':{'ChatWebsiteId':_0x5e9137['params']['id']},'transaction':_0x511b5b})[_0x28c7('0x23')](function(_0x3148ed){var _0x45e5b1=_['map'](_0x5e9137[_0x28c7('0x5f')],function(_0x17e968){_0x17e968[_0x28c7('0x69')]=_0x5e9137[_0x28c7('0x5b')]['id'];return _0x17e968;});return db['ChatApplication'][_0x28c7('0x121')](_0x45e5b1,{'transaction':_0x511b5b});});})[_0x28c7('0x23')](function(){return db[_0x28c7('0x9f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5e9137[_0x28c7('0x5b')]['id']},'order':_0x28c7('0xa5')});});}})[_0x28c7('0x23')](respondWithResult(_0x3fe098,null))[_0x28c7('0x2d')](handleError(_0x3fe098,null));};exports[_0x28c7('0x122')]=function(_0x56c32f,_0x34c262,_0x48ead0){var _0xb105d6={};var _0x255288={};var _0x1dfabc;var _0x20205f;return db['ChatWebsite'][_0x28c7('0x6e')]({'where':{'id':_0x56c32f[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x34c262,null))[_0x28c7('0x23')](function(_0x2694b0){if(_0x2694b0){_0x1dfabc=_0x2694b0;_0x255288[_0x28c7('0x46')]=_[_0x28c7('0x48')](db[_0x28c7('0x9f')][_0x28c7('0x43')]);_0x255288[_0x28c7('0x47')]=_[_0x28c7('0x48')](_0x56c32f[_0x28c7('0x47')]);_0x255288[_0x28c7('0x49')]=_[_0x28c7('0x4a')](_0x255288[_0x28c7('0x46')],_0x255288[_0x28c7('0x47')]);_0xb105d6[_0x28c7('0x4b')]=_[_0x28c7('0x4a')](_0x255288['model'],qs['fields'](_0x56c32f['query'][_0x28c7('0x4c')]));_0xb105d6[_0x28c7('0x4b')]=_0xb105d6[_0x28c7('0x4b')][_0x28c7('0x5c')]?_0xb105d6[_0x28c7('0x4b')]:_0x255288['model'];_0xb105d6['order']=qs[_0x28c7('0x50')](_0x56c32f[_0x28c7('0x47')]['sort']);_0xb105d6[_0x28c7('0x51')]=qs['filters'](_['pick'](_0x56c32f[_0x28c7('0x47')],_0x255288[_0x28c7('0x49')]));if(_0x56c32f['query'][_0x28c7('0x56')]){_0xb105d6[_0x28c7('0x51')]=_['merge'](_0xb105d6[_0x28c7('0x51')],{'$or':_[_0x28c7('0x41')](_0xb105d6[_0x28c7('0x4b')],function(_0x26f2d7){var _0x5f0c59={};_0x5f0c59[_0x26f2d7]={'$like':'%'+_0x56c32f[_0x28c7('0x47')][_0x28c7('0x56')]+'%'};return _0x5f0c59;})});}_0xb105d6=_[_0x28c7('0x53')]({},_0xb105d6,_0x56c32f[_0x28c7('0x57')]);return _0x1dfabc[_0x28c7('0x122')](_0xb105d6);}})[_0x28c7('0x23')](function(_0x239519){if(_0x239519){_0x20205f=_0x239519[_0x28c7('0x5c')];if(!_0x56c32f[_0x28c7('0x47')]['hasOwnProperty'](_0x28c7('0x4e'))){_0xb105d6[_0x28c7('0x33')]=qs[_0x28c7('0x33')](_0x56c32f[_0x28c7('0x47')][_0x28c7('0x33')]);_0xb105d6[_0x28c7('0x31')]=qs['offset'](_0x56c32f[_0x28c7('0x47')][_0x28c7('0x31')]);}return _0x1dfabc[_0x28c7('0x122')](_0xb105d6);}})[_0x28c7('0x23')](function(_0x55d21b){if(_0x55d21b){return _0x55d21b?{'count':_0x20205f,'rows':_0x55d21b}:null;}})[_0x28c7('0x23')](respondWithResult(_0x34c262,null))[_0x28c7('0x2d')](handleError(_0x34c262,null));};exports[_0x28c7('0x123')]=function(_0x4cd111,_0x50cfd7,_0x3d95c2){return db[_0x28c7('0x124')][_0x28c7('0x5d')]({'where':{'id':_0x4cd111[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x50cfd7,null))[_0x28c7('0x23')](function(_0x314148){if(_0x314148){return _0x314148[_0x28c7('0x123')](_0x4cd111[_0x28c7('0x5f')][_0x28c7('0x70')],_['omit'](_0x4cd111[_0x28c7('0x5f')],[_0x28c7('0x70'),'id'])||{});}})[_0x28c7('0x23')](respondWithResult(_0x50cfd7,null))[_0x28c7('0x2d')](handleError(_0x50cfd7,null));};exports['getProactiveActions']=function(_0x501e63,_0x22632e,_0x97cd36){var _0x428772={};var _0x24067a={};var _0x21261a;var _0xa12402;return db[_0x28c7('0x42')][_0x28c7('0x6e')]({'where':{'id':_0x501e63[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x22632e,null))['then'](function(_0x32b44c){if(_0x32b44c){_0x21261a=_0x32b44c;_0x24067a[_0x28c7('0x46')]=_[_0x28c7('0x48')](db[_0x28c7('0x125')][_0x28c7('0x43')]);_0x24067a[_0x28c7('0x47')]=_[_0x28c7('0x48')](_0x501e63[_0x28c7('0x47')]);_0x24067a[_0x28c7('0x49')]=_[_0x28c7('0x4a')](_0x24067a['model'],_0x24067a['query']);_0x428772['attributes']=_[_0x28c7('0x4a')](_0x24067a[_0x28c7('0x46')],qs[_0x28c7('0x4c')](_0x501e63[_0x28c7('0x47')][_0x28c7('0x4c')]));_0x428772[_0x28c7('0x4b')]=_0x428772['attributes'][_0x28c7('0x5c')]?_0x428772[_0x28c7('0x4b')]:_0x24067a[_0x28c7('0x46')];_0x428772[_0x28c7('0x4f')]=qs[_0x28c7('0x50')](_0x501e63[_0x28c7('0x47')]['sort']);_0x428772[_0x28c7('0x51')]=qs[_0x28c7('0x49')](_[_0x28c7('0x52')](_0x501e63[_0x28c7('0x47')],_0x24067a[_0x28c7('0x49')]));if(_0x501e63[_0x28c7('0x47')]['filter']){_0x428772[_0x28c7('0x51')]=_[_0x28c7('0x53')](_0x428772[_0x28c7('0x51')],{'$or':_['map'](_0x428772[_0x28c7('0x4b')],function(_0x3d0811){var _0x45b624={};_0x45b624[_0x3d0811]={'$like':'%'+_0x501e63['query'][_0x28c7('0x56')]+'%'};return _0x45b624;})});}_0x428772=_[_0x28c7('0x53')]({},_0x428772,_0x501e63['options']);return _0x21261a['getProactiveActions'](_0x428772);}})['then'](function(_0xe1b6c4){if(_0xe1b6c4){_0xa12402=_0xe1b6c4[_0x28c7('0x5c')];if(!_0x501e63[_0x28c7('0x47')][_0x28c7('0x4d')](_0x28c7('0x4e'))){_0x428772[_0x28c7('0x33')]=qs[_0x28c7('0x33')](_0x501e63[_0x28c7('0x47')][_0x28c7('0x33')]);_0x428772[_0x28c7('0x31')]=qs['offset'](_0x501e63[_0x28c7('0x47')][_0x28c7('0x31')]);}return _0x21261a[_0x28c7('0x10f')](_0x428772);}})['then'](function(_0x26c583){if(_0x26c583){return _0x26c583?{'count':_0xa12402,'rows':_0x26c583}:null;}})[_0x28c7('0x23')](respondWithResult(_0x22632e,null))[_0x28c7('0x2d')](handleError(_0x22632e,null));};exports['getFields']=function(_0x184d51,_0x1c0c7f,_0x47e094){var _0x4ad54d=_0x184d51[_0x28c7('0x47')][_0x28c7('0x126')]===_0x28c7('0x127')?_0x28c7('0x128'):_0x28c7('0x129');return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'attributes':['id',_0x4ad54d],'where':{'id':_0x184d51['params']['id']}})['then'](handleEntityNotFound(_0x1c0c7f,null))[_0x28c7('0x23')](function(_0x54d24a){if(_0x54d24a){var _0x242e3d=_0x54d24a[_0x4ad54d];var _0x2af019=_0x242e3d&&_0x242e3d[_0x28c7('0x12a')]?_0x242e3d[_0x28c7('0x12a')]:[];_0x1c0c7f[_0x28c7('0x3e')]({'fromKey':_['isNil'](_0x242e3d['fromKey'])?undefined:_0x242e3d[_0x28c7('0x12b')],'count':_0x2af019[_0x28c7('0x5c')],'rows':_0x2af019});}})[_0x28c7('0x2d')](handleError(_0x1c0c7f,null));};exports[_0x28c7('0x12c')]=function(_0x25023a,_0x40a4c8,_0x16078f){var _0x5ec008={'raw':![],'where':{}};var _0x193fad={};var _0x508ea0={'count':0x0,'rows':[]};return db[_0x28c7('0x42')]['findOne']({'where':{'id':_0x25023a[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x40a4c8,null))[_0x28c7('0x23')](function(_0x78bf93){if(_0x78bf93){_0x193fad['model']=_[_0x28c7('0x48')](db[_0x28c7('0x12d')][_0x28c7('0x43')]);_0x193fad['query']=_[_0x28c7('0x48')](_0x25023a[_0x28c7('0x47')]);_0x193fad[_0x28c7('0x49')]=_[_0x28c7('0x4a')](_0x193fad[_0x28c7('0x46')],_0x193fad[_0x28c7('0x47')]);_0x5ec008[_0x28c7('0x4b')]=_[_0x28c7('0x4a')](_0x193fad[_0x28c7('0x46')],qs[_0x28c7('0x4c')](_0x25023a[_0x28c7('0x47')]['fields']));_0x5ec008[_0x28c7('0x4b')]=_0x5ec008[_0x28c7('0x4b')][_0x28c7('0x5c')]?_0x5ec008['attributes']:_0x193fad[_0x28c7('0x46')];if(!_0x25023a[_0x28c7('0x47')][_0x28c7('0x4d')](_0x28c7('0x4e'))){_0x5ec008[_0x28c7('0x33')]=qs[_0x28c7('0x33')](_0x25023a[_0x28c7('0x47')]['limit']);_0x5ec008[_0x28c7('0x31')]=qs[_0x28c7('0x31')](_0x25023a[_0x28c7('0x47')][_0x28c7('0x31')]);}_0x5ec008['order']=qs[_0x28c7('0x50')](_0x25023a[_0x28c7('0x47')][_0x28c7('0x50')]);_0x5ec008[_0x28c7('0x51')]=qs[_0x28c7('0x49')](_[_0x28c7('0x52')](_0x25023a[_0x28c7('0x47')],_0x193fad[_0x28c7('0x49')]));_0x5ec008[_0x28c7('0x51')]['ChatWebsiteId']=_0x78bf93['id'];if(_0x25023a[_0x28c7('0x47')]['filter']){_0x5ec008[_0x28c7('0x51')]=_[_0x28c7('0x53')](_0x5ec008[_0x28c7('0x51')],{'$or':_[_0x28c7('0x41')](_0x5ec008[_0x28c7('0x4b')],function(_0x13fd3e){var _0x5b61d6={};_0x5b61d6[_0x13fd3e]={'$like':'%'+_0x25023a['query'][_0x28c7('0x56')]+'%'};return _0x5b61d6;})});}_0x5ec008=_[_0x28c7('0x53')]({},_0x5ec008,_0x25023a[_0x28c7('0x57')]);return db[_0x28c7('0x12d')]['count']({'where':_0x5ec008[_0x28c7('0x51')]})[_0x28c7('0x23')](function(_0x2244a7){_0x508ea0[_0x28c7('0x34')]=_0x2244a7;if(_0x25023a[_0x28c7('0x47')][_0x28c7('0x58')]){_0x5ec008[_0x28c7('0x59')]=[{'all':!![]}];}else{_0x5ec008[_0x28c7('0x59')]=[{'model':db['CmContact'],'as':_0x28c7('0xfd'),'required':![]},{'model':db[_0x28c7('0xe1')],'as':_0x28c7('0x12e'),'required':![]}];}return db[_0x28c7('0x12d')][_0x28c7('0x5a')](_0x5ec008);})['then'](function(_0x37c42d){_0x508ea0[_0x28c7('0x6b')]=_0x37c42d;return _0x508ea0;});}})['then'](respondWithFilteredResult(_0x40a4c8,_0x5ec008))[_0x28c7('0x2d')](handleError(_0x40a4c8,null));};exports[_0x28c7('0x12f')]=function(_0x36f356,_0x1ed030,_0x264746){return db[_0x28c7('0x42')][_0x28c7('0x5d')]({'where':{'id':_0x36f356[_0x28c7('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1ed030,null))['then'](function(_0x3d27ac){if(_0x3d27ac){return _0x3d27ac[_0x28c7('0x12f')](_0x36f356[_0x28c7('0x5f')][_0x28c7('0x70')],_['omit'](_0x36f356[_0x28c7('0x5f')],['ids','id'])||{})[_0x28c7('0xbc')](function(_0x5f26dc){for(var _0x31ba37=0x0;_0x31ba37<_0x36f356[_0x28c7('0x5f')][_0x28c7('0x70')][_0x28c7('0x5c')];_0x31ba37+=0x1){socket['emit'](_0x28c7('0x130'),{'UserId':Number(_0x36f356[_0x28c7('0x5f')][_0x28c7('0x70')][_0x31ba37]),'ChatWebsiteId':Number(_0x36f356[_0x28c7('0x5b')]['id'])});}return _0x5f26dc;});}})[_0x28c7('0x23')](respondWithResult(_0x1ed030,null))[_0x28c7('0x2d')](handleError(_0x1ed030,null));};exports[_0x28c7('0x131')]=function(_0x43420b,_0x5f510a,_0x22d912){return db['ChatWebsite']['find']({'where':{'id':_0x43420b[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x5f510a,null))[_0x28c7('0x23')](function(_0x452515){if(_0x452515){return _0x452515[_0x28c7('0x131')](_0x43420b['query']['ids'])[_0x28c7('0x23')](function(){if(_[_0x28c7('0x132')](_0x43420b[_0x28c7('0x47')][_0x28c7('0x70')])){for(var _0x2d881c=0x0;_0x2d881c<_0x43420b['query'][_0x28c7('0x70')]['length'];_0x2d881c+=0x1){socket[_0x28c7('0x133')](_0x28c7('0x134'),{'UserId':Number(_0x43420b['query'][_0x28c7('0x70')][_0x2d881c]),'ChatWebsiteId':Number(_0x43420b['params']['id'])});}}else{socket[_0x28c7('0x133')](_0x28c7('0x134'),{'UserId':Number(_0x43420b[_0x28c7('0x47')][_0x28c7('0x70')]),'ChatWebsiteId':Number(_0x43420b[_0x28c7('0x5b')]['id'])});}});}})[_0x28c7('0x23')](respondWithStatusCode(_0x5f510a,null))[_0x28c7('0x2d')](handleError(_0x5f510a,null));};exports[_0x28c7('0x135')]=function(_0x28fc64,_0x4c1492,_0x309af0){var _0x2ce2f6={};var _0x1bb6e5={};var _0x983277;var _0x593df0;return db['ChatWebsite'][_0x28c7('0x6e')]({'where':{'id':_0x28fc64[_0x28c7('0x5b')]['id']}})[_0x28c7('0x23')](handleEntityNotFound(_0x4c1492,null))[_0x28c7('0x23')](function(_0x49247f){if(_0x49247f){_0x983277=_0x49247f;_0x1bb6e5[_0x28c7('0x46')]=_[_0x28c7('0x48')](db['User'][_0x28c7('0x43')]);_0x1bb6e5[_0x28c7('0x47')]=_[_0x28c7('0x48')](_0x28fc64[_0x28c7('0x47')]);_0x1bb6e5[_0x28c7('0x49')]=_['intersection'](_0x1bb6e5[_0x28c7('0x46')],_0x1bb6e5[_0x28c7('0x47')]);_0x2ce2f6['attributes']=_['intersection'](_0x1bb6e5[_0x28c7('0x46')],qs['fields'](_0x28fc64[_0x28c7('0x47')][_0x28c7('0x4c')]));_0x2ce2f6[_0x28c7('0x4b')]=_0x2ce2f6[_0x28c7('0x4b')][_0x28c7('0x5c')]?_0x2ce2f6[_0x28c7('0x4b')]:_0x1bb6e5['model'];_0x2ce2f6[_0x28c7('0x4f')]=qs['sort'](_0x28fc64[_0x28c7('0x47')][_0x28c7('0x50')]);_0x2ce2f6[_0x28c7('0x51')]=qs[_0x28c7('0x49')](_['pick'](_0x28fc64[_0x28c7('0x47')],_0x1bb6e5[_0x28c7('0x49')]));if(_0x28fc64[_0x28c7('0x47')]['filter']){_0x2ce2f6[_0x28c7('0x51')]=_[_0x28c7('0x53')](_0x2ce2f6[_0x28c7('0x51')],{'$or':_[_0x28c7('0x41')](_0x2ce2f6[_0x28c7('0x4b')],function(_0x537892){var _0x5d528d={};_0x5d528d[_0x537892]={'$like':'%'+_0x28fc64[_0x28c7('0x47')][_0x28c7('0x56')]+'%'};return _0x5d528d;})});}_0x2ce2f6=_['merge']({},_0x2ce2f6,_0x28fc64[_0x28c7('0x57')]);return _0x983277[_0x28c7('0x135')](_0x2ce2f6);}})[_0x28c7('0x23')](function(_0x291250){if(_0x291250){_0x593df0=_0x291250[_0x28c7('0x5c')];if(!_0x28fc64[_0x28c7('0x47')][_0x28c7('0x4d')](_0x28c7('0x4e'))){_0x2ce2f6[_0x28c7('0x33')]=qs['limit'](_0x28fc64[_0x28c7('0x47')]['limit']);_0x2ce2f6[_0x28c7('0x31')]=qs[_0x28c7('0x31')](_0x28fc64[_0x28c7('0x47')][_0x28c7('0x31')]);}return _0x983277[_0x28c7('0x135')](_0x2ce2f6);}})[_0x28c7('0x23')](function(_0x2410ed){if(_0x2410ed){return _0x2410ed?{'count':_0x593df0,'rows':_0x2410ed}:null;}})[_0x28c7('0x23')](respondWithResult(_0x4c1492,null))[_0x28c7('0x2d')](handleError(_0x4c1492,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index e430c66..a696434 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 _0x26cf=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','save'];(function(_0x5835c1,_0x23d9b4){var _0x3ea4a6=function(_0x40e08c){while(--_0x40e08c){_0x5835c1['push'](_0x5835c1['shift']());}};_0x3ea4a6(++_0x23d9b4);}(_0x26cf,0x135));var _0xf26c=function(_0x2320be,_0x18678b){_0x2320be=_0x2320be-0x0;var _0x2fcaf7=_0x26cf[_0x2320be];return _0x2fcaf7;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xf26c('0x0'))['db'][_0xf26c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf26c('0x2'),'afterUpdate':'update','afterDestroy':_0xf26c('0x3')};function emitEvent(_0x4c414f){return function(_0x314cdf,_0xf4a93f,_0x58d7b7){ChatWebsiteEvents[_0xf26c('0x4')](_0x4c414f+':'+_0x314cdf['id'],_0x314cdf);ChatWebsiteEvents[_0xf26c('0x4')](_0x4c414f,_0x314cdf);_0x58d7b7(null);};}for(var e in events){if(events[_0xf26c('0x5')](e)){var event=events[e];ChatWebsite[_0xf26c('0x6')](e,emitEvent(event));}}module[_0xf26c('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xceae=['hasOwnProperty','hook','exports','events','../../mysqldb','update','emit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xceae,0x122));var _0xecea=function(_0x36de53,_0x4a0679){_0x36de53=_0x36de53-0x0;var _0x2b04cb=_0xceae[_0x36de53];return _0x2b04cb;};'use strict';var EventEmitter=require(_0xecea('0x0'));var ChatWebsite=require(_0xecea('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xecea('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5bba59){return function(_0x28b2cf,_0x457d37,_0x39d285){ChatWebsiteEvents[_0xecea('0x3')](_0x5bba59+':'+_0x28b2cf['id'],_0x28b2cf);ChatWebsiteEvents[_0xecea('0x3')](_0x5bba59,_0x28b2cf);_0x39d285(null);};}for(var e in events){if(events[_0xecea('0x4')](e)){var event=events[e];ChatWebsite[_0xecea('0x5')](e,emitEvent(event));}}module[_0xecea('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 7aa5414..2610e74 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 _0x9402=['exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x1d21a8,_0x75aef7){var _0x2f0d24=function(_0xb6614e){while(--_0xb6614e){_0x1d21a8['push'](_0x1d21a8['shift']());}};_0x2f0d24(++_0x75aef7);}(_0x9402,0x185));var _0x2940=function(_0x47db65,_0x4510af){_0x47db65=_0x47db65-0x0;var _0x44a4b7=_0x9402[_0x47db65];return _0x44a4b7;};'use strict';var _=require(_0x2940('0x0'));var util=require(_0x2940('0x1'));var logger=require('../../config/logger')(_0x2940('0x2'));var moment=require(_0x2940('0x3'));var BPromise=require('bluebird');var rp=require(_0x2940('0x4'));var fs=require('fs');var path=require(_0x2940('0x5'));var rimraf=require(_0x2940('0x6'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x2940('0x7')]=function(_0x51d7c1,_0x3a4553){return _0x51d7c1[_0x2940('0x8')](_0x2940('0x9'),attributes,{'tableName':_0x2940('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb49d=['./chatWebsite.attributes','exports','ChatWebsite','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0xf04b83,_0x399c28){var _0x3d15eb=function(_0x3b554d){while(--_0x3b554d){_0xf04b83['push'](_0xf04b83['shift']());}};_0x3d15eb(++_0x399c28);}(_0xb49d,0x7b));var _0xdb49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb49d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdb49('0x0'));var util=require('util');var logger=require(_0xdb49('0x1'))(_0xdb49('0x2'));var moment=require(_0xdb49('0x3'));var BPromise=require(_0xdb49('0x4'));var rp=require(_0xdb49('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdb49('0x6'));var attributes=require(_0xdb49('0x7'));module[_0xdb49('0x8')]=function(_0x5507db,_0x57c6ff){return _0x5507db['define'](_0xdb49('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 1072b53..edf2531 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 _0xb314=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','request','then','info','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x52666e,_0x5b3776){var _0x515330=function(_0x29cd4f){while(--_0x29cd4f){_0x52666e['push'](_0x52666e['shift']());}};_0x515330(++_0x5b3776);}(_0xb314,0x1a4));var _0x4b31=function(_0x3ac379,_0xdb25fc){_0x3ac379=_0x3ac379-0x0;var _0x1d9f92=_0xb314[_0x3ac379];return _0x1d9f92;};'use strict';var _=require(_0x4b31('0x0'));var util=require(_0x4b31('0x1'));var moment=require(_0x4b31('0x2'));var BPromise=require(_0x4b31('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b31('0x4'))['db'];var utils=require(_0x4b31('0x5'));var logger=require(_0x4b31('0x6'))(_0x4b31('0x7'));var config=require(_0x4b31('0x8'));var jayson=require(_0x4b31('0x9'));var client=jayson['client'][_0x4b31('0xa')]({'port':0x232a});config['redis']=_[_0x4b31('0xb')](config[_0x4b31('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b31('0xd'))(new Redis(config[_0x4b31('0xc')]));require(_0x4b31('0xe'))[_0x4b31('0xf')](socket);function respondWithRpcPromise(_0x1bc113,_0x5715ef,_0x596ff6){return new BPromise(function(_0x54fb96,_0x1bdb28){return client[_0x4b31('0x10')](_0x1bc113,_0x596ff6)[_0x4b31('0x11')](function(_0x149b27){logger[_0x4b31('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x5715ef,'request\x20sent');logger[_0x4b31('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5715ef,'request\x20sent',JSON[_0x4b31('0x14')](_0x149b27));if(_0x149b27['error']){if(_0x149b27[_0x4b31('0x15')][_0x4b31('0x16')]===0x1f4){logger[_0x4b31('0x15')](_0x4b31('0x17'),_0x5715ef,_0x149b27[_0x4b31('0x15')][_0x4b31('0x18')]);return _0x1bdb28(_0x149b27[_0x4b31('0x15')]['message']);}logger[_0x4b31('0x15')](_0x4b31('0x17'),_0x5715ef,_0x149b27[_0x4b31('0x15')]['message']);return _0x54fb96(_0x149b27[_0x4b31('0x15')][_0x4b31('0x18')]);}else{logger[_0x4b31('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x5715ef,_0x4b31('0x19'));_0x54fb96(_0x149b27[_0x4b31('0x1a')][_0x4b31('0x18')]);}})[_0x4b31('0x1b')](function(_0x4b1a72){logger[_0x4b31('0x15')](_0x4b31('0x17'),_0x5715ef,_0x4b1a72);_0x1bdb28(_0x4b1a72);});});}
\ No newline at end of file
+var _0x0251=['catch','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x11452c,_0xc363f4){var _0x547698=function(_0x2d6c8b){while(--_0x2d6c8b){_0x11452c['push'](_0x11452c['shift']());}};_0x547698(++_0xc363f4);}(_0x0251,0x109));var _0x1025=function(_0x2b254f,_0x3df8ff){_0x2b254f=_0x2b254f-0x0;var _0xcc593f=_0x0251[_0x2b254f];return _0xcc593f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1025('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1025('0x1'));var db=require(_0x1025('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1025('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1025('0x4'));var client=jayson[_0x1025('0x5')][_0x1025('0x6')]({'port':0x232a});config[_0x1025('0x7')]=_[_0x1025('0x8')](config[_0x1025('0x7')],{'host':_0x1025('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1025('0x7')]));require(_0x1025('0xa'))[_0x1025('0xb')](socket);function respondWithRpcPromise(_0x1afbb7,_0x2ec8b3,_0x136531){return new BPromise(function(_0x9196d2,_0x8c87ce){return client[_0x1025('0xc')](_0x1afbb7,_0x136531)[_0x1025('0xd')](function(_0x2b545b){logger[_0x1025('0xe')](_0x1025('0xf'),_0x2ec8b3,_0x1025('0x10'));logger[_0x1025('0x11')](_0x1025('0x12'),_0x2ec8b3,'request\x20sent',JSON['stringify'](_0x2b545b));if(_0x2b545b[_0x1025('0x13')]){if(_0x2b545b['error'][_0x1025('0x14')]===0x1f4){logger[_0x1025('0x13')](_0x1025('0xf'),_0x2ec8b3,_0x2b545b['error'][_0x1025('0x15')]);return _0x8c87ce(_0x2b545b['error']['message']);}logger[_0x1025('0x13')](_0x1025('0xf'),_0x2ec8b3,_0x2b545b[_0x1025('0x13')][_0x1025('0x15')]);return _0x9196d2(_0x2b545b[_0x1025('0x13')][_0x1025('0x15')]);}else{logger[_0x1025('0xe')]('ChatWebsite,\x20%s,\x20%s',_0x2ec8b3,_0x1025('0x10'));_0x9196d2(_0x2b545b[_0x1025('0x16')]['message']);}})[_0x1025('0x17')](function(_0x50aff3){logger[_0x1025('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2ec8b3,_0x50aff3);_0x8c87ce(_0x50aff3);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 866f8e0..0233caf 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 _0x5479=['chatWebsite:','save','update','emit','removeListener','register'];(function(_0x418e6b,_0x262a9e){var _0x85e208=function(_0x4d02a4){while(--_0x4d02a4){_0x418e6b['push'](_0x418e6b['shift']());}};_0x85e208(++_0x262a9e);}(_0x5479,0x1cf));var _0x9547=function(_0x4859bc,_0x11cbcb){_0x4859bc=_0x4859bc-0x0;var _0x5e20a8=_0x5479[_0x4859bc];return _0x5e20a8;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x9547('0x0'),'remove',_0x9547('0x1')];function createListener(_0x14ccbe,_0x1ad843){return function(_0x5551b5){_0x1ad843[_0x9547('0x2')](_0x14ccbe,_0x5551b5);};}function removeListener(_0x56f8a7,_0xbdd3b4){return function(){ChatWebsiteEvents[_0x9547('0x3')](_0x56f8a7,_0xbdd3b4);};}exports[_0x9547('0x4')]=function(_0x5ef6fa){for(var _0x1b84d7=0x0,_0x37dd9c=events['length'];_0x1b84d7<_0x37dd9c;_0x1b84d7++){var _0x2e2f9a=events[_0x1b84d7];var _0x3f723a=createListener(_0x9547('0x5')+_0x2e2f9a,_0x5ef6fa);ChatWebsiteEvents['on'](_0x2e2f9a,_0x3f723a);}};
\ No newline at end of file
+var _0x88e4=['save','remove','emit','removeListener','register','length','./chatWebsite.events'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x88e4,0xd1));var _0x488e=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0x88e4[_0x487ab4];return _0x3bef77;};'use strict';var ChatWebsiteEvents=require(_0x488e('0x0'));var events=[_0x488e('0x1'),_0x488e('0x2'),'update'];function createListener(_0x1e2306,_0x25d3bb){return function(_0x2065ac){_0x25d3bb[_0x488e('0x3')](_0x1e2306,_0x2065ac);};}function removeListener(_0x131da4,_0x4e1dab){return function(){ChatWebsiteEvents[_0x488e('0x4')](_0x131da4,_0x4e1dab);};}exports[_0x488e('0x5')]=function(_0x401195){for(var _0x1a9329=0x0,_0x56a4fe=events[_0x488e('0x6')];_0x1a9329<_0x56a4fe;_0x1a9329++){var _0xf94626=events[_0x1a9329];var _0x1eaddb=createListener('chatWebsite:'+_0xf94626,_0x401195);ChatWebsiteEvents['on'](_0xf94626,_0x1eaddb);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 3a99ac4..b6b43be 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 _0xd136=['delete','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','format','now','originalname','single','addLogo','server/files/images/avatars/','%s-%s','/:id/avatar','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','put','update'];(function(_0x31e891,_0x2ca1ec){var _0x21aa5b=function(_0x5f43ec){while(--_0x5f43ec){_0x31e891['push'](_0x31e891['shift']());}};_0x21aa5b(++_0x2ca1ec);}(_0xd136,0x158));var _0x6d13=function(_0x392c80,_0x140fdd){_0x392c80=_0x392c80-0x0;var _0x692cf6=_0xd136[_0x392c80];return _0x692cf6;};'use strict';var multer=require(_0x6d13('0x0'));var util=require(_0x6d13('0x1'));var path=require('path');var timeout=require(_0x6d13('0x2'));var express=require(_0x6d13('0x3'));var router=express['Router']();var fs_extra=require(_0x6d13('0x4'));var auth=require(_0x6d13('0x5'));var interaction=require(_0x6d13('0x6'));var config=require(_0x6d13('0x7'));var controller=require('./chatWebsite.controller');router[_0x6d13('0x8')]('/',auth[_0x6d13('0x9')](),controller['index']);router['get'](_0x6d13('0xa'),auth[_0x6d13('0x9')](),controller['describe']);router[_0x6d13('0x8')](_0x6d13('0xb'),auth[_0x6d13('0x9')](),controller[_0x6d13('0xc')]);router['get'](_0x6d13('0xd'),auth['isAuthenticated'](),controller[_0x6d13('0xe')]);router['get'](_0x6d13('0xf'),auth[_0x6d13('0x9')](),controller[_0x6d13('0x10')]);router['get'](_0x6d13('0x11'),controller['getLogo']);router[_0x6d13('0x8')]('/:id/avatar',controller['getAvatar']);router['get'](_0x6d13('0x12'),controller[_0x6d13('0x13')]);router[_0x6d13('0x8')](_0x6d13('0x14'),controller[_0x6d13('0x15')]);router[_0x6d13('0x8')](_0x6d13('0x16'),auth[_0x6d13('0x9')](),controller[_0x6d13('0x17')]);router[_0x6d13('0x8')](_0x6d13('0x18'),controller[_0x6d13('0x19')]);router[_0x6d13('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x6d13('0x1a')]);router['get'](_0x6d13('0x1b'),auth[_0x6d13('0x9')](),controller[_0x6d13('0x1c')]);router[_0x6d13('0x8')]('/:id/fields',controller[_0x6d13('0x1d')]);router[_0x6d13('0x8')](_0x6d13('0x1e'),auth[_0x6d13('0x9')](),controller['getOfflineMessages']);router[_0x6d13('0x8')](_0x6d13('0x1f'),auth[_0x6d13('0x9')](),controller[_0x6d13('0x20')]);router[_0x6d13('0x21')]('/',auth[_0x6d13('0x9')](),controller['create']);router['post'](_0x6d13('0xd'),auth[_0x6d13('0x9')](),controller[_0x6d13('0x22')]);router[_0x6d13('0x21')](_0x6d13('0xf'),auth['isAuthenticated'](),controller[_0x6d13('0x23')]);var upload=multer({'storage':multer[_0x6d13('0x24')]({'destination':function(_0x29d6b5,_0x36986c,_0x418ce3){_0x418ce3(null,path[_0x6d13('0x25')](config[_0x6d13('0x26')],'server/files/images/logos/'));},'filename':function(_0x185893,_0x17b097,_0x525fa0){_0x525fa0(null,util[_0x6d13('0x27')]('%s-%s',Date[_0x6d13('0x28')](),_0x17b097[_0x6d13('0x29')]));}})});router[_0x6d13('0x21')]('/:id/logo',upload[_0x6d13('0x2a')]('file'),controller[_0x6d13('0x2b')]);var upload=multer({'storage':multer[_0x6d13('0x24')]({'destination':function(_0x31407a,_0x1aa44b,_0x2e0b38){_0x2e0b38(null,path['join'](config['root'],_0x6d13('0x2c')));},'filename':function(_0x2f07e8,_0x1b54eb,_0x4a2465){_0x4a2465(null,util[_0x6d13('0x27')](_0x6d13('0x2d'),Date['now'](),_0x1b54eb[_0x6d13('0x29')]));}})});router['post'](_0x6d13('0x2e'),upload[_0x6d13('0x2a')](_0x6d13('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3be747,_0x44fcf7,_0x29b528){_0x29b528(null,path[_0x6d13('0x25')](config['root'],_0x6d13('0x2c')));},'filename':function(_0x49482f,_0x7f7758,_0x6d520e){_0x6d520e(null,util[_0x6d13('0x27')](_0x6d13('0x2d'),Date[_0x6d13('0x28')](),_0x7f7758[_0x6d13('0x29')]));}})});router[_0x6d13('0x21')](_0x6d13('0x12'),upload[_0x6d13('0x2a')](_0x6d13('0x2f')),controller[_0x6d13('0x30')]);var upload=multer({'storage':multer[_0x6d13('0x24')]({'destination':function(_0x13b32c,_0x826ef2,_0xcf0d96){_0xcf0d96(null,path['join'](config[_0x6d13('0x26')],'server/files/images/avatars/'));},'filename':function(_0x6d7b20,_0x3b9b18,_0x361c57){_0x361c57(null,util[_0x6d13('0x27')](_0x6d13('0x2d'),Date[_0x6d13('0x28')](),_0x3b9b18[_0x6d13('0x29')]));}})});router[_0x6d13('0x21')]('/:id/system_avatar',upload['single']('file'),controller[_0x6d13('0x31')]);router[_0x6d13('0x21')](_0x6d13('0x32'),controller[_0x6d13('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x6d13('0x24')]({'destination':function(_0x2c8970,_0x3527e6,_0x175654){const _0x2a7024=path[_0x6d13('0x25')](config[_0x6d13('0x26')],_0x6d13('0x34'),_0x6d13('0x35'),_0x6d13('0x36'));fs_extra[_0x6d13('0x37')](_0x2a7024,function(){_0x175654(null,_0x2a7024);});},'filename':function(_0x3eb111,_0x7640ac,_0x4ce26c){const _0x2f293d=_0x7640ac[_0x6d13('0x29')][_0x6d13('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2d1d11=path['extname'](_0x2f293d);const _0x1579c9=Date[_0x6d13('0x28')]()+'-'+_0x2f293d[_0x6d13('0x38')](_0x2d1d11,'')+_0x2d1d11;_0x4ce26c(null,_0x1579c9);}})});router[_0x6d13('0x21')](_0x6d13('0x39'),offlineUploadMulter[_0x6d13('0x3a')](),controller[_0x6d13('0x3b')]);router[_0x6d13('0x21')](_0x6d13('0x16'),auth[_0x6d13('0x9')](),controller[_0x6d13('0x3c')]);router[_0x6d13('0x21')]('/:id/applications',auth[_0x6d13('0x9')](),controller[_0x6d13('0x3d')]);router[_0x6d13('0x21')](_0x6d13('0x1b'),auth[_0x6d13('0x9')](),controller['addProactiveActions']);router[_0x6d13('0x21')](_0x6d13('0x1f'),auth[_0x6d13('0x9')](),controller['addAgents']);router[_0x6d13('0x3e')](_0x6d13('0xb'),auth[_0x6d13('0x9')](),controller[_0x6d13('0x3f')]);router[_0x6d13('0x40')](_0x6d13('0xb'),auth[_0x6d13('0x9')](),controller['destroy']);router[_0x6d13('0x40')]('/:id/dispositions',auth[_0x6d13('0x9')](),controller[_0x6d13('0x41')]);router[_0x6d13('0x40')](_0x6d13('0xf'),auth[_0x6d13('0x9')](),controller['removeAnswers']);router[_0x6d13('0x40')](_0x6d13('0x1f'),auth[_0x6d13('0x9')](),controller[_0x6d13('0x42')]);module[_0x6d13('0x43')]=router;
\ No newline at end of file
+var _0x76ab=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','join','root','format','now','originalname','single','file','server/files/images/avatars/','%s-%s','addAvatar','/:id/customer_avatar','addCustomerAvatar','diskStorage','server/files','offline-chat','replace','any','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0x5d1441,_0x12f002){var _0x4228c5=function(_0xdc8a94){while(--_0xdc8a94){_0x5d1441['push'](_0x5d1441['shift']());}};_0x4228c5(++_0x12f002);}(_0x76ab,0xcf));var _0xb76a=function(_0x1b02bb,_0x3d9fde){_0x1b02bb=_0x1b02bb-0x0;var _0x131245=_0x76ab[_0x1b02bb];return _0x131245;};'use strict';var multer=require('multer');var util=require(_0xb76a('0x0'));var path=require(_0xb76a('0x1'));var timeout=require(_0xb76a('0x2'));var express=require('express');var router=express[_0xb76a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb76a('0x4'));var interaction=require(_0xb76a('0x5'));var config=require('../../config/environment');var controller=require(_0xb76a('0x6'));router['get']('/',auth[_0xb76a('0x7')](),controller[_0xb76a('0x8')]);router[_0xb76a('0x9')](_0xb76a('0xa'),auth[_0xb76a('0x7')](),controller[_0xb76a('0xb')]);router[_0xb76a('0x9')](_0xb76a('0xc'),auth[_0xb76a('0x7')](),controller[_0xb76a('0xd')]);router['get'](_0xb76a('0xe'),auth[_0xb76a('0x7')](),controller[_0xb76a('0xf')]);router[_0xb76a('0x9')](_0xb76a('0x10'),auth[_0xb76a('0x7')](),controller[_0xb76a('0x11')]);router[_0xb76a('0x9')](_0xb76a('0x12'),controller[_0xb76a('0x13')]);router[_0xb76a('0x9')](_0xb76a('0x14'),controller[_0xb76a('0x15')]);router['get']('/:id/customer_avatar',controller[_0xb76a('0x16')]);router[_0xb76a('0x9')](_0xb76a('0x17'),controller['getSystemAvatar']);router[_0xb76a('0x9')]('/:id/interactions',auth[_0xb76a('0x7')](),controller[_0xb76a('0x18')]);router[_0xb76a('0x9')](_0xb76a('0x19'),controller[_0xb76a('0x1a')]);router[_0xb76a('0x9')](_0xb76a('0x1b'),auth['isAuthenticated'](),controller[_0xb76a('0x1c')]);router[_0xb76a('0x9')](_0xb76a('0x1d'),auth[_0xb76a('0x7')](),controller[_0xb76a('0x1e')]);router['get'](_0xb76a('0x1f'),controller[_0xb76a('0x20')]);router[_0xb76a('0x9')]('/:id/offline_messages',auth[_0xb76a('0x7')](),controller[_0xb76a('0x21')]);router[_0xb76a('0x9')](_0xb76a('0x22'),auth[_0xb76a('0x7')](),controller[_0xb76a('0x23')]);router[_0xb76a('0x24')]('/',auth[_0xb76a('0x7')](),controller[_0xb76a('0x25')]);router[_0xb76a('0x24')](_0xb76a('0xe'),auth[_0xb76a('0x7')](),controller[_0xb76a('0x26')]);router[_0xb76a('0x24')](_0xb76a('0x10'),auth[_0xb76a('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x390e21,_0x4e6a26,_0x52655c){_0x52655c(null,path[_0xb76a('0x27')](config[_0xb76a('0x28')],'server/files/images/logos/'));},'filename':function(_0x5dcca4,_0x36a7c7,_0x228c24){_0x228c24(null,util[_0xb76a('0x29')]('%s-%s',Date[_0xb76a('0x2a')](),_0x36a7c7[_0xb76a('0x2b')]));}})});router[_0xb76a('0x24')](_0xb76a('0x12'),upload[_0xb76a('0x2c')](_0xb76a('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38af25,_0x2420c3,_0x5d9520){_0x5d9520(null,path['join'](config[_0xb76a('0x28')],_0xb76a('0x2e')));},'filename':function(_0x4dbeab,_0x5208b7,_0x43d2fa){_0x43d2fa(null,util[_0xb76a('0x29')](_0xb76a('0x2f'),Date[_0xb76a('0x2a')](),_0x5208b7[_0xb76a('0x2b')]));}})});router[_0xb76a('0x24')](_0xb76a('0x14'),upload[_0xb76a('0x2c')](_0xb76a('0x2d')),controller[_0xb76a('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x39a213,_0xe5461f,_0x5de9d2){_0x5de9d2(null,path[_0xb76a('0x27')](config[_0xb76a('0x28')],'server/files/images/avatars/'));},'filename':function(_0x454e3d,_0x252425,_0x49eda5){_0x49eda5(null,util[_0xb76a('0x29')](_0xb76a('0x2f'),Date['now'](),_0x252425[_0xb76a('0x2b')]));}})});router[_0xb76a('0x24')](_0xb76a('0x31'),upload['single'](_0xb76a('0x2d')),controller[_0xb76a('0x32')]);var upload=multer({'storage':multer[_0xb76a('0x33')]({'destination':function(_0x1ad034,_0x2bd7e6,_0x4397bf){_0x4397bf(null,path['join'](config[_0xb76a('0x28')],'server/files/images/avatars/'));},'filename':function(_0x5b4d36,_0x13e8a6,_0x32aebf){_0x32aebf(null,util['format'](_0xb76a('0x2f'),Date['now'](),_0x13e8a6[_0xb76a('0x2b')]));}})});router['post'](_0xb76a('0x17'),upload[_0xb76a('0x2c')]('file'),controller['addSystemAvatar']);router[_0xb76a('0x24')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xb76a('0x33')]({'destination':function(_0x403f32,_0x38dd4b,_0x13312d){const _0x588046=path[_0xb76a('0x27')](config[_0xb76a('0x28')],_0xb76a('0x34'),'attachments',_0xb76a('0x35'));fs_extra['ensureDir'](_0x588046,function(){_0x13312d(null,_0x588046);});},'filename':function(_0xfa9173,_0x16281a,_0x49781d){const _0x5d8a68=_0x16281a[_0xb76a('0x2b')][_0xb76a('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x59a87f=path['extname'](_0x5d8a68);const _0xfa7545=Date['now']()+'-'+_0x5d8a68['replace'](_0x59a87f,'')+_0x59a87f;_0x49781d(null,_0xfa7545);}})});router[_0xb76a('0x24')]('/:id/offline',offlineUploadMulter[_0xb76a('0x37')](),controller['offline']);router[_0xb76a('0x24')](_0xb76a('0x38'),auth['isAuthenticated'](),controller[_0xb76a('0x39')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xb76a('0x3a')]);router['post'](_0xb76a('0x1d'),auth['isAuthenticated'](),controller[_0xb76a('0x3b')]);router[_0xb76a('0x24')](_0xb76a('0x22'),auth['isAuthenticated'](),controller[_0xb76a('0x3c')]);router[_0xb76a('0x3d')](_0xb76a('0xc'),auth['isAuthenticated'](),controller[_0xb76a('0x3e')]);router[_0xb76a('0x3f')](_0xb76a('0xc'),auth[_0xb76a('0x7')](),controller[_0xb76a('0x40')]);router['delete'](_0xb76a('0xe'),auth[_0xb76a('0x7')](),controller[_0xb76a('0x41')]);router['delete'](_0xb76a('0x10'),auth[_0xb76a('0x7')](),controller[_0xb76a('0x42')]);router[_0xb76a('0x3f')](_0xb76a('0x22'),auth[_0xb76a('0x7')](),controller[_0xb76a('0x43')]);module[_0xb76a('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index c9083ae..f09e921 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 _0xc7a3=['STRING','ENUM','AmazonAWS','Google','exports'];(function(_0xe906a5,_0x3bfd31){var _0x4fb701=function(_0x18c9f1){while(--_0x18c9f1){_0xe906a5['push'](_0xe906a5['shift']());}};_0x4fb701(++_0x3bfd31);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x87ef72,_0x570105){_0x87ef72=_0x87ef72-0x0;var _0x22ba0f=_0xc7a3[_0x87ef72];return _0x22ba0f;};'use strict';var Sequelize=require('sequelize');module[_0x3c7a('0x0')]={'name':{'type':Sequelize[_0x3c7a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3c7a('0x2')](_0x3c7a('0x3'),_0x3c7a('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3c7a('0x1')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5c91=['exports','STRING','AmazonAWS','Google','sequelize'];(function(_0x33cf66,_0x30e414){var _0x3a400b=function(_0x29130b){while(--_0x29130b){_0x33cf66['push'](_0x33cf66['shift']());}};_0x3a400b(++_0x30e414);}(_0x5c91,0x1e9));var _0x15c9=function(_0x1c01d6,_0x4ceb21){_0x1c01d6=_0x1c01d6-0x0;var _0x56f5f0=_0x5c91[_0x1c01d6];return _0x56f5f0;};'use strict';var Sequelize=require(_0x15c9('0x0'));module[_0x15c9('0x1')]={'name':{'type':Sequelize[_0x15c9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x15c9('0x3'),_0x15c9('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x15c9('0x2')]},'data2':{'type':Sequelize[_0x15c9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e222230..7e471fc 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 _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x1bf56f,_0xe09640){var _0x4aa20b=function(_0x32e7c4){while(--_0x32e7c4){_0x1bf56f['push'](_0x1bf56f['shift']());}};_0x4aa20b(++_0xe09640);}(_0xdb28,0x106));var _0x8db2=function(_0x325388,_0x4ec7de){_0x325388=_0x325388-0x0;var _0x30c413=_0xdb28[_0x325388];return _0x30c413;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
+var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xadb5,0xad));var _0x5adb=function(_0x24f4e5,_0x297856){_0x24f4e5=_0x24f4e5-0x0;var _0x2e00c5=_0xadb5[_0x24f4e5];return _0x2e00c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 720aa2f..db26c12 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 _0xaf76=['exports','define','CloudProvider','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3cf884,_0x2274c8){var _0xc5b0ca=function(_0x520d32){while(--_0x520d32){_0x3cf884['push'](_0x3cf884['shift']());}};_0xc5b0ca(++_0x2274c8);}(_0xaf76,0x19d));var _0x6af7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf76[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6af7('0x0'));var util=require('util');var logger=require(_0x6af7('0x1'))(_0x6af7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6af7('0x3'));var fs=require('fs');var path=require(_0x6af7('0x4'));var rimraf=require(_0x6af7('0x5'));var config=require(_0x6af7('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x6af7('0x7')]=function(_0x41ba91,_0x22e434){return _0x41ba91[_0x6af7('0x8')](_0x6af7('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e0b=['exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7e0b,0x163));var _0xb7e0=function(_0x5f2cb4,_0x36be8f){_0x5f2cb4=_0x5f2cb4-0x0;var _0x52184e=_0x7e0b[_0x5f2cb4];return _0x52184e;};'use strict';var _=require(_0xb7e0('0x0'));var util=require(_0xb7e0('0x1'));var logger=require(_0xb7e0('0x2'))(_0xb7e0('0x3'));var moment=require('moment');var BPromise=require(_0xb7e0('0x4'));var rp=require(_0xb7e0('0x5'));var fs=require('fs');var path=require(_0xb7e0('0x6'));var rimraf=require('rimraf');var config=require(_0xb7e0('0x7'));var attributes=require(_0xb7e0('0x8'));module[_0xb7e0('0x9')]=function(_0xd94a1e,_0x48f088){return _0xd94a1e[_0xb7e0('0xa')](_0xb7e0('0xb'),attributes,{'tableName':_0xb7e0('0xc'),'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 07f9191..0dae96b 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 _0xf9e5=['info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0xec25eb,_0x184e0d){var _0x5a5059=function(_0x4022f2){while(--_0x4022f2){_0xec25eb['push'](_0xec25eb['shift']());}};_0x5a5059(++_0x184e0d);}(_0xf9e5,0x89));var _0x5f9e=function(_0x59ce00,_0x204d43){_0x59ce00=_0x59ce00-0x0;var _0x36774e=_0xf9e5[_0x59ce00];return _0x36774e;};'use strict';var _=require(_0x5f9e('0x0'));var util=require(_0x5f9e('0x1'));var moment=require(_0x5f9e('0x2'));var BPromise=require(_0x5f9e('0x3'));var rs=require(_0x5f9e('0x4'));var fs=require('fs');var Redis=require(_0x5f9e('0x5'));var db=require(_0x5f9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f9e('0x7'))(_0x5f9e('0x8'));var config=require('../../config/environment');var jayson=require(_0x5f9e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8bb75c,_0x35fcc8,_0x4ee331){return new BPromise(function(_0x13de1c,_0x3cebf5){return client['request'](_0x8bb75c,_0x4ee331)['then'](function(_0x549a00){logger[_0x5f9e('0xa')](_0x5f9e('0xb'),_0x35fcc8,'request\x20sent');logger[_0x5f9e('0xc')](_0x5f9e('0xd'),_0x35fcc8,_0x5f9e('0xe'),JSON[_0x5f9e('0xf')](_0x549a00));if(_0x549a00[_0x5f9e('0x10')]){if(_0x549a00['error'][_0x5f9e('0x11')]===0x1f4){logger[_0x5f9e('0x10')](_0x5f9e('0xb'),_0x35fcc8,_0x549a00[_0x5f9e('0x10')]['message']);return _0x3cebf5(_0x549a00[_0x5f9e('0x10')][_0x5f9e('0x12')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x35fcc8,_0x549a00[_0x5f9e('0x10')][_0x5f9e('0x12')]);return _0x13de1c(_0x549a00[_0x5f9e('0x10')]['message']);}else{logger[_0x5f9e('0xa')](_0x5f9e('0xb'),_0x35fcc8,_0x5f9e('0xe'));_0x13de1c(_0x549a00[_0x5f9e('0x13')]['message']);}})[_0x5f9e('0x14')](function(_0x293fe2){logger['error']('CloudProvider,\x20%s,\x20%s',_0x35fcc8,_0x293fe2);_0x3cebf5(_0x293fe2);});});}
\ No newline at end of file
+var _0x1ab1=['client','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xee436a,_0x23daad){var _0x2e6f12=function(_0x5bddfa){while(--_0x5bddfa){_0xee436a['push'](_0xee436a['shift']());}};_0x2e6f12(++_0x23daad);}(_0x1ab1,0x12c));var _0x11ab=function(_0x83993b,_0x16e7aa){_0x83993b=_0x83993b-0x0;var _0x1cf6cc=_0x1ab1[_0x83993b];return _0x1cf6cc;};'use strict';var _=require(_0x11ab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x11ab('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x11ab('0x2'));var logger=require('../../config/logger')(_0x11ab('0x3'));var config=require(_0x11ab('0x4'));var jayson=require(_0x11ab('0x5'));var client=jayson[_0x11ab('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eaf8b,_0xaf0223,_0x2788a0){return new BPromise(function(_0x441aca,_0x4b89b9){return client[_0x11ab('0x7')](_0x3eaf8b,_0x2788a0)['then'](function(_0x1abc4e){logger['info'](_0x11ab('0x8'),_0xaf0223,_0x11ab('0x9'));logger[_0x11ab('0xa')](_0x11ab('0xb'),_0xaf0223,'request\x20sent',JSON[_0x11ab('0xc')](_0x1abc4e));if(_0x1abc4e[_0x11ab('0xd')]){if(_0x1abc4e[_0x11ab('0xd')][_0x11ab('0xe')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0xaf0223,_0x1abc4e[_0x11ab('0xd')][_0x11ab('0xf')]);return _0x4b89b9(_0x1abc4e[_0x11ab('0xd')][_0x11ab('0xf')]);}logger[_0x11ab('0xd')]('CloudProvider,\x20%s,\x20%s',_0xaf0223,_0x1abc4e[_0x11ab('0xd')][_0x11ab('0xf')]);return _0x441aca(_0x1abc4e[_0x11ab('0xd')][_0x11ab('0xf')]);}else{logger['info'](_0x11ab('0x8'),_0xaf0223,_0x11ab('0x9'));_0x441aca(_0x1abc4e[_0x11ab('0x10')][_0x11ab('0xf')]);}})[_0x11ab('0x11')](function(_0x3a500b){logger[_0x11ab('0xd')]('CloudProvider,\x20%s,\x20%s',_0xaf0223,_0x3a500b);_0x4b89b9(_0x3a500b);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 085c37c..c84a2e5 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 _0x28e2=['../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0x2f808f,_0x2de01c){var _0x58a7aa=function(_0x1a81f9){while(--_0x1a81f9){_0x2f808f['push'](_0x2f808f['shift']());}};_0x58a7aa(++_0x2de01c);}(_0x28e2,0xf2));var _0x228e=function(_0x306c61,_0x292d64){_0x306c61=_0x306c61-0x0;var _0x2fff0b=_0x28e2[_0x306c61];return _0x2fff0b;};'use strict';var multer=require(_0x228e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x228e('0x1'));var router=express[_0x228e('0x2')]();var fs_extra=require(_0x228e('0x3'));var auth=require(_0x228e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x228e('0x5'));var controller=require(_0x228e('0x6'));router[_0x228e('0x7')]('/',auth[_0x228e('0x8')](),controller[_0x228e('0x9')]);router[_0x228e('0x7')](_0x228e('0xa'),auth[_0x228e('0x8')](),controller[_0x228e('0xb')]);router[_0x228e('0xc')]('/',auth[_0x228e('0x8')](),controller[_0x228e('0xd')]);router[_0x228e('0xe')](_0x228e('0xa'),auth[_0x228e('0x8')](),controller[_0x228e('0xf')]);router[_0x228e('0x10')](_0x228e('0xa'),auth['isAuthenticated'](),controller[_0x228e('0x11')]);module[_0x228e('0x12')]=router;
\ No newline at end of file
+var _0xade9=['create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x496c30,_0x4f32cf){var _0x168fbb=function(_0x26a112){while(--_0x26a112){_0x496c30['push'](_0x496c30['shift']());}};_0x168fbb(++_0x4f32cf);}(_0xade9,0x194));var _0x9ade=function(_0xd344ef,_0x132b5f){_0xd344ef=_0xd344ef-0x0;var _0x50a171=_0xade9[_0xd344ef];return _0x50a171;};'use strict';var multer=require(_0x9ade('0x0'));var util=require(_0x9ade('0x1'));var path=require(_0x9ade('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ade('0x3'));var router=express[_0x9ade('0x4')]();var fs_extra=require(_0x9ade('0x5'));var auth=require(_0x9ade('0x6'));var interaction=require(_0x9ade('0x7'));var config=require(_0x9ade('0x8'));var controller=require(_0x9ade('0x9'));router[_0x9ade('0xa')]('/',auth[_0x9ade('0xb')](),controller[_0x9ade('0xc')]);router['get'](_0x9ade('0xd'),auth[_0x9ade('0xb')](),controller[_0x9ade('0xe')]);router[_0x9ade('0xf')]('/',auth[_0x9ade('0xb')](),controller[_0x9ade('0x10')]);router[_0x9ade('0x11')](_0x9ade('0xd'),auth[_0x9ade('0xb')](),controller[_0x9ade('0x12')]);router['delete'](_0x9ade('0xd'),auth['isAuthenticated'](),controller[_0x9ade('0x13')]);module[_0x9ade('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index da64fa4..6a92407 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 _0xcefe=['name','sequelize','STRING'];(function(_0x56ffb0,_0x1e619b){var _0x4a4f2c=function(_0x21d16a){while(--_0x21d16a){_0x56ffb0['push'](_0x56ffb0['shift']());}};_0x4a4f2c(++_0x1e619b);}(_0xcefe,0x15a));var _0xecef=function(_0x42d40a,_0x3128eb){_0x42d40a=_0x42d40a-0x0;var _0x37803b=_0xcefe[_0x42d40a];return _0x37803b;};'use strict';var Sequelize=require(_0xecef('0x0'));module['exports']={'name':{'type':Sequelize[_0xecef('0x1')],'unique':_0xecef('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xecef('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xecef('0x1')]},'phone':{'type':Sequelize[_0xecef('0x1')]},'fax':{'type':Sequelize[_0xecef('0x1')]},'type':{'type':Sequelize[_0xecef('0x1')]},'street':{'type':Sequelize[_0xecef('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xecef('0x1')]},'email':{'type':Sequelize[_0xecef('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xecef('0x1')]},'sPostalCode':{'type':Sequelize[_0xecef('0x1')]},'sCity':{'type':Sequelize[_0xecef('0x1')]},'sCountry':{'type':Sequelize[_0xecef('0x1')]},'description':{'type':Sequelize[_0xecef('0x1')]}};
\ No newline at end of file
+var _0x295e=['sequelize','exports','STRING'];(function(_0x4717b8,_0x331c49){var _0x42a536=function(_0x580b33){while(--_0x580b33){_0x4717b8['push'](_0x4717b8['shift']());}};_0x42a536(++_0x331c49);}(_0x295e,0x14a));var _0xe295=function(_0x3c6ce7,_0x212875){_0x3c6ce7=_0x3c6ce7-0x0;var _0xb0aa37=_0x295e[_0x3c6ce7];return _0xb0aa37;};'use strict';var Sequelize=require(_0xe295('0x0'));module[_0xe295('0x1')]={'name':{'type':Sequelize[_0xe295('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe295('0x2')]},'companyId':{'type':Sequelize[_0xe295('0x2')]},'website':{'type':Sequelize[_0xe295('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe295('0x2')]},'type':{'type':Sequelize[_0xe295('0x2')]},'street':{'type':Sequelize[_0xe295('0x2')]},'postalCode':{'type':Sequelize[_0xe295('0x2')]},'city':{'type':Sequelize[_0xe295('0x2')]},'country':{'type':Sequelize[_0xe295('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe295('0x2')]},'sStreet':{'type':Sequelize[_0xe295('0x2')]},'sPostalCode':{'type':Sequelize[_0xe295('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xe295('0x2')]},'description':{'type':Sequelize[_0xe295('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index e58e683..4723a79 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 _0xd998=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CmCompany','includeAll','include','rows','catch','show','params','rawAttributes','find','create','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','omit','ids','getContacts','order','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5025ae,_0xba29c2){var _0xa26dac=function(_0x1dfd34){while(--_0x1dfd34){_0x5025ae['push'](_0x5025ae['shift']());}};_0xa26dac(++_0xba29c2);}(_0xd998,0x1a4));var _0x8d99=function(_0x2365db,_0x4ea500){_0x2365db=_0x2365db-0x0;var _0x2bee41=_0xd998[_0x2365db];return _0x2bee41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d99('0x0'));var zipdir=require(_0x8d99('0x1'));var jsonpatch=require(_0x8d99('0x2'));var rp=require(_0x8d99('0x3'));var moment=require(_0x8d99('0x4'));var BPromise=require(_0x8d99('0x5'));var Mustache=require(_0x8d99('0x6'));var util=require(_0x8d99('0x7'));var path=require(_0x8d99('0x8'));var sox=require(_0x8d99('0x9'));var csv=require(_0x8d99('0xa'));var ejs=require(_0x8d99('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d99('0xc'));var squel=require(_0x8d99('0xd'));var crypto=require(_0x8d99('0xe'));var jsforce=require(_0x8d99('0xf'));var deskjs=require(_0x8d99('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8d99('0x11'));var Papa=require(_0x8d99('0x12'));var Redis=require(_0x8d99('0x13'));var authService=require(_0x8d99('0x14'));var qs=require(_0x8d99('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d99('0x16'));var logger=require(_0x8d99('0x17'))(_0x8d99('0x18'));var utils=require(_0x8d99('0x19'));var config=require(_0x8d99('0x1a'));var licenseUtil=require(_0x8d99('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d2213,_0x341847){_0x341847=_0x341847||0xcc;return function(_0x39cdf6){if(_0x39cdf6){return _0x8d2213[_0x8d99('0x1c')](_0x341847);}return _0x8d2213[_0x8d99('0x1d')](_0x341847)[_0x8d99('0x1e')]();};}function respondWithResult(_0xd85472,_0x5e5755){_0x5e5755=_0x5e5755||0xc8;return function(_0x17f24e){if(_0x17f24e){return _0xd85472[_0x8d99('0x1d')](_0x5e5755)[_0x8d99('0x1f')](_0x17f24e);}};}function respondWithFilteredResult(_0x4b4193,_0x354ad3){return function(_0x3cbe27){if(_0x3cbe27){var _0x5d444f=typeof _0x354ad3[_0x8d99('0x20')]===_0x8d99('0x21')&&typeof _0x354ad3['limit']===_0x8d99('0x21');var _0x518065=_0x3cbe27['count'];var _0x5b3f17=_0x5d444f?0x0:_0x354ad3[_0x8d99('0x20')];var _0x313018=_0x5d444f?_0x3cbe27[_0x8d99('0x22')]:_0x354ad3[_0x8d99('0x20')]+_0x354ad3[_0x8d99('0x23')];var _0xbfd503;if(_0x313018>=_0x518065){_0x313018=_0x518065;_0xbfd503=0xc8;}else{_0xbfd503=0xce;}_0x4b4193[_0x8d99('0x1d')](_0xbfd503);return _0x4b4193[_0x8d99('0x24')](_0x8d99('0x25'),_0x5b3f17+'-'+_0x313018+'/'+_0x518065)['json'](_0x3cbe27);}return null;};}function patchUpdates(_0x135e2f){return function(_0x2eba1e){try{jsonpatch[_0x8d99('0x26')](_0x2eba1e,_0x135e2f,!![]);}catch(_0x9dd589){return BPromise[_0x8d99('0x27')](_0x9dd589);}return _0x2eba1e[_0x8d99('0x28')]();};}function saveUpdates(_0x3cdf2c,_0x1437a7){return function(_0x173765){if(_0x173765){return _0x173765['update'](_0x3cdf2c)[_0x8d99('0x29')](function(_0x3c708f){return _0x3c708f;});}return null;};}function removeEntity(_0x27b840,_0x280d4a){return function(_0x13e564){if(_0x13e564){return _0x13e564['destroy']()['then'](function(){var _0x5ce40f=_0x13e564[_0x8d99('0x2a')]({'plain':!![]});var _0x54597f='Companies';return db[_0x8d99('0x2b')][_0x8d99('0x2c')]({'where':{'type':_0x54597f,'resourceId':_0x5ce40f['id']}})[_0x8d99('0x29')](function(){return _0x13e564;});})['then'](function(){_0x27b840[_0x8d99('0x1d')](0xcc)[_0x8d99('0x1e')]();});}};}function handleEntityNotFound(_0x1d0c47,_0x2c3ee4){return function(_0xb94fa){if(!_0xb94fa){_0x1d0c47[_0x8d99('0x1c')](0x194);}return _0xb94fa;};}function handleError(_0x48308e,_0x48bb4b){_0x48bb4b=_0x48bb4b||0x1f4;return function(_0x15fbd3){logger[_0x8d99('0x2d')](_0x15fbd3[_0x8d99('0x2e')]);if(_0x15fbd3[_0x8d99('0x2f')]){delete _0x15fbd3[_0x8d99('0x2f')];}_0x48308e['status'](_0x48bb4b)[_0x8d99('0x30')](_0x15fbd3);};}exports[_0x8d99('0x31')]=function(_0x5cf5c7,_0x53b9eb){var _0x74c05c={},_0x612713={},_0x5ab155={'count':0x0,'rows':[]};return db['CmCompany'][_0x8d99('0x32')]()['then'](function(_0x70fff){_0x612713[_0x8d99('0x33')]=_[_0x8d99('0x34')](_0x70fff);_0x612713[_0x8d99('0x35')]=_[_0x8d99('0x34')](_0x5cf5c7[_0x8d99('0x35')]);_0x612713[_0x8d99('0x36')]=_[_0x8d99('0x37')](_0x612713[_0x8d99('0x33')],_0x612713['query']);_0x74c05c[_0x8d99('0x38')]=_[_0x8d99('0x37')](_0x612713[_0x8d99('0x33')],qs[_0x8d99('0x39')](_0x5cf5c7[_0x8d99('0x35')][_0x8d99('0x39')]));_0x74c05c[_0x8d99('0x38')]=_0x74c05c[_0x8d99('0x38')][_0x8d99('0x3a')]?_0x74c05c[_0x8d99('0x38')]:_0x612713[_0x8d99('0x33')];if(!_0x5cf5c7[_0x8d99('0x35')][_0x8d99('0x3b')](_0x8d99('0x3c'))){_0x74c05c['limit']=qs[_0x8d99('0x23')](_0x5cf5c7[_0x8d99('0x35')][_0x8d99('0x23')]);_0x74c05c[_0x8d99('0x20')]=qs[_0x8d99('0x20')](_0x5cf5c7[_0x8d99('0x35')][_0x8d99('0x20')]);}_0x74c05c['order']=qs[_0x8d99('0x3d')](_0x5cf5c7[_0x8d99('0x35')][_0x8d99('0x3d')]);_0x74c05c[_0x8d99('0x3e')]=qs['filters'](_[_0x8d99('0x3f')](_0x5cf5c7['query'],_0x612713[_0x8d99('0x36')]),_0x70fff);if(_0x5cf5c7[_0x8d99('0x35')][_0x8d99('0x40')]){_0x74c05c[_0x8d99('0x3e')]=_[_0x8d99('0x41')](_0x74c05c[_0x8d99('0x3e')],{'$or':_['map'](_0x74c05c[_0x8d99('0x38')],function(_0x4aa517){var _0x400103={};_0x400103[_0x4aa517]={'$like':'%'+_0x5cf5c7['query']['filter']+'%'};return _0x400103;})});}_0x74c05c=_[_0x8d99('0x41')]({},_0x74c05c,_0x5cf5c7[_0x8d99('0x42')]);var _0x2c15c0={'where':_0x74c05c['where']};return db[_0x8d99('0x43')][_0x8d99('0x22')](_0x2c15c0)['then'](function(_0x1b90ed){_0x5ab155['count']=_0x1b90ed;if(_0x5cf5c7[_0x8d99('0x35')][_0x8d99('0x44')]){_0x74c05c[_0x8d99('0x45')]=[{'all':!![]}];}return db[_0x8d99('0x43')]['findAll'](_0x74c05c);})[_0x8d99('0x29')](function(_0x1289f8){_0x5ab155[_0x8d99('0x46')]=_0x1289f8;return _0x5ab155;})[_0x8d99('0x29')](respondWithFilteredResult(_0x53b9eb,_0x74c05c))[_0x8d99('0x47')](handleError(_0x53b9eb,null));})[_0x8d99('0x47')](handleError(_0x53b9eb,null));};exports[_0x8d99('0x48')]=function(_0x33da08,_0x16f597){var _0x5d51e7={'raw':![],'where':{'id':_0x33da08[_0x8d99('0x49')]['id']}},_0x4f93ff={};_0x4f93ff[_0x8d99('0x33')]=_[_0x8d99('0x34')](db[_0x8d99('0x43')][_0x8d99('0x4a')]);_0x4f93ff[_0x8d99('0x35')]=_[_0x8d99('0x34')](_0x33da08['query']);_0x4f93ff[_0x8d99('0x36')]=_[_0x8d99('0x37')](_0x4f93ff[_0x8d99('0x33')],_0x4f93ff[_0x8d99('0x35')]);_0x5d51e7[_0x8d99('0x38')]=_[_0x8d99('0x37')](_0x4f93ff[_0x8d99('0x33')],qs[_0x8d99('0x39')](_0x33da08['query'][_0x8d99('0x39')]));_0x5d51e7[_0x8d99('0x38')]=_0x5d51e7['attributes']['length']?_0x5d51e7[_0x8d99('0x38')]:_0x4f93ff[_0x8d99('0x33')];if(_0x33da08[_0x8d99('0x35')][_0x8d99('0x44')]){_0x5d51e7[_0x8d99('0x45')]=[{'all':!![]}];}_0x5d51e7=_[_0x8d99('0x41')]({},_0x5d51e7,_0x33da08[_0x8d99('0x42')]);return db[_0x8d99('0x43')][_0x8d99('0x4b')](_0x5d51e7)[_0x8d99('0x29')](handleEntityNotFound(_0x16f597,null))[_0x8d99('0x29')](respondWithResult(_0x16f597,null))[_0x8d99('0x47')](handleError(_0x16f597,null));};exports[_0x8d99('0x4c')]=function(_0x5a53b9,_0x3c735a){return db[_0x8d99('0x43')][_0x8d99('0x4c')](_0x5a53b9['body'],{})[_0x8d99('0x29')](function(_0x9a901){var _0x26ae94=_0x5a53b9['user']['get']({'plain':!![]});if(!_0x26ae94)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26ae94['role']==='user'){var _0x346ad2=_0x9a901['get']({'plain':!![]});var _0x4ec283='Companies';return db[_0x8d99('0x4d')][_0x8d99('0x4b')]({'where':{'name':_0x4ec283,'userProfileId':_0x26ae94[_0x8d99('0x4e')]},'raw':!![]})['then'](function(_0x1ad510){if(_0x1ad510&&_0x1ad510[_0x8d99('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x346ad2[_0x8d99('0x2f')],'resourceId':_0x346ad2['id'],'type':_0x1ad510[_0x8d99('0x2f')],'sectionId':_0x1ad510['id']},{})[_0x8d99('0x29')](function(){return _0x9a901;});}else{return _0x9a901;}})[_0x8d99('0x47')](function(_0x1a0cf8){logger[_0x8d99('0x2d')](_0x8d99('0x50'),_0x1a0cf8);throw _0x1a0cf8;});}return _0x9a901;})[_0x8d99('0x29')](respondWithResult(_0x3c735a,0xc9))[_0x8d99('0x47')](handleError(_0x3c735a,null));};exports['update']=function(_0xdd9b2,_0x401a35){if(_0xdd9b2[_0x8d99('0x51')]['id']){delete _0xdd9b2[_0x8d99('0x51')]['id'];}return db['CmCompany'][_0x8d99('0x4b')]({'where':{'id':_0xdd9b2['params']['id']}})[_0x8d99('0x29')](handleEntityNotFound(_0x401a35,null))[_0x8d99('0x29')](saveUpdates(_0xdd9b2['body'],null))[_0x8d99('0x29')](respondWithResult(_0x401a35,null))['catch'](handleError(_0x401a35,null));};exports['destroy']=function(_0xfa5f6c,_0x30f159){return db[_0x8d99('0x43')][_0x8d99('0x4b')]({'where':{'id':_0xfa5f6c['params']['id']}})[_0x8d99('0x29')](handleEntityNotFound(_0x30f159,null))[_0x8d99('0x29')](removeEntity(_0x30f159,null))[_0x8d99('0x47')](handleError(_0x30f159,null));};exports[_0x8d99('0x32')]=function(_0x1548cb,_0x52bc42){return db['CmCompany'][_0x8d99('0x32')]()[_0x8d99('0x29')](respondWithResult(_0x52bc42,null))['catch'](handleError(_0x52bc42,null));};exports[_0x8d99('0x52')]=function(_0x1176e0,_0x2a256d,_0x2a34f8){return db['CmContact'][_0x8d99('0x4b')]({'where':{'id':_0x1176e0[_0x8d99('0x49')]['id']}})[_0x8d99('0x29')](handleEntityNotFound(_0x2a256d,null))[_0x8d99('0x29')](function(_0x4f4051){if(_0x4f4051){return _0x4f4051[_0x8d99('0x52')](_0x1176e0['body']['ids'],_[_0x8d99('0x53')](_0x1176e0[_0x8d99('0x51')],[_0x8d99('0x54'),'id'])||{});}})[_0x8d99('0x29')](respondWithResult(_0x2a256d,null))[_0x8d99('0x47')](handleError(_0x2a256d,null));};exports[_0x8d99('0x55')]=function(_0x3993ab,_0x149a93,_0x401027){var _0x4b4da4={};var _0x105eba={};var _0x4b35b6;var _0x474e8a;return db[_0x8d99('0x43')]['findOne']({'where':{'id':_0x3993ab[_0x8d99('0x49')]['id']}})[_0x8d99('0x29')](handleEntityNotFound(_0x149a93,null))[_0x8d99('0x29')](function(_0x5601b9){if(_0x5601b9){_0x4b35b6=_0x5601b9;_0x105eba[_0x8d99('0x33')]=_[_0x8d99('0x34')](db['CmContact'][_0x8d99('0x4a')]);_0x105eba['query']=_[_0x8d99('0x34')](_0x3993ab[_0x8d99('0x35')]);_0x105eba['filters']=_[_0x8d99('0x37')](_0x105eba[_0x8d99('0x33')],_0x105eba[_0x8d99('0x35')]);_0x4b4da4['attributes']=_[_0x8d99('0x37')](_0x105eba[_0x8d99('0x33')],qs[_0x8d99('0x39')](_0x3993ab[_0x8d99('0x35')][_0x8d99('0x39')]));_0x4b4da4[_0x8d99('0x38')]=_0x4b4da4[_0x8d99('0x38')][_0x8d99('0x3a')]?_0x4b4da4[_0x8d99('0x38')]:_0x105eba[_0x8d99('0x33')];_0x4b4da4[_0x8d99('0x56')]=qs[_0x8d99('0x3d')](_0x3993ab[_0x8d99('0x35')][_0x8d99('0x3d')]);_0x4b4da4[_0x8d99('0x3e')]=qs[_0x8d99('0x36')](_[_0x8d99('0x3f')](_0x3993ab[_0x8d99('0x35')],_0x105eba[_0x8d99('0x36')]));if(_0x3993ab['query'][_0x8d99('0x40')]){_0x4b4da4['where']=_[_0x8d99('0x41')](_0x4b4da4[_0x8d99('0x3e')],{'$or':_[_0x8d99('0x57')](_0x4b4da4['attributes'],function(_0x5dbdbe){var _0x11a82b={};_0x11a82b[_0x5dbdbe]={'$like':'%'+_0x3993ab[_0x8d99('0x35')][_0x8d99('0x40')]+'%'};return _0x11a82b;})});}_0x4b4da4=_['merge']({},_0x4b4da4,_0x3993ab[_0x8d99('0x42')]);return _0x4b35b6[_0x8d99('0x55')](_0x4b4da4);}})['then'](function(_0x50b029){if(_0x50b029){_0x474e8a=_0x50b029['length'];if(!_0x3993ab[_0x8d99('0x35')][_0x8d99('0x3b')](_0x8d99('0x3c'))){_0x4b4da4['limit']=qs[_0x8d99('0x23')](_0x3993ab[_0x8d99('0x35')][_0x8d99('0x23')]);_0x4b4da4[_0x8d99('0x20')]=qs['offset'](_0x3993ab[_0x8d99('0x35')][_0x8d99('0x20')]);}return _0x4b35b6['getContacts'](_0x4b4da4);}})[_0x8d99('0x29')](function(_0xa08bbb){if(_0xa08bbb){return _0xa08bbb?{'count':_0x474e8a,'rows':_0xa08bbb}:null;}})[_0x8d99('0x29')](respondWithResult(_0x149a93,null))[_0x8d99('0x47')](handleError(_0x149a93,null));};
\ No newline at end of file
+var _0x6ecf=['getContacts','findOne','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','Companies','UserProfileResource','end','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','map','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','omit'];(function(_0x37635e,_0x21b6f5){var _0x3c0965=function(_0xe9864c){while(--_0xe9864c){_0x37635e['push'](_0x37635e['shift']());}};_0x3c0965(++_0x21b6f5);}(_0x6ecf,0x120));var _0xf6ec=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x6ecf[_0x102e37];return _0x35a07c;};'use strict';var emlformat=require(_0xf6ec('0x0'));var rimraf=require(_0xf6ec('0x1'));var zipdir=require(_0xf6ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6ec('0x3'));var moment=require(_0xf6ec('0x4'));var BPromise=require(_0xf6ec('0x5'));var Mustache=require(_0xf6ec('0x6'));var util=require(_0xf6ec('0x7'));var path=require(_0xf6ec('0x8'));var sox=require('sox');var csv=require(_0xf6ec('0x9'));var ejs=require(_0xf6ec('0xa'));var fs=require('fs');var fs_extra=require(_0xf6ec('0xb'));var _=require('lodash');var squel=require(_0xf6ec('0xc'));var crypto=require(_0xf6ec('0xd'));var jsforce=require(_0xf6ec('0xe'));var deskjs=require(_0xf6ec('0xf'));var toCsv=require(_0xf6ec('0x9'));var querystring=require(_0xf6ec('0x10'));var Papa=require(_0xf6ec('0x11'));var Redis=require(_0xf6ec('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf6ec('0x13'));var as=require(_0xf6ec('0x14'));var hardwareService=require(_0xf6ec('0x15'));var logger=require(_0xf6ec('0x16'))(_0xf6ec('0x17'));var utils=require(_0xf6ec('0x18'));var config=require(_0xf6ec('0x19'));var licenseUtil=require(_0xf6ec('0x1a'));var db=require(_0xf6ec('0x1b'))['db'];function respondWithStatusCode(_0xd786ec,_0x23689b){_0x23689b=_0x23689b||0xcc;return function(_0x5e3884){if(_0x5e3884){return _0xd786ec[_0xf6ec('0x1c')](_0x23689b);}return _0xd786ec['status'](_0x23689b)['end']();};}function respondWithResult(_0x303978,_0xa0db2c){_0xa0db2c=_0xa0db2c||0xc8;return function(_0x2ccf93){if(_0x2ccf93){return _0x303978[_0xf6ec('0x1d')](_0xa0db2c)[_0xf6ec('0x1e')](_0x2ccf93);}};}function respondWithFilteredResult(_0xa26a45,_0x352486){return function(_0x704ec1){if(_0x704ec1){var _0x2e8f32=typeof _0x352486[_0xf6ec('0x1f')]===_0xf6ec('0x20')&&typeof _0x352486[_0xf6ec('0x21')]===_0xf6ec('0x20');var _0xb25d4f=_0x704ec1[_0xf6ec('0x22')];var _0x22f015=_0x2e8f32?0x0:_0x352486['offset'];var _0x185954=_0x2e8f32?_0x704ec1[_0xf6ec('0x22')]:_0x352486[_0xf6ec('0x1f')]+_0x352486[_0xf6ec('0x21')];var _0xc94bb9;if(_0x185954>=_0xb25d4f){_0x185954=_0xb25d4f;_0xc94bb9=0xc8;}else{_0xc94bb9=0xce;}_0xa26a45[_0xf6ec('0x1d')](_0xc94bb9);return _0xa26a45[_0xf6ec('0x23')](_0xf6ec('0x24'),_0x22f015+'-'+_0x185954+'/'+_0xb25d4f)[_0xf6ec('0x1e')](_0x704ec1);}return null;};}function patchUpdates(_0x476f50){return function(_0x17ff75){try{jsonpatch[_0xf6ec('0x25')](_0x17ff75,_0x476f50,!![]);}catch(_0x38067e){return BPromise[_0xf6ec('0x26')](_0x38067e);}return _0x17ff75[_0xf6ec('0x27')]();};}function saveUpdates(_0x2ad3b9,_0x4b30bb){return function(_0x19687b){if(_0x19687b){return _0x19687b['update'](_0x2ad3b9)['then'](function(_0x5813b7){return _0x5813b7;});}return null;};}function removeEntity(_0x568948,_0x1175d1){return function(_0x3f6b2b){if(_0x3f6b2b){return _0x3f6b2b[_0xf6ec('0x28')]()[_0xf6ec('0x29')](function(){var _0x52270b=_0x3f6b2b[_0xf6ec('0x2a')]({'plain':!![]});var _0x175a4d=_0xf6ec('0x2b');return db[_0xf6ec('0x2c')][_0xf6ec('0x28')]({'where':{'type':_0x175a4d,'resourceId':_0x52270b['id']}})[_0xf6ec('0x29')](function(){return _0x3f6b2b;});})[_0xf6ec('0x29')](function(){_0x568948['status'](0xcc)[_0xf6ec('0x2d')]();});}};}function handleEntityNotFound(_0x1f8f5d,_0x2f4d82){return function(_0x38275a){if(!_0x38275a){_0x1f8f5d[_0xf6ec('0x1c')](0x194);}return _0x38275a;};}function handleError(_0xf05b78,_0x3e8d09){_0x3e8d09=_0x3e8d09||0x1f4;return function(_0x5bc1b1){logger['error'](_0x5bc1b1[_0xf6ec('0x2e')]);if(_0x5bc1b1[_0xf6ec('0x2f')]){delete _0x5bc1b1[_0xf6ec('0x2f')];}_0xf05b78[_0xf6ec('0x1d')](_0x3e8d09)[_0xf6ec('0x30')](_0x5bc1b1);};}exports[_0xf6ec('0x31')]=function(_0xa19aa2,_0x181402){var _0x270405={},_0x2f7fd3={},_0x2f808f={'count':0x0,'rows':[]};return db[_0xf6ec('0x32')][_0xf6ec('0x33')]()[_0xf6ec('0x29')](function(_0x5c8098){_0x2f7fd3[_0xf6ec('0x34')]=_['keys'](_0x5c8098);_0x2f7fd3[_0xf6ec('0x35')]=_[_0xf6ec('0x36')](_0xa19aa2[_0xf6ec('0x35')]);_0x2f7fd3[_0xf6ec('0x37')]=_[_0xf6ec('0x38')](_0x2f7fd3['model'],_0x2f7fd3[_0xf6ec('0x35')]);_0x270405[_0xf6ec('0x39')]=_[_0xf6ec('0x38')](_0x2f7fd3[_0xf6ec('0x34')],qs[_0xf6ec('0x3a')](_0xa19aa2[_0xf6ec('0x35')]['fields']));_0x270405['attributes']=_0x270405[_0xf6ec('0x39')][_0xf6ec('0x3b')]?_0x270405[_0xf6ec('0x39')]:_0x2f7fd3[_0xf6ec('0x34')];if(!_0xa19aa2[_0xf6ec('0x35')][_0xf6ec('0x3c')]('nolimit')){_0x270405[_0xf6ec('0x21')]=qs[_0xf6ec('0x21')](_0xa19aa2['query'][_0xf6ec('0x21')]);_0x270405[_0xf6ec('0x1f')]=qs[_0xf6ec('0x1f')](_0xa19aa2[_0xf6ec('0x35')][_0xf6ec('0x1f')]);}_0x270405[_0xf6ec('0x3d')]=qs['sort'](_0xa19aa2[_0xf6ec('0x35')][_0xf6ec('0x3e')]);_0x270405['where']=qs[_0xf6ec('0x37')](_[_0xf6ec('0x3f')](_0xa19aa2[_0xf6ec('0x35')],_0x2f7fd3['filters']),_0x5c8098);if(_0xa19aa2[_0xf6ec('0x35')]['filter']){_0x270405[_0xf6ec('0x40')]=_[_0xf6ec('0x41')](_0x270405[_0xf6ec('0x40')],{'$or':_[_0xf6ec('0x42')](_0x270405[_0xf6ec('0x39')],function(_0x54d7fb){var _0x2106a5={};_0x2106a5[_0x54d7fb]={'$like':'%'+_0xa19aa2[_0xf6ec('0x35')][_0xf6ec('0x43')]+'%'};return _0x2106a5;})});}_0x270405=_[_0xf6ec('0x41')]({},_0x270405,_0xa19aa2['options']);var _0x5b261d={'where':_0x270405[_0xf6ec('0x40')]};return db['CmCompany'][_0xf6ec('0x22')](_0x5b261d)['then'](function(_0x5aa02e){_0x2f808f[_0xf6ec('0x22')]=_0x5aa02e;if(_0xa19aa2[_0xf6ec('0x35')][_0xf6ec('0x44')]){_0x270405[_0xf6ec('0x45')]=[{'all':!![]}];}return db['CmCompany'][_0xf6ec('0x46')](_0x270405);})[_0xf6ec('0x29')](function(_0x3558f4){_0x2f808f[_0xf6ec('0x47')]=_0x3558f4;return _0x2f808f;})[_0xf6ec('0x29')](respondWithFilteredResult(_0x181402,_0x270405))[_0xf6ec('0x48')](handleError(_0x181402,null));})[_0xf6ec('0x48')](handleError(_0x181402,null));};exports[_0xf6ec('0x49')]=function(_0x38a309,_0x851be1){var _0x1f82a6={'raw':![],'where':{'id':_0x38a309[_0xf6ec('0x4a')]['id']}},_0x5d6e73={};_0x5d6e73[_0xf6ec('0x34')]=_[_0xf6ec('0x36')](db[_0xf6ec('0x32')][_0xf6ec('0x4b')]);_0x5d6e73[_0xf6ec('0x35')]=_[_0xf6ec('0x36')](_0x38a309[_0xf6ec('0x35')]);_0x5d6e73[_0xf6ec('0x37')]=_['intersection'](_0x5d6e73['model'],_0x5d6e73[_0xf6ec('0x35')]);_0x1f82a6[_0xf6ec('0x39')]=_['intersection'](_0x5d6e73[_0xf6ec('0x34')],qs['fields'](_0x38a309['query'][_0xf6ec('0x3a')]));_0x1f82a6['attributes']=_0x1f82a6[_0xf6ec('0x39')][_0xf6ec('0x3b')]?_0x1f82a6[_0xf6ec('0x39')]:_0x5d6e73[_0xf6ec('0x34')];if(_0x38a309[_0xf6ec('0x35')]['includeAll']){_0x1f82a6['include']=[{'all':!![]}];}_0x1f82a6=_[_0xf6ec('0x41')]({},_0x1f82a6,_0x38a309[_0xf6ec('0x4c')]);return db['CmCompany']['find'](_0x1f82a6)[_0xf6ec('0x29')](handleEntityNotFound(_0x851be1,null))['then'](respondWithResult(_0x851be1,null))[_0xf6ec('0x48')](handleError(_0x851be1,null));};exports[_0xf6ec('0x4d')]=function(_0x3a0abd,_0x3edcdf){return db[_0xf6ec('0x32')]['create'](_0x3a0abd[_0xf6ec('0x4e')],{})['then'](function(_0x36f3e6){var _0x41d492=_0x3a0abd[_0xf6ec('0x4f')]['get']({'plain':!![]});if(!_0x41d492)throw new Error(_0xf6ec('0x50'));if(_0x41d492[_0xf6ec('0x51')]===_0xf6ec('0x4f')){var _0x5dea7c=_0x36f3e6[_0xf6ec('0x2a')]({'plain':!![]});var _0x840087=_0xf6ec('0x2b');return db['UserProfileSection'][_0xf6ec('0x52')]({'where':{'name':_0x840087,'userProfileId':_0x41d492[_0xf6ec('0x53')]},'raw':!![]})[_0xf6ec('0x29')](function(_0x23b6ad){if(_0x23b6ad&&_0x23b6ad[_0xf6ec('0x54')]===0x0){return db[_0xf6ec('0x2c')][_0xf6ec('0x4d')]({'name':_0x5dea7c['name'],'resourceId':_0x5dea7c['id'],'type':_0x23b6ad[_0xf6ec('0x2f')],'sectionId':_0x23b6ad['id']},{})[_0xf6ec('0x29')](function(){return _0x36f3e6;});}else{return _0x36f3e6;}})[_0xf6ec('0x48')](function(_0x38cdd3){logger[_0xf6ec('0x55')](_0xf6ec('0x56'),_0x38cdd3);throw _0x38cdd3;});}return _0x36f3e6;})[_0xf6ec('0x29')](respondWithResult(_0x3edcdf,0xc9))[_0xf6ec('0x48')](handleError(_0x3edcdf,null));};exports[_0xf6ec('0x57')]=function(_0x32e74e,_0x5aceb6){if(_0x32e74e['body']['id']){delete _0x32e74e['body']['id'];}return db[_0xf6ec('0x32')][_0xf6ec('0x52')]({'where':{'id':_0x32e74e[_0xf6ec('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5aceb6,null))['then'](saveUpdates(_0x32e74e[_0xf6ec('0x4e')],null))[_0xf6ec('0x29')](respondWithResult(_0x5aceb6,null))[_0xf6ec('0x48')](handleError(_0x5aceb6,null));};exports[_0xf6ec('0x28')]=function(_0x4489ac,_0x508ad7){return db[_0xf6ec('0x32')][_0xf6ec('0x52')]({'where':{'id':_0x4489ac[_0xf6ec('0x4a')]['id']}})[_0xf6ec('0x29')](handleEntityNotFound(_0x508ad7,null))[_0xf6ec('0x29')](removeEntity(_0x508ad7,null))['catch'](handleError(_0x508ad7,null));};exports[_0xf6ec('0x33')]=function(_0x480f26,_0x4cef1d){return db[_0xf6ec('0x32')][_0xf6ec('0x33')]()['then'](respondWithResult(_0x4cef1d,null))[_0xf6ec('0x48')](handleError(_0x4cef1d,null));};exports['addContacts']=function(_0x535440,_0x3371d2,_0x58c2c2){return db[_0xf6ec('0x58')][_0xf6ec('0x52')]({'where':{'id':_0x535440[_0xf6ec('0x4a')]['id']}})[_0xf6ec('0x29')](handleEntityNotFound(_0x3371d2,null))[_0xf6ec('0x29')](function(_0x34ce50){if(_0x34ce50){return _0x34ce50[_0xf6ec('0x59')](_0x535440[_0xf6ec('0x4e')][_0xf6ec('0x5a')],_[_0xf6ec('0x5b')](_0x535440['body'],[_0xf6ec('0x5a'),'id'])||{});}})[_0xf6ec('0x29')](respondWithResult(_0x3371d2,null))[_0xf6ec('0x48')](handleError(_0x3371d2,null));};exports[_0xf6ec('0x5c')]=function(_0x411401,_0x2088d7,_0x3b8236){var _0x21e133={};var _0xcd8aac={};var _0x19d124;var _0x331362;return db[_0xf6ec('0x32')][_0xf6ec('0x5d')]({'where':{'id':_0x411401['params']['id']}})[_0xf6ec('0x29')](handleEntityNotFound(_0x2088d7,null))[_0xf6ec('0x29')](function(_0x49d5a5){if(_0x49d5a5){_0x19d124=_0x49d5a5;_0xcd8aac[_0xf6ec('0x34')]=_['keys'](db[_0xf6ec('0x58')][_0xf6ec('0x4b')]);_0xcd8aac['query']=_[_0xf6ec('0x36')](_0x411401['query']);_0xcd8aac[_0xf6ec('0x37')]=_[_0xf6ec('0x38')](_0xcd8aac[_0xf6ec('0x34')],_0xcd8aac[_0xf6ec('0x35')]);_0x21e133[_0xf6ec('0x39')]=_[_0xf6ec('0x38')](_0xcd8aac[_0xf6ec('0x34')],qs['fields'](_0x411401[_0xf6ec('0x35')][_0xf6ec('0x3a')]));_0x21e133[_0xf6ec('0x39')]=_0x21e133['attributes'][_0xf6ec('0x3b')]?_0x21e133[_0xf6ec('0x39')]:_0xcd8aac['model'];_0x21e133[_0xf6ec('0x3d')]=qs[_0xf6ec('0x3e')](_0x411401[_0xf6ec('0x35')][_0xf6ec('0x3e')]);_0x21e133[_0xf6ec('0x40')]=qs['filters'](_['pick'](_0x411401[_0xf6ec('0x35')],_0xcd8aac[_0xf6ec('0x37')]));if(_0x411401['query'][_0xf6ec('0x43')]){_0x21e133[_0xf6ec('0x40')]=_['merge'](_0x21e133[_0xf6ec('0x40')],{'$or':_[_0xf6ec('0x42')](_0x21e133[_0xf6ec('0x39')],function(_0x42e62b){var _0x16730c={};_0x16730c[_0x42e62b]={'$like':'%'+_0x411401[_0xf6ec('0x35')]['filter']+'%'};return _0x16730c;})});}_0x21e133=_[_0xf6ec('0x41')]({},_0x21e133,_0x411401[_0xf6ec('0x4c')]);return _0x19d124['getContacts'](_0x21e133);}})[_0xf6ec('0x29')](function(_0x29f373){if(_0x29f373){_0x331362=_0x29f373['length'];if(!_0x411401['query'][_0xf6ec('0x3c')](_0xf6ec('0x5e'))){_0x21e133['limit']=qs[_0xf6ec('0x21')](_0x411401[_0xf6ec('0x35')][_0xf6ec('0x21')]);_0x21e133['offset']=qs[_0xf6ec('0x1f')](_0x411401[_0xf6ec('0x35')][_0xf6ec('0x1f')]);}return _0x19d124[_0xf6ec('0x5c')](_0x21e133);}})[_0xf6ec('0x29')](function(_0x15fcde){if(_0x15fcde){return _0x15fcde?{'count':_0x331362,'rows':_0x15fcde}:null;}})[_0xf6ec('0x29')](respondWithResult(_0x2088d7,null))[_0xf6ec('0x48')](handleError(_0x2088d7,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index ae9cc59..5b46c73 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 _0xaa23=['define','CmCompany','cm_companies','util','../../config/logger','api','moment','path','../../config/environment','./cmCompany.attributes'];(function(_0x1605a0,_0x11d5a2){var _0x1c279f=function(_0x520e69){while(--_0x520e69){_0x1605a0['push'](_0x1605a0['shift']());}};_0x1c279f(++_0x11d5a2);}(_0xaa23,0x157));var _0x3aa2=function(_0x3d368b,_0xbbc5db){_0x3d368b=_0x3d368b-0x0;var _0x579af1=_0xaa23[_0x3d368b];return _0x579af1;};'use strict';var _=require('lodash');var util=require(_0x3aa2('0x0'));var logger=require(_0x3aa2('0x1'))(_0x3aa2('0x2'));var moment=require(_0x3aa2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3aa2('0x4'));var rimraf=require('rimraf');var config=require(_0x3aa2('0x5'));var attributes=require(_0x3aa2('0x6'));module['exports']=function(_0x5a42f0,_0x5fac46){return _0x5a42f0[_0x3aa2('0x7')](_0x3aa2('0x8'),attributes,{'tableName':_0x3aa2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa2c=['cm_companies','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','CmCompany'];(function(_0x3941e6,_0x8f277f){var _0x3b363d=function(_0x4bffa4){while(--_0x4bffa4){_0x3941e6['push'](_0x3941e6['shift']());}};_0x3b363d(++_0x8f277f);}(_0xaa2c,0x9d));var _0xcaa2=function(_0x9a9f46,_0x1d1e25){_0x9a9f46=_0x9a9f46-0x0;var _0x5dc8be=_0xaa2c[_0x9a9f46];return _0x5dc8be;};'use strict';var _=require(_0xcaa2('0x0'));var util=require(_0xcaa2('0x1'));var logger=require('../../config/logger')(_0xcaa2('0x2'));var moment=require(_0xcaa2('0x3'));var BPromise=require(_0xcaa2('0x4'));var rp=require(_0xcaa2('0x5'));var fs=require('fs');var path=require(_0xcaa2('0x6'));var rimraf=require('rimraf');var config=require(_0xcaa2('0x7'));var attributes=require(_0xcaa2('0x8'));module[_0xcaa2('0x9')]=function(_0x57f517,_0x4ba08e){return _0x57f517['define'](_0xcaa2('0xa'),attributes,{'tableName':_0xcaa2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 016eda4..5a65160 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 _0x314d=['jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1fe705,_0x2ed051){var _0x41e937=function(_0x3cc23e){while(--_0x3cc23e){_0x1fe705['push'](_0x1fe705['shift']());}};_0x41e937(++_0x2ed051);}(_0x314d,0x186));var _0xd314=function(_0x59fc4d,_0x1187f5){_0x59fc4d=_0x59fc4d-0x0;var _0x253646=_0x314d[_0x59fc4d];return _0x253646;};'use strict';var _=require('lodash');var util=require(_0xd314('0x0'));var moment=require(_0xd314('0x1'));var BPromise=require(_0xd314('0x2'));var rs=require(_0xd314('0x3'));var fs=require('fs');var Redis=require(_0xd314('0x4'));var db=require(_0xd314('0x5'))['db'];var utils=require(_0xd314('0x6'));var logger=require(_0xd314('0x7'))(_0xd314('0x8'));var config=require(_0xd314('0x9'));var jayson=require(_0xd314('0xa'));var client=jayson[_0xd314('0xb')][_0xd314('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47db98,_0x2c736d,_0x4f2a02){return new BPromise(function(_0x422bfd,_0x55e525){return client[_0xd314('0xd')](_0x47db98,_0x4f2a02)[_0xd314('0xe')](function(_0x172e2b){logger['info'](_0xd314('0xf'),_0x2c736d,_0xd314('0x10'));logger[_0xd314('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2c736d,_0xd314('0x10'),JSON[_0xd314('0x12')](_0x172e2b));if(_0x172e2b['error']){if(_0x172e2b[_0xd314('0x13')][_0xd314('0x14')]===0x1f4){logger[_0xd314('0x13')]('CmCompany,\x20%s,\x20%s',_0x2c736d,_0x172e2b['error'][_0xd314('0x15')]);return _0x55e525(_0x172e2b[_0xd314('0x13')][_0xd314('0x15')]);}logger[_0xd314('0x13')](_0xd314('0xf'),_0x2c736d,_0x172e2b[_0xd314('0x13')][_0xd314('0x15')]);return _0x422bfd(_0x172e2b['error'][_0xd314('0x15')]);}else{logger[_0xd314('0x16')](_0xd314('0xf'),_0x2c736d,_0xd314('0x10'));_0x422bfd(_0x172e2b[_0xd314('0x17')][_0xd314('0x15')]);}})[_0xd314('0x18')](function(_0x48211b){logger[_0xd314('0x13')]('CmCompany,\x20%s,\x20%s',_0x2c736d,_0x48211b);_0x55e525(_0x48211b);});});}
\ No newline at end of file
+var _0x5c28=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x37f212,_0x3b31a0){var _0x5dcd8d=function(_0x1e2fc6){while(--_0x1e2fc6){_0x37f212['push'](_0x37f212['shift']());}};_0x5dcd8d(++_0x3b31a0);}(_0x5c28,0xb4));var _0x85c2=function(_0x1c4306,_0x45117e){_0x1c4306=_0x1c4306-0x0;var _0x3b233a=_0x5c28[_0x1c4306];return _0x3b233a;};'use strict';var _=require(_0x85c2('0x0'));var util=require(_0x85c2('0x1'));var moment=require(_0x85c2('0x2'));var BPromise=require(_0x85c2('0x3'));var rs=require(_0x85c2('0x4'));var fs=require('fs');var Redis=require(_0x85c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x85c2('0x6'));var logger=require(_0x85c2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x85c2('0x8'));var client=jayson[_0x85c2('0x9')][_0x85c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x504949,_0xd9d362,_0xff3a72){return new BPromise(function(_0x141eb3,_0x3c7639){return client[_0x85c2('0xb')](_0x504949,_0xff3a72)['then'](function(_0x55fa24){logger['info'](_0x85c2('0xc'),_0xd9d362,_0x85c2('0xd'));logger[_0x85c2('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0xd9d362,_0x85c2('0xd'),JSON[_0x85c2('0xf')](_0x55fa24));if(_0x55fa24[_0x85c2('0x10')]){if(_0x55fa24[_0x85c2('0x10')]['code']===0x1f4){logger['error'](_0x85c2('0xc'),_0xd9d362,_0x55fa24[_0x85c2('0x10')]['message']);return _0x3c7639(_0x55fa24[_0x85c2('0x10')]['message']);}logger['error'](_0x85c2('0xc'),_0xd9d362,_0x55fa24[_0x85c2('0x10')][_0x85c2('0x11')]);return _0x141eb3(_0x55fa24[_0x85c2('0x10')]['message']);}else{logger['info'](_0x85c2('0xc'),_0xd9d362,'request\x20sent');_0x141eb3(_0x55fa24[_0x85c2('0x12')][_0x85c2('0x11')]);}})[_0x85c2('0x13')](function(_0x310e28){logger[_0x85c2('0x10')]('CmCompany,\x20%s,\x20%s',_0xd9d362,_0x310e28);_0x3c7639(_0x310e28);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 28af114..04c56d0 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 _0xf0d2=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','destroy','multer','util','path'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xf0d2,0x14d));var _0x2f0d=function(_0x21bf17,_0x166806){_0x21bf17=_0x21bf17-0x0;var _0x35bd98=_0xf0d2[_0x21bf17];return _0x35bd98;};'use strict';var multer=require(_0x2f0d('0x0'));var util=require(_0x2f0d('0x1'));var path=require(_0x2f0d('0x2'));var timeout=require(_0x2f0d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2f0d('0x4'));var auth=require(_0x2f0d('0x5'));var interaction=require(_0x2f0d('0x6'));var config=require(_0x2f0d('0x7'));var controller=require(_0x2f0d('0x8'));router[_0x2f0d('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f0d('0xa')]);router[_0x2f0d('0x9')]('/describe',auth[_0x2f0d('0xb')](),controller['describe']);router['get'](_0x2f0d('0xc'),auth[_0x2f0d('0xb')](),controller[_0x2f0d('0xd')]);router[_0x2f0d('0x9')](_0x2f0d('0xe'),auth[_0x2f0d('0xb')](),controller[_0x2f0d('0xf')]);router[_0x2f0d('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2f0d('0x10')](_0x2f0d('0xe'),auth[_0x2f0d('0xb')](),controller[_0x2f0d('0x11')]);router[_0x2f0d('0x12')](_0x2f0d('0xc'),auth[_0x2f0d('0xb')](),controller[_0x2f0d('0x13')]);router['delete'](_0x2f0d('0xc'),auth['isAuthenticated'](),controller[_0x2f0d('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xc29f=['addContacts','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','/describe','/:id','show','get','getContacts','post','create','/:id/contacts'];(function(_0x2de92b,_0x4cc32e){var _0x240333=function(_0x58e274){while(--_0x58e274){_0x2de92b['push'](_0x2de92b['shift']());}};_0x240333(++_0x4cc32e);}(_0xc29f,0xac));var _0xfc29=function(_0x3fc306,_0x5a571f){_0x3fc306=_0x3fc306-0x0;var _0xba4556=_0xc29f[_0x3fc306];return _0xba4556;};'use strict';var multer=require(_0xfc29('0x0'));var util=require(_0xfc29('0x1'));var path=require(_0xfc29('0x2'));var timeout=require(_0xfc29('0x3'));var express=require(_0xfc29('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfc29('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfc29('0x6'));var controller=require(_0xfc29('0x7'));router['get']('/',auth[_0xfc29('0x8')](),controller['index']);router['get'](_0xfc29('0x9'),auth[_0xfc29('0x8')](),controller['describe']);router['get'](_0xfc29('0xa'),auth[_0xfc29('0x8')](),controller[_0xfc29('0xb')]);router[_0xfc29('0xc')]('/:id/contacts',auth[_0xfc29('0x8')](),controller[_0xfc29('0xd')]);router[_0xfc29('0xe')]('/',auth['isAuthenticated'](),controller[_0xfc29('0xf')]);router['post'](_0xfc29('0x10'),auth[_0xfc29('0x8')](),controller[_0xfc29('0x11')]);router[_0xfc29('0x12')](_0xfc29('0xa'),auth['isAuthenticated'](),controller[_0xfc29('0x13')]);router['delete']('/:id',auth[_0xfc29('0x8')](),controller[_0xfc29('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c9a8fdd..25b7c2a 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 _0xdcdf=['exports','STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash'];(function(_0xd839e7,_0x4209e9){var _0xc3cf23=function(_0x16ace2){while(--_0x16ace2){_0xd839e7['push'](_0xd839e7['shift']());}};_0xc3cf23(++_0x4209e9);}(_0xdcdf,0xe6));var _0xfdcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdcdf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfdcd('0x0'));var Sequelize=require('sequelize');module[_0xfdcd('0x1')]={'firstName':{'type':Sequelize[_0xfdcd('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfdcd('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfdcd('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xfdcd('0x2')]},'description':{'type':Sequelize[_0xfdcd('0x3')]},'phone':{'type':Sequelize[_0xfdcd('0x2')]},'mobile':{'type':Sequelize[_0xfdcd('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xfdcd('0x2')]},'url':{'type':Sequelize[_0xfdcd('0x2')]},'facebook':{'type':Sequelize[_0xfdcd('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xfdcd('0x2')]},'line':{'type':Sequelize[_0xfdcd('0x2')]},'wechat':{'type':Sequelize[_0xfdcd('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xfdcd('0x4')](0x2)[_0xfdcd('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xfdcd('0x6')]}};
\ No newline at end of file
+var _0x1c73=['exports','STRING','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x2766b4,_0xb9c42c){var _0x3c72ba=function(_0x3c4117){while(--_0x3c4117){_0x2766b4['push'](_0x2766b4['shift']());}};_0x3c72ba(++_0xb9c42c);}(_0x1c73,0xde));var _0x31c7=function(_0x126c2f,_0x19a958){_0x126c2f=_0x126c2f-0x0;var _0x421c3a=_0x1c73[_0x126c2f];return _0x421c3a;};'use strict';var _=require(_0x31c7('0x0'));var Sequelize=require(_0x31c7('0x1'));module[_0x31c7('0x2')]={'firstName':{'type':Sequelize[_0x31c7('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x31c7('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x31c7('0x3')]},'country':{'type':Sequelize[_0x31c7('0x3')]},'dateOfBirth':{'type':Sequelize[_0x31c7('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x31c7('0x3')]},'mobile':{'type':Sequelize[_0x31c7('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x31c7('0x3')]},'facebook':{'type':Sequelize[_0x31c7('0x3')]},'fb_data':{'type':Sequelize[_0x31c7('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x31c7('0x3')]},'teams':{'type':Sequelize[_0x31c7('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x31c7('0x3')]},'telegram':{'type':Sequelize[_0x31c7('0x3')]},'UserId':{'type':Sequelize[_0x31c7('0x4')]},'priority':{'type':Sequelize[_0x31c7('0x4')](0x2)[_0x31c7('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x31c7('0x6')],'defaultValue':Sequelize[_0x31c7('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 1f707fd..ab6c52f 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 _0xe04b=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./cmContact.socket','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','describe','length','keys','cf_','push','CmCustomField','findOne','all','type','query','filters','model','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','field','color','from','select','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','parseSearch','sqlOperator','conditions','find','value','map','forEach','union','User','and','uc.UserId\x20=\x20?','fieldType','datetime','castTo','DATE','buildExpression','text','start','isNil','Contact','isEmpty','ListId','concat','\x20=\x20?','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','fields','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','destroy','CmContact','params','tags','startsWith','columnName','displayName','findAll','custom','catch','merge','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','bulkCreate','each','duplicates','findOrCreate','spread','show','Tag','omit','cf_%d','$and','pickBy','table','cm_contacts','setFields','id\x20=\x20?','values','phone','getTags','rawAttributes','pick','setTags','ids','getHoppers','options','includeAll','include','rows','ContactId','getHopperFinals','getJscriptySessions','uploadCsv','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','firstName','join','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','parse','meta','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','mail','chat','openchannel','fax','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','UserId','fullname','createdAt','findAndCountAll','alias','startCase','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','customerPort','osName','ratingMessage','ratingType','referer','substatus','externalUrl','Interaction','sortBy','reverse','slice','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x428618,_0x993295){var _0x3e9d26=function(_0x3e2975){while(--_0x3e2975){_0x428618['push'](_0x428618['shift']());}};_0x3e9d26(++_0x993295);}(_0xe04b,0x112));var _0xbe04=function(_0x5e7f62,_0x5ba327){_0x5e7f62=_0x5e7f62-0x0;var _0x4626ab=_0xe04b[_0x5e7f62];return _0x4626ab;};'use strict';var emlformat=require(_0xbe04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe04('0x1'));var jsonpatch=require(_0xbe04('0x2'));var rp=require(_0xbe04('0x3'));var moment=require(_0xbe04('0x4'));var BPromise=require(_0xbe04('0x5'));var Mustache=require(_0xbe04('0x6'));var util=require(_0xbe04('0x7'));var path=require(_0xbe04('0x8'));var sox=require(_0xbe04('0x9'));var csv=require(_0xbe04('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe04('0xb'));var _=require(_0xbe04('0xc'));var squel=require(_0xbe04('0xd'));var crypto=require(_0xbe04('0xe'));var jsforce=require(_0xbe04('0xf'));var deskjs=require(_0xbe04('0x10'));var toCsv=require(_0xbe04('0xa'));var querystring=require(_0xbe04('0x11'));var Papa=require(_0xbe04('0x12'));var Redis=require(_0xbe04('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbe04('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe04('0x15'));var logger=require(_0xbe04('0x16'))('api');var utils=require(_0xbe04('0x17'));var config=require(_0xbe04('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xbe04('0x19')](config['redis'],{'host':_0xbe04('0x1a'),'port':0x18eb});var socket=require(_0xbe04('0x1b'))(new Redis(config[_0xbe04('0x1c')]));require(_0xbe04('0x1d'))['register'](socket);function respondWithStatusCode(_0x488a45,_0x59e21d){_0x59e21d=_0x59e21d||0xcc;return function(_0x153e76){if(_0x153e76){return _0x488a45[_0xbe04('0x1e')](_0x59e21d);}return _0x488a45[_0xbe04('0x1f')](_0x59e21d)['end']();};}function respondWithResult(_0x3d7cdc,_0x11e237){_0x11e237=_0x11e237||0xc8;return function(_0x3d8f64){if(_0x3d8f64){return _0x3d7cdc[_0xbe04('0x1f')](_0x11e237)[_0xbe04('0x20')](_0x3d8f64);}};}function respondWithFilteredResult(_0x4ba96f,_0xc14403){return function(_0x466efd){if(_0x466efd){var _0x4df6b5=typeof _0xc14403[_0xbe04('0x21')]==='undefined'&&typeof _0xc14403[_0xbe04('0x22')]===_0xbe04('0x23');var _0x87bff5=_0x466efd[_0xbe04('0x24')];var _0x1c3563=_0x4df6b5?0x0:_0xc14403['offset'];var _0x691809=_0x4df6b5?_0x466efd[_0xbe04('0x24')]:_0xc14403[_0xbe04('0x21')]+_0xc14403[_0xbe04('0x22')];var _0x1dfd1d;if(_0x691809>=_0x87bff5){_0x691809=_0x87bff5;_0x1dfd1d=0xc8;}else{_0x1dfd1d=0xce;}_0x4ba96f[_0xbe04('0x1f')](_0x1dfd1d);return _0x4ba96f['set'](_0xbe04('0x25'),_0x1c3563+'-'+_0x691809+'/'+_0x87bff5)[_0xbe04('0x20')](_0x466efd);}return null;};}function patchUpdates(_0x5d08c6){return function(_0x4d9229){try{jsonpatch[_0xbe04('0x26')](_0x4d9229,_0x5d08c6,!![]);}catch(_0x3c00e5){return BPromise[_0xbe04('0x27')](_0x3c00e5);}return _0x4d9229[_0xbe04('0x28')]();};}function saveUpdates(_0x48d411,_0x504773){return function(_0x9f9223){if(_0x9f9223){return _0x9f9223[_0xbe04('0x29')](_0x48d411)[_0xbe04('0x2a')](function(_0x15bedb){return _0x15bedb;});}return null;};}function removeEntity(_0x3c94ba,_0x4f9514){return function(_0x12ebc1){if(_0x12ebc1){return _0x12ebc1['destroy']()[_0xbe04('0x2a')](function(){_0x3c94ba['status'](0xcc)[_0xbe04('0x2b')]();});}};}function handleEntityNotFound(_0x4ccb90,_0x33c380){return function(_0x481b14){if(!_0x481b14){_0x4ccb90[_0xbe04('0x1e')](0x194);}return _0x481b14;};}function handleError(_0x10ff8f,_0x2bcf45){_0x2bcf45=_0x2bcf45||0x1f4;return function(_0x27f4c3){logger[_0xbe04('0x2c')](_0x27f4c3[_0xbe04('0x2d')]);if(_0x27f4c3[_0xbe04('0x2e')]){delete _0x27f4c3[_0xbe04('0x2e')];}_0x10ff8f[_0xbe04('0x1f')](_0x2bcf45)[_0xbe04('0x2f')](_0x27f4c3);};}exports[_0xbe04('0x30')]=function(_0x258d84,_0x29197f){var _0xf4f753={},_0x48d9c3={},_0x2f5815={'count':0x0,'rows':[]};return db['CmContact'][_0xbe04('0x31')]()[_0xbe04('0x2a')](function(_0x50e5e8){var _0x41fc8b=[];for(var _0x5e4e7e=0x0;_0x5e4e7e
','Attachments','Title','getHost','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','email','../../../config/environment','address','anonymous'];(function(_0x30ff6e,_0x1b64d7){var _0x2f68fa=function(_0x4f08ca){while(--_0x4f08ca){_0x30ff6e['push'](_0x30ff6e['shift']());}};_0x2f68fa(++_0x1b64d7);}(_0xa057,0x123));var _0x7a05=function(_0x173147,_0x17d723){_0x173147=_0x173147-0x0;var _0x236b2b=_0xa057[_0x173147];return _0x236b2b;};'use strict';var _=require(_0x7a05('0x0'));var moment=require(_0x7a05('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x7a05('0x2'));var util=require(_0x7a05('0x3'));var tnef=require(_0x7a05('0x4'));var logger=require('../../../config/logger')(_0x7a05('0x5'));var config=require(_0x7a05('0x6'));function getAddress(_0x5404f2){var _0x435a35=_['head'](_0x5404f2['value']);return _0x435a35&&_0x435a35[_0x7a05('0x7')]?_0x435a35[_0x7a05('0x7')]:_0x7a05('0x8')+random['generate'](0x6)+_0x7a05('0x9');}function getFirstName(_0x2135d2){var _0x93ca4a=_['head'](_0x2135d2[_0x7a05('0xa')]);if(_0x93ca4a&&_0x93ca4a[_0x7a05('0xb')]){if(_0x93ca4a[_0x7a05('0xb')]==_0x93ca4a[_0x7a05('0x7')]){return _0x93ca4a[_0x7a05('0xb')][_0x7a05('0xc')](0x0,_0x93ca4a['name'][_0x7a05('0xd')]('@'));}var _0x463a80=_0x93ca4a['name']['split'](/\s+/);return _0x463a80[_0x7a05('0xe')]>0x1?_0x463a80[_0x7a05('0xf')](0x0,-0x1)['join']('\x20'):_0x93ca4a['name'];}return'Anonymous';}function getLastName(_0x21415c){var _0x4efea=_[_0x7a05('0x10')](_0x21415c[_0x7a05('0xa')]);if(_0x4efea&&_0x4efea[_0x7a05('0xb')]){var _0x351ac2=_0x4efea[_0x7a05('0xb')][_0x7a05('0x11')](/\s+/);return _0x351ac2['length']>0x1?_0x351ac2['pop']():'';}return'';}function getMails(_0x37d394,_0x8ad482){var _0x480c8b='';for(var _0x5ad0e6=0x0;_0x5ad0e6<_0x8ad482[_0x7a05('0xa')]['length'];_0x5ad0e6+=0x1){if(_0x8ad482[_0x7a05('0xa')][_0x5ad0e6][_0x7a05('0x7')]!==_0x37d394){if(!_[_0x7a05('0x12')](_0x480c8b)){_0x480c8b+=',';}_0x480c8b+=_0x8ad482['value'][_0x5ad0e6]['name']||_0x8ad482[_0x7a05('0xa')][_0x5ad0e6]['address']||'';_0x480c8b+='\x20<';_0x480c8b+=_0x8ad482[_0x7a05('0xa')][_0x5ad0e6][_0x7a05('0x7')]?_0x8ad482['value'][_0x5ad0e6]['address']:'anonymous'+random[_0x7a05('0x13')](0x6)+_0x7a05('0x9');_0x480c8b+='>';}}return _0x480c8b;}function parseEmail(_0x443f33,_0x288581,_0x4f385d){if(_0x288581[_0x7a05('0x14')]){var _0x391ecf=/