From: support
Date: Thu, 16 Mar 2023 14:49:30 +0000 (+0000)
Subject: Built motion from commit 1efd3d96.|2.6.31
X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=1a5cfa1823c039b2b8b7fbf096e685b0fbbfb05c;p=motion2.git
Built motion from commit 1efd3d96.|2.6.31
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index fce271d..9ab4ae0 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-15T10:38:25.011Z",
+ "time": "2023-03-16T14:40:30.384Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index ec2b1e0..6753c04 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-15T10:38:25.011Z",
+ "time": "2023-03-16T14:40:30.384Z",
"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 a0e2772..339ff2a 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 _0x19d0=['getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL'];(function(_0x1a09b9,_0x2c9f0a){var _0xe67872=function(_0x38f8d6){while(--_0x38f8d6){_0x1a09b9['push'](_0x1a09b9['shift']());}};_0xe67872(++_0x2c9f0a);}(_0x19d0,0xd9));var _0x019d=function(_0x1c96d3,_0x2448d3){_0x1c96d3=_0x1c96d3-0x0;var _0x452cbe=_0x19d0[_0x1c96d3];return _0x452cbe;};'use strict';var Sequelize=require(_0x019d('0x0'));module[_0x019d('0x1')]={'name':{'type':Sequelize[_0x019d('0x2')],'get':function(_0x35ec9){return this[_0x019d('0x3')](_0x019d('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x019d('0x5'),_0x019d('0x6'),_0x019d('0x7'),_0x019d('0x8'),_0x019d('0x9'),_0x019d('0xa'),_0x019d('0xb'),_0x019d('0xc')]],'msg':_0x019d('0xd')}},'comment':_0x019d('0xd')},'data1':{'type':Sequelize[_0x019d('0xe')](0x1000),'comment':_0x019d('0xf')},'data2':{'type':Sequelize[_0x019d('0xe')](0x1000),'comment':_0x019d('0x10')},'data3':{'type':Sequelize[_0x019d('0xe')](0x1000),'comment':_0x019d('0x11')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x019d('0x12')},'data5':{'type':Sequelize[_0x019d('0xe')](0x1000),'comments':_0x019d('0x13')},'data6':{'type':Sequelize[_0x019d('0xe')],'comments':_0x019d('0x14')},'data7':{'type':Sequelize[_0x019d('0x15')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xf8ba=['integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT','urlForward[body]','exports','VIRTUAL','action','contactManager'];(function(_0x484a4d,_0x31f4b3){var _0x515e22=function(_0xc93ff4){while(--_0xc93ff4){_0x484a4d['push'](_0x484a4d['shift']());}};_0x515e22(++_0x31f4b3);}(_0xf8ba,0x1a5));var _0xaf8b=function(_0x5e01ca,_0x2e113e){_0x5e01ca=_0x5e01ca-0x0;var _0x482dcd=_0xf8ba[_0x5e01ca];return _0x482dcd;};'use strict';var Sequelize=require('sequelize');module[_0xaf8b('0x0')]={'name':{'type':Sequelize[_0xaf8b('0x1')],'get':function(_0x417560){return this['getDataValue'](_0xaf8b('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xaf8b('0x3'),_0xaf8b('0x4'),_0xaf8b('0x5'),_0xaf8b('0x6'),_0xaf8b('0x7'),'browser',_0xaf8b('0x8'),_0xaf8b('0x9')]],'msg':_0xaf8b('0xa')}},'comment':_0xaf8b('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xaf8b('0xb')},'data2':{'type':Sequelize[_0xaf8b('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xaf8b('0xc')](0x1000),'comment':_0xaf8b('0xd')},'data4':{'type':Sequelize[_0xaf8b('0xc')](0x1000),'comments':_0xaf8b('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xaf8b('0xc')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xaf8b('0xf')],'comments':_0xaf8b('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 82b6d15..1519fe5 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 _0xccd7=['../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','end','stack','name','update','find','params','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5e6bae,_0x51f5ee){var _0x5f5a34=function(_0x30d270){while(--_0x30d270){_0x5e6bae['push'](_0x5e6bae['shift']());}};_0x5f5a34(++_0x51f5ee);}(_0xccd7,0x131));var _0x7ccd=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0xccd7[_0x3e69ae];return _0x3d7f42;};'use strict';var emlformat=require(_0x7ccd('0x0'));var rimraf=require(_0x7ccd('0x1'));var zipdir=require(_0x7ccd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ccd('0x3'));var moment=require(_0x7ccd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7ccd('0x5'));var util=require(_0x7ccd('0x6'));var path=require('path');var sox=require(_0x7ccd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ccd('0x8'));var _=require(_0x7ccd('0x9'));var squel=require(_0x7ccd('0xa'));var crypto=require(_0x7ccd('0xb'));var jsforce=require(_0x7ccd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7ccd('0xd'));var Papa=require(_0x7ccd('0xe'));var Redis=require(_0x7ccd('0xf'));var authService=require(_0x7ccd('0x10'));var qs=require(_0x7ccd('0x11'));var as=require(_0x7ccd('0x12'));var hardwareService=require(_0x7ccd('0x13'));var logger=require(_0x7ccd('0x14'))(_0x7ccd('0x15'));var utils=require(_0x7ccd('0x16'));var config=require(_0x7ccd('0x17'));var licenseUtil=require(_0x7ccd('0x18'));var db=require(_0x7ccd('0x19'))['db'];function respondWithStatusCode(_0x613845,_0x2773d4){_0x2773d4=_0x2773d4||0xcc;return function(_0x41ca46){if(_0x41ca46){return _0x613845[_0x7ccd('0x1a')](_0x2773d4);}return _0x613845['status'](_0x2773d4)['end']();};}function respondWithResult(_0x2aad7b,_0x2e9144){_0x2e9144=_0x2e9144||0xc8;return function(_0x35f603){if(_0x35f603){return _0x2aad7b[_0x7ccd('0x1b')](_0x2e9144)[_0x7ccd('0x1c')](_0x35f603);}};}function respondWithFilteredResult(_0x695ffb,_0x116cc9){return function(_0x3f798f){if(_0x3f798f){var _0x117dab=typeof _0x116cc9['offset']===_0x7ccd('0x1d')&&typeof _0x116cc9[_0x7ccd('0x1e')]==='undefined';var _0x2f95cd=_0x3f798f[_0x7ccd('0x1f')];var _0x19b648=_0x117dab?0x0:_0x116cc9[_0x7ccd('0x20')];var _0x4fb9e3=_0x117dab?_0x3f798f['count']:_0x116cc9['offset']+_0x116cc9['limit'];var _0x1881d0;if(_0x4fb9e3>=_0x2f95cd){_0x4fb9e3=_0x2f95cd;_0x1881d0=0xc8;}else{_0x1881d0=0xce;}_0x695ffb['status'](_0x1881d0);return _0x695ffb[_0x7ccd('0x21')](_0x7ccd('0x22'),_0x19b648+'-'+_0x4fb9e3+'/'+_0x2f95cd)[_0x7ccd('0x1c')](_0x3f798f);}return null;};}function patchUpdates(_0x136815){return function(_0x1446a7){try{jsonpatch[_0x7ccd('0x23')](_0x1446a7,_0x136815,!![]);}catch(_0x3e4d0b){return BPromise[_0x7ccd('0x24')](_0x3e4d0b);}return _0x1446a7[_0x7ccd('0x25')]();};}function saveUpdates(_0x1ba9ad,_0x5a1d66){return function(_0x3e91dc){if(_0x3e91dc){return _0x3e91dc['update'](_0x1ba9ad)[_0x7ccd('0x26')](function(_0x2eaa40){return _0x2eaa40;});}return null;};}function removeEntity(_0x2cd009,_0x3b75be){return function(_0x49bcf4){if(_0x49bcf4){return _0x49bcf4['destroy']()[_0x7ccd('0x26')](function(){_0x2cd009[_0x7ccd('0x1b')](0xcc)[_0x7ccd('0x27')]();});}};}function handleEntityNotFound(_0x2f7c14,_0x537c90){return function(_0x983b0c){if(!_0x983b0c){_0x2f7c14['sendStatus'](0x194);}return _0x983b0c;};}function handleError(_0x288237,_0x2397b5){_0x2397b5=_0x2397b5||0x1f4;return function(_0x107b2d){logger['error'](_0x107b2d[_0x7ccd('0x28')]);if(_0x107b2d['name']){delete _0x107b2d[_0x7ccd('0x29')];}_0x288237[_0x7ccd('0x1b')](_0x2397b5)['send'](_0x107b2d);};}exports[_0x7ccd('0x2a')]=function(_0x17522d,_0x2e2cf3){if(_0x17522d['body']['id']){delete _0x17522d['body']['id'];}return db['Action'][_0x7ccd('0x2b')]({'where':{'id':_0x17522d[_0x7ccd('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2e2cf3,null))[_0x7ccd('0x26')](saveUpdates(_0x17522d['body'],null))[_0x7ccd('0x26')](respondWithResult(_0x2e2cf3,null))[_0x7ccd('0x2d')](handleError(_0x2e2cf3,null));};exports[_0x7ccd('0x2e')]=function(_0x319b23,_0x483750){return db['Action'][_0x7ccd('0x2b')]({'where':{'id':_0x319b23[_0x7ccd('0x2c')]['id']}})['then'](handleEntityNotFound(_0x483750,null))[_0x7ccd('0x26')](removeEntity(_0x483750,null))[_0x7ccd('0x2d')](handleError(_0x483750,null));};
\ No newline at end of file
+var _0xfbfd=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js'];(function(_0x18fed5,_0x2da9e1){var _0x2a9166=function(_0x20fa39){while(--_0x20fa39){_0x18fed5['push'](_0x18fed5['shift']());}};_0x2a9166(++_0x2da9e1);}(_0xfbfd,0x16a));var _0xdfbf=function(_0x36fd68,_0x1ad27a){_0x36fd68=_0x36fd68-0x0;var _0x2a4a8e=_0xfbfd[_0x36fd68];return _0x2a4a8e;};'use strict';var emlformat=require(_0xdfbf('0x0'));var rimraf=require(_0xdfbf('0x1'));var zipdir=require(_0xdfbf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfbf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdfbf('0x4'));var util=require(_0xdfbf('0x5'));var path=require(_0xdfbf('0x6'));var sox=require(_0xdfbf('0x7'));var csv=require(_0xdfbf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfbf('0x9'));var squel=require(_0xdfbf('0xa'));var crypto=require(_0xdfbf('0xb'));var jsforce=require(_0xdfbf('0xc'));var deskjs=require(_0xdfbf('0xd'));var toCsv=require(_0xdfbf('0x8'));var querystring=require(_0xdfbf('0xe'));var Papa=require('papaparse');var Redis=require(_0xdfbf('0xf'));var authService=require(_0xdfbf('0x10'));var qs=require(_0xdfbf('0x11'));var as=require(_0xdfbf('0x12'));var hardwareService=require(_0xdfbf('0x13'));var logger=require('../../config/logger')(_0xdfbf('0x14'));var utils=require(_0xdfbf('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdfbf('0x16'))['db'];function respondWithStatusCode(_0x562e3a,_0x537ca9){_0x537ca9=_0x537ca9||0xcc;return function(_0x55dcc8){if(_0x55dcc8){return _0x562e3a[_0xdfbf('0x17')](_0x537ca9);}return _0x562e3a[_0xdfbf('0x18')](_0x537ca9)['end']();};}function respondWithResult(_0x40a4c8,_0x539a6f){_0x539a6f=_0x539a6f||0xc8;return function(_0x1620fc){if(_0x1620fc){return _0x40a4c8['status'](_0x539a6f)[_0xdfbf('0x19')](_0x1620fc);}};}function respondWithFilteredResult(_0x5edd48,_0x57af68){return function(_0x2133ab){if(_0x2133ab){var _0x588dfe=typeof _0x57af68[_0xdfbf('0x1a')]===_0xdfbf('0x1b')&&typeof _0x57af68[_0xdfbf('0x1c')]===_0xdfbf('0x1b');var _0x3b92fd=_0x2133ab[_0xdfbf('0x1d')];var _0x46a34a=_0x588dfe?0x0:_0x57af68['offset'];var _0x2033c5=_0x588dfe?_0x2133ab['count']:_0x57af68['offset']+_0x57af68[_0xdfbf('0x1c')];var _0x26b956;if(_0x2033c5>=_0x3b92fd){_0x2033c5=_0x3b92fd;_0x26b956=0xc8;}else{_0x26b956=0xce;}_0x5edd48[_0xdfbf('0x18')](_0x26b956);return _0x5edd48[_0xdfbf('0x1e')](_0xdfbf('0x1f'),_0x46a34a+'-'+_0x2033c5+'/'+_0x3b92fd)[_0xdfbf('0x19')](_0x2133ab);}return null;};}function patchUpdates(_0x3f7c8e){return function(_0x3ae7e4){try{jsonpatch[_0xdfbf('0x20')](_0x3ae7e4,_0x3f7c8e,!![]);}catch(_0x63a3c3){return BPromise[_0xdfbf('0x21')](_0x63a3c3);}return _0x3ae7e4[_0xdfbf('0x22')]();};}function saveUpdates(_0x5d5562,_0x9451db){return function(_0x3daa9d){if(_0x3daa9d){return _0x3daa9d[_0xdfbf('0x23')](_0x5d5562)[_0xdfbf('0x24')](function(_0x2658c9){return _0x2658c9;});}return null;};}function removeEntity(_0x239e24,_0x1a0e15){return function(_0x44bb6d){if(_0x44bb6d){return _0x44bb6d[_0xdfbf('0x25')]()[_0xdfbf('0x24')](function(){_0x239e24[_0xdfbf('0x18')](0xcc)[_0xdfbf('0x26')]();});}};}function handleEntityNotFound(_0x2ce93,_0x22c826){return function(_0x2dac07){if(!_0x2dac07){_0x2ce93[_0xdfbf('0x17')](0x194);}return _0x2dac07;};}function handleError(_0x300d07,_0x3bf538){_0x3bf538=_0x3bf538||0x1f4;return function(_0x4ca444){logger['error'](_0x4ca444[_0xdfbf('0x27')]);if(_0x4ca444[_0xdfbf('0x28')]){delete _0x4ca444[_0xdfbf('0x28')];}_0x300d07[_0xdfbf('0x18')](_0x3bf538)[_0xdfbf('0x29')](_0x4ca444);};}exports['update']=function(_0x70620e,_0xae79d9){if(_0x70620e[_0xdfbf('0x2a')]['id']){delete _0x70620e[_0xdfbf('0x2a')]['id'];}return db[_0xdfbf('0x2b')][_0xdfbf('0x2c')]({'where':{'id':_0x70620e[_0xdfbf('0x2d')]['id']}})[_0xdfbf('0x24')](handleEntityNotFound(_0xae79d9,null))['then'](saveUpdates(_0x70620e[_0xdfbf('0x2a')],null))[_0xdfbf('0x24')](respondWithResult(_0xae79d9,null))[_0xdfbf('0x2e')](handleError(_0xae79d9,null));};exports[_0xdfbf('0x25')]=function(_0xabb69c,_0x3078ac){return db[_0xdfbf('0x2b')]['find']({'where':{'id':_0xabb69c[_0xdfbf('0x2d')]['id']}})[_0xdfbf('0x24')](handleEntityNotFound(_0x3078ac,null))[_0xdfbf('0x24')](removeEntity(_0x3078ac,null))[_0xdfbf('0x2e')](handleError(_0x3078ac,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index ca3b5bb..c07c909 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 _0x854f=['../../config/logger','api','moment','bluebird','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util'];(function(_0x5a6ffd,_0x4ad38c){var _0x375ef2=function(_0x412850){while(--_0x412850){_0x5a6ffd['push'](_0x5a6ffd['shift']());}};_0x375ef2(++_0x4ad38c);}(_0x854f,0xc1));var _0xf854=function(_0x407853,_0x1a6796){_0x407853=_0x407853-0x0;var _0x4dcfb3=_0x854f[_0x407853];return _0x4dcfb3;};'use strict';var _=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var logger=require(_0xf854('0x2'))(_0xf854('0x3'));var moment=require(_0xf854('0x4'));var BPromise=require(_0xf854('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf854('0x6'));var rimraf=require('rimraf');var config=require(_0xf854('0x7'));var attributes=require(_0xf854('0x8'));module[_0xf854('0x9')]=function(_0x1f5ec4,_0x4b1ca8){return _0x1f5ec4[_0xf854('0xa')](_0xf854('0xb'),attributes,{'tableName':_0xf854('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed2a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x118957,_0x302de7){var _0x5b14e6=function(_0x85b0eb){while(--_0x85b0eb){_0x118957['push'](_0x118957['shift']());}};_0x5b14e6(++_0x302de7);}(_0xed2a,0xc2));var _0xaed2=function(_0x36ac10,_0x4176b5){_0x36ac10=_0x36ac10-0x0;var _0x527b0f=_0xed2a[_0x36ac10];return _0x527b0f;};'use strict';var _=require('lodash');var util=require(_0xaed2('0x0'));var logger=require(_0xaed2('0x1'))(_0xaed2('0x2'));var moment=require(_0xaed2('0x3'));var BPromise=require(_0xaed2('0x4'));var rp=require(_0xaed2('0x5'));var fs=require('fs');var path=require(_0xaed2('0x6'));var rimraf=require(_0xaed2('0x7'));var config=require(_0xaed2('0x8'));var attributes=require(_0xaed2('0x9'));module[_0xaed2('0xa')]=function(_0x20aa10,_0x32972d){return _0x20aa10[_0xaed2('0xb')](_0xaed2('0xc'),attributes,{'tableName':_0xaed2('0xd'),'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 2b70a8b..986649d 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1a0d69,_0x102561){var _0x1337e3=function(_0x3e7753){while(--_0x3e7753){_0x1a0d69['push'](_0x1a0d69['shift']());}};_0x1337e3(++_0x102561);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'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')]('Action,\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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1dfd62,_0x57aa2f){var _0x2db5a9=function(_0x240b48){while(--_0x240b48){_0x1dfd62['push'](_0x1dfd62['shift']());}};_0x2db5a9(++_0x57aa2f);}(_0x326f,0xd1));var _0xf326=function(_0x2863ba,_0x4df8bb){_0x2863ba=_0x2863ba-0x0;var _0x51cf7f=_0x326f[_0x2863ba];return _0x51cf7f;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 433b9fb..b75ab2a 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 _0xa566=['exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','delete','destroy'];(function(_0x43e8b0,_0x3e6cd5){var _0x136980=function(_0x26359f){while(--_0x26359f){_0x43e8b0['push'](_0x43e8b0['shift']());}};_0x136980(++_0x3e6cd5);}(_0xa566,0xcd));var _0x6a56=function(_0x5e64e4,_0x2de132){_0x5e64e4=_0x5e64e4-0x0;var _0x591b4d=_0xa566[_0x5e64e4];return _0x591b4d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a56('0x0'));var timeout=require('connect-timeout');var express=require(_0x6a56('0x1'));var router=express[_0x6a56('0x2')]();var fs_extra=require(_0x6a56('0x3'));var auth=require(_0x6a56('0x4'));var interaction=require(_0x6a56('0x5'));var config=require(_0x6a56('0x6'));var controller=require('./action.controller');router[_0x6a56('0x7')](_0x6a56('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x6a56('0x9')](_0x6a56('0x8'),auth['isAuthenticated'](),controller[_0x6a56('0xa')]);module[_0x6a56('0xb')]=router;
\ No newline at end of file
+var _0x9388=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','/:id','isAuthenticated','destroy'];(function(_0x1d3577,_0x17a32e){var _0x277d9a=function(_0x4b4144){while(--_0x4b4144){_0x1d3577['push'](_0x1d3577['shift']());}};_0x277d9a(++_0x17a32e);}(_0x9388,0x1f0));var _0x8938=function(_0xcb63c3,_0x1769ac){_0xcb63c3=_0xcb63c3-0x0;var _0x3fdc0e=_0x9388[_0xcb63c3];return _0x3fdc0e;};'use strict';var multer=require(_0x8938('0x0'));var util=require(_0x8938('0x1'));var path=require(_0x8938('0x2'));var timeout=require('connect-timeout');var express=require(_0x8938('0x3'));var router=express[_0x8938('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8938('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8938('0x6'));var controller=require('./action.controller');router['put'](_0x8938('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8938('0x7'),auth[_0x8938('0x8')](),controller[_0x8938('0x9')]);module[_0x8938('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 4fce374..62cccca 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 _0x207c=['STRING','TEXT','exports'];(function(_0x10dddb,_0x2de7c0){var _0xeb738f=function(_0x1fb52c){while(--_0x1fb52c){_0x10dddb['push'](_0x10dddb['shift']());}};_0xeb738f(++_0x2de7c0);}(_0x207c,0x1e8));var _0xc207=function(_0x289e48,_0x2fe387){_0x289e48=_0x289e48-0x0;var _0x56d497=_0x207c[_0x289e48];return _0x56d497;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}};
\ No newline at end of file
+var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x46ed,0x168));var _0xd46e=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x46ed[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 51c11a4..7fc7351 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 _0x66d4=['join','cross_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','Sequelize','keyBy','from','metric','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','fork','output','../../files/reports','countTable','COUNT(*)','QueryTypes','SELECT','run','alias','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','get','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize'];(function(_0xb38a96,_0xfeb8f0){var _0x1a362a=function(_0x57d24a){while(--_0x57d24a){_0xb38a96['push'](_0xb38a96['shift']());}};_0x1a362a(++_0xfeb8f0);}(_0x66d4,0x174));var _0x466d=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x66d4[_0x4c2f17];return _0x20919e;};'use strict';var emlformat=require(_0x466d('0x0'));var rimraf=require(_0x466d('0x1'));var zipdir=require(_0x466d('0x2'));var jsonpatch=require(_0x466d('0x3'));var rp=require(_0x466d('0x4'));var moment=require(_0x466d('0x5'));var BPromise=require(_0x466d('0x6'));var Mustache=require(_0x466d('0x7'));var util=require(_0x466d('0x8'));var path=require(_0x466d('0x9'));var sox=require(_0x466d('0xa'));var csv=require(_0x466d('0xb'));var ejs=require(_0x466d('0xc'));var fs=require('fs');var fs_extra=require(_0x466d('0xd'));var _=require(_0x466d('0xe'));var squel=require(_0x466d('0xf'));var crypto=require(_0x466d('0x10'));var jsforce=require(_0x466d('0x11'));var deskjs=require(_0x466d('0x12'));var toCsv=require(_0x466d('0xb'));var querystring=require(_0x466d('0x13'));var Papa=require(_0x466d('0x14'));var Redis=require(_0x466d('0x15'));var authService=require(_0x466d('0x16'));var qs=require(_0x466d('0x17'));var as=require(_0x466d('0x18'));var hardwareService=require(_0x466d('0x19'));var logger=require(_0x466d('0x1a'))('api');var utils=require(_0x466d('0x1b'));var config=require(_0x466d('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x466d('0x1d'))['db'];var dbH=require('../../mysqldb')[_0x466d('0x1e')];function respondWithStatusCode(_0x1ca278,_0x435466){_0x435466=_0x435466||0xcc;return function(_0x493499){if(_0x493499){return _0x1ca278[_0x466d('0x1f')](_0x435466);}return _0x1ca278[_0x466d('0x20')](_0x435466)['end']();};}function respondWithResult(_0x127b24,_0x1be2dd){_0x1be2dd=_0x1be2dd||0xc8;return function(_0x1fcbcc){if(_0x1fcbcc){return _0x127b24[_0x466d('0x20')](_0x1be2dd)[_0x466d('0x21')](_0x1fcbcc);}};}function respondWithFilteredResult(_0x451bfb,_0x346d7e){return function(_0x533f4d){if(_0x533f4d){var _0x54ef53=typeof _0x346d7e[_0x466d('0x22')]===_0x466d('0x23')&&typeof _0x346d7e[_0x466d('0x24')]===_0x466d('0x23');var _0x4bfb6f=_0x533f4d[_0x466d('0x25')];var _0x2f1dbd=_0x54ef53?0x0:_0x346d7e[_0x466d('0x22')];var _0x484c37=_0x54ef53?_0x533f4d[_0x466d('0x25')]:_0x346d7e[_0x466d('0x22')]+_0x346d7e[_0x466d('0x24')];var _0xd154bd;if(_0x484c37>=_0x4bfb6f){_0x484c37=_0x4bfb6f;_0xd154bd=0xc8;}else{_0xd154bd=0xce;}_0x451bfb[_0x466d('0x20')](_0xd154bd);return _0x451bfb[_0x466d('0x26')](_0x466d('0x27'),_0x2f1dbd+'-'+_0x484c37+'/'+_0x4bfb6f)['json'](_0x533f4d);}return null;};}function patchUpdates(_0x1cca1f){return function(_0x553db3){try{jsonpatch[_0x466d('0x28')](_0x553db3,_0x1cca1f,!![]);}catch(_0x597dc2){return BPromise[_0x466d('0x29')](_0x597dc2);}return _0x553db3[_0x466d('0x2a')]();};}function saveUpdates(_0x483f4e,_0x4fc31d){return function(_0x2b1ba0){if(_0x2b1ba0){return _0x2b1ba0[_0x466d('0x2b')](_0x483f4e)[_0x466d('0x2c')](function(_0x42878e){return _0x42878e;});}return null;};}function removeEntity(_0x5232da,_0x84e1c4){return function(_0x30d82e){if(_0x30d82e){return _0x30d82e[_0x466d('0x2d')]()[_0x466d('0x2c')](function(){var _0x313244=_0x30d82e['get']({'plain':!![]});var _0x2e4534='CustomReports';return db['UserProfileResource'][_0x466d('0x2d')]({'where':{'type':_0x2e4534,'resourceId':_0x313244['id']}})[_0x466d('0x2c')](function(){return _0x30d82e;});})[_0x466d('0x2c')](function(){_0x5232da['status'](0xcc)[_0x466d('0x2e')]();});}};}function handleEntityNotFound(_0x32aff7,_0x2db3dd){return function(_0x2f584c){if(!_0x2f584c){_0x32aff7[_0x466d('0x1f')](0x194);}return _0x2f584c;};}function handleError(_0x59a995,_0x54fed9){_0x54fed9=_0x54fed9||0x1f4;return function(_0x34685d){logger[_0x466d('0x2f')](_0x34685d[_0x466d('0x30')]);if(_0x34685d[_0x466d('0x31')]){delete _0x34685d[_0x466d('0x31')];}_0x59a995[_0x466d('0x20')](_0x54fed9)['send'](_0x34685d);};}exports['index']=function(_0x646117,_0x1f864f){var _0x75f4ad={},_0x509b41={},_0x28064a={'count':0x0,'rows':[]};var _0x36bcdf=_[_0x466d('0x32')](db[_0x466d('0x33')][_0x466d('0x34')],function(_0x874548){return{'name':_0x874548[_0x466d('0x35')],'type':_0x874548[_0x466d('0x36')][_0x466d('0x37')]};});_0x509b41['model']=_[_0x466d('0x32')](_0x36bcdf,'name');_0x509b41['query']=_['keys'](_0x646117[_0x466d('0x38')]);_0x509b41[_0x466d('0x39')]=_[_0x466d('0x3a')](_0x509b41[_0x466d('0x3b')],_0x509b41[_0x466d('0x38')]);_0x75f4ad[_0x466d('0x3c')]=_[_0x466d('0x3a')](_0x509b41['model'],qs['fields'](_0x646117[_0x466d('0x38')][_0x466d('0x3d')]));_0x75f4ad[_0x466d('0x3c')]=_0x75f4ad[_0x466d('0x3c')][_0x466d('0x3e')]?_0x75f4ad['attributes']:_0x509b41[_0x466d('0x3b')];if(!_0x646117[_0x466d('0x38')][_0x466d('0x3f')](_0x466d('0x40'))){_0x75f4ad[_0x466d('0x24')]=qs[_0x466d('0x24')](_0x646117[_0x466d('0x38')][_0x466d('0x24')]);_0x75f4ad[_0x466d('0x22')]=qs[_0x466d('0x22')](_0x646117[_0x466d('0x38')][_0x466d('0x22')]);}_0x75f4ad[_0x466d('0x41')]=qs[_0x466d('0x42')](_0x646117[_0x466d('0x38')][_0x466d('0x42')]);_0x75f4ad[_0x466d('0x43')]=qs[_0x466d('0x39')](_[_0x466d('0x44')](_0x646117[_0x466d('0x38')],_0x509b41[_0x466d('0x39')]),_0x36bcdf);if(_0x646117[_0x466d('0x38')][_0x466d('0x45')]){_0x75f4ad[_0x466d('0x43')]=_[_0x466d('0x46')](_0x75f4ad['where'],{'$or':_[_0x466d('0x32')](_0x36bcdf,function(_0x3e6c2d){if(_0x3e6c2d['type']!==_0x466d('0x47')){var _0x338994={};_0x338994[_0x3e6c2d['name']]={'$like':'%'+_0x646117['query'][_0x466d('0x45')]+'%'};return _0x338994;}})});}_0x75f4ad=_[_0x466d('0x46')]({},_0x75f4ad,_0x646117[_0x466d('0x48')]);var _0x2e6e48={'where':_0x75f4ad[_0x466d('0x43')]};return db[_0x466d('0x33')]['count'](_0x2e6e48)[_0x466d('0x2c')](function(_0x55868f){_0x28064a[_0x466d('0x25')]=_0x55868f;if(_0x646117[_0x466d('0x38')]['includeAll']){_0x75f4ad[_0x466d('0x49')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x466d('0x4a')](_0x75f4ad);})[_0x466d('0x2c')](function(_0x2adfc1){_0x28064a[_0x466d('0x4b')]=_0x2adfc1;return _0x28064a;})[_0x466d('0x2c')](respondWithFilteredResult(_0x1f864f,_0x75f4ad))[_0x466d('0x4c')](handleError(_0x1f864f,null));};exports[_0x466d('0x4d')]=function(_0x4547e1,_0x479144){var _0x48425d={'raw':![],'where':{'id':_0x4547e1[_0x466d('0x4e')]['id']}},_0x1ab80e={};_0x1ab80e['model']=_[_0x466d('0x4f')](db[_0x466d('0x33')][_0x466d('0x34')]);_0x1ab80e[_0x466d('0x38')]=_[_0x466d('0x4f')](_0x4547e1[_0x466d('0x38')]);_0x1ab80e[_0x466d('0x39')]=_[_0x466d('0x3a')](_0x1ab80e['model'],_0x1ab80e['query']);_0x48425d['attributes']=_[_0x466d('0x3a')](_0x1ab80e[_0x466d('0x3b')],qs[_0x466d('0x3d')](_0x4547e1[_0x466d('0x38')][_0x466d('0x3d')]));_0x48425d[_0x466d('0x3c')]=_0x48425d[_0x466d('0x3c')]['length']?_0x48425d[_0x466d('0x3c')]:_0x1ab80e[_0x466d('0x3b')];if(_0x4547e1['query'][_0x466d('0x50')]){_0x48425d[_0x466d('0x49')]=[{'all':!![]}];}_0x48425d=_[_0x466d('0x46')]({},_0x48425d,_0x4547e1[_0x466d('0x48')]);return db[_0x466d('0x33')][_0x466d('0x51')](_0x48425d)['then'](handleEntityNotFound(_0x479144,null))['then'](respondWithResult(_0x479144,null))[_0x466d('0x4c')](handleError(_0x479144,null));};exports[_0x466d('0x52')]=function(_0x3b4cbd,_0xb84a82){return db[_0x466d('0x33')]['create'](_0x3b4cbd[_0x466d('0x53')],{})[_0x466d('0x2c')](function(_0x43fb3e){var _0x23b9f8=_0x3b4cbd[_0x466d('0x54')][_0x466d('0x55')]({'plain':!![]});if(!_0x23b9f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23b9f8[_0x466d('0x56')]===_0x466d('0x54')){var _0x1d8d4e=_0x43fb3e[_0x466d('0x55')]({'plain':!![]});var _0x1ad05a=_0x466d('0x57');return db[_0x466d('0x58')][_0x466d('0x51')]({'where':{'name':_0x1ad05a,'userProfileId':_0x23b9f8[_0x466d('0x59')]},'raw':!![]})['then'](function(_0x44ec89){if(_0x44ec89&&_0x44ec89[_0x466d('0x5a')]===0x0){return db[_0x466d('0x5b')][_0x466d('0x52')]({'name':_0x1d8d4e[_0x466d('0x31')],'resourceId':_0x1d8d4e['id'],'type':'CustomReports','sectionId':_0x44ec89['id']},{})[_0x466d('0x2c')](function(){return _0x43fb3e;});}else{return _0x43fb3e;}})[_0x466d('0x4c')](function(_0x5e853e){logger[_0x466d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e853e);throw _0x5e853e;});}return _0x43fb3e;})[_0x466d('0x2c')](respondWithResult(_0xb84a82,0xc9))[_0x466d('0x4c')](handleError(_0xb84a82,null));};exports[_0x466d('0x2b')]=function(_0x777dda,_0x325ea6){if(_0x777dda['body']['id']){delete _0x777dda[_0x466d('0x53')]['id'];}return db[_0x466d('0x33')][_0x466d('0x51')]({'where':{'id':_0x777dda[_0x466d('0x4e')]['id']}})[_0x466d('0x2c')](handleEntityNotFound(_0x325ea6,null))[_0x466d('0x2c')](saveUpdates(_0x777dda[_0x466d('0x53')],null))[_0x466d('0x2c')](respondWithResult(_0x325ea6,null))['catch'](handleError(_0x325ea6,null));};exports['destroy']=function(_0x2dfd87,_0x555aa1){return db['AnalyticCustomReport'][_0x466d('0x51')]({'where':{'id':_0x2dfd87[_0x466d('0x4e')]['id']}})[_0x466d('0x2c')](handleEntityNotFound(_0x555aa1,null))['then'](removeEntity(_0x555aa1,null))[_0x466d('0x4c')](handleError(_0x555aa1,null));};exports['preview']=function(_0x564755,_0x3a2ae3){var _0x2883ae=0xa;var _0x5c6855=['join',_0x466d('0x5c'),_0x466d('0x5d'),'cross_join'];var _0x5624a7={'SUM':_0x466d('0x5e'),'COUNT':_0x466d('0x5f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x466d('0x60'),'MIN':_0x466d('0x61'),'AVG':_0x466d('0x62'),'GROUP_CONCAT':_0x466d('0x63'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x466d('0x64')};var _0x3da099={'SEC_TO_TIME':_0x466d('0x65'),'DATE':_0x466d('0x66'),'HOUR':_0x466d('0x67'),'ROUND':_0x466d('0x68'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x179f76=function(_0x514c66){return!_[_0x466d('0x69')]([_0x466d('0x6a'),_0x466d('0x6b'),_0x466d('0x6c'),_0x466d('0x6d')],_0x514c66);};var _0x29f54d=function(_0x30ddef){if(!_0x30ddef||!_0x30ddef[_0x466d('0x6e')][_0x466d('0x3e')]){return'';}for(var _0x2a18e2='(',_0x3f620e=0x0;_0x3f620e<_0x30ddef['rules'][_0x466d('0x3e')];_0x3f620e+=0x1){_0x3f620e>0x0&&(_0x2a18e2+='\x20'+_0x30ddef[_0x466d('0x6f')]+'\x20');_0x2a18e2+=_0x30ddef[_0x466d('0x6e')][_0x3f620e][_0x466d('0x70')]?_0x29f54d(_0x30ddef[_0x466d('0x6e')][_0x3f620e][_0x466d('0x70')]):_0x30ddef[_0x466d('0x6e')][_0x3f620e]['field']+'\x20'+_0x30ddef[_0x466d('0x6e')][_0x3f620e]['condition']+(_0x179f76(_0x30ddef[_0x466d('0x6e')][_0x3f620e][_0x466d('0x71')])?'\x20'+_0x30ddef['rules'][_0x3f620e][_0x466d('0x72')]:'');}return _0x2a18e2+')';};var _0x3c30d9={'where':{'id':_0x564755[_0x466d('0x4e')]['id']}},_0x36a9f6,_0x3cb2ef,_0x4f4a49,_0x3f3a38,_0x31c56e;_0x3c30d9=_[_0x466d('0x46')]({},_0x3c30d9,_0x564755['options']);return db[_0x466d('0x33')]['find'](_0x3c30d9)[_0x466d('0x2c')](function(_0x18bab9){if(_0x18bab9){_0x36a9f6=_0x18bab9;return _0x18bab9[_0x466d('0x73')]();}return null;})['then'](function(_0x592ece){if(_0x592ece){if(!_0x592ece[_0x466d('0x3e')]){throw new db['Sequelize'][(_0x466d('0x74'))](_0x466d('0x75'),0x193);}_0x3cb2ef=_0x592ece;return db[_0x466d('0x76')][_0x466d('0x4a')]({'raw':!![]});}return null;})[_0x466d('0x2c')](function(_0x1b6e68){if(_0x1b6e68){_0x4f4a49=_['keyBy'](_0x1b6e68,'id');var _0x308a84;var _0x122895=squel[_0x466d('0x77')]();_0x122895['from'](_0x36a9f6[_0x466d('0x78')]);for(var _0x38ebaa=0x0;_0x38ebaa<_0x3cb2ef[_0x466d('0x3e')];_0x38ebaa+=0x1){_0x308a84=_0x3cb2ef[_0x38ebaa][_0x466d('0x79')]?_0x4f4a49[_0x3cb2ef[_0x38ebaa][_0x466d('0x79')]]['metric']:_0x3cb2ef[_0x38ebaa][_0x466d('0x7a')];_0x308a84=_0x3cb2ef[_0x38ebaa][_0x466d('0x7b')]?_[_0x466d('0x7c')](_0x5624a7[_0x3cb2ef[_0x38ebaa]['function']],'%s',_0x308a84):_0x308a84;_0x308a84=_0x3cb2ef[_0x38ebaa][_0x466d('0x7d')]?_[_0x466d('0x7c')](_0x3da099[_0x3cb2ef[_0x38ebaa][_0x466d('0x7d')]],'%s',_0x308a84):_0x308a84;if(_0x3cb2ef[_0x38ebaa][_0x466d('0x7e')]){_0x122895['group'](_0x308a84);}_0x3cb2ef[_0x38ebaa][_0x466d('0x7f')]&&_0x122895[_0x466d('0x41')](_0x308a84,_0x3cb2ef[_0x38ebaa][_0x466d('0x7f')]===_0x466d('0x80')?![]:!![]);_0x122895[_0x466d('0x7a')](_0x308a84,_0x3cb2ef[_0x38ebaa]['alias']||_0x308a84);}if(_0x36a9f6[_0x466d('0x81')]){_0x36a9f6[_0x466d('0x81')]=JSON[_0x466d('0x82')](_0x36a9f6[_0x466d('0x81')]);for(var _0x3bcb54=0x0;_0x3bcb54<_0x36a9f6['joins'][_0x466d('0x3e')];_0x3bcb54+=0x1){if(_0x36a9f6[_0x466d('0x81')][_0x3bcb54][_0x466d('0x36')]&&_[_0x466d('0x69')](_0x5c6855,_0x36a9f6[_0x466d('0x81')][_0x3bcb54]['type'])&&_0x36a9f6['joins'][_0x3bcb54][_0x466d('0x83')]&&_0x36a9f6[_0x466d('0x81')][_0x3bcb54]['foreignTable']&&_0x36a9f6[_0x466d('0x81')][_0x3bcb54][_0x466d('0x84')]){_0x122895[_0x36a9f6[_0x466d('0x81')][_0x3bcb54]['type']](_0x36a9f6[_0x466d('0x81')][_0x3bcb54][_0x466d('0x85')],null,util[_0x466d('0x7d')](_0x466d('0x86'),_0x36a9f6['table'],_0x36a9f6[_0x466d('0x81')][_0x3bcb54][_0x466d('0x83')],_0x36a9f6['joins'][_0x3bcb54]['foreignTable'],_0x36a9f6[_0x466d('0x81')][_0x3bcb54]['foreignKey']));}}}if(_0x36a9f6[_0x466d('0x87')]){_0x36a9f6[_0x466d('0x87')]=JSON[_0x466d('0x82')](_0x36a9f6['conditions']);_0x122895[_0x466d('0x43')](_0x29f54d(_0x36a9f6[_0x466d('0x87')]['group']));}_0x31c56e=_0x122895[_0x466d('0x88')]();_0x122895[_0x466d('0x24')](_0x2883ae);_0x122895[_0x466d('0x22')](0x0);logger[_0x466d('0x89')](_0x466d('0x8a'),_0x122895[_0x466d('0x8b')]());return dbH[_0x466d('0x8c')][_0x466d('0x38')](_0x122895[_0x466d('0x8b')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x3a2ae3,null))[_0x466d('0x4c')](handleError(_0x3a2ae3,null));};function runReport(_0x1c9726,_0x47856b,_0x402c1e){var _0x118040=_0x47856b[_0x466d('0x31')];var _0x73eb91=0xa;var _0x42de5c=[_0x466d('0x8d'),_0x466d('0x5c'),_0x466d('0x5d'),_0x466d('0x8e')];var _0x281003={'SUM':'SUM(%s)','COUNT':_0x466d('0x5f'),'COUNT DISTINCT':_0x466d('0x8f'),'MAX':_0x466d('0x60'),'MIN':'MIN(%s)','AVG':_0x466d('0x62'),'GROUP_CONCAT':_0x466d('0x63'),'GROUP_CONCAT ASC':_0x466d('0x90'),'GROUP_CONCAT DESC':_0x466d('0x64')};var _0x20926b={'SEC_TO_TIME':_0x466d('0x65'),'DATE':_0x466d('0x66'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x466d('0x91')};var _0x55d86e=function(_0x283983){return!_['includes'](['IS\x20NULL',_0x466d('0x6b'),_0x466d('0x6c'),_0x466d('0x6d')],_0x283983);};var _0x2eab48=function(_0x262bb5){if(!_0x262bb5||!_0x262bb5[_0x466d('0x6e')]['length']){return'';}for(var _0x21992d='(',_0x445140=0x0;_0x445140<_0x262bb5['rules'][_0x466d('0x3e')];_0x445140+=0x1){_0x445140>0x0&&(_0x21992d+='\x20'+_0x262bb5['operator']+'\x20');_0x21992d+=_0x262bb5[_0x466d('0x6e')][_0x445140][_0x466d('0x70')]?_0x2eab48(_0x262bb5[_0x466d('0x6e')][_0x445140][_0x466d('0x70')]):_0x262bb5[_0x466d('0x6e')][_0x445140][_0x466d('0x7a')]+'\x20'+_0x262bb5[_0x466d('0x6e')][_0x445140]['condition']+(_0x55d86e(_0x262bb5[_0x466d('0x6e')][_0x445140]['condition'])?'\x20'+_0x262bb5[_0x466d('0x6e')][_0x445140][_0x466d('0x72')]:'');}return _0x21992d+')';};var _0x1d7bcb={'where':{'id':_0x1c9726['id']}},_0x105428,_0xe2d1c,_0x48c541,_0x20aa79,_0x45f314;_0x1d7bcb=_[_0x466d('0x46')]({},_0x1d7bcb,_0x402c1e);return db['AnalyticCustomReport'][_0x466d('0x51')](_0x1d7bcb)[_0x466d('0x2c')](function(_0x3d78a2){if(_0x3d78a2){_0x105428=_0x3d78a2;return _0x3d78a2[_0x466d('0x73')]();}return null;})['then'](function(_0x578e19){if(_0x578e19){if(!_0x578e19['length']){throw new db[(_0x466d('0x92'))][(_0x466d('0x74'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe2d1c=_0x578e19;return db[_0x466d('0x76')][_0x466d('0x4a')]({'raw':!![]});}return null;})['then'](function(_0xa7cca0){if(_0xa7cca0){_0x48c541=_[_0x466d('0x93')](_0xa7cca0,'id');var _0x23a8c9;var _0x34aaf1=squel[_0x466d('0x77')]();_0x34aaf1[_0x466d('0x94')](_0x105428[_0x466d('0x78')]);for(var _0x20c6f6=0x0;_0x20c6f6<_0xe2d1c[_0x466d('0x3e')];_0x20c6f6+=0x1){_0x23a8c9=_0xe2d1c[_0x20c6f6][_0x466d('0x79')]?_0x48c541[_0xe2d1c[_0x20c6f6][_0x466d('0x79')]][_0x466d('0x95')]:_0xe2d1c[_0x20c6f6][_0x466d('0x7a')];_0x23a8c9=_0xe2d1c[_0x20c6f6][_0x466d('0x7b')]?_[_0x466d('0x7c')](_0x281003[_0xe2d1c[_0x20c6f6][_0x466d('0x7b')]],'%s',_0x23a8c9):_0x23a8c9;_0x23a8c9=_0xe2d1c[_0x20c6f6][_0x466d('0x7d')]?_[_0x466d('0x7c')](_0x20926b[_0xe2d1c[_0x20c6f6]['format']],'%s',_0x23a8c9):_0x23a8c9;if(_0xe2d1c[_0x20c6f6][_0x466d('0x7e')]){_0x34aaf1['group'](_0x23a8c9);}_0xe2d1c[_0x20c6f6]['orderBy']&&_0x34aaf1[_0x466d('0x41')](_0x23a8c9,_0xe2d1c[_0x20c6f6][_0x466d('0x7f')]===_0x466d('0x80')?![]:!![]);_0x34aaf1[_0x466d('0x7a')](_0x23a8c9,_0xe2d1c[_0x20c6f6]['alias']||_0x23a8c9);}if(_0x105428['joins']){_0x105428[_0x466d('0x81')]=JSON['parse'](_0x105428[_0x466d('0x81')]);for(var _0x48dd61=0x0;_0x48dd61<_0x105428[_0x466d('0x81')]['length'];_0x48dd61+=0x1){if(_0x105428[_0x466d('0x81')][_0x48dd61][_0x466d('0x36')]&&_[_0x466d('0x69')](_0x42de5c,_0x105428[_0x466d('0x81')][_0x48dd61]['type'])&&_0x105428[_0x466d('0x81')][_0x48dd61][_0x466d('0x83')]&&_0x105428[_0x466d('0x81')][_0x48dd61][_0x466d('0x85')]&&_0x105428[_0x466d('0x81')][_0x48dd61]['foreignKey']){_0x34aaf1[_0x105428[_0x466d('0x81')][_0x48dd61][_0x466d('0x36')]](_0x105428['joins'][_0x48dd61]['foreignTable'],null,util['format'](_0x466d('0x86'),_0x105428['table'],_0x105428[_0x466d('0x81')][_0x48dd61]['parentKey'],_0x105428['joins'][_0x48dd61][_0x466d('0x85')],_0x105428[_0x466d('0x81')][_0x48dd61][_0x466d('0x84')]));}}}if(_0x105428['conditions']){_0x105428[_0x466d('0x87')]=JSON['parse'](_0x105428[_0x466d('0x87')]);_0x34aaf1[_0x466d('0x43')](_0x2eab48(_0x105428['conditions'][_0x466d('0x70')]));}_0x45f314=_0x34aaf1['clone']();_0x34aaf1[_0x466d('0x24')](_0x73eb91);_0x34aaf1['offset'](0x0);return;}})[_0x466d('0x2c')](function(){if(_0x47856b['output']===_0x466d('0x96')){return null;}var _0x2a4d14=_['merge'](_0x47856b,{'name':_0x47856b[_0x466d('0x97')]||_0x47856b['name']||_0x105428[_0x466d('0x31')],'basename':_0x118040,'savename':util[_0x466d('0x7d')](_0x466d('0x98'),_0x47856b['name']||_0x105428[_0x466d('0x31')],require(_0x466d('0x99'))[_0x466d('0x9a')](0x4),_0x47856b['output']||_0x466d('0x9b')),'reportId':_0x105428['id'],'reportType':'custom'});return db[_0x466d('0x9c')][_0x466d('0x52')](_0x2a4d14,{'raw':!![]});})['then'](function(_0x4592e1){if(_0x105428[_0x466d('0x78')]==='cdr'){_0x45f314[_0x466d('0x43')](_0x105428[_0x466d('0x78')]+_0x466d('0x9d'),_0x47856b[_0x466d('0x9e')],_0x47856b[_0x466d('0x9f')]);}else{_0x45f314[_0x466d('0x43')](_0x105428[_0x466d('0x78')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x47856b[_0x466d('0x9e')],_0x47856b[_0x466d('0x9f')]);}if(_0x4592e1){logger[_0x466d('0xa0')](_0x466d('0xa1'),_0x45f314[_0x466d('0x8b')]());require('child_process')[_0x466d('0xa2')](path[_0x466d('0x8d')](__dirname,'../../components/export/',_0x4592e1[_0x466d('0xa3')]),[_0x4592e1['id'],_0x45f314[_0x466d('0x8b')](),path[_0x466d('0x8d')](__dirname,_0x466d('0xa4'),_0x4592e1['savename']),_0x118040]);return _0x4592e1;}else{var _0x27d936=squel[_0x466d('0x77')]();_0x27d936['from']('('+_0x45f314['toString']()+')',_0x466d('0xa5'));_0x27d936['field'](_0x466d('0xa6'),'count');_0x45f314['limit'](_0x47856b[_0x466d('0x24')]||_0x73eb91);_0x45f314[_0x466d('0x22')](_0x47856b[_0x466d('0x22')]||0x0);return dbH[_0x466d('0x8c')][_0x466d('0x38')](_0x27d936['toString'](),{'type':dbH['sequelize'][_0x466d('0xa7')][_0x466d('0xa8')]})['then'](function(_0x56c1d7){if(!_0x56c1d7[_0x466d('0x3e')]){_0x20aa79=0x0;}else{_0x20aa79=_0x56c1d7[0x0][_0x466d('0x25')]||0x0;}return dbH['sequelize'][_0x466d('0x38')](_0x45f314[_0x466d('0x8b')](),{'type':dbH[_0x466d('0x8c')]['QueryTypes'][_0x466d('0xa8')]});})[_0x466d('0x2c')](function(_0x5c55ec){return{'rows':_0x5c55ec||[],'count':_0x20aa79};});}});}exports[_0x466d('0xa9')]=function(_0x40f028,_0x42e883){return runReport(_0x40f028[_0x466d('0x4e')],_0x40f028['query'],_0x40f028['options'])[_0x466d('0x2c')](respondWithResult(_0x42e883,null))[_0x466d('0x4c')](handleError(_0x42e883,null));};exports['runReport']=runReport;exports[_0x466d('0x38')]=function(_0x5a91d4,_0x4775c4){var _0x171bb2=0xa;var _0x3569b1=[_0x466d('0x8d'),_0x466d('0x5c'),_0x466d('0x5d'),_0x466d('0x8e')];var _0x67f602={'SUM':_0x466d('0x5e'),'COUNT':_0x466d('0x5f'),'COUNT DISTINCT':_0x466d('0x8f'),'MAX':_0x466d('0x60'),'MIN':_0x466d('0x61'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x466d('0x63'),'GROUP_CONCAT ASC':_0x466d('0x90'),'GROUP_CONCAT DESC':_0x466d('0x64')};var _0x22610b={'SEC_TO_TIME':_0x466d('0x65'),'DATE':_0x466d('0x66'),'HOUR':_0x466d('0x67'),'ROUND':_0x466d('0x68'),'UNIX_TIMESTAMP':_0x466d('0x91')};var _0x5f0697=function(_0x270546){return!_[_0x466d('0x69')]([_0x466d('0x6a'),_0x466d('0x6b'),_0x466d('0x6c'),_0x466d('0x6d')],_0x270546);};var _0x6cfe92=function(_0x5ac828){if(!_0x5ac828||!_0x5ac828[_0x466d('0x6e')][_0x466d('0x3e')]){return'';}for(var _0x119bc5='(',_0x2b5f6e=0x0;_0x2b5f6e<_0x5ac828[_0x466d('0x6e')][_0x466d('0x3e')];_0x2b5f6e+=0x1){_0x2b5f6e>0x0&&(_0x119bc5+='\x20'+_0x5ac828[_0x466d('0x6f')]+'\x20');_0x119bc5+=_0x5ac828[_0x466d('0x6e')][_0x2b5f6e]['group']?_0x6cfe92(_0x5ac828['rules'][_0x2b5f6e]['group']):_0x5ac828[_0x466d('0x6e')][_0x2b5f6e][_0x466d('0x7a')]+'\x20'+_0x5ac828[_0x466d('0x6e')][_0x2b5f6e]['condition']+(_0x5f0697(_0x5ac828[_0x466d('0x6e')][_0x2b5f6e]['condition'])?'\x20'+_0x5ac828[_0x466d('0x6e')][_0x2b5f6e][_0x466d('0x72')]:'');}return _0x119bc5+')';};var _0x45bd04={'where':{'id':_0x5a91d4[_0x466d('0x4e')]['id']}},_0x1edc97,_0x5f13c7,_0x3ed851,_0x260b6b,_0x1054b2;_0x45bd04=_['merge']({},_0x45bd04,_0x5a91d4['options']);return db[_0x466d('0x33')]['find'](_0x45bd04)[_0x466d('0x2c')](function(_0x324a87){if(_0x324a87){_0x1edc97=_0x324a87;return _0x324a87[_0x466d('0x73')]();}return null;})[_0x466d('0x2c')](function(_0x58047b){if(_0x58047b){if(!_0x58047b[_0x466d('0x3e')]){throw new db[(_0x466d('0x92'))][(_0x466d('0x74'))](_0x466d('0x75'),0x193);}_0x5f13c7=_0x58047b;return db[_0x466d('0x76')][_0x466d('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x1c6c51){if(_0x1c6c51){_0x3ed851=_[_0x466d('0x93')](_0x1c6c51,'id');var _0x48b8b3;var _0x324747=squel[_0x466d('0x77')]();_0x324747['from'](_0x1edc97[_0x466d('0x78')]);for(var _0x54d89c=0x0;_0x54d89c<_0x5f13c7[_0x466d('0x3e')];_0x54d89c+=0x1){_0x48b8b3=_0x5f13c7[_0x54d89c][_0x466d('0x79')]?_0x3ed851[_0x5f13c7[_0x54d89c]['MetricId']][_0x466d('0x95')]:_0x5f13c7[_0x54d89c][_0x466d('0x7a')];_0x48b8b3=_0x5f13c7[_0x54d89c]['function']?_[_0x466d('0x7c')](_0x67f602[_0x5f13c7[_0x54d89c]['function']],'%s',_0x48b8b3):_0x48b8b3;_0x48b8b3=_0x5f13c7[_0x54d89c][_0x466d('0x7d')]?_[_0x466d('0x7c')](_0x22610b[_0x5f13c7[_0x54d89c][_0x466d('0x7d')]],'%s',_0x48b8b3):_0x48b8b3;if(_0x5f13c7[_0x54d89c]['groupBy']){_0x324747[_0x466d('0x70')](_0x48b8b3);}_0x5f13c7[_0x54d89c][_0x466d('0x7f')]&&_0x324747[_0x466d('0x41')](_0x48b8b3,_0x5f13c7[_0x54d89c][_0x466d('0x7f')]===_0x466d('0x80')?![]:!![]);_0x324747[_0x466d('0x7a')](_0x48b8b3,_0x5f13c7[_0x54d89c][_0x466d('0xaa')]||_0x48b8b3);}if(_0x1edc97['joins']){_0x1edc97['joins']=JSON['parse'](_0x1edc97[_0x466d('0x81')]);for(var _0x31be55=0x0;_0x31be55<_0x1edc97[_0x466d('0x81')][_0x466d('0x3e')];_0x31be55+=0x1){if(_0x1edc97[_0x466d('0x81')][_0x31be55][_0x466d('0x36')]&&_[_0x466d('0x69')](_0x3569b1,_0x1edc97['joins'][_0x31be55][_0x466d('0x36')])&&_0x1edc97[_0x466d('0x81')][_0x31be55][_0x466d('0x83')]&&_0x1edc97[_0x466d('0x81')][_0x31be55]['foreignTable']&&_0x1edc97[_0x466d('0x81')][_0x31be55][_0x466d('0x84')]){_0x324747[_0x1edc97[_0x466d('0x81')][_0x31be55]['type']](_0x1edc97[_0x466d('0x81')][_0x31be55][_0x466d('0x85')],null,util[_0x466d('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1edc97[_0x466d('0x78')],_0x1edc97[_0x466d('0x81')][_0x31be55][_0x466d('0x83')],_0x1edc97[_0x466d('0x81')][_0x31be55][_0x466d('0x85')],_0x1edc97[_0x466d('0x81')][_0x31be55][_0x466d('0x84')]));}}}if(_0x1edc97['conditions']){_0x1edc97['conditions']=JSON[_0x466d('0x82')](_0x1edc97[_0x466d('0x87')]);_0x324747[_0x466d('0x43')](_0x6cfe92(_0x1edc97[_0x466d('0x87')][_0x466d('0x70')]));}_0x1054b2=_0x324747['clone']();_0x324747[_0x466d('0x24')](_0x171bb2);_0x324747[_0x466d('0x22')](0x0);logger[_0x466d('0x89')]('Limited\x20Query:',_0x324747[_0x466d('0x8b')]());return dbH[_0x466d('0x8c')]['query'](_0x324747[_0x466d('0x8b')](),{'type':dbH['sequelize'][_0x466d('0xa7')][_0x466d('0xa8')]});}})['then'](function(){return{'sql':_0x1054b2[_0x466d('0x8b')]()};})[_0x466d('0x2c')](respondWithResult(_0x4775c4,null))[_0x466d('0x4c')](handleError(_0x4775c4,null));};
\ No newline at end of file
+var _0xbf21=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','MetricId','function','replace','format','groupBy','orderBy','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','table','foreignTable','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','operator','from','metric','DESC','alias','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','../../components/export/','savename','COUNT(*)','runReport','cross_join','HOUR(%s)','IS\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','set','apply','reject','update','then','get','CustomReports','destroy','sendStatus','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbf21,0xec));var _0x1bf2=function(_0x44b691,_0x368823){_0x44b691=_0x44b691-0x0;var _0x4f6637=_0xbf21[_0x44b691];return _0x4f6637;};'use strict';var emlformat=require(_0x1bf2('0x0'));var rimraf=require(_0x1bf2('0x1'));var zipdir=require(_0x1bf2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1bf2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1bf2('0x4'));var util=require(_0x1bf2('0x5'));var path=require(_0x1bf2('0x6'));var sox=require(_0x1bf2('0x7'));var csv=require(_0x1bf2('0x8'));var ejs=require(_0x1bf2('0x9'));var fs=require('fs');var fs_extra=require(_0x1bf2('0xa'));var _=require(_0x1bf2('0xb'));var squel=require(_0x1bf2('0xc'));var crypto=require('crypto');var jsforce=require(_0x1bf2('0xd'));var deskjs=require(_0x1bf2('0xe'));var toCsv=require(_0x1bf2('0x8'));var querystring=require(_0x1bf2('0xf'));var Papa=require(_0x1bf2('0x10'));var Redis=require(_0x1bf2('0x11'));var authService=require(_0x1bf2('0x12'));var qs=require(_0x1bf2('0x13'));var as=require(_0x1bf2('0x14'));var hardwareService=require(_0x1bf2('0x15'));var logger=require(_0x1bf2('0x16'))(_0x1bf2('0x17'));var utils=require('../../config/utils');var config=require(_0x1bf2('0x18'));var licenseUtil=require(_0x1bf2('0x19'));var db=require(_0x1bf2('0x1a'))['db'];var dbH=require(_0x1bf2('0x1a'))[_0x1bf2('0x1b')];function respondWithStatusCode(_0x10a428,_0x5f4cb1){_0x5f4cb1=_0x5f4cb1||0xcc;return function(_0x2927b4){if(_0x2927b4){return _0x10a428['sendStatus'](_0x5f4cb1);}return _0x10a428[_0x1bf2('0x1c')](_0x5f4cb1)[_0x1bf2('0x1d')]();};}function respondWithResult(_0x138c98,_0x1413b0){_0x1413b0=_0x1413b0||0xc8;return function(_0x3e3e6c){if(_0x3e3e6c){return _0x138c98[_0x1bf2('0x1c')](_0x1413b0)[_0x1bf2('0x1e')](_0x3e3e6c);}};}function respondWithFilteredResult(_0x55769b,_0x818e0a){return function(_0x5dd095){if(_0x5dd095){var _0x19c3cc=typeof _0x818e0a[_0x1bf2('0x1f')]===_0x1bf2('0x20')&&typeof _0x818e0a['limit']===_0x1bf2('0x20');var _0x261e53=_0x5dd095[_0x1bf2('0x21')];var _0x547e6b=_0x19c3cc?0x0:_0x818e0a[_0x1bf2('0x1f')];var _0x46e711=_0x19c3cc?_0x5dd095[_0x1bf2('0x21')]:_0x818e0a[_0x1bf2('0x1f')]+_0x818e0a['limit'];var _0x449736;if(_0x46e711>=_0x261e53){_0x46e711=_0x261e53;_0x449736=0xc8;}else{_0x449736=0xce;}_0x55769b[_0x1bf2('0x1c')](_0x449736);return _0x55769b[_0x1bf2('0x22')]('Content-Range',_0x547e6b+'-'+_0x46e711+'/'+_0x261e53)['json'](_0x5dd095);}return null;};}function patchUpdates(_0x326dd3){return function(_0x526be0){try{jsonpatch[_0x1bf2('0x23')](_0x526be0,_0x326dd3,!![]);}catch(_0x172409){return BPromise[_0x1bf2('0x24')](_0x172409);}return _0x526be0['save']();};}function saveUpdates(_0x347772,_0x4c9874){return function(_0x500a82){if(_0x500a82){return _0x500a82[_0x1bf2('0x25')](_0x347772)[_0x1bf2('0x26')](function(_0x4fbec4){return _0x4fbec4;});}return null;};}function removeEntity(_0xb13cd7,_0x241a6b){return function(_0x514966){if(_0x514966){return _0x514966['destroy']()['then'](function(){var _0xfa82f7=_0x514966[_0x1bf2('0x27')]({'plain':!![]});var _0x4c3dd2=_0x1bf2('0x28');return db['UserProfileResource'][_0x1bf2('0x29')]({'where':{'type':_0x4c3dd2,'resourceId':_0xfa82f7['id']}})[_0x1bf2('0x26')](function(){return _0x514966;});})[_0x1bf2('0x26')](function(){_0xb13cd7['status'](0xcc)[_0x1bf2('0x1d')]();});}};}function handleEntityNotFound(_0x2ae72c,_0x53df96){return function(_0x3eb070){if(!_0x3eb070){_0x2ae72c[_0x1bf2('0x2a')](0x194);}return _0x3eb070;};}function handleError(_0x54b31f,_0x75aa1e){_0x75aa1e=_0x75aa1e||0x1f4;return function(_0x4b16a8){logger[_0x1bf2('0x2b')](_0x4b16a8[_0x1bf2('0x2c')]);if(_0x4b16a8[_0x1bf2('0x2d')]){delete _0x4b16a8[_0x1bf2('0x2d')];}_0x54b31f[_0x1bf2('0x1c')](_0x75aa1e)[_0x1bf2('0x2e')](_0x4b16a8);};}exports['index']=function(_0x3afff0,_0x315f49){var _0x42e4ba={},_0x2c4166={},_0x186e91={'count':0x0,'rows':[]};var _0xccb8c6=_[_0x1bf2('0x2f')](db[_0x1bf2('0x30')][_0x1bf2('0x31')],function(_0x1286ec){return{'name':_0x1286ec[_0x1bf2('0x32')],'type':_0x1286ec[_0x1bf2('0x33')][_0x1bf2('0x34')]};});_0x2c4166[_0x1bf2('0x35')]=_[_0x1bf2('0x2f')](_0xccb8c6,_0x1bf2('0x2d'));_0x2c4166[_0x1bf2('0x36')]=_['keys'](_0x3afff0[_0x1bf2('0x36')]);_0x2c4166['filters']=_[_0x1bf2('0x37')](_0x2c4166['model'],_0x2c4166['query']);_0x42e4ba[_0x1bf2('0x38')]=_['intersection'](_0x2c4166[_0x1bf2('0x35')],qs['fields'](_0x3afff0[_0x1bf2('0x36')][_0x1bf2('0x39')]));_0x42e4ba['attributes']=_0x42e4ba[_0x1bf2('0x38')][_0x1bf2('0x3a')]?_0x42e4ba['attributes']:_0x2c4166['model'];if(!_0x3afff0[_0x1bf2('0x36')][_0x1bf2('0x3b')](_0x1bf2('0x3c'))){_0x42e4ba['limit']=qs[_0x1bf2('0x3d')](_0x3afff0[_0x1bf2('0x36')][_0x1bf2('0x3d')]);_0x42e4ba['offset']=qs['offset'](_0x3afff0[_0x1bf2('0x36')][_0x1bf2('0x1f')]);}_0x42e4ba[_0x1bf2('0x3e')]=qs[_0x1bf2('0x3f')](_0x3afff0[_0x1bf2('0x36')][_0x1bf2('0x3f')]);_0x42e4ba[_0x1bf2('0x40')]=qs[_0x1bf2('0x41')](_['pick'](_0x3afff0[_0x1bf2('0x36')],_0x2c4166[_0x1bf2('0x41')]),_0xccb8c6);if(_0x3afff0[_0x1bf2('0x36')][_0x1bf2('0x42')]){_0x42e4ba[_0x1bf2('0x40')]=_[_0x1bf2('0x43')](_0x42e4ba[_0x1bf2('0x40')],{'$or':_[_0x1bf2('0x2f')](_0xccb8c6,function(_0x47955b){if(_0x47955b[_0x1bf2('0x33')]!==_0x1bf2('0x44')){var _0x1e4def={};_0x1e4def[_0x47955b['name']]={'$like':'%'+_0x3afff0[_0x1bf2('0x36')]['filter']+'%'};return _0x1e4def;}})});}_0x42e4ba=_[_0x1bf2('0x43')]({},_0x42e4ba,_0x3afff0[_0x1bf2('0x45')]);var _0x2cfb67={'where':_0x42e4ba[_0x1bf2('0x40')]};return db[_0x1bf2('0x30')][_0x1bf2('0x21')](_0x2cfb67)[_0x1bf2('0x26')](function(_0x11b451){_0x186e91[_0x1bf2('0x21')]=_0x11b451;if(_0x3afff0[_0x1bf2('0x36')][_0x1bf2('0x46')]){_0x42e4ba[_0x1bf2('0x47')]=[{'all':!![]}];}return db[_0x1bf2('0x30')]['findAll'](_0x42e4ba);})[_0x1bf2('0x26')](function(_0xec142a){_0x186e91[_0x1bf2('0x48')]=_0xec142a;return _0x186e91;})['then'](respondWithFilteredResult(_0x315f49,_0x42e4ba))['catch'](handleError(_0x315f49,null));};exports[_0x1bf2('0x49')]=function(_0x3650e5,_0x25cbb6){var _0xa1670={'raw':![],'where':{'id':_0x3650e5[_0x1bf2('0x4a')]['id']}},_0x2cd6cc={};_0x2cd6cc[_0x1bf2('0x35')]=_[_0x1bf2('0x4b')](db[_0x1bf2('0x30')][_0x1bf2('0x31')]);_0x2cd6cc[_0x1bf2('0x36')]=_[_0x1bf2('0x4b')](_0x3650e5['query']);_0x2cd6cc[_0x1bf2('0x41')]=_[_0x1bf2('0x37')](_0x2cd6cc[_0x1bf2('0x35')],_0x2cd6cc[_0x1bf2('0x36')]);_0xa1670[_0x1bf2('0x38')]=_['intersection'](_0x2cd6cc[_0x1bf2('0x35')],qs[_0x1bf2('0x39')](_0x3650e5[_0x1bf2('0x36')][_0x1bf2('0x39')]));_0xa1670[_0x1bf2('0x38')]=_0xa1670['attributes'][_0x1bf2('0x3a')]?_0xa1670[_0x1bf2('0x38')]:_0x2cd6cc['model'];if(_0x3650e5[_0x1bf2('0x36')][_0x1bf2('0x46')]){_0xa1670[_0x1bf2('0x47')]=[{'all':!![]}];}_0xa1670=_[_0x1bf2('0x43')]({},_0xa1670,_0x3650e5[_0x1bf2('0x45')]);return db[_0x1bf2('0x30')][_0x1bf2('0x4c')](_0xa1670)[_0x1bf2('0x26')](handleEntityNotFound(_0x25cbb6,null))[_0x1bf2('0x26')](respondWithResult(_0x25cbb6,null))[_0x1bf2('0x4d')](handleError(_0x25cbb6,null));};exports[_0x1bf2('0x4e')]=function(_0xc2bdb,_0x40bd57){return db['AnalyticCustomReport'][_0x1bf2('0x4e')](_0xc2bdb[_0x1bf2('0x4f')],{})[_0x1bf2('0x26')](function(_0x2daf1b){var _0x21cdaf=_0xc2bdb['user'][_0x1bf2('0x27')]({'plain':!![]});if(!_0x21cdaf)throw new Error(_0x1bf2('0x50'));if(_0x21cdaf['role']===_0x1bf2('0x51')){var _0x2dee5f=_0x2daf1b['get']({'plain':!![]});var _0x271691=_0x1bf2('0x52');return db[_0x1bf2('0x53')][_0x1bf2('0x4c')]({'where':{'name':_0x271691,'userProfileId':_0x21cdaf[_0x1bf2('0x54')]},'raw':!![]})['then'](function(_0x1e1f67){if(_0x1e1f67&&_0x1e1f67[_0x1bf2('0x55')]===0x0){return db[_0x1bf2('0x56')][_0x1bf2('0x4e')]({'name':_0x2dee5f['name'],'resourceId':_0x2dee5f['id'],'type':_0x1bf2('0x28'),'sectionId':_0x1e1f67['id']},{})['then'](function(){return _0x2daf1b;});}else{return _0x2daf1b;}})[_0x1bf2('0x4d')](function(_0x27c624){logger[_0x1bf2('0x2b')](_0x1bf2('0x57'),_0x27c624);throw _0x27c624;});}return _0x2daf1b;})[_0x1bf2('0x26')](respondWithResult(_0x40bd57,0xc9))[_0x1bf2('0x4d')](handleError(_0x40bd57,null));};exports['update']=function(_0x34fe9b,_0x1a5967){if(_0x34fe9b[_0x1bf2('0x4f')]['id']){delete _0x34fe9b[_0x1bf2('0x4f')]['id'];}return db[_0x1bf2('0x30')][_0x1bf2('0x4c')]({'where':{'id':_0x34fe9b[_0x1bf2('0x4a')]['id']}})[_0x1bf2('0x26')](handleEntityNotFound(_0x1a5967,null))[_0x1bf2('0x26')](saveUpdates(_0x34fe9b['body'],null))['then'](respondWithResult(_0x1a5967,null))['catch'](handleError(_0x1a5967,null));};exports[_0x1bf2('0x29')]=function(_0x2efd6f,_0x4e4e5f){return db['AnalyticCustomReport'][_0x1bf2('0x4c')]({'where':{'id':_0x2efd6f[_0x1bf2('0x4a')]['id']}})[_0x1bf2('0x26')](handleEntityNotFound(_0x4e4e5f,null))['then'](removeEntity(_0x4e4e5f,null))[_0x1bf2('0x4d')](handleError(_0x4e4e5f,null));};exports[_0x1bf2('0x58')]=function(_0x11e509,_0x24d8e8){var _0x3bbbce=0xa;var _0x52a83e=['join','left_join',_0x1bf2('0x59'),'cross_join'];var _0x47c970={'SUM':_0x1bf2('0x5a'),'COUNT':_0x1bf2('0x5b'),'COUNT DISTINCT':_0x1bf2('0x5c'),'MAX':_0x1bf2('0x5d'),'MIN':_0x1bf2('0x5e'),'AVG':_0x1bf2('0x5f'),'GROUP_CONCAT':_0x1bf2('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4ae808={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1bf2('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x1bf2('0x62'),'UNIX_TIMESTAMP':_0x1bf2('0x63')};var _0x40d1a1=function(_0x2c8a29){return!_[_0x1bf2('0x64')]([_0x1bf2('0x65'),_0x1bf2('0x66'),'IS\x20EMPTY',_0x1bf2('0x67')],_0x2c8a29);};var _0x1f7783=function(_0x5d9919){if(!_0x5d9919||!_0x5d9919[_0x1bf2('0x68')]['length']){return'';}for(var _0x5588be='(',_0x356f1b=0x0;_0x356f1b<_0x5d9919['rules'][_0x1bf2('0x3a')];_0x356f1b+=0x1){_0x356f1b>0x0&&(_0x5588be+='\x20'+_0x5d9919['operator']+'\x20');_0x5588be+=_0x5d9919[_0x1bf2('0x68')][_0x356f1b][_0x1bf2('0x69')]?_0x1f7783(_0x5d9919[_0x1bf2('0x68')][_0x356f1b]['group']):_0x5d9919[_0x1bf2('0x68')][_0x356f1b][_0x1bf2('0x6a')]+'\x20'+_0x5d9919[_0x1bf2('0x68')][_0x356f1b][_0x1bf2('0x6b')]+(_0x40d1a1(_0x5d9919[_0x1bf2('0x68')][_0x356f1b][_0x1bf2('0x6b')])?'\x20'+_0x5d9919[_0x1bf2('0x68')][_0x356f1b][_0x1bf2('0x6c')]:'');}return _0x5588be+')';};var _0x16898b={'where':{'id':_0x11e509[_0x1bf2('0x4a')]['id']}},_0x19b93a,_0x3e2e66,_0x11ba5f,_0x4ceb95,_0x33711a;_0x16898b=_[_0x1bf2('0x43')]({},_0x16898b,_0x11e509[_0x1bf2('0x45')]);return db[_0x1bf2('0x30')][_0x1bf2('0x4c')](_0x16898b)[_0x1bf2('0x26')](function(_0x3b10fc){if(_0x3b10fc){_0x19b93a=_0x3b10fc;return _0x3b10fc[_0x1bf2('0x6d')]();}return null;})['then'](function(_0x55449e){if(_0x55449e){if(!_0x55449e[_0x1bf2('0x3a')]){throw new db['Sequelize'][(_0x1bf2('0x6e'))](_0x1bf2('0x6f'),0x193);}_0x3e2e66=_0x55449e;return db[_0x1bf2('0x70')][_0x1bf2('0x71')]({'raw':!![]});}return null;})['then'](function(_0x3fb6ae){if(_0x3fb6ae){_0x11ba5f=_[_0x1bf2('0x72')](_0x3fb6ae,'id');var _0x2cbcf3;var _0x376401=squel[_0x1bf2('0x73')]();_0x376401['from'](_0x19b93a['table']);for(var _0xaec1d3=0x0;_0xaec1d3<_0x3e2e66[_0x1bf2('0x3a')];_0xaec1d3+=0x1){_0x2cbcf3=_0x3e2e66[_0xaec1d3][_0x1bf2('0x74')]?_0x11ba5f[_0x3e2e66[_0xaec1d3][_0x1bf2('0x74')]]['metric']:_0x3e2e66[_0xaec1d3]['field'];_0x2cbcf3=_0x3e2e66[_0xaec1d3][_0x1bf2('0x75')]?_[_0x1bf2('0x76')](_0x47c970[_0x3e2e66[_0xaec1d3][_0x1bf2('0x75')]],'%s',_0x2cbcf3):_0x2cbcf3;_0x2cbcf3=_0x3e2e66[_0xaec1d3][_0x1bf2('0x77')]?_[_0x1bf2('0x76')](_0x4ae808[_0x3e2e66[_0xaec1d3][_0x1bf2('0x77')]],'%s',_0x2cbcf3):_0x2cbcf3;if(_0x3e2e66[_0xaec1d3][_0x1bf2('0x78')]){_0x376401[_0x1bf2('0x69')](_0x2cbcf3);}_0x3e2e66[_0xaec1d3][_0x1bf2('0x79')]&&_0x376401[_0x1bf2('0x3e')](_0x2cbcf3,_0x3e2e66[_0xaec1d3]['orderBy']==='DESC'?![]:!![]);_0x376401[_0x1bf2('0x6a')](_0x2cbcf3,_0x3e2e66[_0xaec1d3]['alias']||_0x2cbcf3);}if(_0x19b93a[_0x1bf2('0x7a')]){_0x19b93a[_0x1bf2('0x7a')]=JSON[_0x1bf2('0x7b')](_0x19b93a['joins']);for(var _0x258314=0x0;_0x258314<_0x19b93a[_0x1bf2('0x7a')]['length'];_0x258314+=0x1){if(_0x19b93a[_0x1bf2('0x7a')][_0x258314][_0x1bf2('0x33')]&&_[_0x1bf2('0x64')](_0x52a83e,_0x19b93a[_0x1bf2('0x7a')][_0x258314][_0x1bf2('0x33')])&&_0x19b93a[_0x1bf2('0x7a')][_0x258314][_0x1bf2('0x7c')]&&_0x19b93a['joins'][_0x258314]['foreignTable']&&_0x19b93a['joins'][_0x258314][_0x1bf2('0x7d')]){_0x376401[_0x19b93a[_0x1bf2('0x7a')][_0x258314][_0x1bf2('0x33')]](_0x19b93a[_0x1bf2('0x7a')][_0x258314]['foreignTable'],null,util[_0x1bf2('0x77')](_0x1bf2('0x7e'),_0x19b93a[_0x1bf2('0x7f')],_0x19b93a['joins'][_0x258314]['parentKey'],_0x19b93a[_0x1bf2('0x7a')][_0x258314][_0x1bf2('0x80')],_0x19b93a[_0x1bf2('0x7a')][_0x258314]['foreignKey']));}}}if(_0x19b93a[_0x1bf2('0x81')]){_0x19b93a[_0x1bf2('0x81')]=JSON[_0x1bf2('0x7b')](_0x19b93a['conditions']);_0x376401[_0x1bf2('0x40')](_0x1f7783(_0x19b93a['conditions'][_0x1bf2('0x69')]));}_0x33711a=_0x376401['clone']();_0x376401[_0x1bf2('0x3d')](_0x3bbbce);_0x376401[_0x1bf2('0x1f')](0x0);logger[_0x1bf2('0x82')](_0x1bf2('0x83'),_0x376401[_0x1bf2('0x84')]());return dbH['sequelize']['query'](_0x376401[_0x1bf2('0x84')](),{'type':dbH[_0x1bf2('0x85')][_0x1bf2('0x86')][_0x1bf2('0x87')]});}})['then'](respondWithResult(_0x24d8e8,null))[_0x1bf2('0x4d')](handleError(_0x24d8e8,null));};function runReport(_0x5e93be,_0x3ffca4,_0x13e93a){var _0x20d0c9=_0x3ffca4[_0x1bf2('0x2d')];var _0x7286da=0xa;var _0x4df555=[_0x1bf2('0x88'),_0x1bf2('0x89'),_0x1bf2('0x59'),'cross_join'];var _0x2e72b0={'SUM':_0x1bf2('0x5a'),'COUNT':_0x1bf2('0x5b'),'COUNT DISTINCT':_0x1bf2('0x5c'),'MAX':_0x1bf2('0x5d'),'MIN':_0x1bf2('0x5e'),'AVG':_0x1bf2('0x5f'),'GROUP_CONCAT':_0x1bf2('0x60'),'GROUP_CONCAT ASC':_0x1bf2('0x8a'),'GROUP_CONCAT DESC':_0x1bf2('0x8b')};var _0x4511f5={'SEC_TO_TIME':_0x1bf2('0x8c'),'DATE':_0x1bf2('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x1bf2('0x62'),'UNIX_TIMESTAMP':_0x1bf2('0x63')};var _0x25bcab=function(_0xbf13f0){return!_[_0x1bf2('0x64')]([_0x1bf2('0x65'),_0x1bf2('0x66'),'IS\x20EMPTY',_0x1bf2('0x67')],_0xbf13f0);};var _0x1fa858=function(_0x3bfcfd){if(!_0x3bfcfd||!_0x3bfcfd[_0x1bf2('0x68')]['length']){return'';}for(var _0xcacfca='(',_0x35c4d0=0x0;_0x35c4d0<_0x3bfcfd['rules'][_0x1bf2('0x3a')];_0x35c4d0+=0x1){_0x35c4d0>0x0&&(_0xcacfca+='\x20'+_0x3bfcfd[_0x1bf2('0x8d')]+'\x20');_0xcacfca+=_0x3bfcfd[_0x1bf2('0x68')][_0x35c4d0][_0x1bf2('0x69')]?_0x1fa858(_0x3bfcfd[_0x1bf2('0x68')][_0x35c4d0][_0x1bf2('0x69')]):_0x3bfcfd[_0x1bf2('0x68')][_0x35c4d0]['field']+'\x20'+_0x3bfcfd[_0x1bf2('0x68')][_0x35c4d0][_0x1bf2('0x6b')]+(_0x25bcab(_0x3bfcfd[_0x1bf2('0x68')][_0x35c4d0][_0x1bf2('0x6b')])?'\x20'+_0x3bfcfd['rules'][_0x35c4d0][_0x1bf2('0x6c')]:'');}return _0xcacfca+')';};var _0x4d3a45={'where':{'id':_0x5e93be['id']}},_0x3082e5,_0x2712c9,_0x3f94bd,_0x7ce3c5,_0x4ea9bd;_0x4d3a45=_['merge']({},_0x4d3a45,_0x13e93a);return db['AnalyticCustomReport']['find'](_0x4d3a45)[_0x1bf2('0x26')](function(_0x1f80dc){if(_0x1f80dc){_0x3082e5=_0x1f80dc;return _0x1f80dc[_0x1bf2('0x6d')]();}return null;})['then'](function(_0x31063c){if(_0x31063c){if(!_0x31063c[_0x1bf2('0x3a')]){throw new db['Sequelize'][(_0x1bf2('0x6e'))](_0x1bf2('0x6f'),0x193);}_0x2712c9=_0x31063c;return db[_0x1bf2('0x70')]['findAll']({'raw':!![]});}return null;})[_0x1bf2('0x26')](function(_0x225617){if(_0x225617){_0x3f94bd=_[_0x1bf2('0x72')](_0x225617,'id');var _0x5cebac;var _0x3d69fb=squel[_0x1bf2('0x73')]();_0x3d69fb[_0x1bf2('0x8e')](_0x3082e5[_0x1bf2('0x7f')]);for(var _0x5ecc4c=0x0;_0x5ecc4c<_0x2712c9[_0x1bf2('0x3a')];_0x5ecc4c+=0x1){_0x5cebac=_0x2712c9[_0x5ecc4c]['MetricId']?_0x3f94bd[_0x2712c9[_0x5ecc4c][_0x1bf2('0x74')]][_0x1bf2('0x8f')]:_0x2712c9[_0x5ecc4c][_0x1bf2('0x6a')];_0x5cebac=_0x2712c9[_0x5ecc4c][_0x1bf2('0x75')]?_[_0x1bf2('0x76')](_0x2e72b0[_0x2712c9[_0x5ecc4c][_0x1bf2('0x75')]],'%s',_0x5cebac):_0x5cebac;_0x5cebac=_0x2712c9[_0x5ecc4c]['format']?_[_0x1bf2('0x76')](_0x4511f5[_0x2712c9[_0x5ecc4c]['format']],'%s',_0x5cebac):_0x5cebac;if(_0x2712c9[_0x5ecc4c][_0x1bf2('0x78')]){_0x3d69fb[_0x1bf2('0x69')](_0x5cebac);}_0x2712c9[_0x5ecc4c][_0x1bf2('0x79')]&&_0x3d69fb[_0x1bf2('0x3e')](_0x5cebac,_0x2712c9[_0x5ecc4c][_0x1bf2('0x79')]===_0x1bf2('0x90')?![]:!![]);_0x3d69fb[_0x1bf2('0x6a')](_0x5cebac,_0x2712c9[_0x5ecc4c][_0x1bf2('0x91')]||_0x5cebac);}if(_0x3082e5[_0x1bf2('0x7a')]){_0x3082e5[_0x1bf2('0x7a')]=JSON[_0x1bf2('0x7b')](_0x3082e5[_0x1bf2('0x7a')]);for(var _0x2be8ae=0x0;_0x2be8ae<_0x3082e5['joins'][_0x1bf2('0x3a')];_0x2be8ae+=0x1){if(_0x3082e5['joins'][_0x2be8ae][_0x1bf2('0x33')]&&_['includes'](_0x4df555,_0x3082e5['joins'][_0x2be8ae][_0x1bf2('0x33')])&&_0x3082e5[_0x1bf2('0x7a')][_0x2be8ae]['parentKey']&&_0x3082e5[_0x1bf2('0x7a')][_0x2be8ae][_0x1bf2('0x80')]&&_0x3082e5[_0x1bf2('0x7a')][_0x2be8ae][_0x1bf2('0x7d')]){_0x3d69fb[_0x3082e5[_0x1bf2('0x7a')][_0x2be8ae][_0x1bf2('0x33')]](_0x3082e5[_0x1bf2('0x7a')][_0x2be8ae][_0x1bf2('0x80')],null,util[_0x1bf2('0x77')](_0x1bf2('0x7e'),_0x3082e5[_0x1bf2('0x7f')],_0x3082e5[_0x1bf2('0x7a')][_0x2be8ae][_0x1bf2('0x7c')],_0x3082e5['joins'][_0x2be8ae][_0x1bf2('0x80')],_0x3082e5['joins'][_0x2be8ae]['foreignKey']));}}}if(_0x3082e5['conditions']){_0x3082e5[_0x1bf2('0x81')]=JSON['parse'](_0x3082e5[_0x1bf2('0x81')]);_0x3d69fb['where'](_0x1fa858(_0x3082e5[_0x1bf2('0x81')][_0x1bf2('0x69')]));}_0x4ea9bd=_0x3d69fb[_0x1bf2('0x92')]();_0x3d69fb['limit'](_0x7286da);_0x3d69fb['offset'](0x0);return;}})[_0x1bf2('0x26')](function(){if(_0x3ffca4[_0x1bf2('0x93')]==='web'){return null;}var _0xd6e73e=_[_0x1bf2('0x43')](_0x3ffca4,{'name':_0x3ffca4[_0x1bf2('0x94')]||_0x3ffca4[_0x1bf2('0x2d')]||_0x3082e5[_0x1bf2('0x2d')],'basename':_0x20d0c9,'savename':util[_0x1bf2('0x77')](_0x1bf2('0x95'),_0x3ffca4[_0x1bf2('0x2d')]||_0x3082e5[_0x1bf2('0x2d')],require(_0x1bf2('0x96'))[_0x1bf2('0x97')](0x4),_0x3ffca4[_0x1bf2('0x93')]||_0x1bf2('0x98')),'reportId':_0x3082e5['id'],'reportType':'custom'});return db[_0x1bf2('0x99')][_0x1bf2('0x4e')](_0xd6e73e,{'raw':!![]});})[_0x1bf2('0x26')](function(_0x59d180){if(_0x3082e5[_0x1bf2('0x7f')]===_0x1bf2('0x9a')){_0x4ea9bd[_0x1bf2('0x40')](_0x3082e5[_0x1bf2('0x7f')]+_0x1bf2('0x9b'),_0x3ffca4[_0x1bf2('0x9c')],_0x3ffca4[_0x1bf2('0x9d')]);}else{_0x4ea9bd[_0x1bf2('0x40')](_0x3082e5['table']+_0x1bf2('0x9e'),_0x3ffca4[_0x1bf2('0x9c')],_0x3ffca4[_0x1bf2('0x9d')]);}if(_0x59d180){logger['info']('Run\x20Query:',_0x4ea9bd[_0x1bf2('0x84')]());require(_0x1bf2('0x9f'))[_0x1bf2('0xa0')](path[_0x1bf2('0x88')](__dirname,_0x1bf2('0xa1'),_0x59d180['output']),[_0x59d180['id'],_0x4ea9bd['toString'](),path[_0x1bf2('0x88')](__dirname,'../../files/reports',_0x59d180[_0x1bf2('0xa2')]),_0x20d0c9]);return _0x59d180;}else{var _0x1d379e=squel[_0x1bf2('0x73')]();_0x1d379e['from']('('+_0x4ea9bd[_0x1bf2('0x84')]()+')','countTable');_0x1d379e[_0x1bf2('0x6a')](_0x1bf2('0xa3'),'count');_0x4ea9bd[_0x1bf2('0x3d')](_0x3ffca4['limit']||_0x7286da);_0x4ea9bd[_0x1bf2('0x1f')](_0x3ffca4[_0x1bf2('0x1f')]||0x0);return dbH['sequelize']['query'](_0x1d379e['toString'](),{'type':dbH[_0x1bf2('0x85')][_0x1bf2('0x86')][_0x1bf2('0x87')]})['then'](function(_0x1f4cad){if(!_0x1f4cad[_0x1bf2('0x3a')]){_0x7ce3c5=0x0;}else{_0x7ce3c5=_0x1f4cad[0x0]['count']||0x0;}return dbH[_0x1bf2('0x85')]['query'](_0x4ea9bd[_0x1bf2('0x84')](),{'type':dbH[_0x1bf2('0x85')][_0x1bf2('0x86')][_0x1bf2('0x87')]});})[_0x1bf2('0x26')](function(_0x3d4601){return{'rows':_0x3d4601||[],'count':_0x7ce3c5};});}});}exports['run']=function(_0x5a06e9,_0x184c2b){return runReport(_0x5a06e9[_0x1bf2('0x4a')],_0x5a06e9['query'],_0x5a06e9[_0x1bf2('0x45')])['then'](respondWithResult(_0x184c2b,null))[_0x1bf2('0x4d')](handleError(_0x184c2b,null));};exports[_0x1bf2('0xa4')]=runReport;exports['query']=function(_0x7169b,_0x4048ac){var _0x4ada0a=0xa;var _0xa24947=[_0x1bf2('0x88'),_0x1bf2('0x89'),_0x1bf2('0x59'),_0x1bf2('0xa5')];var _0x25ed78={'SUM':_0x1bf2('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1bf2('0x5c'),'MAX':'MAX(%s)','MIN':_0x1bf2('0x5e'),'AVG':_0x1bf2('0x5f'),'GROUP_CONCAT':_0x1bf2('0x60'),'GROUP_CONCAT ASC':_0x1bf2('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x51877e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1bf2('0x61'),'HOUR':_0x1bf2('0xa6'),'ROUND':_0x1bf2('0x62'),'UNIX_TIMESTAMP':_0x1bf2('0x63')};var _0x136ba2=function(_0x12cafa){return!_[_0x1bf2('0x64')]([_0x1bf2('0x65'),'IS\x20NOT\x20NULL',_0x1bf2('0xa7'),_0x1bf2('0x67')],_0x12cafa);};var _0x2cc744=function(_0x59286a){if(!_0x59286a||!_0x59286a[_0x1bf2('0x68')]['length']){return'';}for(var _0x531338='(',_0x132c4f=0x0;_0x132c4f<_0x59286a[_0x1bf2('0x68')][_0x1bf2('0x3a')];_0x132c4f+=0x1){_0x132c4f>0x0&&(_0x531338+='\x20'+_0x59286a['operator']+'\x20');_0x531338+=_0x59286a[_0x1bf2('0x68')][_0x132c4f][_0x1bf2('0x69')]?_0x2cc744(_0x59286a[_0x1bf2('0x68')][_0x132c4f][_0x1bf2('0x69')]):_0x59286a[_0x1bf2('0x68')][_0x132c4f]['field']+'\x20'+_0x59286a[_0x1bf2('0x68')][_0x132c4f][_0x1bf2('0x6b')]+(_0x136ba2(_0x59286a[_0x1bf2('0x68')][_0x132c4f][_0x1bf2('0x6b')])?'\x20'+_0x59286a[_0x1bf2('0x68')][_0x132c4f][_0x1bf2('0x6c')]:'');}return _0x531338+')';};var _0xbe0bb1={'where':{'id':_0x7169b[_0x1bf2('0x4a')]['id']}},_0x59ae19,_0x586dd9,_0x3a780c,_0x343a0a,_0xf36346;_0xbe0bb1=_[_0x1bf2('0x43')]({},_0xbe0bb1,_0x7169b['options']);return db[_0x1bf2('0x30')][_0x1bf2('0x4c')](_0xbe0bb1)[_0x1bf2('0x26')](function(_0x54fa0e){if(_0x54fa0e){_0x59ae19=_0x54fa0e;return _0x54fa0e['getFields']();}return null;})[_0x1bf2('0x26')](function(_0x59aa12){if(_0x59aa12){if(!_0x59aa12['length']){throw new db['Sequelize'][(_0x1bf2('0x6e'))](_0x1bf2('0x6f'),0x193);}_0x586dd9=_0x59aa12;return db[_0x1bf2('0x70')][_0x1bf2('0x71')]({'raw':!![]});}return null;})[_0x1bf2('0x26')](function(_0x21177c){if(_0x21177c){_0x3a780c=_[_0x1bf2('0x72')](_0x21177c,'id');var _0x571448;var _0xc38d16=squel[_0x1bf2('0x73')]();_0xc38d16[_0x1bf2('0x8e')](_0x59ae19[_0x1bf2('0x7f')]);for(var _0x32eaad=0x0;_0x32eaad<_0x586dd9['length'];_0x32eaad+=0x1){_0x571448=_0x586dd9[_0x32eaad][_0x1bf2('0x74')]?_0x3a780c[_0x586dd9[_0x32eaad]['MetricId']][_0x1bf2('0x8f')]:_0x586dd9[_0x32eaad][_0x1bf2('0x6a')];_0x571448=_0x586dd9[_0x32eaad][_0x1bf2('0x75')]?_[_0x1bf2('0x76')](_0x25ed78[_0x586dd9[_0x32eaad][_0x1bf2('0x75')]],'%s',_0x571448):_0x571448;_0x571448=_0x586dd9[_0x32eaad][_0x1bf2('0x77')]?_[_0x1bf2('0x76')](_0x51877e[_0x586dd9[_0x32eaad][_0x1bf2('0x77')]],'%s',_0x571448):_0x571448;if(_0x586dd9[_0x32eaad]['groupBy']){_0xc38d16[_0x1bf2('0x69')](_0x571448);}_0x586dd9[_0x32eaad][_0x1bf2('0x79')]&&_0xc38d16[_0x1bf2('0x3e')](_0x571448,_0x586dd9[_0x32eaad][_0x1bf2('0x79')]===_0x1bf2('0x90')?![]:!![]);_0xc38d16[_0x1bf2('0x6a')](_0x571448,_0x586dd9[_0x32eaad][_0x1bf2('0x91')]||_0x571448);}if(_0x59ae19[_0x1bf2('0x7a')]){_0x59ae19[_0x1bf2('0x7a')]=JSON['parse'](_0x59ae19[_0x1bf2('0x7a')]);for(var _0x5e98f1=0x0;_0x5e98f1<_0x59ae19[_0x1bf2('0x7a')][_0x1bf2('0x3a')];_0x5e98f1+=0x1){if(_0x59ae19['joins'][_0x5e98f1][_0x1bf2('0x33')]&&_[_0x1bf2('0x64')](_0xa24947,_0x59ae19['joins'][_0x5e98f1][_0x1bf2('0x33')])&&_0x59ae19[_0x1bf2('0x7a')][_0x5e98f1]['parentKey']&&_0x59ae19['joins'][_0x5e98f1][_0x1bf2('0x80')]&&_0x59ae19[_0x1bf2('0x7a')][_0x5e98f1][_0x1bf2('0x7d')]){_0xc38d16[_0x59ae19[_0x1bf2('0x7a')][_0x5e98f1][_0x1bf2('0x33')]](_0x59ae19[_0x1bf2('0x7a')][_0x5e98f1]['foreignTable'],null,util[_0x1bf2('0x77')](_0x1bf2('0x7e'),_0x59ae19[_0x1bf2('0x7f')],_0x59ae19[_0x1bf2('0x7a')][_0x5e98f1][_0x1bf2('0x7c')],_0x59ae19[_0x1bf2('0x7a')][_0x5e98f1][_0x1bf2('0x80')],_0x59ae19['joins'][_0x5e98f1][_0x1bf2('0x7d')]));}}}if(_0x59ae19[_0x1bf2('0x81')]){_0x59ae19[_0x1bf2('0x81')]=JSON[_0x1bf2('0x7b')](_0x59ae19[_0x1bf2('0x81')]);_0xc38d16['where'](_0x2cc744(_0x59ae19[_0x1bf2('0x81')][_0x1bf2('0x69')]));}_0xf36346=_0xc38d16[_0x1bf2('0x92')]();_0xc38d16[_0x1bf2('0x3d')](_0x4ada0a);_0xc38d16[_0x1bf2('0x1f')](0x0);logger['debug'](_0x1bf2('0x83'),_0xc38d16['toString']());return dbH['sequelize'][_0x1bf2('0x36')](_0xc38d16[_0x1bf2('0x84')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0xf36346[_0x1bf2('0x84')]()};})[_0x1bf2('0x26')](respondWithResult(_0x4048ac,null))[_0x1bf2('0x4d')](handleError(_0x4048ac,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 70cecc8..0fbebdc 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 _0xf418=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports'];(function(_0x42a791,_0x1f32c7){var _0x1732b1=function(_0x5ed167){while(--_0x5ed167){_0x42a791['push'](_0x42a791['shift']());}};_0x1732b1(++_0x1f32c7);}(_0xf418,0xf0));var _0x8f41=function(_0x1da3a4,_0x5a5a8b){_0x1da3a4=_0x1da3a4-0x0;var _0x88c6ab=_0xf418[_0x1da3a4];return _0x88c6ab;};'use strict';var _=require(_0x8f41('0x0'));var util=require('util');var logger=require(_0x8f41('0x1'))(_0x8f41('0x2'));var moment=require(_0x8f41('0x3'));var BPromise=require(_0x8f41('0x4'));var rp=require(_0x8f41('0x5'));var fs=require('fs');var path=require(_0x8f41('0x6'));var rimraf=require('rimraf');var config=require(_0x8f41('0x7'));var attributes=require(_0x8f41('0x8'));module[_0x8f41('0x9')]=function(_0x1bb3d1,_0x3d002b){return _0x1bb3d1[_0x8f41('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x8f41('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e55=['moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e55,0x127));var _0x53e5=function(_0x4fff26,_0x4ba88e){_0x4fff26=_0x4fff26-0x0;var _0x56cb24=_0x3e55[_0x4fff26];return _0x56cb24;};'use strict';var _=require(_0x53e5('0x0'));var util=require('util');var logger=require(_0x53e5('0x1'))('api');var moment=require(_0x53e5('0x2'));var BPromise=require(_0x53e5('0x3'));var rp=require(_0x53e5('0x4'));var fs=require('fs');var path=require(_0x53e5('0x5'));var rimraf=require(_0x53e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x53e5('0x7'));module[_0x53e5('0x8')]=function(_0x3e1db9,_0x53baf0){return _0x3e1db9['define'](_0x53e5('0x9'),attributes,{'tableName':_0x53e5('0xa'),'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 f8aee97..63dd15d 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 _0x81d0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x35fc3a,_0x327ea7){var _0x339c58=function(_0x1a22ff){while(--_0x1a22ff){_0x35fc3a['push'](_0x35fc3a['shift']());}};_0x339c58(++_0x327ea7);}(_0x81d0,0x119));var _0x081d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x081d('0x0'));var util=require(_0x081d('0x1'));var moment=require(_0x081d('0x2'));var BPromise=require('bluebird');var rs=require(_0x081d('0x3'));var fs=require('fs');var Redis=require(_0x081d('0x4'));var db=require(_0x081d('0x5'))['db'];var utils=require(_0x081d('0x6'));var logger=require(_0x081d('0x7'))(_0x081d('0x8'));var config=require(_0x081d('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7922d9,_0x17cb85,_0x296270){return new BPromise(function(_0x4406ee,_0x3b3b6a){return client[_0x081d('0xa')](_0x7922d9,_0x296270)[_0x081d('0xb')](function(_0x15a1b8){logger[_0x081d('0xc')](_0x081d('0xd'),_0x17cb85,'request\x20sent');logger[_0x081d('0xe')](_0x081d('0xf'),_0x17cb85,'request\x20sent',JSON[_0x081d('0x10')](_0x15a1b8));if(_0x15a1b8[_0x081d('0x11')]){if(_0x15a1b8[_0x081d('0x11')]['code']===0x1f4){logger[_0x081d('0x11')](_0x081d('0xd'),_0x17cb85,_0x15a1b8[_0x081d('0x11')][_0x081d('0x12')]);return _0x3b3b6a(_0x15a1b8[_0x081d('0x11')][_0x081d('0x12')]);}logger[_0x081d('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x17cb85,_0x15a1b8[_0x081d('0x11')][_0x081d('0x12')]);return _0x4406ee(_0x15a1b8['error'][_0x081d('0x12')]);}else{logger[_0x081d('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x17cb85,_0x081d('0x13'));_0x4406ee(_0x15a1b8[_0x081d('0x14')][_0x081d('0x12')]);}})[_0x081d('0x15')](function(_0x1cbcf5){logger[_0x081d('0x11')](_0x081d('0xd'),_0x17cb85,_0x1cbcf5);_0x3b3b6a(_0x1cbcf5);});});}
\ No newline at end of file
+var _0xd9f4=['message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd9f4,0xac));var _0x4d9f=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xd9f4[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x4d9f('0x0'));var util=require('util');var moment=require(_0x4d9f('0x1'));var BPromise=require(_0x4d9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d9f('0x3'));var db=require(_0x4d9f('0x4'))['db'];var utils=require(_0x4d9f('0x5'));var logger=require('../../config/logger')(_0x4d9f('0x6'));var config=require(_0x4d9f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc6df,_0x4002fd,_0x473fe7){return new BPromise(function(_0x216980,_0x164560){return client[_0x4d9f('0x8')](_0x4dc6df,_0x473fe7)[_0x4d9f('0x9')](function(_0xa40336){logger[_0x4d9f('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4002fd,_0x4d9f('0xb'));logger[_0x4d9f('0xc')](_0x4d9f('0xd'),_0x4002fd,_0x4d9f('0xb'),JSON[_0x4d9f('0xe')](_0xa40336));if(_0xa40336[_0x4d9f('0xf')]){if(_0xa40336[_0x4d9f('0xf')][_0x4d9f('0x10')]===0x1f4){logger['error'](_0x4d9f('0x11'),_0x4002fd,_0xa40336[_0x4d9f('0xf')]['message']);return _0x164560(_0xa40336['error'][_0x4d9f('0x12')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4002fd,_0xa40336[_0x4d9f('0xf')][_0x4d9f('0x12')]);return _0x216980(_0xa40336[_0x4d9f('0xf')][_0x4d9f('0x12')]);}else{logger['info'](_0x4d9f('0x11'),_0x4002fd,_0x4d9f('0xb'));_0x216980(_0xa40336['result'][_0x4d9f('0x12')]);}})['catch'](function(_0x5456ae){logger[_0x4d9f('0xf')](_0x4d9f('0x11'),_0x4002fd,_0x5456ae);_0x164560(_0x5456ae);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 72efb4a..43b68b9 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 _0xbc2c=['/:id/query','query','create','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x1305a5,_0x43a964){var _0x4df750=function(_0x217da7){while(--_0x217da7){_0x1305a5['push'](_0x1305a5['shift']());}};_0x4df750(++_0x43a964);}(_0xbc2c,0x19e));var _0xcbc2=function(_0x2fe383,_0x4ca01b){_0x2fe383=_0x2fe383-0x0;var _0x496a15=_0xbc2c[_0x2fe383];return _0x496a15;};'use strict';var multer=require(_0xcbc2('0x0'));var util=require(_0xcbc2('0x1'));var path=require(_0xcbc2('0x2'));var timeout=require('connect-timeout');var express=require(_0xcbc2('0x3'));var router=express[_0xcbc2('0x4')]();var fs_extra=require(_0xcbc2('0x5'));var auth=require(_0xcbc2('0x6'));var interaction=require(_0xcbc2('0x7'));var config=require(_0xcbc2('0x8'));var controller=require(_0xcbc2('0x9'));router[_0xcbc2('0xa')]('/',auth[_0xcbc2('0xb')](),controller[_0xcbc2('0xc')]);router[_0xcbc2('0xa')](_0xcbc2('0xd'),auth[_0xcbc2('0xb')](),controller[_0xcbc2('0xe')]);router['get'](_0xcbc2('0xf'),auth[_0xcbc2('0xb')](),controller[_0xcbc2('0x10')]);router[_0xcbc2('0xa')](_0xcbc2('0x11'),auth[_0xcbc2('0xb')](),controller['run']);router[_0xcbc2('0xa')](_0xcbc2('0x12'),auth[_0xcbc2('0xb')](),controller[_0xcbc2('0x13')]);router['post']('/',auth[_0xcbc2('0xb')](),controller[_0xcbc2('0x14')]);router['put']('/:id',auth[_0xcbc2('0xb')](),controller[_0xcbc2('0x15')]);router[_0xcbc2('0x16')](_0xcbc2('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xcbc2('0x17')]=router;
\ No newline at end of file
+var _0x2cb4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete'];(function(_0x459a5c,_0x5caa61){var _0x138038=function(_0xe10aa4){while(--_0xe10aa4){_0x459a5c['push'](_0x459a5c['shift']());}};_0x138038(++_0x5caa61);}(_0x2cb4,0x1cc));var _0x42cb=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0x2cb4[_0x4fa0ea];return _0x51d027;};'use strict';var multer=require(_0x42cb('0x0'));var util=require(_0x42cb('0x1'));var path=require(_0x42cb('0x2'));var timeout=require(_0x42cb('0x3'));var express=require(_0x42cb('0x4'));var router=express[_0x42cb('0x5')]();var fs_extra=require(_0x42cb('0x6'));var auth=require(_0x42cb('0x7'));var interaction=require(_0x42cb('0x8'));var config=require(_0x42cb('0x9'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x42cb('0xa')](),controller[_0x42cb('0xb')]);router[_0x42cb('0xc')](_0x42cb('0xd'),auth[_0x42cb('0xa')](),controller[_0x42cb('0xe')]);router['get'](_0x42cb('0xf'),auth[_0x42cb('0xa')](),controller[_0x42cb('0x10')]);router['get'](_0x42cb('0x11'),auth[_0x42cb('0xa')](),controller[_0x42cb('0x12')]);router['get'](_0x42cb('0x13'),auth[_0x42cb('0xa')](),controller[_0x42cb('0x14')]);router[_0x42cb('0x15')]('/',auth['isAuthenticated'](),controller[_0x42cb('0x16')]);router[_0x42cb('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x42cb('0x18')]);router[_0x42cb('0x19')](_0x42cb('0xd'),auth[_0x42cb('0xa')](),controller['destroy']);module[_0x42cb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index e6d98bf..2ba31bc 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 _0x71ab=['TEXT','exports','STRING'];(function(_0x4e611c,_0x3a3057){var _0x168a72=function(_0x32ddcf){while(--_0x32ddcf){_0x4e611c['push'](_0x4e611c['shift']());}};_0x168a72(++_0x3a3057);}(_0x71ab,0x64));var _0xb71a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71ab[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
+var _0x6aa7=['TEXT','sequelize','STRING'];(function(_0x36d2a1,_0x176456){var _0x5de65d=function(_0xb44b57){while(--_0xb44b57){_0x36d2a1['push'](_0x36d2a1['shift']());}};_0x5de65d(++_0x176456);}(_0x6aa7,0x178));var _0x76aa=function(_0x560406,_0x3da3f7){_0x560406=_0x560406-0x0;var _0x4e2bbf=_0x6aa7[_0x560406];return _0x4e2bbf;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x76aa('0x1')]},'parent':{'type':Sequelize[_0x76aa('0x1')]},'table':{'type':Sequelize[_0x76aa('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x76aa('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 430acb4..fbadf27 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(_0x3af576,_0x2b4be0){var _0xca84cd=function(_0x68403b){while(--_0x68403b){_0x3af576['push'](_0x3af576['shift']());}};_0xca84cd(++_0x2b4be0);}(_0x4975,0x86));var _0x5497=function(_0x4af63b,_0x3fa86b){_0x4af63b=_0x4af63b-0x0;var _0x1d59ab=_0x4975[_0x4af63b];return _0x1d59ab;};'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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x2e726e,_0x3faf87){var _0x273748=function(_0x3d9fbb){while(--_0x3d9fbb){_0x2e726e['push'](_0x2e726e['shift']());}};_0x273748(++_0x3faf87);}(_0xda19,0xd5));var _0x9da1=function(_0x45cafc,_0x37c891){_0x45cafc=_0x45cafc-0x0;var _0x21d385=_0xda19[_0x45cafc];return _0x21d385;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index b17b6b0..5ccb2ac 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 _0xdee9=['../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdee9,0x1b2));var _0x9dee=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xdee9[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x9dee('0x0'));var util=require(_0x9dee('0x1'));var logger=require(_0x9dee('0x2'))(_0x9dee('0x3'));var moment=require('moment');var BPromise=require(_0x9dee('0x4'));var rp=require(_0x9dee('0x5'));var fs=require('fs');var path=require(_0x9dee('0x6'));var rimraf=require(_0x9dee('0x7'));var config=require(_0x9dee('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x9dee('0x9')]=function(_0x17a4b7,_0x687199){return _0x17a4b7[_0x9dee('0xa')](_0x9dee('0xb'),attributes,{'tableName':_0x9dee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe797=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash'];(function(_0x247b94,_0x57ed01){var _0x50029f=function(_0x51013d){while(--_0x51013d){_0x247b94['push'](_0x247b94['shift']());}};_0x50029f(++_0x57ed01);}(_0xe797,0xdc));var _0x7e79=function(_0x2f8b86,_0x14fb9f){_0x2f8b86=_0x2f8b86-0x0;var _0x340414=_0xe797[_0x2f8b86];return _0x340414;};'use strict';var _=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var logger=require(_0x7e79('0x2'))(_0x7e79('0x3'));var moment=require(_0x7e79('0x4'));var BPromise=require(_0x7e79('0x5'));var rp=require(_0x7e79('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e79('0x7'));var config=require(_0x7e79('0x8'));var attributes=require(_0x7e79('0x9'));module[_0x7e79('0xa')]=function(_0x19c696,_0x501ba6){return _0x19c696[_0x7e79('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x7e79('0xc'),'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 5b756f8..e616858 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 _0xcf7a=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x35b201,_0x4a6e0c){var _0x998cc0=function(_0x2f0565){while(--_0x2f0565){_0x35b201['push'](_0x35b201['shift']());}};_0x998cc0(++_0x4a6e0c);}(_0xcf7a,0x1a7));var _0xacf7=function(_0x169c25,_0xb9b181){_0x169c25=_0x169c25-0x0;var _0x3688b4=_0xcf7a[_0x169c25];return _0x3688b4;};'use strict';var _=require(_0xacf7('0x0'));var util=require(_0xacf7('0x1'));var moment=require(_0xacf7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacf7('0x3'));var db=require(_0xacf7('0x4'))['db'];var utils=require(_0xacf7('0x5'));var logger=require(_0xacf7('0x6'))(_0xacf7('0x7'));var config=require(_0xacf7('0x8'));var jayson=require(_0xacf7('0x9'));var client=jayson[_0xacf7('0xa')][_0xacf7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17d1f9,_0x616916,_0x3cc8e9){return new BPromise(function(_0x5cf8a9,_0x4547a1){return client[_0xacf7('0xc')](_0x17d1f9,_0x3cc8e9)[_0xacf7('0xd')](function(_0x1266e0){logger['info'](_0xacf7('0xe'),_0x616916,_0xacf7('0xf'));logger[_0xacf7('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x616916,_0xacf7('0xf'),JSON[_0xacf7('0x11')](_0x1266e0));if(_0x1266e0['error']){if(_0x1266e0[_0xacf7('0x12')][_0xacf7('0x13')]===0x1f4){logger[_0xacf7('0x12')](_0xacf7('0xe'),_0x616916,_0x1266e0[_0xacf7('0x12')][_0xacf7('0x14')]);return _0x4547a1(_0x1266e0[_0xacf7('0x12')][_0xacf7('0x14')]);}logger['error'](_0xacf7('0xe'),_0x616916,_0x1266e0[_0xacf7('0x12')][_0xacf7('0x14')]);return _0x5cf8a9(_0x1266e0[_0xacf7('0x12')]['message']);}else{logger[_0xacf7('0x15')](_0xacf7('0xe'),_0x616916,'request\x20sent');_0x5cf8a9(_0x1266e0[_0xacf7('0x16')]['message']);}})['catch'](function(_0x230022){logger[_0xacf7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x616916,_0x230022);_0x4547a1(_0x230022);});});}
\ No newline at end of file
+var _0x4d30=['code','AnalyticDefaultReport,\x20%s,\x20%s','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x152341,_0x8f0c56){var _0x440e1b=function(_0x33918f){while(--_0x33918f){_0x152341['push'](_0x152341['shift']());}};_0x440e1b(++_0x8f0c56);}(_0x4d30,0xc6));var _0x04d3=function(_0x362fd0,_0x316ea4){_0x362fd0=_0x362fd0-0x0;var _0x3e20bb=_0x4d30[_0x362fd0];return _0x3e20bb;};'use strict';var _=require('lodash');var util=require(_0x04d3('0x0'));var moment=require(_0x04d3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04d3('0x2'));var db=require(_0x04d3('0x3'))['db'];var utils=require(_0x04d3('0x4'));var logger=require(_0x04d3('0x5'))(_0x04d3('0x6'));var config=require(_0x04d3('0x7'));var jayson=require(_0x04d3('0x8'));var client=jayson[_0x04d3('0x9')][_0x04d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ae4db,_0x21d8b2,_0x3875f4){return new BPromise(function(_0x470fcb,_0x16f8a1){return client[_0x04d3('0xb')](_0x2ae4db,_0x3875f4)[_0x04d3('0xc')](function(_0xdcea8c){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x21d8b2,'request\x20sent');logger[_0x04d3('0xd')](_0x04d3('0xe'),_0x21d8b2,_0x04d3('0xf'),JSON[_0x04d3('0x10')](_0xdcea8c));if(_0xdcea8c['error']){if(_0xdcea8c[_0x04d3('0x11')][_0x04d3('0x12')]===0x1f4){logger['error'](_0x04d3('0x13'),_0x21d8b2,_0xdcea8c[_0x04d3('0x11')][_0x04d3('0x14')]);return _0x16f8a1(_0xdcea8c[_0x04d3('0x11')][_0x04d3('0x14')]);}logger[_0x04d3('0x11')](_0x04d3('0x13'),_0x21d8b2,_0xdcea8c[_0x04d3('0x11')][_0x04d3('0x14')]);return _0x470fcb(_0xdcea8c[_0x04d3('0x11')][_0x04d3('0x14')]);}else{logger[_0x04d3('0x15')](_0x04d3('0x13'),_0x21d8b2,_0x04d3('0xf'));_0x470fcb(_0xdcea8c[_0x04d3('0x16')][_0x04d3('0x14')]);}})[_0x04d3('0x17')](function(_0x5cb6b3){logger[_0x04d3('0x11')](_0x04d3('0x13'),_0x21d8b2,_0x5cb6b3);_0x16f8a1(_0x5cb6b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 42e3a16..ba71f49 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 _0xc627=['get','/:id','show','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xc627,0x12b));var _0x7c62=function(_0x2ea107,_0xd3322a){_0x2ea107=_0x2ea107-0x0;var _0xd82057=_0xc627[_0x2ea107];return _0xd82057;};'use strict';var multer=require(_0x7c62('0x0'));var util=require(_0x7c62('0x1'));var path=require(_0x7c62('0x2'));var timeout=require(_0x7c62('0x3'));var express=require(_0x7c62('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7c62('0x5'));var controller=require(_0x7c62('0x6'));router['get']('/',auth[_0x7c62('0x7')](),controller[_0x7c62('0x8')]);router[_0x7c62('0x9')](_0x7c62('0xa'),auth[_0x7c62('0x7')](),controller[_0x7c62('0xb')]);router['get']('/:id/preview',auth[_0x7c62('0x7')](),controller['preview']);router[_0x7c62('0x9')](_0x7c62('0xc'),auth[_0x7c62('0x7')](),controller[_0x7c62('0xd')]);router['get'](_0x7c62('0xe'),auth[_0x7c62('0x7')](),controller[_0x7c62('0xf')]);router[_0x7c62('0x10')]('/',auth[_0x7c62('0x7')](),controller[_0x7c62('0x11')]);router[_0x7c62('0x12')](_0x7c62('0xa'),auth['isAuthenticated'](),controller[_0x7c62('0x13')]);router[_0x7c62('0x14')](_0x7c62('0xa'),auth[_0x7c62('0x7')](),controller[_0x7c62('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x4af0=['isAuthenticated','preview','/:id/run','run','query','post','create','put','delete','destroy','exports','path','express','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','show','/:id/preview'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x4af0,0x15b));var _0x04af=function(_0x52d637,_0x4f76ce){_0x52d637=_0x52d637-0x0;var _0x2de925=_0x4af0[_0x52d637];return _0x2de925;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x04af('0x0'));var timeout=require('connect-timeout');var express=require(_0x04af('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x04af('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x04af('0x3'));var controller=require(_0x04af('0x4'));router[_0x04af('0x5')]('/',auth['isAuthenticated'](),controller[_0x04af('0x6')]);router[_0x04af('0x5')](_0x04af('0x7'),auth['isAuthenticated'](),controller[_0x04af('0x8')]);router[_0x04af('0x5')](_0x04af('0x9'),auth[_0x04af('0xa')](),controller[_0x04af('0xb')]);router[_0x04af('0x5')](_0x04af('0xc'),auth[_0x04af('0xa')](),controller[_0x04af('0xd')]);router[_0x04af('0x5')]('/:id/query',auth[_0x04af('0xa')](),controller[_0x04af('0xe')]);router[_0x04af('0xf')]('/',auth[_0x04af('0xa')](),controller[_0x04af('0x10')]);router[_0x04af('0x11')](_0x04af('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x04af('0x12')](_0x04af('0x7'),auth[_0x04af('0xa')](),controller[_0x04af('0x13')]);module[_0x04af('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 1a64d61..8f2e77d 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 _0x6574=['exports','STRING','ENUM','xlsx','DATE','scheduled','manual','INTEGER','sequelize','moment'];(function(_0x5bfdc1,_0x7b1e19){var _0xd18268=function(_0x43ff55){while(--_0x43ff55){_0x5bfdc1['push'](_0x5bfdc1['shift']());}};_0xd18268(++_0x7b1e19);}(_0x6574,0x18e));var _0x4657=function(_0x50dea1,_0x3dc580){_0x50dea1=_0x50dea1-0x0;var _0x300b3f=_0x6574[_0x50dea1];return _0x300b3f;};'use strict';var Sequelize=require(_0x4657('0x0'));var moment=require(_0x4657('0x1'));module[_0x4657('0x2')]={'name':{'type':Sequelize[_0x4657('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x4657('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x4657('0x4')]('csv','pdf',_0x4657('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x4657('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x4657('0x6')]},'status':{'type':Sequelize[_0x4657('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0x4657('0x7')),'allowNull':![],'defaultValue':_0x4657('0x8')},'reportId':{'type':Sequelize[_0x4657('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x4657('0x3')]}};
\ No newline at end of file
+var _0x73bc=['exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','INTEGER','sequelize','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x73bc,0xfa));var _0xc73b=function(_0x2afb83,_0x567025){_0x2afb83=_0x2afb83-0x0;var _0x4ecfcf=_0x73bc[_0x2afb83];return _0x4ecfcf;};'use strict';var Sequelize=require(_0xc73b('0x0'));var moment=require(_0xc73b('0x1'));module[_0xc73b('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc73b('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xc73b('0x4'),_0xc73b('0x5'),_0xc73b('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xc73b('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc73b('0x7')]},'endDate':{'type':Sequelize[_0xc73b('0x7')]},'status':{'type':Sequelize[_0xc73b('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xc73b('0x8')](_0xc73b('0x9'),_0xc73b('0xa')),'allowNull':![],'defaultValue':_0xc73b('0x9')},'reportId':{'type':Sequelize[_0xc73b('0xb')](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 47f12e6..5cd6f25 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 _0x24d5=['request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','ExtractedReports','end','sendStatus','error','name','send','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','join','savename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14639e,_0x2407e0){var _0x49be63=function(_0x27dbc4){while(--_0x27dbc4){_0x14639e['push'](_0x14639e['shift']());}};_0x49be63(++_0x2407e0);}(_0x24d5,0x116));var _0x524d=function(_0x377408,_0x1e2f33){_0x377408=_0x377408-0x0;var _0x4769d4=_0x24d5[_0x377408];return _0x4769d4;};'use strict';var emlformat=require(_0x524d('0x0'));var rimraf=require(_0x524d('0x1'));var zipdir=require(_0x524d('0x2'));var jsonpatch=require(_0x524d('0x3'));var rp=require(_0x524d('0x4'));var moment=require(_0x524d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x524d('0x6'));var util=require('util');var path=require(_0x524d('0x7'));var sox=require(_0x524d('0x8'));var csv=require(_0x524d('0x9'));var ejs=require(_0x524d('0xa'));var fs=require('fs');var fs_extra=require(_0x524d('0xb'));var _=require(_0x524d('0xc'));var squel=require(_0x524d('0xd'));var crypto=require(_0x524d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x524d('0xf'));var toCsv=require(_0x524d('0x9'));var querystring=require('querystring');var Papa=require(_0x524d('0x10'));var Redis=require(_0x524d('0x11'));var authService=require(_0x524d('0x12'));var qs=require(_0x524d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x524d('0x14'));var logger=require(_0x524d('0x15'))('api');var utils=require(_0x524d('0x16'));var config=require(_0x524d('0x17'));var licenseUtil=require(_0x524d('0x18'));var db=require(_0x524d('0x19'))['db'];function respondWithStatusCode(_0x3d6b1a,_0x36d164){_0x36d164=_0x36d164||0xcc;return function(_0x4f473c){if(_0x4f473c){return _0x3d6b1a['sendStatus'](_0x36d164);}return _0x3d6b1a['status'](_0x36d164)['end']();};}function respondWithResult(_0x23d557,_0x1aa443){_0x1aa443=_0x1aa443||0xc8;return function(_0x2f0e8f){if(_0x2f0e8f){return _0x23d557[_0x524d('0x1a')](_0x1aa443)[_0x524d('0x1b')](_0x2f0e8f);}};}function respondWithFilteredResult(_0x8297f,_0x47a8d8){return function(_0x5b3491){if(_0x5b3491){var _0x1de0e9=typeof _0x47a8d8[_0x524d('0x1c')]===_0x524d('0x1d')&&typeof _0x47a8d8[_0x524d('0x1e')]===_0x524d('0x1d');var _0x2ab3fd=_0x5b3491[_0x524d('0x1f')];var _0x44f4bb=_0x1de0e9?0x0:_0x47a8d8[_0x524d('0x1c')];var _0x427124=_0x1de0e9?_0x5b3491[_0x524d('0x1f')]:_0x47a8d8['offset']+_0x47a8d8[_0x524d('0x1e')];var _0x27ac00;if(_0x427124>=_0x2ab3fd){_0x427124=_0x2ab3fd;_0x27ac00=0xc8;}else{_0x27ac00=0xce;}_0x8297f['status'](_0x27ac00);return _0x8297f['set'](_0x524d('0x20'),_0x44f4bb+'-'+_0x427124+'/'+_0x2ab3fd)[_0x524d('0x1b')](_0x5b3491);}return null;};}function patchUpdates(_0x575808){return function(_0x34ef9d){try{jsonpatch['apply'](_0x34ef9d,_0x575808,!![]);}catch(_0x8d6f64){return BPromise['reject'](_0x8d6f64);}return _0x34ef9d['save']();};}function saveUpdates(_0x3550cd,_0x43897b){return function(_0x129ca0){if(_0x129ca0){return _0x129ca0[_0x524d('0x21')](_0x3550cd)[_0x524d('0x22')](function(_0x511d35){return _0x511d35;});}return null;};}function removeEntity(_0x4167e6,_0x34241e){return function(_0x2fd24a){if(_0x2fd24a){return _0x2fd24a[_0x524d('0x23')]()[_0x524d('0x22')](function(){var _0x2aab56=_0x2fd24a['get']({'plain':!![]});var _0x12decf=_0x524d('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x12decf,'resourceId':_0x2aab56['id']}})[_0x524d('0x22')](function(){return _0x2fd24a;});})['then'](function(){_0x4167e6[_0x524d('0x1a')](0xcc)[_0x524d('0x25')]();});}};}function handleEntityNotFound(_0x2846ad,_0x28d73d){return function(_0x2d9ffa){if(!_0x2d9ffa){_0x2846ad[_0x524d('0x26')](0x194);}return _0x2d9ffa;};}function handleError(_0x19a3f9,_0x8bd9be){_0x8bd9be=_0x8bd9be||0x1f4;return function(_0x4745e1){logger[_0x524d('0x27')](_0x4745e1['stack']);if(_0x4745e1[_0x524d('0x28')]){delete _0x4745e1[_0x524d('0x28')];}_0x19a3f9[_0x524d('0x1a')](_0x8bd9be)[_0x524d('0x29')](_0x4745e1);};}exports['index']=function(_0x18018c,_0x384a36){var _0x38c955={},_0x1b3681={},_0x5a1a0f={'count':0x0,'rows':[]};var _0x15ca45=_[_0x524d('0x2a')](db[_0x524d('0x2b')][_0x524d('0x2c')],function(_0x16a980){return{'name':_0x16a980['fieldName'],'type':_0x16a980[_0x524d('0x2d')][_0x524d('0x2e')]};});_0x1b3681[_0x524d('0x2f')]=_[_0x524d('0x2a')](_0x15ca45,_0x524d('0x28'));_0x1b3681[_0x524d('0x30')]=_[_0x524d('0x31')](_0x18018c[_0x524d('0x30')]);_0x1b3681[_0x524d('0x32')]=_[_0x524d('0x33')](_0x1b3681['model'],_0x1b3681[_0x524d('0x30')]);_0x38c955['attributes']=_[_0x524d('0x33')](_0x1b3681['model'],qs[_0x524d('0x34')](_0x18018c[_0x524d('0x30')][_0x524d('0x34')]));_0x38c955['attributes']=_0x38c955[_0x524d('0x35')][_0x524d('0x36')]?_0x38c955[_0x524d('0x35')]:_0x1b3681[_0x524d('0x2f')];if(!_0x18018c[_0x524d('0x30')][_0x524d('0x37')](_0x524d('0x38'))){_0x38c955['limit']=qs['limit'](_0x18018c[_0x524d('0x30')][_0x524d('0x1e')]);_0x38c955[_0x524d('0x1c')]=qs[_0x524d('0x1c')](_0x18018c[_0x524d('0x30')]['offset']);}_0x38c955['order']=qs[_0x524d('0x39')](_0x18018c['query']['sort']);_0x38c955[_0x524d('0x3a')]=qs[_0x524d('0x32')](_[_0x524d('0x3b')](_0x18018c[_0x524d('0x30')],_0x1b3681[_0x524d('0x32')]),_0x15ca45);if(_0x18018c['query'][_0x524d('0x3c')]){_0x38c955[_0x524d('0x3a')]=_[_0x524d('0x3d')](_0x38c955['where'],{'$or':_[_0x524d('0x2a')](_0x15ca45,function(_0x11534f){if(_0x11534f[_0x524d('0x2d')]!==_0x524d('0x3e')){var _0x7534e={};_0x7534e[_0x11534f[_0x524d('0x28')]]={'$like':'%'+_0x18018c['query'][_0x524d('0x3c')]+'%'};return _0x7534e;}})});}_0x38c955=_[_0x524d('0x3d')]({},_0x38c955,_0x18018c[_0x524d('0x3f')]);var _0x12ff5a={'where':_0x38c955['where']};return db[_0x524d('0x2b')][_0x524d('0x1f')](_0x12ff5a)[_0x524d('0x22')](function(_0x243968){_0x5a1a0f[_0x524d('0x1f')]=_0x243968;if(_0x18018c[_0x524d('0x30')][_0x524d('0x40')]){_0x38c955[_0x524d('0x41')]=[{'all':!![]}];}return db[_0x524d('0x2b')][_0x524d('0x42')](_0x38c955);})[_0x524d('0x22')](function(_0x1da597){_0x5a1a0f[_0x524d('0x43')]=_0x1da597;return _0x5a1a0f;})[_0x524d('0x22')](respondWithFilteredResult(_0x384a36,_0x38c955))[_0x524d('0x44')](handleError(_0x384a36,null));};exports[_0x524d('0x45')]=function(_0x1c9b32,_0x4e7d56){var _0x3b7f04={'raw':!![],'where':{'id':_0x1c9b32[_0x524d('0x46')]['id']}},_0x3352f8={};_0x3352f8['model']=_[_0x524d('0x31')](db['AnalyticExtractedReport'][_0x524d('0x2c')]);_0x3352f8[_0x524d('0x30')]=_[_0x524d('0x31')](_0x1c9b32[_0x524d('0x30')]);_0x3352f8['filters']=_[_0x524d('0x33')](_0x3352f8[_0x524d('0x2f')],_0x3352f8[_0x524d('0x30')]);_0x3b7f04['attributes']=_[_0x524d('0x33')](_0x3352f8[_0x524d('0x2f')],qs[_0x524d('0x34')](_0x1c9b32[_0x524d('0x30')][_0x524d('0x34')]));_0x3b7f04['attributes']=_0x3b7f04[_0x524d('0x35')][_0x524d('0x36')]?_0x3b7f04['attributes']:_0x3352f8[_0x524d('0x2f')];if(_0x1c9b32['query'][_0x524d('0x40')]){_0x3b7f04['include']=[{'all':!![]}];}_0x3b7f04=_[_0x524d('0x3d')]({},_0x3b7f04,_0x1c9b32[_0x524d('0x3f')]);return db[_0x524d('0x2b')]['find'](_0x3b7f04)[_0x524d('0x22')](handleEntityNotFound(_0x4e7d56,null))[_0x524d('0x22')](respondWithResult(_0x4e7d56,null))[_0x524d('0x44')](handleError(_0x4e7d56,null));};exports['create']=function(_0x1d0ffa,_0x194bb7){return db[_0x524d('0x2b')][_0x524d('0x47')](_0x1d0ffa[_0x524d('0x48')],{})[_0x524d('0x22')](function(_0x4b3984){var _0x16cdf3=_0x1d0ffa[_0x524d('0x49')][_0x524d('0x4a')]({'plain':!![]});if(!_0x16cdf3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16cdf3[_0x524d('0x4b')]===_0x524d('0x49')){var _0x767e35=_0x4b3984[_0x524d('0x4a')]({'plain':!![]});var _0x157222=_0x524d('0x24');return db[_0x524d('0x4c')][_0x524d('0x4d')]({'where':{'name':_0x157222,'userProfileId':_0x16cdf3[_0x524d('0x4e')]},'raw':!![]})['then'](function(_0x60dd60){if(_0x60dd60&&_0x60dd60[_0x524d('0x4f')]===0x0){return db[_0x524d('0x50')]['create']({'name':_0x767e35['name'],'resourceId':_0x767e35['id'],'type':_0x60dd60['name'],'sectionId':_0x60dd60['id']},{})[_0x524d('0x22')](function(){return _0x4b3984;});}else{return _0x4b3984;}})['catch'](function(_0x1371ea){logger[_0x524d('0x27')](_0x524d('0x51'),_0x1371ea);throw _0x1371ea;});}return _0x4b3984;})[_0x524d('0x22')](respondWithResult(_0x194bb7,0xc9))[_0x524d('0x44')](handleError(_0x194bb7,null));};exports['update']=function(_0x4dca41,_0x1b073c){if(_0x4dca41[_0x524d('0x48')]['id']){delete _0x4dca41[_0x524d('0x48')]['id'];}return db[_0x524d('0x2b')][_0x524d('0x4d')]({'where':{'id':_0x4dca41[_0x524d('0x46')]['id']}})[_0x524d('0x22')](handleEntityNotFound(_0x1b073c,null))[_0x524d('0x22')](saveUpdates(_0x4dca41[_0x524d('0x48')],null))[_0x524d('0x22')](respondWithResult(_0x1b073c,null))[_0x524d('0x44')](handleError(_0x1b073c,null));};exports[_0x524d('0x23')]=function(_0x3082b4,_0x5e433d){return db[_0x524d('0x2b')][_0x524d('0x4d')]({'where':{'id':_0x3082b4[_0x524d('0x46')]['id']}})[_0x524d('0x22')](handleEntityNotFound(_0x5e433d,null))[_0x524d('0x22')](removeEntity(_0x5e433d,null))[_0x524d('0x44')](handleError(_0x5e433d,null));};exports[_0x524d('0x52')]=function(_0x25f33c,_0x497191,_0x496c5e){return db[_0x524d('0x2b')]['find']({'where':{'id':_0x25f33c[_0x524d('0x46')]['id']},'attributes':[_0x524d('0x28'),_0x524d('0x53'),'savename',_0x524d('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x497191,null))[_0x524d('0x22')](function(_0x1d9f48){if(_0x1d9f48){if(!fs[_0x524d('0x55')](path['join'](config[_0x524d('0x56')],_0x524d('0x57'),_0x1d9f48['savename']))){throw new db[(_0x524d('0x58'))][(_0x524d('0x59'))](_0x524d('0x5a'));}if(_0x25f33c['query']['exists']){return _0x497191['sendStatus'](0xc8);}return _0x497191[_0x524d('0x52')](path[_0x524d('0x5b')](config[_0x524d('0x56')],_0x524d('0x57'),_0x1d9f48[_0x524d('0x5c')]),util['format']('%s.%s',_0x1d9f48[_0x524d('0x53')]||_0x1d9f48[_0x524d('0x28')],_0x1d9f48[_0x524d('0x54')][_0x524d('0x5d')]()));}})['catch'](handleError(_0x497191,null));};
\ No newline at end of file
+var _0x770c=['query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','key','keys','filters','intersection','model'];(function(_0x486ca7,_0x4ca73b){var _0x31834a=function(_0x3d8be6){while(--_0x3d8be6){_0x486ca7['push'](_0x486ca7['shift']());}};_0x31834a(++_0x4ca73b);}(_0x770c,0x14c));var _0xc770=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0x770c[_0x5ca5bc];return _0x26ca86;};'use strict';var emlformat=require(_0xc770('0x0'));var rimraf=require(_0xc770('0x1'));var zipdir=require(_0xc770('0x2'));var jsonpatch=require(_0xc770('0x3'));var rp=require(_0xc770('0x4'));var moment=require(_0xc770('0x5'));var BPromise=require(_0xc770('0x6'));var Mustache=require(_0xc770('0x7'));var util=require('util');var path=require(_0xc770('0x8'));var sox=require('sox');var csv=require(_0xc770('0x9'));var ejs=require(_0xc770('0xa'));var fs=require('fs');var fs_extra=require(_0xc770('0xb'));var _=require(_0xc770('0xc'));var squel=require(_0xc770('0xd'));var crypto=require(_0xc770('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc770('0xf'));var toCsv=require(_0xc770('0x9'));var querystring=require('querystring');var Papa=require(_0xc770('0x10'));var Redis=require(_0xc770('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc770('0x12'));var as=require(_0xc770('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc770('0x14'));var utils=require('../../config/utils');var config=require(_0xc770('0x15'));var licenseUtil=require(_0xc770('0x16'));var db=require(_0xc770('0x17'))['db'];function respondWithStatusCode(_0x5e5dfd,_0x2bb8bb){_0x2bb8bb=_0x2bb8bb||0xcc;return function(_0x3aefd3){if(_0x3aefd3){return _0x5e5dfd[_0xc770('0x18')](_0x2bb8bb);}return _0x5e5dfd[_0xc770('0x19')](_0x2bb8bb)[_0xc770('0x1a')]();};}function respondWithResult(_0x157e98,_0x465ac5){_0x465ac5=_0x465ac5||0xc8;return function(_0x591a18){if(_0x591a18){return _0x157e98[_0xc770('0x19')](_0x465ac5)[_0xc770('0x1b')](_0x591a18);}};}function respondWithFilteredResult(_0x4d0b3c,_0x2c7817){return function(_0x3b9fb8){if(_0x3b9fb8){var _0x5d1e07=typeof _0x2c7817[_0xc770('0x1c')]===_0xc770('0x1d')&&typeof _0x2c7817['limit']==='undefined';var _0x297371=_0x3b9fb8['count'];var _0x271fae=_0x5d1e07?0x0:_0x2c7817[_0xc770('0x1c')];var _0x6b2fbd=_0x5d1e07?_0x3b9fb8[_0xc770('0x1e')]:_0x2c7817['offset']+_0x2c7817['limit'];var _0x5ba565;if(_0x6b2fbd>=_0x297371){_0x6b2fbd=_0x297371;_0x5ba565=0xc8;}else{_0x5ba565=0xce;}_0x4d0b3c[_0xc770('0x19')](_0x5ba565);return _0x4d0b3c[_0xc770('0x1f')](_0xc770('0x20'),_0x271fae+'-'+_0x6b2fbd+'/'+_0x297371)[_0xc770('0x1b')](_0x3b9fb8);}return null;};}function patchUpdates(_0x67cbe3){return function(_0x5b53ff){try{jsonpatch['apply'](_0x5b53ff,_0x67cbe3,!![]);}catch(_0x12c230){return BPromise[_0xc770('0x21')](_0x12c230);}return _0x5b53ff[_0xc770('0x22')]();};}function saveUpdates(_0x27756b,_0x4a3d12){return function(_0x270223){if(_0x270223){return _0x270223[_0xc770('0x23')](_0x27756b)[_0xc770('0x24')](function(_0x352175){return _0x352175;});}return null;};}function removeEntity(_0x114d0c,_0x277dc8){return function(_0x5e1679){if(_0x5e1679){return _0x5e1679[_0xc770('0x25')]()[_0xc770('0x24')](function(){var _0x2e2a45=_0x5e1679[_0xc770('0x26')]({'plain':!![]});var _0x2fb6b1=_0xc770('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x2fb6b1,'resourceId':_0x2e2a45['id']}})['then'](function(){return _0x5e1679;});})[_0xc770('0x24')](function(){_0x114d0c[_0xc770('0x19')](0xcc)[_0xc770('0x1a')]();});}};}function handleEntityNotFound(_0x3edf01,_0x3a4d64){return function(_0x5ec24c){if(!_0x5ec24c){_0x3edf01[_0xc770('0x18')](0x194);}return _0x5ec24c;};}function handleError(_0x10d9f0,_0x4a08c2){_0x4a08c2=_0x4a08c2||0x1f4;return function(_0xbb49a3){logger[_0xc770('0x28')](_0xbb49a3[_0xc770('0x29')]);if(_0xbb49a3[_0xc770('0x2a')]){delete _0xbb49a3[_0xc770('0x2a')];}_0x10d9f0[_0xc770('0x19')](_0x4a08c2)[_0xc770('0x2b')](_0xbb49a3);};}exports['index']=function(_0x1bdbee,_0x4a9951){var _0x18270b={},_0x235b1d={},_0x52dd30={'count':0x0,'rows':[]};var _0x5f4ee8=_[_0xc770('0x2c')](db[_0xc770('0x2d')][_0xc770('0x2e')],function(_0x3e0c31){return{'name':_0x3e0c31['fieldName'],'type':_0x3e0c31['type'][_0xc770('0x2f')]};});_0x235b1d['model']=_[_0xc770('0x2c')](_0x5f4ee8,'name');_0x235b1d['query']=_[_0xc770('0x30')](_0x1bdbee['query']);_0x235b1d[_0xc770('0x31')]=_[_0xc770('0x32')](_0x235b1d[_0xc770('0x33')],_0x235b1d[_0xc770('0x34')]);_0x18270b[_0xc770('0x35')]=_['intersection'](_0x235b1d[_0xc770('0x33')],qs[_0xc770('0x36')](_0x1bdbee['query'][_0xc770('0x36')]));_0x18270b[_0xc770('0x35')]=_0x18270b[_0xc770('0x35')][_0xc770('0x37')]?_0x18270b[_0xc770('0x35')]:_0x235b1d[_0xc770('0x33')];if(!_0x1bdbee[_0xc770('0x34')][_0xc770('0x38')](_0xc770('0x39'))){_0x18270b['limit']=qs[_0xc770('0x3a')](_0x1bdbee[_0xc770('0x34')][_0xc770('0x3a')]);_0x18270b['offset']=qs[_0xc770('0x1c')](_0x1bdbee[_0xc770('0x34')][_0xc770('0x1c')]);}_0x18270b[_0xc770('0x3b')]=qs[_0xc770('0x3c')](_0x1bdbee[_0xc770('0x34')]['sort']);_0x18270b['where']=qs['filters'](_[_0xc770('0x3d')](_0x1bdbee['query'],_0x235b1d['filters']),_0x5f4ee8);if(_0x1bdbee[_0xc770('0x34')][_0xc770('0x3e')]){_0x18270b[_0xc770('0x3f')]=_[_0xc770('0x40')](_0x18270b[_0xc770('0x3f')],{'$or':_[_0xc770('0x2c')](_0x5f4ee8,function(_0x4f4cea){if(_0x4f4cea['type']!=='VIRTUAL'){var _0x2e74d8={};_0x2e74d8[_0x4f4cea[_0xc770('0x2a')]]={'$like':'%'+_0x1bdbee[_0xc770('0x34')][_0xc770('0x3e')]+'%'};return _0x2e74d8;}})});}_0x18270b=_[_0xc770('0x40')]({},_0x18270b,_0x1bdbee['options']);var _0x484cc0={'where':_0x18270b['where']};return db[_0xc770('0x2d')][_0xc770('0x1e')](_0x484cc0)[_0xc770('0x24')](function(_0x426197){_0x52dd30[_0xc770('0x1e')]=_0x426197;if(_0x1bdbee[_0xc770('0x34')][_0xc770('0x41')]){_0x18270b[_0xc770('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xc770('0x43')](_0x18270b);})['then'](function(_0x19ef16){_0x52dd30[_0xc770('0x44')]=_0x19ef16;return _0x52dd30;})['then'](respondWithFilteredResult(_0x4a9951,_0x18270b))[_0xc770('0x45')](handleError(_0x4a9951,null));};exports[_0xc770('0x46')]=function(_0x5890ad,_0x58b47f){var _0x5b79d8={'raw':!![],'where':{'id':_0x5890ad[_0xc770('0x47')]['id']}},_0x564172={};_0x564172[_0xc770('0x33')]=_[_0xc770('0x30')](db[_0xc770('0x2d')][_0xc770('0x2e')]);_0x564172[_0xc770('0x34')]=_[_0xc770('0x30')](_0x5890ad['query']);_0x564172[_0xc770('0x31')]=_[_0xc770('0x32')](_0x564172[_0xc770('0x33')],_0x564172[_0xc770('0x34')]);_0x5b79d8[_0xc770('0x35')]=_['intersection'](_0x564172[_0xc770('0x33')],qs[_0xc770('0x36')](_0x5890ad[_0xc770('0x34')][_0xc770('0x36')]));_0x5b79d8[_0xc770('0x35')]=_0x5b79d8['attributes'][_0xc770('0x37')]?_0x5b79d8[_0xc770('0x35')]:_0x564172[_0xc770('0x33')];if(_0x5890ad[_0xc770('0x34')][_0xc770('0x41')]){_0x5b79d8[_0xc770('0x42')]=[{'all':!![]}];}_0x5b79d8=_[_0xc770('0x40')]({},_0x5b79d8,_0x5890ad['options']);return db[_0xc770('0x2d')][_0xc770('0x48')](_0x5b79d8)[_0xc770('0x24')](handleEntityNotFound(_0x58b47f,null))[_0xc770('0x24')](respondWithResult(_0x58b47f,null))['catch'](handleError(_0x58b47f,null));};exports[_0xc770('0x49')]=function(_0x31b7d8,_0x180365){return db[_0xc770('0x2d')]['create'](_0x31b7d8[_0xc770('0x4a')],{})[_0xc770('0x24')](function(_0x33844e){var _0x420a01=_0x31b7d8[_0xc770('0x4b')]['get']({'plain':!![]});if(!_0x420a01)throw new Error(_0xc770('0x4c'));if(_0x420a01['role']===_0xc770('0x4b')){var _0x44689c=_0x33844e[_0xc770('0x26')]({'plain':!![]});var _0x4a3b7d=_0xc770('0x27');return db[_0xc770('0x4d')][_0xc770('0x48')]({'where':{'name':_0x4a3b7d,'userProfileId':_0x420a01[_0xc770('0x4e')]},'raw':!![]})[_0xc770('0x24')](function(_0x10136f){if(_0x10136f&&_0x10136f[_0xc770('0x4f')]===0x0){return db[_0xc770('0x50')]['create']({'name':_0x44689c['name'],'resourceId':_0x44689c['id'],'type':_0x10136f[_0xc770('0x2a')],'sectionId':_0x10136f['id']},{})['then'](function(){return _0x33844e;});}else{return _0x33844e;}})[_0xc770('0x45')](function(_0x1b66ba){logger[_0xc770('0x28')](_0xc770('0x51'),_0x1b66ba);throw _0x1b66ba;});}return _0x33844e;})[_0xc770('0x24')](respondWithResult(_0x180365,0xc9))[_0xc770('0x45')](handleError(_0x180365,null));};exports['update']=function(_0x47f419,_0x352a8b){if(_0x47f419[_0xc770('0x4a')]['id']){delete _0x47f419[_0xc770('0x4a')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x47f419[_0xc770('0x47')]['id']}})[_0xc770('0x24')](handleEntityNotFound(_0x352a8b,null))[_0xc770('0x24')](saveUpdates(_0x47f419[_0xc770('0x4a')],null))[_0xc770('0x24')](respondWithResult(_0x352a8b,null))[_0xc770('0x45')](handleError(_0x352a8b,null));};exports[_0xc770('0x25')]=function(_0x53dbfb,_0x370842){return db[_0xc770('0x2d')][_0xc770('0x48')]({'where':{'id':_0x53dbfb['params']['id']}})[_0xc770('0x24')](handleEntityNotFound(_0x370842,null))[_0xc770('0x24')](removeEntity(_0x370842,null))[_0xc770('0x45')](handleError(_0x370842,null));};exports[_0xc770('0x52')]=function(_0x53664b,_0x53676d,_0x5e58cc){return db[_0xc770('0x2d')][_0xc770('0x48')]({'where':{'id':_0x53664b[_0xc770('0x47')]['id']},'attributes':['name','basename','savename',_0xc770('0x53')],'raw':!![]})[_0xc770('0x24')](handleEntityNotFound(_0x53676d,null))[_0xc770('0x24')](function(_0x592d9b){if(_0x592d9b){if(!fs[_0xc770('0x54')](path[_0xc770('0x55')](config[_0xc770('0x56')],_0xc770('0x57'),_0x592d9b[_0xc770('0x58')]))){throw new db[(_0xc770('0x59'))][(_0xc770('0x5a'))](_0xc770('0x5b'));}if(_0x53664b[_0xc770('0x34')][_0xc770('0x5c')]){return _0x53676d[_0xc770('0x18')](0xc8);}return _0x53676d[_0xc770('0x52')](path['join'](config['root'],'server/files/reports',_0x592d9b[_0xc770('0x58')]),util[_0xc770('0x5d')]('%s.%s',_0x592d9b[_0xc770('0x5e')]||_0x592d9b[_0xc770('0x2a')],_0x592d9b[_0xc770('0x53')][_0xc770('0x5f')]()));}})[_0xc770('0x45')](handleError(_0x53676d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 237d2d7..1b4e86b 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 _0x1188=['AnalyticExtractedReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x2be2c7,_0x32900e){var _0x4cc9a7=function(_0x2a3c37){while(--_0x2a3c37){_0x2be2c7['push'](_0x2be2c7['shift']());}};_0x4cc9a7(++_0x32900e);}(_0x1188,0x69));var _0x8118=function(_0x1920a3,_0x22bf25){_0x1920a3=_0x1920a3-0x0;var _0x482fc9=_0x1188[_0x1920a3];return _0x482fc9;};'use strict';var _=require(_0x8118('0x0'));var util=require(_0x8118('0x1'));var logger=require(_0x8118('0x2'))(_0x8118('0x3'));var moment=require('moment');var BPromise=require(_0x8118('0x4'));var rp=require(_0x8118('0x5'));var fs=require('fs');var path=require(_0x8118('0x6'));var rimraf=require(_0x8118('0x7'));var config=require(_0x8118('0x8'));var attributes=require(_0x8118('0x9'));module[_0x8118('0xa')]=function(_0x4e0d25,_0x2f47f3){return _0x4e0d25[_0x8118('0xb')](_0x8118('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x576f=['analytics_extracted_reports','lodash','util','api','moment','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x8b0073,_0x107010){var _0x12aff2=function(_0x4c1ae3){while(--_0x4c1ae3){_0x8b0073['push'](_0x8b0073['shift']());}};_0x12aff2(++_0x107010);}(_0x576f,0x181));var _0xf576=function(_0x266f7b,_0x1355af){_0x266f7b=_0x266f7b-0x0;var _0x1b4d71=_0x576f[_0x266f7b];return _0x1b4d71;};'use strict';var _=require(_0xf576('0x0'));var util=require(_0xf576('0x1'));var logger=require('../../config/logger')(_0xf576('0x2'));var moment=require(_0xf576('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf576('0x4'));var rimraf=require(_0xf576('0x5'));var config=require(_0xf576('0x6'));var attributes=require(_0xf576('0x7'));module[_0xf576('0x8')]=function(_0x365f55,_0x194c6c){return _0x365f55[_0xf576('0x9')](_0xf576('0xa'),attributes,{'tableName':_0xf576('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 61c611b..576dad7 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 _0xcc55=['../../config/environment','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x51df70,_0xe0b02b){var _0x252bad=function(_0x1de606){while(--_0x1de606){_0x51df70['push'](_0x51df70['shift']());}};_0x252bad(++_0xe0b02b);}(_0xcc55,0x173));var _0x5cc5=function(_0x3be353,_0x491043){_0x3be353=_0x3be353-0x0;var _0x53b513=_0xcc55[_0x3be353];return _0x53b513;};'use strict';var _=require('lodash');var util=require(_0x5cc5('0x0'));var moment=require(_0x5cc5('0x1'));var BPromise=require(_0x5cc5('0x2'));var rs=require(_0x5cc5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cc5('0x4'))['db'];var utils=require(_0x5cc5('0x5'));var logger=require('../../config/logger')(_0x5cc5('0x6'));var config=require(_0x5cc5('0x7'));var jayson=require(_0x5cc5('0x8'));var client=jayson[_0x5cc5('0x9')][_0x5cc5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ab107,_0x4003b9,_0x43f936){return new BPromise(function(_0x4ce93a,_0x162b80){return client[_0x5cc5('0xb')](_0x1ab107,_0x43f936)['then'](function(_0x336e26){logger['info'](_0x5cc5('0xc'),_0x4003b9,_0x5cc5('0xd'));logger[_0x5cc5('0xe')](_0x5cc5('0xf'),_0x4003b9,_0x5cc5('0xd'),JSON['stringify'](_0x336e26));if(_0x336e26[_0x5cc5('0x10')]){if(_0x336e26[_0x5cc5('0x10')][_0x5cc5('0x11')]===0x1f4){logger[_0x5cc5('0x10')](_0x5cc5('0xc'),_0x4003b9,_0x336e26[_0x5cc5('0x10')][_0x5cc5('0x12')]);return _0x162b80(_0x336e26[_0x5cc5('0x10')][_0x5cc5('0x12')]);}logger[_0x5cc5('0x10')](_0x5cc5('0xc'),_0x4003b9,_0x336e26[_0x5cc5('0x10')][_0x5cc5('0x12')]);return _0x4ce93a(_0x336e26[_0x5cc5('0x10')][_0x5cc5('0x12')]);}else{logger[_0x5cc5('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4003b9,_0x5cc5('0xd'));_0x4ce93a(_0x336e26[_0x5cc5('0x14')][_0x5cc5('0x12')]);}})['catch'](function(_0x26cd2d){logger[_0x5cc5('0x10')](_0x5cc5('0xc'),_0x4003b9,_0x26cd2d);_0x162b80(_0x26cd2d);});});}
\ No newline at end of file
+var _0x4838=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','bluebird'];(function(_0x47b688,_0x200c56){var _0x163100=function(_0xe484e8){while(--_0xe484e8){_0x47b688['push'](_0x47b688['shift']());}};_0x163100(++_0x200c56);}(_0x4838,0x111));var _0x8483=function(_0x471a54,_0x59a122){_0x471a54=_0x471a54-0x0;var _0x20c5e2=_0x4838[_0x471a54];return _0x20c5e2;};'use strict';var _=require('lodash');var util=require(_0x8483('0x0'));var moment=require('moment');var BPromise=require(_0x8483('0x1'));var rs=require(_0x8483('0x2'));var fs=require('fs');var Redis=require(_0x8483('0x3'));var db=require(_0x8483('0x4'))['db'];var utils=require(_0x8483('0x5'));var logger=require(_0x8483('0x6'))(_0x8483('0x7'));var config=require(_0x8483('0x8'));var jayson=require(_0x8483('0x9'));var client=jayson[_0x8483('0xa')][_0x8483('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x169df1,_0x308de4,_0x5efc2b){return new BPromise(function(_0x47ad02,_0x583805){return client[_0x8483('0xc')](_0x169df1,_0x5efc2b)[_0x8483('0xd')](function(_0x3b44ba){logger[_0x8483('0xe')](_0x8483('0xf'),_0x308de4,'request\x20sent');logger[_0x8483('0x10')](_0x8483('0x11'),_0x308de4,'request\x20sent',JSON[_0x8483('0x12')](_0x3b44ba));if(_0x3b44ba[_0x8483('0x13')]){if(_0x3b44ba['error'][_0x8483('0x14')]===0x1f4){logger['error'](_0x8483('0xf'),_0x308de4,_0x3b44ba['error']['message']);return _0x583805(_0x3b44ba['error'][_0x8483('0x15')]);}logger['error'](_0x8483('0xf'),_0x308de4,_0x3b44ba[_0x8483('0x13')]['message']);return _0x47ad02(_0x3b44ba[_0x8483('0x13')][_0x8483('0x15')]);}else{logger[_0x8483('0xe')](_0x8483('0xf'),_0x308de4,_0x8483('0x16'));_0x47ad02(_0x3b44ba[_0x8483('0x17')][_0x8483('0x15')]);}})[_0x8483('0x18')](function(_0xd2d36a){logger[_0x8483('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x308de4,_0xd2d36a);_0x583805(_0xd2d36a);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 2001d67..b82e0bb 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 _0x119f=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','download','post'];(function(_0x2a009e,_0x19d263){var _0x261192=function(_0x8ca28d){while(--_0x8ca28d){_0x2a009e['push'](_0x2a009e['shift']());}};_0x261192(++_0x19d263);}(_0x119f,0x8a));var _0xf119=function(_0x193a5d,_0x161cad){_0x193a5d=_0x193a5d-0x0;var _0x3b2626=_0x119f[_0x193a5d];return _0x3b2626;};'use strict';var multer=require(_0xf119('0x0'));var util=require(_0xf119('0x1'));var path=require(_0xf119('0x2'));var timeout=require(_0xf119('0x3'));var express=require('express');var router=express[_0xf119('0x4')]();var fs_extra=require(_0xf119('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf119('0x6'));var controller=require(_0xf119('0x7'));router[_0xf119('0x8')]('/',auth[_0xf119('0x9')](),controller[_0xf119('0xa')]);router['get'](_0xf119('0xb'),auth[_0xf119('0x9')](),controller['show']);router[_0xf119('0x8')]('/:id/download',auth[_0xf119('0x9')](),controller[_0xf119('0xc')]);router[_0xf119('0xd')]('/',auth[_0xf119('0x9')](),controller[_0xf119('0xe')]);router['put']('/:id',auth[_0xf119('0x9')](),controller[_0xf119('0xf')]);router[_0xf119('0x10')](_0xf119('0xb'),auth[_0xf119('0x9')](),controller[_0xf119('0x11')]);module[_0xf119('0x12')]=router;
\ No newline at end of file
+var _0x6452=['fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','create','put','delete','destroy','exports','path','express'];(function(_0x330cc5,_0x147150){var _0x5b3ad9=function(_0x418fc7){while(--_0x418fc7){_0x330cc5['push'](_0x330cc5['shift']());}};_0x5b3ad9(++_0x147150);}(_0x6452,0x6a));var _0x2645=function(_0x3bceea,_0x58af75){_0x3bceea=_0x3bceea-0x0;var _0x30a8d3=_0x6452[_0x3bceea];return _0x30a8d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2645('0x0'));var timeout=require('connect-timeout');var express=require(_0x2645('0x1'));var router=express['Router']();var fs_extra=require(_0x2645('0x2'));var auth=require(_0x2645('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2645('0x4'));var controller=require(_0x2645('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2645('0x6')](_0x2645('0x7'),auth[_0x2645('0x8')](),controller[_0x2645('0x9')]);router['get'](_0x2645('0xa'),auth[_0x2645('0x8')](),controller[_0x2645('0xb')]);router[_0x2645('0xc')]('/',auth[_0x2645('0x8')](),controller[_0x2645('0xd')]);router[_0x2645('0xe')](_0x2645('0x7'),auth[_0x2645('0x8')](),controller['update']);router[_0x2645('0xf')](_0x2645('0x7'),auth[_0x2645('0x8')](),controller[_0x2645('0x10')]);module[_0x2645('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 7a4202f..d0d05e0 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 _0x94cb=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x51fb0c,_0x937d84){var _0x6b1d12=function(_0xb70b58){while(--_0xb70b58){_0x51fb0c['push'](_0x51fb0c['shift']());}};_0x6b1d12(++_0x937d84);}(_0x94cb,0x137));var _0xb94c=function(_0x2cb08e,_0x48f58a){_0x2cb08e=_0x2cb08e-0x0;var _0x3b5f48=_0x94cb[_0x2cb08e];return _0x3b5f48;};'use strict';var Sequelize=require(_0xb94c('0x0'));module[_0xb94c('0x1')]={'field':{'type':Sequelize[_0xb94c('0x2')]},'alias':{'type':Sequelize[_0xb94c('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb94c('0x3')]},'groupBy':{'type':Sequelize[_0xb94c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb94c('0x3')]},'custom':{'type':Sequelize[_0xb94c('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe9b8=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x10e5a8,_0x31bf6d){var _0x517c65=function(_0x2a7ca7){while(--_0x2a7ca7){_0x10e5a8['push'](_0x10e5a8['shift']());}};_0x517c65(++_0x31bf6d);}(_0xe9b8,0x1ce));var _0x8e9b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe9b8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8e9b('0x0'));module[_0x8e9b('0x1')]={'field':{'type':Sequelize[_0x8e9b('0x2')]},'alias':{'type':Sequelize[_0x8e9b('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x8e9b('0x3')]},'groupBy':{'type':Sequelize[_0x8e9b('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8e9b('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 6ee95a0..282b38b 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 _0xea51=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','AnalyticFieldReport','find','catch','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys'];(function(_0x25d542,_0x462ad9){var _0x377a7e=function(_0x5bd8ee){while(--_0x5bd8ee){_0x25d542['push'](_0x25d542['shift']());}};_0x377a7e(++_0x462ad9);}(_0xea51,0x70));var _0x1ea5=function(_0x2e8adf,_0x246201){_0x2e8adf=_0x2e8adf-0x0;var _0x505ca3=_0xea51[_0x2e8adf];return _0x505ca3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ea5('0x0'));var zipdir=require(_0x1ea5('0x1'));var jsonpatch=require(_0x1ea5('0x2'));var rp=require(_0x1ea5('0x3'));var moment=require(_0x1ea5('0x4'));var BPromise=require(_0x1ea5('0x5'));var Mustache=require(_0x1ea5('0x6'));var util=require(_0x1ea5('0x7'));var path=require(_0x1ea5('0x8'));var sox=require('sox');var csv=require(_0x1ea5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ea5('0xa'));var _=require('lodash');var squel=require(_0x1ea5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ea5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1ea5('0xd'));var Papa=require(_0x1ea5('0xe'));var Redis=require(_0x1ea5('0xf'));var authService=require(_0x1ea5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ea5('0x11'));var logger=require(_0x1ea5('0x12'))(_0x1ea5('0x13'));var utils=require(_0x1ea5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1ea5('0x15'));var db=require(_0x1ea5('0x16'))['db'];function respondWithStatusCode(_0x3e8fcd,_0x38fafd){_0x38fafd=_0x38fafd||0xcc;return function(_0x42359d){if(_0x42359d){return _0x3e8fcd[_0x1ea5('0x17')](_0x38fafd);}return _0x3e8fcd['status'](_0x38fafd)[_0x1ea5('0x18')]();};}function respondWithResult(_0xfdd9c2,_0xed00c5){_0xed00c5=_0xed00c5||0xc8;return function(_0x4ebd1c){if(_0x4ebd1c){return _0xfdd9c2[_0x1ea5('0x19')](_0xed00c5)[_0x1ea5('0x1a')](_0x4ebd1c);}};}function respondWithFilteredResult(_0x182a70,_0x51da19){return function(_0x25144c){if(_0x25144c){var _0x3a46e4=typeof _0x51da19['offset']==='undefined'&&typeof _0x51da19[_0x1ea5('0x1b')]===_0x1ea5('0x1c');var _0x3b5a4a=_0x25144c[_0x1ea5('0x1d')];var _0x3e8c8f=_0x3a46e4?0x0:_0x51da19[_0x1ea5('0x1e')];var _0x24e368=_0x3a46e4?_0x25144c[_0x1ea5('0x1d')]:_0x51da19['offset']+_0x51da19[_0x1ea5('0x1b')];var _0x455b5d;if(_0x24e368>=_0x3b5a4a){_0x24e368=_0x3b5a4a;_0x455b5d=0xc8;}else{_0x455b5d=0xce;}_0x182a70[_0x1ea5('0x19')](_0x455b5d);return _0x182a70['set']('Content-Range',_0x3e8c8f+'-'+_0x24e368+'/'+_0x3b5a4a)[_0x1ea5('0x1a')](_0x25144c);}return null;};}function patchUpdates(_0x4f6b8f){return function(_0x150130){try{jsonpatch[_0x1ea5('0x1f')](_0x150130,_0x4f6b8f,!![]);}catch(_0x131124){return BPromise[_0x1ea5('0x20')](_0x131124);}return _0x150130[_0x1ea5('0x21')]();};}function saveUpdates(_0x561b40,_0x3e95a8){return function(_0x234400){if(_0x234400){return _0x234400[_0x1ea5('0x22')](_0x561b40)[_0x1ea5('0x23')](function(_0x2c0821){return _0x2c0821;});}return null;};}function removeEntity(_0x576e9d,_0x1dbb79){return function(_0x57f434){if(_0x57f434){return _0x57f434[_0x1ea5('0x24')]()['then'](function(){_0x576e9d[_0x1ea5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6aab88,_0x5f34d5){return function(_0xf3290c){if(!_0xf3290c){_0x6aab88[_0x1ea5('0x17')](0x194);}return _0xf3290c;};}function handleError(_0x1343e9,_0x43fc05){_0x43fc05=_0x43fc05||0x1f4;return function(_0x282d8d){logger['error'](_0x282d8d[_0x1ea5('0x25')]);if(_0x282d8d[_0x1ea5('0x26')]){delete _0x282d8d[_0x1ea5('0x26')];}_0x1343e9[_0x1ea5('0x19')](_0x43fc05)[_0x1ea5('0x27')](_0x282d8d);};}exports[_0x1ea5('0x28')]=function(_0x7cff4b,_0x3a7290){var _0x456250={},_0x4f6556={},_0x527ecf={'count':0x0,'rows':[]};var _0x4979eb=_['map'](db['AnalyticFieldReport'][_0x1ea5('0x29')],function(_0xaeb697){return{'name':_0xaeb697[_0x1ea5('0x2a')],'type':_0xaeb697[_0x1ea5('0x2b')]['key']};});_0x4f6556[_0x1ea5('0x2c')]=_[_0x1ea5('0x2d')](_0x4979eb,_0x1ea5('0x26'));_0x4f6556[_0x1ea5('0x2e')]=_[_0x1ea5('0x2f')](_0x7cff4b[_0x1ea5('0x2e')]);_0x4f6556[_0x1ea5('0x30')]=_[_0x1ea5('0x31')](_0x4f6556[_0x1ea5('0x2c')],_0x4f6556[_0x1ea5('0x2e')]);_0x456250[_0x1ea5('0x32')]=_[_0x1ea5('0x31')](_0x4f6556['model'],qs['fields'](_0x7cff4b['query'][_0x1ea5('0x33')]));_0x456250[_0x1ea5('0x32')]=_0x456250['attributes'][_0x1ea5('0x34')]?_0x456250[_0x1ea5('0x32')]:_0x4f6556[_0x1ea5('0x2c')];if(!_0x7cff4b['query'][_0x1ea5('0x35')](_0x1ea5('0x36'))){_0x456250[_0x1ea5('0x1b')]=qs[_0x1ea5('0x1b')](_0x7cff4b[_0x1ea5('0x2e')][_0x1ea5('0x1b')]);_0x456250[_0x1ea5('0x1e')]=qs[_0x1ea5('0x1e')](_0x7cff4b[_0x1ea5('0x2e')]['offset']);}_0x456250[_0x1ea5('0x37')]=qs[_0x1ea5('0x38')](_0x7cff4b[_0x1ea5('0x2e')][_0x1ea5('0x38')]);_0x456250['where']=qs[_0x1ea5('0x30')](_[_0x1ea5('0x39')](_0x7cff4b[_0x1ea5('0x2e')],_0x4f6556[_0x1ea5('0x30')]),_0x4979eb);if(_0x7cff4b['query']['filter']){_0x456250[_0x1ea5('0x3a')]=_['merge'](_0x456250['where'],{'$or':_['map'](_0x4979eb,function(_0x2218c4){if(_0x2218c4[_0x1ea5('0x2b')]!==_0x1ea5('0x3b')){var _0x1de8d2={};_0x1de8d2[_0x2218c4[_0x1ea5('0x26')]]={'$like':'%'+_0x7cff4b[_0x1ea5('0x2e')][_0x1ea5('0x3c')]+'%'};return _0x1de8d2;}})});}_0x456250=_[_0x1ea5('0x3d')]({},_0x456250,_0x7cff4b[_0x1ea5('0x3e')]);var _0x2a0ced={'where':_0x456250[_0x1ea5('0x3a')]};return db['AnalyticFieldReport'][_0x1ea5('0x1d')](_0x2a0ced)['then'](function(_0x5736c3){_0x527ecf[_0x1ea5('0x1d')]=_0x5736c3;if(_0x7cff4b[_0x1ea5('0x2e')][_0x1ea5('0x3f')]){_0x456250[_0x1ea5('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1ea5('0x41')](_0x456250);})[_0x1ea5('0x23')](function(_0x29a215){_0x527ecf[_0x1ea5('0x42')]=_0x29a215;return _0x527ecf;})[_0x1ea5('0x23')](respondWithFilteredResult(_0x3a7290,_0x456250))['catch'](handleError(_0x3a7290,null));};exports['show']=function(_0x4e7d88,_0x163e0c){var _0x536910={'raw':![],'where':{'id':_0x4e7d88[_0x1ea5('0x43')]['id']}},_0x351785={};_0x351785['model']=_[_0x1ea5('0x2f')](db[_0x1ea5('0x44')]['rawAttributes']);_0x351785[_0x1ea5('0x2e')]=_[_0x1ea5('0x2f')](_0x4e7d88['query']);_0x351785['filters']=_[_0x1ea5('0x31')](_0x351785['model'],_0x351785[_0x1ea5('0x2e')]);_0x536910[_0x1ea5('0x32')]=_[_0x1ea5('0x31')](_0x351785['model'],qs['fields'](_0x4e7d88['query']['fields']));_0x536910['attributes']=_0x536910[_0x1ea5('0x32')][_0x1ea5('0x34')]?_0x536910[_0x1ea5('0x32')]:_0x351785[_0x1ea5('0x2c')];if(_0x4e7d88['query'][_0x1ea5('0x3f')]){_0x536910['include']=[{'all':!![]}];}_0x536910=_['merge']({},_0x536910,_0x4e7d88[_0x1ea5('0x3e')]);return db[_0x1ea5('0x44')][_0x1ea5('0x45')](_0x536910)[_0x1ea5('0x23')](handleEntityNotFound(_0x163e0c,null))['then'](respondWithResult(_0x163e0c,null))[_0x1ea5('0x46')](handleError(_0x163e0c,null));};exports['create']=function(_0x12d5f2,_0x4421ea){return db[_0x1ea5('0x44')][_0x1ea5('0x47')](_0x12d5f2[_0x1ea5('0x48')],{})['then'](respondWithResult(_0x4421ea,0xc9))[_0x1ea5('0x46')](handleError(_0x4421ea,null));};exports[_0x1ea5('0x49')]=function(_0x15c77f,_0x596fb1){return db[_0x1ea5('0x44')]['bulkCreate'](_0x15c77f[_0x1ea5('0x48')],{'raw':![],'individualHooks':!![]})[_0x1ea5('0x23')](respondWithResult(_0x596fb1,0xc9))[_0x1ea5('0x46')](handleError(_0x596fb1,null));};exports['update']=function(_0x5e423c,_0x39512d){if(_0x5e423c[_0x1ea5('0x48')]['id']){delete _0x5e423c[_0x1ea5('0x48')]['id'];}return db[_0x1ea5('0x44')][_0x1ea5('0x45')]({'where':{'id':_0x5e423c['params']['id']}})[_0x1ea5('0x23')](handleEntityNotFound(_0x39512d,null))['then'](saveUpdates(_0x5e423c[_0x1ea5('0x48')],null))['then'](respondWithResult(_0x39512d,null))[_0x1ea5('0x46')](handleError(_0x39512d,null));};exports[_0x1ea5('0x24')]=function(_0x439c56,_0x332381){return db[_0x1ea5('0x44')][_0x1ea5('0x45')]({'where':{'id':_0x439c56[_0x1ea5('0x43')]['id']}})['then'](handleEntityNotFound(_0x332381,null))['then'](removeEntity(_0x332381,null))[_0x1ea5('0x46')](handleError(_0x332381,null));};exports['bulkDestroy']=function(_0x311960,_0x524933){return db[_0x1ea5('0x44')][_0x1ea5('0x24')]({'where':{'id':_0x311960['query'][_0x1ea5('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x1ea5('0x23')](respondWithResult(_0x524933,0xcc))[_0x1ea5('0x46')](handleError(_0x524933,null));};exports[_0x1ea5('0x4b')]=function(_0x52012a,_0xc50773,_0x4116e5){return db[_0x1ea5('0x4c')]['findOne']({'where':{'id':_0x52012a[_0x1ea5('0x43')]['id']}})[_0x1ea5('0x23')](handleEntityNotFound(_0xc50773,null))['then'](function(_0x589217){if(_0x589217){return db[_0x1ea5('0x4d')][_0x1ea5('0x4e')](function(_0x4af3df){return db['AnalyticFieldReport'][_0x1ea5('0x24')]({'where':{'CustomReportId':_0x52012a[_0x1ea5('0x43')]['id']},'transaction':_0x4af3df})[_0x1ea5('0x23')](function(_0x26e5e9){var _0x3c61ba=_['map'](_0x52012a[_0x1ea5('0x48')],function(_0x3460a8){delete _0x3460a8['id'];_0x3460a8[_0x1ea5('0x4f')]=_0x52012a[_0x1ea5('0x43')]['id'];return _0x3460a8;});return db['AnalyticFieldReport'][_0x1ea5('0x49')](_0x3c61ba,{'transaction':_0x4af3df});});})[_0x1ea5('0x23')](function(){return db[_0x1ea5('0x44')]['findAll']({'where':{'CustomReportId':_0x52012a[_0x1ea5('0x43')]['id']}});});}})['then'](respondWithResult(_0xc50773,null))[_0x1ea5('0x46')](handleError(_0xc50773,null));};
\ No newline at end of file
+var _0xef2d=['stack','name','send','map','AnalyticFieldReport','fieldName','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','bulkCreate','ids','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x116482,_0x35ddae){var _0x56db37=function(_0xc3685c){while(--_0xc3685c){_0x116482['push'](_0x116482['shift']());}};_0x56db37(++_0x35ddae);}(_0xef2d,0x16d));var _0xdef2=function(_0x17a8dd,_0x3c18fb){_0x17a8dd=_0x17a8dd-0x0;var _0x556f85=_0xef2d[_0x17a8dd];return _0x556f85;};'use strict';var emlformat=require(_0xdef2('0x0'));var rimraf=require(_0xdef2('0x1'));var zipdir=require(_0xdef2('0x2'));var jsonpatch=require(_0xdef2('0x3'));var rp=require(_0xdef2('0x4'));var moment=require('moment');var BPromise=require(_0xdef2('0x5'));var Mustache=require(_0xdef2('0x6'));var util=require(_0xdef2('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdef2('0x8'));var ejs=require(_0xdef2('0x9'));var fs=require('fs');var fs_extra=require(_0xdef2('0xa'));var _=require(_0xdef2('0xb'));var squel=require(_0xdef2('0xc'));var crypto=require(_0xdef2('0xd'));var jsforce=require(_0xdef2('0xe'));var deskjs=require(_0xdef2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdef2('0x10'));var Redis=require(_0xdef2('0x11'));var authService=require(_0xdef2('0x12'));var qs=require(_0xdef2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdef2('0x14'));var logger=require('../../config/logger')(_0xdef2('0x15'));var utils=require(_0xdef2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdef2('0x17'));var db=require(_0xdef2('0x18'))['db'];function respondWithStatusCode(_0x12a29c,_0x2d675a){_0x2d675a=_0x2d675a||0xcc;return function(_0x159c45){if(_0x159c45){return _0x12a29c[_0xdef2('0x19')](_0x2d675a);}return _0x12a29c['status'](_0x2d675a)[_0xdef2('0x1a')]();};}function respondWithResult(_0x4d360a,_0x1a6f41){_0x1a6f41=_0x1a6f41||0xc8;return function(_0x3c61be){if(_0x3c61be){return _0x4d360a[_0xdef2('0x1b')](_0x1a6f41)[_0xdef2('0x1c')](_0x3c61be);}};}function respondWithFilteredResult(_0x456892,_0x4bed6f){return function(_0x126c6c){if(_0x126c6c){var _0x34771c=typeof _0x4bed6f[_0xdef2('0x1d')]===_0xdef2('0x1e')&&typeof _0x4bed6f['limit']===_0xdef2('0x1e');var _0x39fdc5=_0x126c6c[_0xdef2('0x1f')];var _0x1aef0e=_0x34771c?0x0:_0x4bed6f['offset'];var _0x40c2bc=_0x34771c?_0x126c6c[_0xdef2('0x1f')]:_0x4bed6f[_0xdef2('0x1d')]+_0x4bed6f[_0xdef2('0x20')];var _0x6115ad;if(_0x40c2bc>=_0x39fdc5){_0x40c2bc=_0x39fdc5;_0x6115ad=0xc8;}else{_0x6115ad=0xce;}_0x456892[_0xdef2('0x1b')](_0x6115ad);return _0x456892['set'](_0xdef2('0x21'),_0x1aef0e+'-'+_0x40c2bc+'/'+_0x39fdc5)['json'](_0x126c6c);}return null;};}function patchUpdates(_0x15a6e8){return function(_0x1524bc){try{jsonpatch[_0xdef2('0x22')](_0x1524bc,_0x15a6e8,!![]);}catch(_0x4b91ac){return BPromise[_0xdef2('0x23')](_0x4b91ac);}return _0x1524bc['save']();};}function saveUpdates(_0x3546e6,_0x545562){return function(_0x58eaf1){if(_0x58eaf1){return _0x58eaf1[_0xdef2('0x24')](_0x3546e6)[_0xdef2('0x25')](function(_0x2bf0f9){return _0x2bf0f9;});}return null;};}function removeEntity(_0x3db7c0,_0x45da78){return function(_0x41cfd8){if(_0x41cfd8){return _0x41cfd8[_0xdef2('0x26')]()['then'](function(){_0x3db7c0[_0xdef2('0x1b')](0xcc)[_0xdef2('0x1a')]();});}};}function handleEntityNotFound(_0x1d687d,_0x45d52d){return function(_0x199e6a){if(!_0x199e6a){_0x1d687d[_0xdef2('0x19')](0x194);}return _0x199e6a;};}function handleError(_0x3ec81a,_0x5e2b48){_0x5e2b48=_0x5e2b48||0x1f4;return function(_0x5aa303){logger[_0xdef2('0x27')](_0x5aa303[_0xdef2('0x28')]);if(_0x5aa303[_0xdef2('0x29')]){delete _0x5aa303[_0xdef2('0x29')];}_0x3ec81a[_0xdef2('0x1b')](_0x5e2b48)[_0xdef2('0x2a')](_0x5aa303);};}exports['index']=function(_0x73f9ca,_0x521e34){var _0x881a9a={},_0x24e4b8={},_0x3f13c8={'count':0x0,'rows':[]};var _0x2c3faa=_[_0xdef2('0x2b')](db[_0xdef2('0x2c')]['rawAttributes'],function(_0x516c59){return{'name':_0x516c59[_0xdef2('0x2d')],'type':_0x516c59['type'][_0xdef2('0x2e')]};});_0x24e4b8['model']=_[_0xdef2('0x2b')](_0x2c3faa,'name');_0x24e4b8[_0xdef2('0x2f')]=_[_0xdef2('0x30')](_0x73f9ca[_0xdef2('0x2f')]);_0x24e4b8['filters']=_[_0xdef2('0x31')](_0x24e4b8[_0xdef2('0x32')],_0x24e4b8[_0xdef2('0x2f')]);_0x881a9a['attributes']=_[_0xdef2('0x31')](_0x24e4b8['model'],qs[_0xdef2('0x33')](_0x73f9ca[_0xdef2('0x2f')][_0xdef2('0x33')]));_0x881a9a[_0xdef2('0x34')]=_0x881a9a[_0xdef2('0x34')][_0xdef2('0x35')]?_0x881a9a[_0xdef2('0x34')]:_0x24e4b8[_0xdef2('0x32')];if(!_0x73f9ca[_0xdef2('0x2f')]['hasOwnProperty']('nolimit')){_0x881a9a[_0xdef2('0x20')]=qs['limit'](_0x73f9ca[_0xdef2('0x2f')][_0xdef2('0x20')]);_0x881a9a['offset']=qs[_0xdef2('0x1d')](_0x73f9ca[_0xdef2('0x2f')]['offset']);}_0x881a9a[_0xdef2('0x36')]=qs[_0xdef2('0x37')](_0x73f9ca[_0xdef2('0x2f')][_0xdef2('0x37')]);_0x881a9a[_0xdef2('0x38')]=qs[_0xdef2('0x39')](_[_0xdef2('0x3a')](_0x73f9ca['query'],_0x24e4b8[_0xdef2('0x39')]),_0x2c3faa);if(_0x73f9ca[_0xdef2('0x2f')]['filter']){_0x881a9a[_0xdef2('0x38')]=_[_0xdef2('0x3b')](_0x881a9a['where'],{'$or':_[_0xdef2('0x2b')](_0x2c3faa,function(_0x49327c){if(_0x49327c[_0xdef2('0x3c')]!==_0xdef2('0x3d')){var _0xb09374={};_0xb09374[_0x49327c[_0xdef2('0x29')]]={'$like':'%'+_0x73f9ca[_0xdef2('0x2f')][_0xdef2('0x3e')]+'%'};return _0xb09374;}})});}_0x881a9a=_['merge']({},_0x881a9a,_0x73f9ca['options']);var _0x1c08f9={'where':_0x881a9a['where']};return db['AnalyticFieldReport'][_0xdef2('0x1f')](_0x1c08f9)[_0xdef2('0x25')](function(_0x42b52a){_0x3f13c8['count']=_0x42b52a;if(_0x73f9ca[_0xdef2('0x2f')]['includeAll']){_0x881a9a[_0xdef2('0x3f')]=[{'all':!![]}];}return db[_0xdef2('0x2c')][_0xdef2('0x40')](_0x881a9a);})['then'](function(_0x7ae408){_0x3f13c8[_0xdef2('0x41')]=_0x7ae408;return _0x3f13c8;})[_0xdef2('0x25')](respondWithFilteredResult(_0x521e34,_0x881a9a))[_0xdef2('0x42')](handleError(_0x521e34,null));};exports[_0xdef2('0x43')]=function(_0x12bdf2,_0xdffc27){var _0x35c512={'raw':![],'where':{'id':_0x12bdf2[_0xdef2('0x44')]['id']}},_0x2a4822={};_0x2a4822[_0xdef2('0x32')]=_[_0xdef2('0x30')](db['AnalyticFieldReport'][_0xdef2('0x45')]);_0x2a4822[_0xdef2('0x2f')]=_[_0xdef2('0x30')](_0x12bdf2[_0xdef2('0x2f')]);_0x2a4822[_0xdef2('0x39')]=_[_0xdef2('0x31')](_0x2a4822[_0xdef2('0x32')],_0x2a4822[_0xdef2('0x2f')]);_0x35c512['attributes']=_[_0xdef2('0x31')](_0x2a4822[_0xdef2('0x32')],qs[_0xdef2('0x33')](_0x12bdf2[_0xdef2('0x2f')][_0xdef2('0x33')]));_0x35c512['attributes']=_0x35c512[_0xdef2('0x34')][_0xdef2('0x35')]?_0x35c512['attributes']:_0x2a4822[_0xdef2('0x32')];if(_0x12bdf2[_0xdef2('0x2f')][_0xdef2('0x46')]){_0x35c512[_0xdef2('0x3f')]=[{'all':!![]}];}_0x35c512=_[_0xdef2('0x3b')]({},_0x35c512,_0x12bdf2[_0xdef2('0x47')]);return db[_0xdef2('0x2c')][_0xdef2('0x48')](_0x35c512)[_0xdef2('0x25')](handleEntityNotFound(_0xdffc27,null))[_0xdef2('0x25')](respondWithResult(_0xdffc27,null))[_0xdef2('0x42')](handleError(_0xdffc27,null));};exports[_0xdef2('0x49')]=function(_0x550b1f,_0x550b83){return db['AnalyticFieldReport']['create'](_0x550b1f[_0xdef2('0x4a')],{})[_0xdef2('0x25')](respondWithResult(_0x550b83,0xc9))[_0xdef2('0x42')](handleError(_0x550b83,null));};exports[_0xdef2('0x4b')]=function(_0x4d771d,_0x2c9461){return db['AnalyticFieldReport'][_0xdef2('0x4b')](_0x4d771d['body'],{'raw':![],'individualHooks':!![]})[_0xdef2('0x25')](respondWithResult(_0x2c9461,0xc9))[_0xdef2('0x42')](handleError(_0x2c9461,null));};exports['update']=function(_0x53cc81,_0x70ffaf){if(_0x53cc81['body']['id']){delete _0x53cc81[_0xdef2('0x4a')]['id'];}return db[_0xdef2('0x2c')][_0xdef2('0x48')]({'where':{'id':_0x53cc81[_0xdef2('0x44')]['id']}})[_0xdef2('0x25')](handleEntityNotFound(_0x70ffaf,null))[_0xdef2('0x25')](saveUpdates(_0x53cc81[_0xdef2('0x4a')],null))['then'](respondWithResult(_0x70ffaf,null))[_0xdef2('0x42')](handleError(_0x70ffaf,null));};exports['destroy']=function(_0x54c030,_0x2d1cb9){return db[_0xdef2('0x2c')]['find']({'where':{'id':_0x54c030[_0xdef2('0x44')]['id']}})['then'](handleEntityNotFound(_0x2d1cb9,null))[_0xdef2('0x25')](removeEntity(_0x2d1cb9,null))[_0xdef2('0x42')](handleError(_0x2d1cb9,null));};exports['bulkDestroy']=function(_0x3c1d4b,_0x5c877b){return db[_0xdef2('0x2c')][_0xdef2('0x26')]({'where':{'id':_0x3c1d4b[_0xdef2('0x2f')][_0xdef2('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5c877b,0xcc))[_0xdef2('0x42')](handleError(_0x5c877b,null));};exports['addFields']=function(_0x1eb2f5,_0xb0bb7,_0x59b542){return db[_0xdef2('0x4d')][_0xdef2('0x4e')]({'where':{'id':_0x1eb2f5[_0xdef2('0x44')]['id']}})[_0xdef2('0x25')](handleEntityNotFound(_0xb0bb7,null))[_0xdef2('0x25')](function(_0x437a60){if(_0x437a60){return db[_0xdef2('0x4f')]['transaction'](function(_0x1a2783){return db[_0xdef2('0x2c')][_0xdef2('0x26')]({'where':{'CustomReportId':_0x1eb2f5[_0xdef2('0x44')]['id']},'transaction':_0x1a2783})[_0xdef2('0x25')](function(_0x34bb0a){var _0x2728bd=_[_0xdef2('0x2b')](_0x1eb2f5[_0xdef2('0x4a')],function(_0x2fcfa0){delete _0x2fcfa0['id'];_0x2fcfa0[_0xdef2('0x50')]=_0x1eb2f5[_0xdef2('0x44')]['id'];return _0x2fcfa0;});return db[_0xdef2('0x2c')][_0xdef2('0x4b')](_0x2728bd,{'transaction':_0x1a2783});});})[_0xdef2('0x25')](function(){return db['AnalyticFieldReport'][_0xdef2('0x40')]({'where':{'CustomReportId':_0x1eb2f5[_0xdef2('0x44')]['id']}});});}})[_0xdef2('0x25')](respondWithResult(_0xb0bb7,null))[_0xdef2('0x42')](handleError(_0xb0bb7,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 4f27fde..7da1ae1 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 _0xfcdf=['bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0x500206,_0x3e623b){var _0x4bcb84=function(_0x59fa82){while(--_0x59fa82){_0x500206['push'](_0x500206['shift']());}};_0x4bcb84(++_0x3e623b);}(_0xfcdf,0xbc));var _0xffcd=function(_0x522936,_0x323a9c){_0x522936=_0x522936-0x0;var _0x3a7b4c=_0xfcdf[_0x522936];return _0x3a7b4c;};'use strict';var _=require(_0xffcd('0x0'));var util=require(_0xffcd('0x1'));var logger=require(_0xffcd('0x2'))('api');var moment=require(_0xffcd('0x3'));var BPromise=require(_0xffcd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffcd('0x5'));var rimraf=require(_0xffcd('0x6'));var config=require(_0xffcd('0x7'));var attributes=require(_0xffcd('0x8'));module[_0xffcd('0x9')]=function(_0x148507,_0x317310){return _0x148507[_0xffcd('0xa')](_0xffcd('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f40=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','analytics_report_fields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0f40,0x176));var _0x00f4=function(_0x2b4629,_0x2cfe26){_0x2b4629=_0x2b4629-0x0;var _0x1d8fa9=_0x0f40[_0x2b4629];return _0x1d8fa9;};'use strict';var _=require(_0x00f4('0x0'));var util=require(_0x00f4('0x1'));var logger=require(_0x00f4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x00f4('0x3'));var rp=require(_0x00f4('0x4'));var fs=require('fs');var path=require(_0x00f4('0x5'));var rimraf=require(_0x00f4('0x6'));var config=require(_0x00f4('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x00f4('0x8')]=function(_0x11a12b,_0xd0e9d0){return _0x11a12b[_0x00f4('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x00f4('0xa'),'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 1746659..22ec9f9 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 _0xd94b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','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','lodash'];(function(_0x2f34cb,_0x4aebda){var _0x448f63=function(_0x2019f6){while(--_0x2019f6){_0x2f34cb['push'](_0x2f34cb['shift']());}};_0x448f63(++_0x4aebda);}(_0xd94b,0xbf));var _0xbd94=function(_0xfeb39,_0x1d20b7){_0xfeb39=_0xfeb39-0x0;var _0x167aa8=_0xd94b[_0xfeb39];return _0x167aa8;};'use strict';var _=require(_0xbd94('0x0'));var util=require(_0xbd94('0x1'));var moment=require(_0xbd94('0x2'));var BPromise=require(_0xbd94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd94('0x4'));var db=require(_0xbd94('0x5'))['db'];var utils=require(_0xbd94('0x6'));var logger=require(_0xbd94('0x7'))('rpc');var config=require(_0xbd94('0x8'));var jayson=require(_0xbd94('0x9'));var client=jayson[_0xbd94('0xa')][_0xbd94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31a79c,_0x289cb4,_0x2ef2f2){return new BPromise(function(_0x20635d,_0x4aa203){return client[_0xbd94('0xc')](_0x31a79c,_0x2ef2f2)[_0xbd94('0xd')](function(_0x4a525e){logger[_0xbd94('0xe')](_0xbd94('0xf'),_0x289cb4,_0xbd94('0x10'));logger[_0xbd94('0x11')](_0xbd94('0x12'),_0x289cb4,'request\x20sent',JSON[_0xbd94('0x13')](_0x4a525e));if(_0x4a525e[_0xbd94('0x14')]){if(_0x4a525e['error'][_0xbd94('0x15')]===0x1f4){logger[_0xbd94('0x14')](_0xbd94('0xf'),_0x289cb4,_0x4a525e[_0xbd94('0x14')][_0xbd94('0x16')]);return _0x4aa203(_0x4a525e[_0xbd94('0x14')][_0xbd94('0x16')]);}logger[_0xbd94('0x14')](_0xbd94('0xf'),_0x289cb4,_0x4a525e[_0xbd94('0x14')][_0xbd94('0x16')]);return _0x20635d(_0x4a525e[_0xbd94('0x14')][_0xbd94('0x16')]);}else{logger['info'](_0xbd94('0xf'),_0x289cb4,_0xbd94('0x10'));_0x20635d(_0x4a525e[_0xbd94('0x17')][_0xbd94('0x16')]);}})['catch'](function(_0xdb778e){logger[_0xbd94('0x14')](_0xbd94('0xf'),_0x289cb4,_0xdb778e);_0x4aa203(_0xdb778e);});});}
\ No newline at end of file
+var _0xe6f2=['message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xd7df6d,_0x2e784b){var _0x304544=function(_0x4e6594){while(--_0x4e6594){_0xd7df6d['push'](_0xd7df6d['shift']());}};_0x304544(++_0x2e784b);}(_0xe6f2,0x1d2));var _0x2e6f=function(_0x5d2138,_0x3190db){_0x5d2138=_0x5d2138-0x0;var _0x31f675=_0xe6f2[_0x5d2138];return _0x31f675;};'use strict';var _=require('lodash');var util=require(_0x2e6f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2e6f('0x1'));var fs=require('fs');var Redis=require(_0x2e6f('0x2'));var db=require(_0x2e6f('0x3'))['db'];var utils=require(_0x2e6f('0x4'));var logger=require('../../config/logger')(_0x2e6f('0x5'));var config=require(_0x2e6f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e6f('0x7')][_0x2e6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2001d2,_0x5bc7fd,_0x42525a){return new BPromise(function(_0x2cd7c3,_0x4000f2){return client[_0x2e6f('0x9')](_0x2001d2,_0x42525a)[_0x2e6f('0xa')](function(_0x40dbf3){logger['info'](_0x2e6f('0xb'),_0x5bc7fd,_0x2e6f('0xc'));logger[_0x2e6f('0xd')](_0x2e6f('0xe'),_0x5bc7fd,'request\x20sent',JSON[_0x2e6f('0xf')](_0x40dbf3));if(_0x40dbf3['error']){if(_0x40dbf3[_0x2e6f('0x10')][_0x2e6f('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5bc7fd,_0x40dbf3[_0x2e6f('0x10')][_0x2e6f('0x12')]);return _0x4000f2(_0x40dbf3[_0x2e6f('0x10')][_0x2e6f('0x12')]);}logger[_0x2e6f('0x10')](_0x2e6f('0xb'),_0x5bc7fd,_0x40dbf3[_0x2e6f('0x10')][_0x2e6f('0x12')]);return _0x2cd7c3(_0x40dbf3[_0x2e6f('0x10')]['message']);}else{logger[_0x2e6f('0x13')](_0x2e6f('0xb'),_0x5bc7fd,'request\x20sent');_0x2cd7c3(_0x40dbf3[_0x2e6f('0x14')][_0x2e6f('0x12')]);}})[_0x2e6f('0x15')](function(_0xbcdbd9){logger['error'](_0x2e6f('0xb'),_0x5bc7fd,_0xbcdbd9);_0x4000f2(_0xbcdbd9);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index a13f2f5..5947c06 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(_0x531bc7,_0x113e06){var _0x26547c=function(_0x1d8cfd){while(--_0x1d8cfd){_0x531bc7['push'](_0x531bc7['shift']());}};_0x26547c(++_0x113e06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x6b1060,_0x5aaae9){var _0x9d80d3=function(_0x4b3e91){while(--_0x4b3e91){_0x6b1060['push'](_0x6b1060['shift']());}};_0x9d80d3(++_0x5aaae9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 0306e7a..f9e9ecb 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 _0x61a5=['name','TEXT','sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x61a5,0x19e));var _0x561a=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0x61a5[_0x416cdc];return _0x1931ce;};'use strict';var Sequelize=require(_0x561a('0x0'));module['exports']={'name':{'type':Sequelize[_0x561a('0x1')],'allowNull':![],'unique':_0x561a('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x561a('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa4db=['TEXT','name','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa4db,0x139));var _0xba4d=function(_0x29b6ba,_0x3947af){_0x29b6ba=_0x29b6ba-0x0;var _0x215d0f=_0xa4db[_0x29b6ba];return _0x215d0f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xba4d('0x0')},'table':{'type':Sequelize[_0xba4d('0x1')]},'metric':{'type':Sequelize[_0xba4d('0x2')]},'description':{'type':Sequelize[_0xba4d('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 856dcdb..e10632d 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 _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1f8184,_0x59e343){var _0x3e19d8=function(_0x1a2a68){while(--_0x1a2a68){_0x1f8184['push'](_0x1f8184['shift']());}};_0x3e19d8(++_0x59e343);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2a238a,_0x1d5054){_0x2a238a=_0x2a238a-0x0;var _0xeef802=_0x4b84[_0x2a238a];return _0xeef802;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
+var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x45b380,_0x478cbd){var _0x4cdb76=function(_0x1b6a75){while(--_0x1b6a75){_0x45b380['push'](_0x45b380['shift']());}};_0x4cdb76(++_0x478cbd);}(_0x81bd,0x7c));var _0xd81b=function(_0xc4376d,_0x2e6841){_0xc4376d=_0xc4376d-0x0;var _0x291524=_0x81bd[_0xc4376d];return _0x291524;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 60a7c23..dcccd56 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 _0x13c5=['exports','analytics_metrics','lodash','path','./analyticMetric.attributes'];(function(_0x343343,_0x46874d){var _0x25462d=function(_0x2f88a4){while(--_0x2f88a4){_0x343343['push'](_0x343343['shift']());}};_0x25462d(++_0x46874d);}(_0x13c5,0x7a));var _0x513c=function(_0x4861fd,_0x43c3bd){_0x4861fd=_0x4861fd-0x0;var _0x2b7231=_0x13c5[_0x4861fd];return _0x2b7231;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x513c('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x513c('0x2'));module[_0x513c('0x3')]=function(_0x982017,_0x2ad2db){return _0x982017['define']('AnalyticMetric',attributes,{'tableName':_0x513c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d76=['moment','bluebird','request-promise','path','./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api'];(function(_0x23662d,_0x1c9918){var _0x22a879=function(_0xdbc5a5){while(--_0xdbc5a5){_0x23662d['push'](_0x23662d['shift']());}};_0x22a879(++_0x1c9918);}(_0x9d76,0x76));var _0x69d7=function(_0x4bfab7,_0x1f92fc){_0x4bfab7=_0x4bfab7-0x0;var _0x232fd7=_0x9d76[_0x4bfab7];return _0x232fd7;};'use strict';var _=require(_0x69d7('0x0'));var util=require('util');var logger=require(_0x69d7('0x1'))(_0x69d7('0x2'));var moment=require(_0x69d7('0x3'));var BPromise=require(_0x69d7('0x4'));var rp=require(_0x69d7('0x5'));var fs=require('fs');var path=require(_0x69d7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x69d7('0x7'));module[_0x69d7('0x8')]=function(_0x9ec22e,_0x237111){return _0x9ec22e['define'](_0x69d7('0x9'),attributes,{'tableName':_0x69d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index dee7898..4a9b0fb 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 _0xc583=['stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x220c6e,_0x1c328c){var _0x534e93=function(_0xaa73ff){while(--_0xaa73ff){_0x220c6e['push'](_0x220c6e['shift']());}};_0x534e93(++_0x1c328c);}(_0xc583,0x194));var _0x3c58=function(_0x22b96f,_0x35cc0a){_0x22b96f=_0x22b96f-0x0;var _0x2bee8a=_0xc583[_0x22b96f];return _0x2bee8a;};'use strict';var _=require(_0x3c58('0x0'));var util=require('util');var moment=require(_0x3c58('0x1'));var BPromise=require(_0x3c58('0x2'));var rs=require(_0x3c58('0x3'));var fs=require('fs');var Redis=require(_0x3c58('0x4'));var db=require(_0x3c58('0x5'))['db'];var utils=require(_0x3c58('0x6'));var logger=require(_0x3c58('0x7'))(_0x3c58('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c58('0x9')][_0x3c58('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31cf0d,_0x137a4d,_0x3d1974){return new BPromise(function(_0x3439a7,_0x935da2){return client[_0x3c58('0xb')](_0x31cf0d,_0x3d1974)[_0x3c58('0xc')](function(_0x405c25){logger[_0x3c58('0xd')](_0x3c58('0xe'),_0x137a4d,_0x3c58('0xf'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x137a4d,'request\x20sent',JSON[_0x3c58('0x10')](_0x405c25));if(_0x405c25['error']){if(_0x405c25[_0x3c58('0x11')]['code']===0x1f4){logger[_0x3c58('0x11')](_0x3c58('0xe'),_0x137a4d,_0x405c25['error'][_0x3c58('0x12')]);return _0x935da2(_0x405c25[_0x3c58('0x11')][_0x3c58('0x12')]);}logger[_0x3c58('0x11')](_0x3c58('0xe'),_0x137a4d,_0x405c25[_0x3c58('0x11')][_0x3c58('0x12')]);return _0x3439a7(_0x405c25['error'][_0x3c58('0x12')]);}else{logger[_0x3c58('0xd')](_0x3c58('0xe'),_0x137a4d,_0x3c58('0xf'));_0x3439a7(_0x405c25[_0x3c58('0x13')][_0x3c58('0x12')]);}})[_0x3c58('0x14')](function(_0x59be62){logger[_0x3c58('0x11')](_0x3c58('0xe'),_0x137a4d,_0x59be62);_0x935da2(_0x59be62);});});}
\ No newline at end of file
+var _0x0ecf=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x0ecf,0xf0));var _0xf0ec=function(_0x30e5b6,_0x2ab393){_0x30e5b6=_0x30e5b6-0x0;var _0x4f1bf4=_0x0ecf[_0x30e5b6];return _0x4f1bf4;};'use strict';var _=require('lodash');var util=require(_0xf0ec('0x0'));var moment=require(_0xf0ec('0x1'));var BPromise=require(_0xf0ec('0x2'));var rs=require(_0xf0ec('0x3'));var fs=require('fs');var Redis=require(_0xf0ec('0x4'));var db=require(_0xf0ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ec('0x6'))(_0xf0ec('0x7'));var config=require('../../config/environment');var jayson=require(_0xf0ec('0x8'));var client=jayson[_0xf0ec('0x9')][_0xf0ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e6600,_0x5d8752,_0x3423a7){return new BPromise(function(_0x2b3910,_0x113694){return client['request'](_0x5e6600,_0x3423a7)[_0xf0ec('0xb')](function(_0x2d6356){logger[_0xf0ec('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x5d8752,_0xf0ec('0xd'));logger[_0xf0ec('0xe')](_0xf0ec('0xf'),_0x5d8752,_0xf0ec('0xd'),JSON[_0xf0ec('0x10')](_0x2d6356));if(_0x2d6356[_0xf0ec('0x11')]){if(_0x2d6356[_0xf0ec('0x11')][_0xf0ec('0x12')]===0x1f4){logger[_0xf0ec('0x11')](_0xf0ec('0x13'),_0x5d8752,_0x2d6356[_0xf0ec('0x11')][_0xf0ec('0x14')]);return _0x113694(_0x2d6356[_0xf0ec('0x11')][_0xf0ec('0x14')]);}logger[_0xf0ec('0x11')](_0xf0ec('0x13'),_0x5d8752,_0x2d6356[_0xf0ec('0x11')][_0xf0ec('0x14')]);return _0x2b3910(_0x2d6356[_0xf0ec('0x11')][_0xf0ec('0x14')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5d8752,_0xf0ec('0xd'));_0x2b3910(_0x2d6356[_0xf0ec('0x15')]['message']);}})[_0xf0ec('0x16')](function(_0x409cb7){logger['error'](_0xf0ec('0x13'),_0x5d8752,_0x409cb7);_0x113694(_0x409cb7);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index def7732..88e1335 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 _0x6d19=['../../config/environment','./analyticMetric.controller','get','index','/:id','show','post','isAuthenticated','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1bb54c,_0x1ae739){var _0x431e02=function(_0x513416){while(--_0x513416){_0x1bb54c['push'](_0x1bb54c['shift']());}};_0x431e02(++_0x1ae739);}(_0x6d19,0x160));var _0x96d1=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x6d19[_0x548627];return _0x844a84;};'use strict';var multer=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var path=require(_0x96d1('0x2'));var timeout=require(_0x96d1('0x3'));var express=require(_0x96d1('0x4'));var router=express[_0x96d1('0x5')]();var fs_extra=require(_0x96d1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x96d1('0x7'));var config=require(_0x96d1('0x8'));var controller=require(_0x96d1('0x9'));router[_0x96d1('0xa')]('/',auth['isAuthenticated'](),controller[_0x96d1('0xb')]);router[_0x96d1('0xa')](_0x96d1('0xc'),auth['isAuthenticated'](),controller[_0x96d1('0xd')]);router[_0x96d1('0xe')]('/',auth[_0x96d1('0xf')](),controller[_0x96d1('0x10')]);router[_0x96d1('0x11')](_0x96d1('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x96d1('0x12')](_0x96d1('0xc'),auth['isAuthenticated'](),controller[_0x96d1('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x598a=['util','path','connect-timeout','express','fs-extra','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x598a,0xfb));var _0xa598=function(_0x202077,_0x41b817){_0x202077=_0x202077-0x0;var _0x490a54=_0x598a[_0x202077];return _0x490a54;};'use strict';var multer=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var path=require(_0xa598('0x2'));var timeout=require(_0xa598('0x3'));var express=require(_0xa598('0x4'));var router=express['Router']();var fs_extra=require(_0xa598('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa598('0x6'));router[_0xa598('0x7')]('/',auth[_0xa598('0x8')](),controller[_0xa598('0x9')]);router[_0xa598('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa598('0xa')]);router[_0xa598('0xb')]('/',auth[_0xa598('0x8')](),controller[_0xa598('0xc')]);router[_0xa598('0xd')](_0xa598('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xa598('0xf')](_0xa598('0xe'),auth[_0xa598('0x8')](),controller[_0xa598('0x10')]);module[_0xa598('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 71df0f5..57fbf25 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 _0xe24a=['TEXT','exports'];(function(_0x3cd133,_0x222fcb){var _0x2512c8=function(_0x484491){while(--_0x484491){_0x3cd133['push'](_0x3cd133['shift']());}};_0x2512c8(++_0x222fcb);}(_0xe24a,0x87));var _0xae24=function(_0x1c57f9,_0x474d9b){_0x1c57f9=_0x1c57f9-0x0;var _0x5c8aac=_0xe24a[_0x1c57f9];return _0x5c8aac;};'use strict';var Sequelize=require('sequelize');module[_0xae24('0x0')]={'tree':{'type':Sequelize[_0xae24('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x9f4e=['exports','TEXT','sequelize'];(function(_0x59e7e0,_0x3ec148){var _0x26b058=function(_0x212ee2){while(--_0x212ee2){_0x59e7e0['push'](_0x59e7e0['shift']());}};_0x26b058(++_0x3ec148);}(_0x9f4e,0xce));var _0xe9f4=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x9f4e[_0x1057a3];return _0x131cdb;};'use strict';var Sequelize=require(_0xe9f4('0x0'));module[_0xe9f4('0x1')]={'tree':{'type':Sequelize[_0xe9f4('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 2b46f7d..a06477e 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 _0x8bed=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','json','reject','update','then','destroy','sendStatus','error','stack','name','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','includeAll','include','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4a8535,_0x100001){var _0x2e48dd=function(_0x20e9b5){while(--_0x20e9b5){_0x4a8535['push'](_0x4a8535['shift']());}};_0x2e48dd(++_0x100001);}(_0x8bed,0xca));var _0xd8be=function(_0x4ff939,_0x5f54ea){_0x4ff939=_0x4ff939-0x0;var _0x3f8ba8=_0x8bed[_0x4ff939];return _0x3f8ba8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd8be('0x0'));var zipdir=require(_0xd8be('0x1'));var jsonpatch=require(_0xd8be('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8be('0x3'));var Mustache=require(_0xd8be('0x4'));var util=require(_0xd8be('0x5'));var path=require(_0xd8be('0x6'));var sox=require(_0xd8be('0x7'));var csv=require(_0xd8be('0x8'));var ejs=require(_0xd8be('0x9'));var fs=require('fs');var fs_extra=require(_0xd8be('0xa'));var _=require(_0xd8be('0xb'));var squel=require(_0xd8be('0xc'));var crypto=require(_0xd8be('0xd'));var jsforce=require(_0xd8be('0xe'));var deskjs=require(_0xd8be('0xf'));var toCsv=require(_0xd8be('0x8'));var querystring=require(_0xd8be('0x10'));var Papa=require(_0xd8be('0x11'));var Redis=require(_0xd8be('0x12'));var authService=require(_0xd8be('0x13'));var qs=require(_0xd8be('0x14'));var as=require(_0xd8be('0x15'));var hardwareService=require(_0xd8be('0x16'));var logger=require(_0xd8be('0x17'))(_0xd8be('0x18'));var utils=require(_0xd8be('0x19'));var config=require(_0xd8be('0x1a'));var licenseUtil=require(_0xd8be('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2504c8,_0x151719){_0x151719=_0x151719||0xcc;return function(_0x447d92){if(_0x447d92){return _0x2504c8['sendStatus'](_0x151719);}return _0x2504c8[_0xd8be('0x1c')](_0x151719)[_0xd8be('0x1d')]();};}function respondWithResult(_0x450dd8,_0x2f6b07){_0x2f6b07=_0x2f6b07||0xc8;return function(_0x12fd09){if(_0x12fd09){return _0x450dd8[_0xd8be('0x1c')](_0x2f6b07)['json'](_0x12fd09);}};}function respondWithFilteredResult(_0x14bbd6,_0x52a2da){return function(_0x5b6c0e){if(_0x5b6c0e){var _0x5d0ae3=typeof _0x52a2da[_0xd8be('0x1e')]===_0xd8be('0x1f')&&typeof _0x52a2da[_0xd8be('0x20')]===_0xd8be('0x1f');var _0x382d4a=_0x5b6c0e[_0xd8be('0x21')];var _0x52cf76=_0x5d0ae3?0x0:_0x52a2da[_0xd8be('0x1e')];var _0x269a99=_0x5d0ae3?_0x5b6c0e['count']:_0x52a2da['offset']+_0x52a2da[_0xd8be('0x20')];var _0xd75dbb;if(_0x269a99>=_0x382d4a){_0x269a99=_0x382d4a;_0xd75dbb=0xc8;}else{_0xd75dbb=0xce;}_0x14bbd6[_0xd8be('0x1c')](_0xd75dbb);return _0x14bbd6[_0xd8be('0x22')]('Content-Range',_0x52cf76+'-'+_0x269a99+'/'+_0x382d4a)[_0xd8be('0x23')](_0x5b6c0e);}return null;};}function patchUpdates(_0xe34c12){return function(_0x156857){try{jsonpatch['apply'](_0x156857,_0xe34c12,!![]);}catch(_0x48f423){return BPromise[_0xd8be('0x24')](_0x48f423);}return _0x156857['save']();};}function saveUpdates(_0x284f80,_0x31b4ec){return function(_0x10dab6){if(_0x10dab6){return _0x10dab6[_0xd8be('0x25')](_0x284f80)[_0xd8be('0x26')](function(_0x2e9828){return _0x2e9828;});}return null;};}function removeEntity(_0x2f9c19,_0x1914d1){return function(_0x5ae535){if(_0x5ae535){return _0x5ae535[_0xd8be('0x27')]()[_0xd8be('0x26')](function(){_0x2f9c19[_0xd8be('0x1c')](0xcc)[_0xd8be('0x1d')]();});}};}function handleEntityNotFound(_0x5a17e4,_0x4ee1c4){return function(_0x5220b2){if(!_0x5220b2){_0x5a17e4[_0xd8be('0x28')](0x194);}return _0x5220b2;};}function handleError(_0x33fb6a,_0x592c4c){_0x592c4c=_0x592c4c||0x1f4;return function(_0x10789a){logger[_0xd8be('0x29')](_0x10789a[_0xd8be('0x2a')]);if(_0x10789a[_0xd8be('0x2b')]){delete _0x10789a[_0xd8be('0x2b')];}_0x33fb6a[_0xd8be('0x1c')](_0x592c4c)['send'](_0x10789a);};}exports['index']=function(_0x47247f,_0x45ce44){var _0x295faa={},_0x22ac51={},_0x5efc59={'count':0x0,'rows':[]};var _0x5de0ec=_[_0xd8be('0x2c')](db[_0xd8be('0x2d')][_0xd8be('0x2e')],function(_0x1c62eb){return{'name':_0x1c62eb[_0xd8be('0x2f')],'type':_0x1c62eb[_0xd8be('0x30')][_0xd8be('0x31')]};});_0x22ac51[_0xd8be('0x32')]=_[_0xd8be('0x2c')](_0x5de0ec,_0xd8be('0x2b'));_0x22ac51[_0xd8be('0x33')]=_[_0xd8be('0x34')](_0x47247f[_0xd8be('0x33')]);_0x22ac51[_0xd8be('0x35')]=_[_0xd8be('0x36')](_0x22ac51['model'],_0x22ac51['query']);_0x295faa[_0xd8be('0x37')]=_['intersection'](_0x22ac51[_0xd8be('0x32')],qs[_0xd8be('0x38')](_0x47247f[_0xd8be('0x33')][_0xd8be('0x38')]));_0x295faa[_0xd8be('0x37')]=_0x295faa[_0xd8be('0x37')][_0xd8be('0x39')]?_0x295faa['attributes']:_0x22ac51[_0xd8be('0x32')];if(!_0x47247f[_0xd8be('0x33')][_0xd8be('0x3a')]('nolimit')){_0x295faa[_0xd8be('0x20')]=qs['limit'](_0x47247f[_0xd8be('0x33')][_0xd8be('0x20')]);_0x295faa[_0xd8be('0x1e')]=qs['offset'](_0x47247f[_0xd8be('0x33')][_0xd8be('0x1e')]);}_0x295faa['order']=qs[_0xd8be('0x3b')](_0x47247f[_0xd8be('0x33')][_0xd8be('0x3b')]);_0x295faa[_0xd8be('0x3c')]=qs[_0xd8be('0x35')](_['pick'](_0x47247f[_0xd8be('0x33')],_0x22ac51['filters']),_0x5de0ec);if(_0x47247f[_0xd8be('0x33')]['filter']){_0x295faa[_0xd8be('0x3c')]=_[_0xd8be('0x3d')](_0x295faa[_0xd8be('0x3c')],{'$or':_[_0xd8be('0x2c')](_0x5de0ec,function(_0xb960b6){if(_0xb960b6[_0xd8be('0x30')]!==_0xd8be('0x3e')){var _0xd50b91={};_0xd50b91[_0xb960b6[_0xd8be('0x2b')]]={'$like':'%'+_0x47247f[_0xd8be('0x33')][_0xd8be('0x3f')]+'%'};return _0xd50b91;}})});}_0x295faa=_[_0xd8be('0x3d')]({},_0x295faa,_0x47247f['options']);var _0x1a61f2={'where':_0x295faa[_0xd8be('0x3c')]};return db[_0xd8be('0x2d')][_0xd8be('0x21')](_0x1a61f2)[_0xd8be('0x26')](function(_0x1adb91){_0x5efc59[_0xd8be('0x21')]=_0x1adb91;if(_0x47247f['query'][_0xd8be('0x40')]){_0x295faa[_0xd8be('0x41')]=[{'all':!![]}];}return db[_0xd8be('0x2d')]['findAll'](_0x295faa);})[_0xd8be('0x26')](function(_0x4246f8){_0x5efc59['rows']=_0x4246f8;return _0x5efc59;})[_0xd8be('0x26')](respondWithFilteredResult(_0x45ce44,_0x295faa))[_0xd8be('0x42')](handleError(_0x45ce44,null));};exports[_0xd8be('0x43')]=function(_0x2db83f,_0x2829eb){var _0xe9aabe={'raw':!![],'where':{'id':_0x2db83f['params']['id']}},_0x880fde={};_0x880fde[_0xd8be('0x32')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x880fde[_0xd8be('0x33')]=_[_0xd8be('0x34')](_0x2db83f['query']);_0x880fde[_0xd8be('0x35')]=_[_0xd8be('0x36')](_0x880fde['model'],_0x880fde['query']);_0xe9aabe[_0xd8be('0x37')]=_[_0xd8be('0x36')](_0x880fde[_0xd8be('0x32')],qs[_0xd8be('0x38')](_0x2db83f[_0xd8be('0x33')][_0xd8be('0x38')]));_0xe9aabe['attributes']=_0xe9aabe[_0xd8be('0x37')][_0xd8be('0x39')]?_0xe9aabe['attributes']:_0x880fde[_0xd8be('0x32')];if(_0x2db83f[_0xd8be('0x33')][_0xd8be('0x40')]){_0xe9aabe[_0xd8be('0x41')]=[{'all':!![]}];}_0xe9aabe=_[_0xd8be('0x3d')]({},_0xe9aabe,_0x2db83f['options']);return db[_0xd8be('0x2d')][_0xd8be('0x44')](_0xe9aabe)['then'](handleEntityNotFound(_0x2829eb,null))[_0xd8be('0x26')](respondWithResult(_0x2829eb,null))[_0xd8be('0x42')](handleError(_0x2829eb,null));};exports[_0xd8be('0x45')]=function(_0x3dfe33,_0x5af887){return db['AnalyticTreeReport'][_0xd8be('0x45')](_0x3dfe33['body'],{})[_0xd8be('0x26')](respondWithResult(_0x5af887,0xc9))['catch'](handleError(_0x5af887,null));};exports[_0xd8be('0x25')]=function(_0xb64434,_0x47ddf1){if(_0xb64434[_0xd8be('0x46')]['id']){delete _0xb64434['body']['id'];}return db[_0xd8be('0x2d')][_0xd8be('0x44')]({'where':{'id':_0xb64434[_0xd8be('0x47')]['id']}})[_0xd8be('0x26')](handleEntityNotFound(_0x47ddf1,null))[_0xd8be('0x26')](saveUpdates(_0xb64434['body'],null))['then'](respondWithResult(_0x47ddf1,null))[_0xd8be('0x42')](handleError(_0x47ddf1,null));};exports[_0xd8be('0x27')]=function(_0x2f8e37,_0xefcb14){return db[_0xd8be('0x2d')][_0xd8be('0x44')]({'where':{'id':_0x2f8e37[_0xd8be('0x47')]['id']}})['then'](handleEntityNotFound(_0xefcb14,null))[_0xd8be('0x26')](removeEntity(_0xefcb14,null))[_0xd8be('0x42')](handleError(_0xefcb14,null));};
\ No newline at end of file
+var _0x7ad2=['sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','show','params','length','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x4e29f4,_0x481754){var _0xaf50cb=function(_0x25d70c){while(--_0x25d70c){_0x4e29f4['push'](_0x4e29f4['shift']());}};_0xaf50cb(++_0x481754);}(_0x7ad2,0x1f4));var _0x27ad=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x7ad2[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require(_0x27ad('0x0'));var rimraf=require(_0x27ad('0x1'));var zipdir=require(_0x27ad('0x2'));var jsonpatch=require(_0x27ad('0x3'));var rp=require(_0x27ad('0x4'));var moment=require(_0x27ad('0x5'));var BPromise=require(_0x27ad('0x6'));var Mustache=require(_0x27ad('0x7'));var util=require(_0x27ad('0x8'));var path=require(_0x27ad('0x9'));var sox=require('sox');var csv=require(_0x27ad('0xa'));var ejs=require(_0x27ad('0xb'));var fs=require('fs');var fs_extra=require(_0x27ad('0xc'));var _=require(_0x27ad('0xd'));var squel=require(_0x27ad('0xe'));var crypto=require(_0x27ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x27ad('0xa'));var querystring=require(_0x27ad('0x10'));var Papa=require(_0x27ad('0x11'));var Redis=require(_0x27ad('0x12'));var authService=require(_0x27ad('0x13'));var qs=require(_0x27ad('0x14'));var as=require(_0x27ad('0x15'));var hardwareService=require(_0x27ad('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x27ad('0x17'));var config=require(_0x27ad('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3abecd,_0x5d7f1d){_0x5d7f1d=_0x5d7f1d||0xcc;return function(_0x93be95){if(_0x93be95){return _0x3abecd[_0x27ad('0x19')](_0x5d7f1d);}return _0x3abecd[_0x27ad('0x1a')](_0x5d7f1d)[_0x27ad('0x1b')]();};}function respondWithResult(_0x1f1a9b,_0x4841cb){_0x4841cb=_0x4841cb||0xc8;return function(_0x10199d){if(_0x10199d){return _0x1f1a9b['status'](_0x4841cb)[_0x27ad('0x1c')](_0x10199d);}};}function respondWithFilteredResult(_0x5ef0fd,_0x5aead6){return function(_0x54dcb8){if(_0x54dcb8){var _0x5498db=typeof _0x5aead6[_0x27ad('0x1d')]===_0x27ad('0x1e')&&typeof _0x5aead6[_0x27ad('0x1f')]===_0x27ad('0x1e');var _0x9ad64=_0x54dcb8[_0x27ad('0x20')];var _0x374c32=_0x5498db?0x0:_0x5aead6[_0x27ad('0x1d')];var _0x8f3699=_0x5498db?_0x54dcb8['count']:_0x5aead6[_0x27ad('0x1d')]+_0x5aead6[_0x27ad('0x1f')];var _0x3696d4;if(_0x8f3699>=_0x9ad64){_0x8f3699=_0x9ad64;_0x3696d4=0xc8;}else{_0x3696d4=0xce;}_0x5ef0fd[_0x27ad('0x1a')](_0x3696d4);return _0x5ef0fd[_0x27ad('0x21')]('Content-Range',_0x374c32+'-'+_0x8f3699+'/'+_0x9ad64)[_0x27ad('0x1c')](_0x54dcb8);}return null;};}function patchUpdates(_0x2ec67a){return function(_0x2397f8){try{jsonpatch['apply'](_0x2397f8,_0x2ec67a,!![]);}catch(_0x49dd89){return BPromise[_0x27ad('0x22')](_0x49dd89);}return _0x2397f8[_0x27ad('0x23')]();};}function saveUpdates(_0x57005f,_0x31a965){return function(_0x1ec0a9){if(_0x1ec0a9){return _0x1ec0a9[_0x27ad('0x24')](_0x57005f)['then'](function(_0x163409){return _0x163409;});}return null;};}function removeEntity(_0x299309,_0x212fb2){return function(_0x58b1df){if(_0x58b1df){return _0x58b1df[_0x27ad('0x25')]()[_0x27ad('0x26')](function(){_0x299309['status'](0xcc)[_0x27ad('0x1b')]();});}};}function handleEntityNotFound(_0x3ef647,_0x625c04){return function(_0x2315ed){if(!_0x2315ed){_0x3ef647[_0x27ad('0x19')](0x194);}return _0x2315ed;};}function handleError(_0x5d6ac9,_0x49650f){_0x49650f=_0x49650f||0x1f4;return function(_0x43cc54){logger[_0x27ad('0x27')](_0x43cc54[_0x27ad('0x28')]);if(_0x43cc54[_0x27ad('0x29')]){delete _0x43cc54['name'];}_0x5d6ac9[_0x27ad('0x1a')](_0x49650f)[_0x27ad('0x2a')](_0x43cc54);};}exports[_0x27ad('0x2b')]=function(_0x523671,_0x3d7c4c){var _0x3ccbfc={},_0x32bf0c={},_0x1f9031={'count':0x0,'rows':[]};var _0x3c3518=_[_0x27ad('0x2c')](db['AnalyticTreeReport'][_0x27ad('0x2d')],function(_0x4afaef){return{'name':_0x4afaef[_0x27ad('0x2e')],'type':_0x4afaef[_0x27ad('0x2f')]['key']};});_0x32bf0c[_0x27ad('0x30')]=_[_0x27ad('0x2c')](_0x3c3518,_0x27ad('0x29'));_0x32bf0c[_0x27ad('0x31')]=_[_0x27ad('0x32')](_0x523671['query']);_0x32bf0c['filters']=_[_0x27ad('0x33')](_0x32bf0c[_0x27ad('0x30')],_0x32bf0c['query']);_0x3ccbfc[_0x27ad('0x34')]=_['intersection'](_0x32bf0c[_0x27ad('0x30')],qs[_0x27ad('0x35')](_0x523671[_0x27ad('0x31')][_0x27ad('0x35')]));_0x3ccbfc[_0x27ad('0x34')]=_0x3ccbfc['attributes']['length']?_0x3ccbfc[_0x27ad('0x34')]:_0x32bf0c['model'];if(!_0x523671[_0x27ad('0x31')][_0x27ad('0x36')](_0x27ad('0x37'))){_0x3ccbfc[_0x27ad('0x1f')]=qs[_0x27ad('0x1f')](_0x523671[_0x27ad('0x31')]['limit']);_0x3ccbfc[_0x27ad('0x1d')]=qs[_0x27ad('0x1d')](_0x523671[_0x27ad('0x31')]['offset']);}_0x3ccbfc['order']=qs[_0x27ad('0x38')](_0x523671[_0x27ad('0x31')][_0x27ad('0x38')]);_0x3ccbfc[_0x27ad('0x39')]=qs[_0x27ad('0x3a')](_[_0x27ad('0x3b')](_0x523671[_0x27ad('0x31')],_0x32bf0c[_0x27ad('0x3a')]),_0x3c3518);if(_0x523671[_0x27ad('0x31')][_0x27ad('0x3c')]){_0x3ccbfc[_0x27ad('0x39')]=_[_0x27ad('0x3d')](_0x3ccbfc[_0x27ad('0x39')],{'$or':_[_0x27ad('0x2c')](_0x3c3518,function(_0x421973){if(_0x421973['type']!==_0x27ad('0x3e')){var _0x3937dd={};_0x3937dd[_0x421973[_0x27ad('0x29')]]={'$like':'%'+_0x523671[_0x27ad('0x31')][_0x27ad('0x3c')]+'%'};return _0x3937dd;}})});}_0x3ccbfc=_[_0x27ad('0x3d')]({},_0x3ccbfc,_0x523671[_0x27ad('0x3f')]);var _0x49d810={'where':_0x3ccbfc[_0x27ad('0x39')]};return db[_0x27ad('0x40')][_0x27ad('0x20')](_0x49d810)['then'](function(_0x1dfe07){_0x1f9031['count']=_0x1dfe07;if(_0x523671[_0x27ad('0x31')][_0x27ad('0x41')]){_0x3ccbfc['include']=[{'all':!![]}];}return db[_0x27ad('0x40')][_0x27ad('0x42')](_0x3ccbfc);})[_0x27ad('0x26')](function(_0x3f681e){_0x1f9031[_0x27ad('0x43')]=_0x3f681e;return _0x1f9031;})['then'](respondWithFilteredResult(_0x3d7c4c,_0x3ccbfc))['catch'](handleError(_0x3d7c4c,null));};exports[_0x27ad('0x44')]=function(_0x1a98b1,_0x203e81){var _0x40d7eb={'raw':!![],'where':{'id':_0x1a98b1[_0x27ad('0x45')]['id']}},_0x2cce46={};_0x2cce46[_0x27ad('0x30')]=_[_0x27ad('0x32')](db['AnalyticTreeReport'][_0x27ad('0x2d')]);_0x2cce46[_0x27ad('0x31')]=_[_0x27ad('0x32')](_0x1a98b1['query']);_0x2cce46[_0x27ad('0x3a')]=_[_0x27ad('0x33')](_0x2cce46[_0x27ad('0x30')],_0x2cce46[_0x27ad('0x31')]);_0x40d7eb[_0x27ad('0x34')]=_['intersection'](_0x2cce46[_0x27ad('0x30')],qs[_0x27ad('0x35')](_0x1a98b1[_0x27ad('0x31')][_0x27ad('0x35')]));_0x40d7eb[_0x27ad('0x34')]=_0x40d7eb[_0x27ad('0x34')][_0x27ad('0x46')]?_0x40d7eb[_0x27ad('0x34')]:_0x2cce46[_0x27ad('0x30')];if(_0x1a98b1[_0x27ad('0x31')][_0x27ad('0x41')]){_0x40d7eb['include']=[{'all':!![]}];}_0x40d7eb=_[_0x27ad('0x3d')]({},_0x40d7eb,_0x1a98b1['options']);return db[_0x27ad('0x40')]['find'](_0x40d7eb)[_0x27ad('0x26')](handleEntityNotFound(_0x203e81,null))[_0x27ad('0x26')](respondWithResult(_0x203e81,null))[_0x27ad('0x47')](handleError(_0x203e81,null));};exports[_0x27ad('0x48')]=function(_0x5eced9,_0x497b27){return db[_0x27ad('0x40')]['create'](_0x5eced9[_0x27ad('0x49')],{})[_0x27ad('0x26')](respondWithResult(_0x497b27,0xc9))[_0x27ad('0x47')](handleError(_0x497b27,null));};exports[_0x27ad('0x24')]=function(_0x1daab0,_0x2569e8){if(_0x1daab0[_0x27ad('0x49')]['id']){delete _0x1daab0[_0x27ad('0x49')]['id'];}return db[_0x27ad('0x40')][_0x27ad('0x4a')]({'where':{'id':_0x1daab0['params']['id']}})[_0x27ad('0x26')](handleEntityNotFound(_0x2569e8,null))['then'](saveUpdates(_0x1daab0[_0x27ad('0x49')],null))[_0x27ad('0x26')](respondWithResult(_0x2569e8,null))['catch'](handleError(_0x2569e8,null));};exports[_0x27ad('0x25')]=function(_0x487b01,_0x58cd91){return db[_0x27ad('0x40')][_0x27ad('0x4a')]({'where':{'id':_0x487b01[_0x27ad('0x45')]['id']}})['then'](handleEntityNotFound(_0x58cd91,null))[_0x27ad('0x26')](removeEntity(_0x58cd91,null))[_0x27ad('0x47')](handleError(_0x58cd91,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 361de0d..984033a 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 _0x44ef=['moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x474771,_0x50efa1){var _0x6388b6=function(_0x56f4c0){while(--_0x56f4c0){_0x474771['push'](_0x474771['shift']());}};_0x6388b6(++_0x50efa1);}(_0x44ef,0x88));var _0xf44e=function(_0x4306f9,_0x55b768){_0x4306f9=_0x4306f9-0x0;var _0xb960db=_0x44ef[_0x4306f9];return _0xb960db;};'use strict';var _=require(_0xf44e('0x0'));var util=require(_0xf44e('0x1'));var logger=require(_0xf44e('0x2'))(_0xf44e('0x3'));var moment=require(_0xf44e('0x4'));var BPromise=require(_0xf44e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf44e('0x6'));var rimraf=require(_0xf44e('0x7'));var config=require(_0xf44e('0x8'));var attributes=require(_0xf44e('0x9'));module[_0xf44e('0xa')]=function(_0x392679,_0x5f1409){return _0x392679[_0xf44e('0xb')](_0xf44e('0xc'),attributes,{'tableName':_0xf44e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd16f=['rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','lodash','util','api','bluebird','request-promise','path'];(function(_0x30d0ad,_0x5e091a){var _0x4dd2b8=function(_0x363c64){while(--_0x363c64){_0x30d0ad['push'](_0x30d0ad['shift']());}};_0x4dd2b8(++_0x5e091a);}(_0xd16f,0xcb));var _0xfd16=function(_0x5ab00c,_0x1ffb65){_0x5ab00c=_0x5ab00c-0x0;var _0x140a93=_0xd16f[_0x5ab00c];return _0x140a93;};'use strict';var _=require(_0xfd16('0x0'));var util=require(_0xfd16('0x1'));var logger=require('../../config/logger')(_0xfd16('0x2'));var moment=require('moment');var BPromise=require(_0xfd16('0x3'));var rp=require(_0xfd16('0x4'));var fs=require('fs');var path=require(_0xfd16('0x5'));var rimraf=require(_0xfd16('0x6'));var config=require(_0xfd16('0x7'));var attributes=require(_0xfd16('0x8'));module['exports']=function(_0x46ad99,_0x40cce0){return _0x46ad99[_0xfd16('0x9')](_0xfd16('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 4f74ff3..739c993 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(_0x1b4355,_0xa1c0b5){var _0xa12783=function(_0x270dcf){while(--_0x270dcf){_0x1b4355['push'](_0x1b4355['shift']());}};_0xa12783(++_0xa1c0b5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'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 _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(_0x38ca49,_0x206382){var _0x131806=function(_0xd39e4d){while(--_0xd39e4d){_0x38ca49['push'](_0x38ca49['shift']());}};_0x131806(++_0x206382);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index c25ba10..f66cab3 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 _0x9b93=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','post','create','/:id','update','delete','destroy','exports','util','path'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0x9b93,0xb9));var _0x39b9=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x9b93[_0x5d80de];return _0x1c7556;};'use strict';var multer=require('multer');var util=require(_0x39b9('0x0'));var path=require(_0x39b9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x39b9('0x2')]();var fs_extra=require(_0x39b9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x39b9('0x4'));var config=require(_0x39b9('0x5'));var controller=require(_0x39b9('0x6'));router[_0x39b9('0x7')]('/',auth[_0x39b9('0x8')](),controller[_0x39b9('0x9')]);router[_0x39b9('0x7')]('/:id',auth[_0x39b9('0x8')](),controller['show']);router[_0x39b9('0xa')]('/',auth[_0x39b9('0x8')](),controller[_0x39b9('0xb')]);router['put'](_0x39b9('0xc'),auth[_0x39b9('0x8')](),controller[_0x39b9('0xd')]);router[_0x39b9('0xe')]('/:id',auth[_0x39b9('0x8')](),controller[_0x39b9('0xf')]);module[_0x39b9('0x10')]=router;
\ No newline at end of file
+var _0xbd39=['isAuthenticated','index','post','/:id','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0xbd39,0xf5));var _0x9bd3=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xbd39[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require(_0x9bd3('0x0'));var path=require(_0x9bd3('0x1'));var timeout=require(_0x9bd3('0x2'));var express=require('express');var router=express[_0x9bd3('0x3')]();var fs_extra=require(_0x9bd3('0x4'));var auth=require(_0x9bd3('0x5'));var interaction=require(_0x9bd3('0x6'));var config=require(_0x9bd3('0x7'));var controller=require(_0x9bd3('0x8'));router[_0x9bd3('0x9')]('/',auth[_0x9bd3('0xa')](),controller[_0x9bd3('0xb')]);router[_0x9bd3('0x9')]('/:id',auth[_0x9bd3('0xa')](),controller['show']);router[_0x9bd3('0xc')]('/',auth[_0x9bd3('0xa')](),controller['create']);router['put'](_0x9bd3('0xd'),auth[_0x9bd3('0xa')](),controller[_0x9bd3('0xe')]);router[_0x9bd3('0xf')](_0x9bd3('0xd'),auth[_0x9bd3('0xa')](),controller['destroy']);module[_0x9bd3('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 6bf8caf..38bcfe1 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 _0xfd2f=['sequelize','exports','STRING'];(function(_0x5f2854,_0x24dd94){var _0xd871cc=function(_0x242c39){while(--_0x242c39){_0x5f2854['push'](_0x5f2854['shift']());}};_0xd871cc(++_0x24dd94);}(_0xfd2f,0x14a));var _0xffd2=function(_0xadb003,_0x35765e){_0xadb003=_0xadb003-0x0;var _0x43cbc2=_0xfd2f[_0xadb003];return _0x43cbc2;};'use strict';var Sequelize=require(_0xffd2('0x0'));module[_0xffd2('0x1')]={'name':{'type':Sequelize[_0xffd2('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xffd2('0x2')]}};
\ No newline at end of file
+var _0xf8de=['exports','STRING'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf8de,0x1d4));var _0xef8d=function(_0x567992,_0xc335a5){_0x567992=_0x567992-0x0;var _0x48f62f=_0xf8de[_0x567992];return _0x48f62f;};'use strict';var Sequelize=require('sequelize');module[_0xef8d('0x0')]={'name':{'type':Sequelize[_0xef8d('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xef8d('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 1eb7dad..49f9cc0 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 _0xa7c4=['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','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','send','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','params','fields','options','find','clone','get','omit','createdAt','updatedAt','body','create','originalname','file','mimetype','ChatOfflineMessageId','server/files/attachments/','join','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel'];(function(_0x363789,_0x285ecd){var _0x129141=function(_0x38c792){while(--_0x38c792){_0x363789['push'](_0x363789['shift']());}};_0x129141(++_0x285ecd);}(_0xa7c4,0x1ac));var _0x4a7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7c4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4a7c('0x0'));var rimraf=require(_0x4a7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a7c('0x2'));var rp=require(_0x4a7c('0x3'));var moment=require(_0x4a7c('0x4'));var BPromise=require(_0x4a7c('0x5'));var Mustache=require(_0x4a7c('0x6'));var util=require(_0x4a7c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4a7c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a7c('0x9'));var _=require(_0x4a7c('0xa'));var squel=require(_0x4a7c('0xb'));var crypto=require(_0x4a7c('0xc'));var jsforce=require(_0x4a7c('0xd'));var deskjs=require(_0x4a7c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4a7c('0xf'));var Papa=require(_0x4a7c('0x10'));var Redis=require(_0x4a7c('0x11'));var authService=require(_0x4a7c('0x12'));var qs=require(_0x4a7c('0x13'));var as=require(_0x4a7c('0x14'));var hardwareService=require(_0x4a7c('0x15'));var logger=require(_0x4a7c('0x16'))(_0x4a7c('0x17'));var utils=require(_0x4a7c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4a7c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x206795,_0x991f8f){_0x991f8f=_0x991f8f||0xcc;return function(_0x50a600){if(_0x50a600){return _0x206795[_0x4a7c('0x1a')](_0x991f8f);}return _0x206795[_0x4a7c('0x1b')](_0x991f8f)[_0x4a7c('0x1c')]();};}function respondWithResult(_0x4abd95,_0x4ef7fb){_0x4ef7fb=_0x4ef7fb||0xc8;return function(_0x23fead){if(_0x23fead){return _0x4abd95[_0x4a7c('0x1b')](_0x4ef7fb)[_0x4a7c('0x1d')](_0x23fead);}};}function respondWithFilteredResult(_0x2c77cc,_0x50f592){return function(_0xf822af){if(_0xf822af){var _0x57cec6=typeof _0x50f592[_0x4a7c('0x1e')]===_0x4a7c('0x1f')&&typeof _0x50f592['limit']===_0x4a7c('0x1f');var _0xac751c=_0xf822af[_0x4a7c('0x20')];var _0x5a8ba3=_0x57cec6?0x0:_0x50f592['offset'];var _0xe13446=_0x57cec6?_0xf822af[_0x4a7c('0x20')]:_0x50f592['offset']+_0x50f592['limit'];var _0x10a4b0;if(_0xe13446>=_0xac751c){_0xe13446=_0xac751c;_0x10a4b0=0xc8;}else{_0x10a4b0=0xce;}_0x2c77cc['status'](_0x10a4b0);return _0x2c77cc[_0x4a7c('0x21')](_0x4a7c('0x22'),_0x5a8ba3+'-'+_0xe13446+'/'+_0xac751c)[_0x4a7c('0x1d')](_0xf822af);}return null;};}function patchUpdates(_0x125b4a){return function(_0x59232e){try{jsonpatch['apply'](_0x59232e,_0x125b4a,!![]);}catch(_0x14eac8){return BPromise[_0x4a7c('0x23')](_0x14eac8);}return _0x59232e[_0x4a7c('0x24')]();};}function saveUpdates(_0x55bf1a,_0x560a42){return function(_0x15516a){if(_0x15516a){return _0x15516a[_0x4a7c('0x25')](_0x55bf1a)[_0x4a7c('0x26')](function(_0x2968a0){return _0x2968a0;});}return null;};}function removeEntity(_0x33aefe,_0x277c53){return function(_0x2278b1){if(_0x2278b1){return _0x2278b1['destroy']()[_0x4a7c('0x26')](function(){_0x33aefe[_0x4a7c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39a06a,_0x70ddb3){return function(_0x5dc3f6){if(!_0x5dc3f6){_0x39a06a[_0x4a7c('0x1a')](0x194);}return _0x5dc3f6;};}function handleError(_0x3ddb54,_0xe3e136){_0xe3e136=_0xe3e136||0x1f4;return function(_0x5b4535){logger[_0x4a7c('0x27')](_0x5b4535[_0x4a7c('0x28')]);if(_0x5b4535[_0x4a7c('0x29')]){delete _0x5b4535[_0x4a7c('0x29')];}_0x3ddb54[_0x4a7c('0x1b')](_0xe3e136)[_0x4a7c('0x2a')](_0x5b4535);};}exports['index']=function(_0x2b1b28,_0x54b07d){var _0x210817={},_0x5dcb2e={},_0x1028a4={'count':0x0,'rows':[]};var _0x43d743=_[_0x4a7c('0x2b')](db[_0x4a7c('0x2c')][_0x4a7c('0x2d')],function(_0x3057cb){return{'name':_0x3057cb[_0x4a7c('0x2e')],'type':_0x3057cb[_0x4a7c('0x2f')][_0x4a7c('0x30')]};});_0x5dcb2e[_0x4a7c('0x31')]=_[_0x4a7c('0x2b')](_0x43d743,_0x4a7c('0x29'));_0x5dcb2e[_0x4a7c('0x32')]=_[_0x4a7c('0x33')](_0x2b1b28[_0x4a7c('0x32')]);_0x5dcb2e[_0x4a7c('0x34')]=_[_0x4a7c('0x35')](_0x5dcb2e[_0x4a7c('0x31')],_0x5dcb2e[_0x4a7c('0x32')]);_0x210817['attributes']=_['intersection'](_0x5dcb2e['model'],qs['fields'](_0x2b1b28['query']['fields']));_0x210817[_0x4a7c('0x36')]=_0x210817[_0x4a7c('0x36')][_0x4a7c('0x37')]?_0x210817[_0x4a7c('0x36')]:_0x5dcb2e[_0x4a7c('0x31')];if(!_0x2b1b28[_0x4a7c('0x32')][_0x4a7c('0x38')](_0x4a7c('0x39'))){_0x210817[_0x4a7c('0x3a')]=qs['limit'](_0x2b1b28['query']['limit']);_0x210817[_0x4a7c('0x1e')]=qs[_0x4a7c('0x1e')](_0x2b1b28[_0x4a7c('0x32')][_0x4a7c('0x1e')]);}_0x210817[_0x4a7c('0x3b')]=qs[_0x4a7c('0x3c')](_0x2b1b28[_0x4a7c('0x32')][_0x4a7c('0x3c')]);_0x210817[_0x4a7c('0x3d')]=qs[_0x4a7c('0x34')](_[_0x4a7c('0x3e')](_0x2b1b28[_0x4a7c('0x32')],_0x5dcb2e['filters']),_0x43d743);if(_0x2b1b28[_0x4a7c('0x32')]['filter']){_0x210817['where']=_[_0x4a7c('0x3f')](_0x210817[_0x4a7c('0x3d')],{'$or':_[_0x4a7c('0x2b')](_0x43d743,function(_0x39f22b){if(_0x39f22b['type']!==_0x4a7c('0x40')){var _0x23e611={};_0x23e611[_0x39f22b[_0x4a7c('0x29')]]={'$like':'%'+_0x2b1b28[_0x4a7c('0x32')][_0x4a7c('0x41')]+'%'};return _0x23e611;}})});}_0x210817=_[_0x4a7c('0x3f')]({},_0x210817,_0x2b1b28['options']);var _0x45652a={'where':_0x210817[_0x4a7c('0x3d')]};return db[_0x4a7c('0x2c')][_0x4a7c('0x20')](_0x45652a)[_0x4a7c('0x26')](function(_0x69f34e){_0x1028a4[_0x4a7c('0x20')]=_0x69f34e;if(_0x2b1b28[_0x4a7c('0x32')][_0x4a7c('0x42')]){_0x210817[_0x4a7c('0x43')]=[{'all':!![]}];}return db[_0x4a7c('0x2c')][_0x4a7c('0x44')](_0x210817);})[_0x4a7c('0x26')](function(_0x38ac1e){_0x1028a4['rows']=_0x38ac1e;return _0x1028a4;})[_0x4a7c('0x26')](respondWithFilteredResult(_0x54b07d,_0x210817))[_0x4a7c('0x45')](handleError(_0x54b07d,null));};exports['show']=function(_0x5dd955,_0x265c75){var _0x5288c3={'raw':!![],'where':{'id':_0x5dd955[_0x4a7c('0x46')]['id']}},_0x206192={};_0x206192[_0x4a7c('0x31')]=_[_0x4a7c('0x33')](db[_0x4a7c('0x2c')][_0x4a7c('0x2d')]);_0x206192[_0x4a7c('0x32')]=_['keys'](_0x5dd955[_0x4a7c('0x32')]);_0x206192[_0x4a7c('0x34')]=_[_0x4a7c('0x35')](_0x206192['model'],_0x206192[_0x4a7c('0x32')]);_0x5288c3[_0x4a7c('0x36')]=_[_0x4a7c('0x35')](_0x206192[_0x4a7c('0x31')],qs['fields'](_0x5dd955[_0x4a7c('0x32')][_0x4a7c('0x47')]));_0x5288c3[_0x4a7c('0x36')]=_0x5288c3['attributes']['length']?_0x5288c3[_0x4a7c('0x36')]:_0x206192['model'];if(_0x5dd955['query']['includeAll']){_0x5288c3['include']=[{'all':!![]}];}_0x5288c3=_[_0x4a7c('0x3f')]({},_0x5288c3,_0x5dd955[_0x4a7c('0x48')]);return db['Attachment'][_0x4a7c('0x49')](_0x5288c3)[_0x4a7c('0x26')](handleEntityNotFound(_0x265c75,null))[_0x4a7c('0x26')](respondWithResult(_0x265c75,null))[_0x4a7c('0x45')](handleError(_0x265c75,null));};exports[_0x4a7c('0x4a')]=function(_0x10ae40,_0x4ef1b4){var _0x2dc01d={'where':{'id':_0x10ae40[_0x4a7c('0x46')]['id']}},_0x1cc515={};_0x1cc515[_0x4a7c('0x31')]=_[_0x4a7c('0x33')](db[_0x4a7c('0x2c')][_0x4a7c('0x2d')]);_0x2dc01d[_0x4a7c('0x36')]=_[_0x4a7c('0x35')](_0x1cc515[_0x4a7c('0x31')],qs[_0x4a7c('0x47')](_0x10ae40[_0x4a7c('0x32')][_0x4a7c('0x47')]));_0x2dc01d[_0x4a7c('0x36')]=_0x2dc01d[_0x4a7c('0x36')][_0x4a7c('0x37')]?_0x2dc01d[_0x4a7c('0x36')]:_0x1cc515['model'];if(_0x10ae40[_0x4a7c('0x32')]['includeAll']){_0x2dc01d[_0x4a7c('0x43')]=[{'all':!![]}];}_0x2dc01d=_[_0x4a7c('0x3f')]({},_0x2dc01d,_0x10ae40['options']);return db['Attachment'][_0x4a7c('0x49')](_0x2dc01d)['then'](handleEntityNotFound(_0x4ef1b4,null))[_0x4a7c('0x26')](function(_0x1d9536){if(_0x1d9536){var _0x134567=_0x1d9536[_0x4a7c('0x4b')]({'plain':!![]});_0x134567=qs[_0x4a7c('0x4c')](_0x134567,['id',_0x4a7c('0x4d'),_0x4a7c('0x4e')]);_0x10ae40[_0x4a7c('0x4f')]=_['omit'](_0x10ae40[_0x4a7c('0x4f')],['id','createdAt','updatedAt']);return db[_0x4a7c('0x2c')][_0x4a7c('0x50')](_[_0x4a7c('0x3f')](_0x134567,_0x10ae40[_0x4a7c('0x4f')]),{'include':_0x10ae40[_0x4a7c('0x32')][_0x4a7c('0x42')]?[{'all':!![]}]:undefined});}})[_0x4a7c('0x26')](respondWithResult(_0x4ef1b4,0xc9))['catch'](handleError(_0x4ef1b4,null));};exports[_0x4a7c('0x25')]=function(_0x1b063d,_0x286cd5){if(_0x1b063d[_0x4a7c('0x4f')]['id']){delete _0x1b063d['body']['id'];}return db[_0x4a7c('0x2c')][_0x4a7c('0x49')]({'where':{'id':_0x1b063d['params']['id']}})[_0x4a7c('0x26')](handleEntityNotFound(_0x286cd5,null))[_0x4a7c('0x26')](saveUpdates(_0x1b063d[_0x4a7c('0x4f')],null))[_0x4a7c('0x26')](respondWithResult(_0x286cd5,null))['catch'](handleError(_0x286cd5,null));};exports['destroy']=function(_0x21e756,_0x26f54e){return db[_0x4a7c('0x2c')][_0x4a7c('0x49')]({'where':{'id':_0x21e756[_0x4a7c('0x46')]['id']}})[_0x4a7c('0x26')](handleEntityNotFound(_0x26f54e,null))['then'](removeEntity(_0x26f54e,null))['catch'](handleError(_0x26f54e,null));};exports['create']=function(_0x243ec5,_0x15ebbc,_0x2c05c0){_0x243ec5['body']['name']=_0x243ec5['file'][_0x4a7c('0x51')];_0x243ec5[_0x4a7c('0x4f')]['basename']=_0x243ec5[_0x4a7c('0x52')]['filename'];_0x243ec5['body'][_0x4a7c('0x2f')]=_0x243ec5[_0x4a7c('0x52')][_0x4a7c('0x53')];return db[_0x4a7c('0x2c')]['create'](_0x243ec5[_0x4a7c('0x4f')])[_0x4a7c('0x26')](respondWithResult(_0x15ebbc,0xc9))[_0x4a7c('0x45')](handleError(_0x15ebbc,null));};exports['download']=function(_0x5f57e5,_0x301215,_0x239972){return db[_0x4a7c('0x2c')]['findOne']({'where':{'id':_0x5f57e5[_0x4a7c('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x301215,null))['then'](function(_0x6d71e8){if(_0x6d71e8){var _0x12d972=_0x6d71e8[_0x4a7c('0x54')]!==null;var _0x254056=path['join'](config['root'],_0x4a7c('0x55'));if(_0x12d972){_0x254056=path[_0x4a7c('0x56')](_0x254056,'offline-chat/');}var _0x24468a=path[_0x4a7c('0x56')](_0x254056,_0x6d71e8['basename']);return _0x301215[_0x4a7c('0x57')](_0x24468a);}})['catch'](handleError(_0x301215,null));};
\ No newline at end of file
+var _0x7b5a=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','options','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','mimetype','download','findOne','join','root','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7b5a,0xf6));var _0xa7b5=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0x7b5a[_0x30a31e];return _0x170879;};'use strict';var emlformat=require(_0xa7b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa7b5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7b5('0x2'));var moment=require(_0xa7b5('0x3'));var BPromise=require(_0xa7b5('0x4'));var Mustache=require(_0xa7b5('0x5'));var util=require(_0xa7b5('0x6'));var path=require('path');var sox=require(_0xa7b5('0x7'));var csv=require(_0xa7b5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa7b5('0x9'));var _=require(_0xa7b5('0xa'));var squel=require(_0xa7b5('0xb'));var crypto=require(_0xa7b5('0xc'));var jsforce=require(_0xa7b5('0xd'));var deskjs=require(_0xa7b5('0xe'));var toCsv=require(_0xa7b5('0x8'));var querystring=require(_0xa7b5('0xf'));var Papa=require('papaparse');var Redis=require(_0xa7b5('0x10'));var authService=require(_0xa7b5('0x11'));var qs=require(_0xa7b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7b5('0x13'));var logger=require(_0xa7b5('0x14'))(_0xa7b5('0x15'));var utils=require('../../config/utils');var config=require(_0xa7b5('0x16'));var licenseUtil=require(_0xa7b5('0x17'));var db=require(_0xa7b5('0x18'))['db'];function respondWithStatusCode(_0x2f2539,_0x4ec15c){_0x4ec15c=_0x4ec15c||0xcc;return function(_0x31b90b){if(_0x31b90b){return _0x2f2539[_0xa7b5('0x19')](_0x4ec15c);}return _0x2f2539['status'](_0x4ec15c)[_0xa7b5('0x1a')]();};}function respondWithResult(_0x12180e,_0x49ef62){_0x49ef62=_0x49ef62||0xc8;return function(_0x441be2){if(_0x441be2){return _0x12180e[_0xa7b5('0x1b')](_0x49ef62)['json'](_0x441be2);}};}function respondWithFilteredResult(_0x1dd47c,_0x246ed8){return function(_0x49a447){if(_0x49a447){var _0x1ba6aa=typeof _0x246ed8[_0xa7b5('0x1c')]===_0xa7b5('0x1d')&&typeof _0x246ed8['limit']===_0xa7b5('0x1d');var _0x1accad=_0x49a447[_0xa7b5('0x1e')];var _0x46fbe4=_0x1ba6aa?0x0:_0x246ed8[_0xa7b5('0x1c')];var _0x42fb0e=_0x1ba6aa?_0x49a447['count']:_0x246ed8[_0xa7b5('0x1c')]+_0x246ed8[_0xa7b5('0x1f')];var _0x206e2c;if(_0x42fb0e>=_0x1accad){_0x42fb0e=_0x1accad;_0x206e2c=0xc8;}else{_0x206e2c=0xce;}_0x1dd47c[_0xa7b5('0x1b')](_0x206e2c);return _0x1dd47c[_0xa7b5('0x20')](_0xa7b5('0x21'),_0x46fbe4+'-'+_0x42fb0e+'/'+_0x1accad)['json'](_0x49a447);}return null;};}function patchUpdates(_0x4d177a){return function(_0x50122d){try{jsonpatch['apply'](_0x50122d,_0x4d177a,!![]);}catch(_0x493bd7){return BPromise['reject'](_0x493bd7);}return _0x50122d[_0xa7b5('0x22')]();};}function saveUpdates(_0x324d5d,_0x3f63ac){return function(_0x5c4c8a){if(_0x5c4c8a){return _0x5c4c8a[_0xa7b5('0x23')](_0x324d5d)[_0xa7b5('0x24')](function(_0x1530c4){return _0x1530c4;});}return null;};}function removeEntity(_0x14b34d,_0xde5042){return function(_0x51f7a6){if(_0x51f7a6){return _0x51f7a6[_0xa7b5('0x25')]()[_0xa7b5('0x24')](function(){_0x14b34d[_0xa7b5('0x1b')](0xcc)[_0xa7b5('0x1a')]();});}};}function handleEntityNotFound(_0x2307c8,_0x119bcc){return function(_0x5fe7c7){if(!_0x5fe7c7){_0x2307c8[_0xa7b5('0x19')](0x194);}return _0x5fe7c7;};}function handleError(_0x23646c,_0x16bfec){_0x16bfec=_0x16bfec||0x1f4;return function(_0x2f6edb){logger[_0xa7b5('0x26')](_0x2f6edb[_0xa7b5('0x27')]);if(_0x2f6edb[_0xa7b5('0x28')]){delete _0x2f6edb[_0xa7b5('0x28')];}_0x23646c[_0xa7b5('0x1b')](_0x16bfec)[_0xa7b5('0x29')](_0x2f6edb);};}exports[_0xa7b5('0x2a')]=function(_0x7127b9,_0x597b37){var _0x25a54c={},_0x5d18ed={},_0x2473f4={'count':0x0,'rows':[]};var _0x1ec6b6=_[_0xa7b5('0x2b')](db[_0xa7b5('0x2c')][_0xa7b5('0x2d')],function(_0x1f764d){return{'name':_0x1f764d[_0xa7b5('0x2e')],'type':_0x1f764d[_0xa7b5('0x2f')][_0xa7b5('0x30')]};});_0x5d18ed['model']=_[_0xa7b5('0x2b')](_0x1ec6b6,_0xa7b5('0x28'));_0x5d18ed['query']=_['keys'](_0x7127b9[_0xa7b5('0x31')]);_0x5d18ed[_0xa7b5('0x32')]=_[_0xa7b5('0x33')](_0x5d18ed[_0xa7b5('0x34')],_0x5d18ed['query']);_0x25a54c[_0xa7b5('0x35')]=_['intersection'](_0x5d18ed[_0xa7b5('0x34')],qs[_0xa7b5('0x36')](_0x7127b9[_0xa7b5('0x31')][_0xa7b5('0x36')]));_0x25a54c[_0xa7b5('0x35')]=_0x25a54c[_0xa7b5('0x35')][_0xa7b5('0x37')]?_0x25a54c['attributes']:_0x5d18ed[_0xa7b5('0x34')];if(!_0x7127b9[_0xa7b5('0x31')][_0xa7b5('0x38')](_0xa7b5('0x39'))){_0x25a54c[_0xa7b5('0x1f')]=qs[_0xa7b5('0x1f')](_0x7127b9['query']['limit']);_0x25a54c[_0xa7b5('0x1c')]=qs['offset'](_0x7127b9[_0xa7b5('0x31')]['offset']);}_0x25a54c['order']=qs[_0xa7b5('0x3a')](_0x7127b9[_0xa7b5('0x31')][_0xa7b5('0x3a')]);_0x25a54c[_0xa7b5('0x3b')]=qs['filters'](_[_0xa7b5('0x3c')](_0x7127b9[_0xa7b5('0x31')],_0x5d18ed['filters']),_0x1ec6b6);if(_0x7127b9[_0xa7b5('0x31')][_0xa7b5('0x3d')]){_0x25a54c['where']=_[_0xa7b5('0x3e')](_0x25a54c[_0xa7b5('0x3b')],{'$or':_['map'](_0x1ec6b6,function(_0x3392d8){if(_0x3392d8['type']!==_0xa7b5('0x3f')){var _0x87486c={};_0x87486c[_0x3392d8['name']]={'$like':'%'+_0x7127b9[_0xa7b5('0x31')][_0xa7b5('0x3d')]+'%'};return _0x87486c;}})});}_0x25a54c=_['merge']({},_0x25a54c,_0x7127b9['options']);var _0x46dd0c={'where':_0x25a54c[_0xa7b5('0x3b')]};return db[_0xa7b5('0x2c')]['count'](_0x46dd0c)['then'](function(_0xb85536){_0x2473f4['count']=_0xb85536;if(_0x7127b9[_0xa7b5('0x31')][_0xa7b5('0x40')]){_0x25a54c[_0xa7b5('0x41')]=[{'all':!![]}];}return db[_0xa7b5('0x2c')]['findAll'](_0x25a54c);})[_0xa7b5('0x24')](function(_0x1a4d54){_0x2473f4[_0xa7b5('0x42')]=_0x1a4d54;return _0x2473f4;})[_0xa7b5('0x24')](respondWithFilteredResult(_0x597b37,_0x25a54c))[_0xa7b5('0x43')](handleError(_0x597b37,null));};exports[_0xa7b5('0x44')]=function(_0x48596c,_0x3dca6c){var _0x2770f4={'raw':!![],'where':{'id':_0x48596c[_0xa7b5('0x45')]['id']}},_0x5e409a={};_0x5e409a[_0xa7b5('0x34')]=_[_0xa7b5('0x46')](db[_0xa7b5('0x2c')][_0xa7b5('0x2d')]);_0x5e409a['query']=_['keys'](_0x48596c[_0xa7b5('0x31')]);_0x5e409a[_0xa7b5('0x32')]=_[_0xa7b5('0x33')](_0x5e409a[_0xa7b5('0x34')],_0x5e409a[_0xa7b5('0x31')]);_0x2770f4[_0xa7b5('0x35')]=_[_0xa7b5('0x33')](_0x5e409a['model'],qs[_0xa7b5('0x36')](_0x48596c['query'][_0xa7b5('0x36')]));_0x2770f4[_0xa7b5('0x35')]=_0x2770f4[_0xa7b5('0x35')][_0xa7b5('0x37')]?_0x2770f4['attributes']:_0x5e409a[_0xa7b5('0x34')];if(_0x48596c[_0xa7b5('0x31')][_0xa7b5('0x40')]){_0x2770f4[_0xa7b5('0x41')]=[{'all':!![]}];}_0x2770f4=_[_0xa7b5('0x3e')]({},_0x2770f4,_0x48596c[_0xa7b5('0x47')]);return db['Attachment'][_0xa7b5('0x48')](_0x2770f4)[_0xa7b5('0x24')](handleEntityNotFound(_0x3dca6c,null))[_0xa7b5('0x24')](respondWithResult(_0x3dca6c,null))['catch'](handleError(_0x3dca6c,null));};exports['clone']=function(_0x2c0144,_0xc30027){var _0x5237e4={'where':{'id':_0x2c0144['params']['id']}},_0x100d5d={};_0x100d5d[_0xa7b5('0x34')]=_[_0xa7b5('0x46')](db['Attachment'][_0xa7b5('0x2d')]);_0x5237e4[_0xa7b5('0x35')]=_[_0xa7b5('0x33')](_0x100d5d['model'],qs[_0xa7b5('0x36')](_0x2c0144[_0xa7b5('0x31')][_0xa7b5('0x36')]));_0x5237e4[_0xa7b5('0x35')]=_0x5237e4[_0xa7b5('0x35')][_0xa7b5('0x37')]?_0x5237e4[_0xa7b5('0x35')]:_0x100d5d['model'];if(_0x2c0144[_0xa7b5('0x31')][_0xa7b5('0x40')]){_0x5237e4[_0xa7b5('0x41')]=[{'all':!![]}];}_0x5237e4=_[_0xa7b5('0x3e')]({},_0x5237e4,_0x2c0144[_0xa7b5('0x47')]);return db[_0xa7b5('0x2c')][_0xa7b5('0x48')](_0x5237e4)[_0xa7b5('0x24')](handleEntityNotFound(_0xc30027,null))[_0xa7b5('0x24')](function(_0x12949a){if(_0x12949a){var _0x5b1e30=_0x12949a[_0xa7b5('0x49')]({'plain':!![]});_0x5b1e30=qs[_0xa7b5('0x4a')](_0x5b1e30,['id',_0xa7b5('0x4b'),_0xa7b5('0x4c')]);_0x2c0144[_0xa7b5('0x4d')]=_[_0xa7b5('0x4a')](_0x2c0144[_0xa7b5('0x4d')],['id',_0xa7b5('0x4b'),_0xa7b5('0x4c')]);return db[_0xa7b5('0x2c')][_0xa7b5('0x4e')](_[_0xa7b5('0x3e')](_0x5b1e30,_0x2c0144[_0xa7b5('0x4d')]),{'include':_0x2c0144[_0xa7b5('0x31')][_0xa7b5('0x40')]?[{'all':!![]}]:undefined});}})[_0xa7b5('0x24')](respondWithResult(_0xc30027,0xc9))[_0xa7b5('0x43')](handleError(_0xc30027,null));};exports['update']=function(_0x428fd4,_0x540c1c){if(_0x428fd4[_0xa7b5('0x4d')]['id']){delete _0x428fd4[_0xa7b5('0x4d')]['id'];}return db['Attachment']['find']({'where':{'id':_0x428fd4[_0xa7b5('0x45')]['id']}})[_0xa7b5('0x24')](handleEntityNotFound(_0x540c1c,null))['then'](saveUpdates(_0x428fd4[_0xa7b5('0x4d')],null))[_0xa7b5('0x24')](respondWithResult(_0x540c1c,null))[_0xa7b5('0x43')](handleError(_0x540c1c,null));};exports[_0xa7b5('0x25')]=function(_0x2a1683,_0x2b0431){return db['Attachment']['find']({'where':{'id':_0x2a1683[_0xa7b5('0x45')]['id']}})[_0xa7b5('0x24')](handleEntityNotFound(_0x2b0431,null))[_0xa7b5('0x24')](removeEntity(_0x2b0431,null))[_0xa7b5('0x43')](handleError(_0x2b0431,null));};exports['create']=function(_0xc6f412,_0x1ef939,_0x55a819){_0xc6f412['body'][_0xa7b5('0x28')]=_0xc6f412['file'][_0xa7b5('0x4f')];_0xc6f412[_0xa7b5('0x4d')][_0xa7b5('0x50')]=_0xc6f412[_0xa7b5('0x51')]['filename'];_0xc6f412[_0xa7b5('0x4d')]['type']=_0xc6f412[_0xa7b5('0x51')][_0xa7b5('0x52')];return db['Attachment']['create'](_0xc6f412[_0xa7b5('0x4d')])[_0xa7b5('0x24')](respondWithResult(_0x1ef939,0xc9))['catch'](handleError(_0x1ef939,null));};exports[_0xa7b5('0x53')]=function(_0x3935c2,_0x4587fb,_0x8c9b39){return db[_0xa7b5('0x2c')][_0xa7b5('0x54')]({'where':{'id':_0x3935c2[_0xa7b5('0x45')]['id']},'raw':!![]})[_0xa7b5('0x24')](handleEntityNotFound(_0x4587fb,null))[_0xa7b5('0x24')](function(_0x6067c4){if(_0x6067c4){var _0x2361c8=_0x6067c4['ChatOfflineMessageId']!==null;var _0x561b8c=path[_0xa7b5('0x55')](config[_0xa7b5('0x56')],'server/files/attachments/');if(_0x2361c8){_0x561b8c=path[_0xa7b5('0x55')](_0x561b8c,'offline-chat/');}var _0x2ef73d=path[_0xa7b5('0x55')](_0x561b8c,_0x6067c4[_0xa7b5('0x50')]);return _0x4587fb[_0xa7b5('0x53')](_0x2ef73d);}})[_0xa7b5('0x43')](handleError(_0x4587fb,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index c5eb2bc..532ac3b 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 _0xc0b8=['bluebird','path','rimraf','../../config/environment','./attachment.attributes','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x3a6ec0,_0x39220a){var _0x336102=function(_0x496e14){while(--_0x496e14){_0x3a6ec0['push'](_0x3a6ec0['shift']());}};_0x336102(++_0x39220a);}(_0xc0b8,0x1f3));var _0x8c0b=function(_0x3a27cb,_0x361775){_0x3a27cb=_0x3a27cb-0x0;var _0x3aa498=_0xc0b8[_0x3a27cb];return _0x3aa498;};'use strict';var _=require(_0x8c0b('0x0'));var util=require(_0x8c0b('0x1'));var logger=require(_0x8c0b('0x2'))(_0x8c0b('0x3'));var moment=require(_0x8c0b('0x4'));var BPromise=require(_0x8c0b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c0b('0x6'));var rimraf=require(_0x8c0b('0x7'));var config=require(_0x8c0b('0x8'));var attributes=require(_0x8c0b('0x9'));module['exports']=function(_0x493937,_0x913fc9){return _0x493937['define'](_0x8c0b('0xa'),attributes,{'tableName':_0x8c0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a51=['attachments','lodash','util','api','moment','request-promise','rimraf','../../config/environment','exports','Attachment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6a51,0xe7));var _0x16a5=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x6a51[_0x427352];return _0x23e0e6;};'use strict';var _=require(_0x16a5('0x0'));var util=require(_0x16a5('0x1'));var logger=require('../../config/logger')(_0x16a5('0x2'));var moment=require(_0x16a5('0x3'));var BPromise=require('bluebird');var rp=require(_0x16a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16a5('0x5'));var config=require(_0x16a5('0x6'));var attributes=require('./attachment.attributes');module[_0x16a5('0x7')]=function(_0x2031c1,_0x361cd7){return _0x2031c1['define'](_0x16a5('0x8'),attributes,{'tableName':_0x16a5('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 bc2cad4..9170477 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 _0x1094=['create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment'];(function(_0x398256,_0x4e19cc){var _0x4af8a9=function(_0x1b497c){while(--_0x1b497c){_0x398256['push'](_0x398256['shift']());}};_0x4af8a9(++_0x4e19cc);}(_0x1094,0x143));var _0x4109=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x1094[_0x5c1345];return _0x1c070d;};'use strict';var _=require(_0x4109('0x0'));var util=require(_0x4109('0x1'));var moment=require('moment');var BPromise=require(_0x4109('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4109('0x3'));var db=require(_0x4109('0x4'))['db'];var utils=require(_0x4109('0x5'));var logger=require(_0x4109('0x6'))(_0x4109('0x7'));var config=require('../../config/environment');var jayson=require(_0x4109('0x8'));var client=jayson[_0x4109('0x9')][_0x4109('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36c3e9,_0xd2df16,_0x2c34f){return new BPromise(function(_0x5512e8,_0x5b4ecf){return client[_0x4109('0xb')](_0x36c3e9,_0x2c34f)[_0x4109('0xc')](function(_0x2fa1d8){logger[_0x4109('0xd')]('Attachment,\x20%s,\x20%s',_0xd2df16,'request\x20sent');logger[_0x4109('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0xd2df16,_0x4109('0xf'),JSON[_0x4109('0x10')](_0x2fa1d8));if(_0x2fa1d8[_0x4109('0x11')]){if(_0x2fa1d8['error'][_0x4109('0x12')]===0x1f4){logger[_0x4109('0x11')](_0x4109('0x13'),_0xd2df16,_0x2fa1d8[_0x4109('0x11')][_0x4109('0x14')]);return _0x5b4ecf(_0x2fa1d8['error'][_0x4109('0x14')]);}logger[_0x4109('0x11')](_0x4109('0x13'),_0xd2df16,_0x2fa1d8[_0x4109('0x11')]['message']);return _0x5512e8(_0x2fa1d8['error'][_0x4109('0x14')]);}else{logger[_0x4109('0xd')](_0x4109('0x13'),_0xd2df16,_0x4109('0xf'));_0x5512e8(_0x2fa1d8[_0x4109('0x15')][_0x4109('0x14')]);}})[_0x4109('0x16')](function(_0x3c6542){logger['error']('Attachment,\x20%s,\x20%s',_0xd2df16,_0x3c6542);_0x5b4ecf(_0x3c6542);});});}exports[_0x4109('0x17')]=function(_0x328f1c){var _0x6945ae=this;return new Promise(function(_0x2e3fd6,_0x415e48){return db[_0x4109('0x18')][_0x4109('0x19')](_0x328f1c[_0x4109('0x1a')],{'raw':_0x328f1c[_0x4109('0x1b')]?_0x328f1c['options'][_0x4109('0x1c')]===undefined?!![]:![]:!![]})[_0x4109('0xc')](function(_0x5cde5d){logger[_0x4109('0xd')](_0x4109('0x17'),_0x328f1c);logger['debug']('CreateAttachment',_0x328f1c,JSON[_0x4109('0x10')](_0x5cde5d));_0x2e3fd6(_0x5cde5d);})['catch'](function(_0x369de0){logger[_0x4109('0x11')](_0x4109('0x17'),_0x369de0[_0x4109('0x14')],_0x328f1c);_0x415e48(_0x6945ae['error'](0x1f4,_0x369de0[_0x4109('0x14')]));});});};
\ No newline at end of file
+var _0xd246=['../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x575d0,_0x45eb69){var _0x1a6e7b=function(_0x16d607){while(--_0x16d607){_0x575d0['push'](_0x575d0['shift']());}};_0x1a6e7b(++_0x45eb69);}(_0xd246,0xf5));var _0x6d24=function(_0x4f8722,_0x47e4ae){_0x4f8722=_0x4f8722-0x0;var _0x1430eb=_0xd246[_0x4f8722];return _0x1430eb;};'use strict';var _=require(_0x6d24('0x0'));var util=require(_0x6d24('0x1'));var moment=require(_0x6d24('0x2'));var BPromise=require(_0x6d24('0x3'));var rs=require(_0x6d24('0x4'));var fs=require('fs');var Redis=require(_0x6d24('0x5'));var db=require(_0x6d24('0x6'))['db'];var utils=require(_0x6d24('0x7'));var logger=require('../../config/logger')(_0x6d24('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d24('0x9'));var client=jayson['client'][_0x6d24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7f6dfa,_0x1dcaa2,_0x358a65){return new BPromise(function(_0x38e1eb,_0x43500f){return client[_0x6d24('0xb')](_0x7f6dfa,_0x358a65)['then'](function(_0x5a05d3){logger[_0x6d24('0xc')]('Attachment,\x20%s,\x20%s',_0x1dcaa2,_0x6d24('0xd'));logger['debug'](_0x6d24('0xe'),_0x1dcaa2,'request\x20sent',JSON[_0x6d24('0xf')](_0x5a05d3));if(_0x5a05d3[_0x6d24('0x10')]){if(_0x5a05d3['error'][_0x6d24('0x11')]===0x1f4){logger['error'](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')]['message']);return _0x43500f(_0x5a05d3['error']['message']);}logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')][_0x6d24('0x13')]);return _0x38e1eb(_0x5a05d3['error']['message']);}else{logger[_0x6d24('0xc')](_0x6d24('0x12'),_0x1dcaa2,_0x6d24('0xd'));_0x38e1eb(_0x5a05d3['result']['message']);}})[_0x6d24('0x14')](function(_0x336aeb){logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x336aeb);_0x43500f(_0x336aeb);});});}exports[_0x6d24('0x15')]=function(_0xad7d02){var _0x49a269=this;return new Promise(function(_0x5b81b4,_0x430b55){return db[_0x6d24('0x16')][_0x6d24('0x17')](_0xad7d02['body'],{'raw':_0xad7d02[_0x6d24('0x18')]?_0xad7d02[_0x6d24('0x18')][_0x6d24('0x19')]===undefined?!![]:![]:!![]})[_0x6d24('0x1a')](function(_0x359430){logger['info'](_0x6d24('0x15'),_0xad7d02);logger[_0x6d24('0x1b')]('CreateAttachment',_0xad7d02,JSON[_0x6d24('0xf')](_0x359430));_0x5b81b4(_0x359430);})['catch'](function(_0xca50d5){logger[_0x6d24('0x10')](_0x6d24('0x15'),_0xca50d5[_0x6d24('0x13')],_0xad7d02);_0x430b55(_0x49a269[_0x6d24('0x10')](0x1f4,_0xca50d5[_0x6d24('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 874361e..d12f2a8 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x45e329,_0x29482f){var _0x31282b=function(_0x4e6609){while(--_0x4e6609){_0x45e329['push'](_0x45e329['shift']());}};_0x31282b(++_0x29482f);}(_0x757a,0xde));var _0xa757=function(_0x20de4e,_0x468e68){_0x20de4e=_0x20de4e-0x0;var _0x2228d0=_0x757a[_0x20de4e];return _0x2228d0;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3064f0,_0x4eda7f){var _0xde6d31=function(_0x141c41){while(--_0x141c41){_0x3064f0['push'](_0x3064f0['shift']());}};_0xde6d31(++_0x4eda7f);}(_0x2032,0xd9));var _0x2203=function(_0x30a647,_0x4cd2ca){_0x30a647=_0x30a647-0x0;var _0x5c3f7a=_0x2032[_0x30a647];return _0x5c3f7a;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index ff46bdb..c832941 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f5d=['clearBlockUser','getLicense','catch','status','send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','password','User','passport-local','Strategy','moment','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','online','user','agent','add'];(function(_0x4c2e41,_0x5408d7){var _0x57fcc9=function(_0x4d7492){while(--_0x4d7492){_0x4c2e41['push'](_0x4c2e41['shift']());}};_0x57fcc9(++_0x5408d7);}(_0x5f5d,0x15d));var _0xd5f5=function(_0x27b1ba,_0x452e63){_0x27b1ba=_0x27b1ba-0x0;var _0x72679e=_0x5f5d[_0x27b1ba];return _0x72679e;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xd5f5('0x0'))[_0xd5f5('0x1')];var moment=require(_0xd5f5('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xd5f5('0x3'));var util=require('util');var db=require(_0xd5f5('0x4'))['db'];var authService=require(_0xd5f5('0x5'));var utils=require(_0xd5f5('0x6'));var config=require(_0xd5f5('0x7'));var logger=require(_0xd5f5('0x8'))(_0xd5f5('0x9'));function isActiveDirectoryConfigured(_0x2a8647){var _0xe3f28a=![];if(typeof _0x2a8647[_0xd5f5('0xa')]!=='undefined'){_0xe3f28a=_0x2a8647[_0xd5f5('0xa')][_0xd5f5('0xb')]&&_0x2a8647[_0xd5f5('0xa')][_0xd5f5('0xc')]&&_0x2a8647[_0xd5f5('0xa')][_0xd5f5('0xd')];}return _0xe3f28a;}function adAuthenticate(_0x417340,_0x1a078d,_0x175b56){return new BPromise(function(_0x34598f,_0x2faf52){try{var _0x1be92b=new ActiveDirectory(_0x417340);_0x1be92b['authenticate'](_0x1a078d,_0x175b56,function(_0x41cef6,_0x4141c3){if(_0x41cef6){logger[_0xd5f5('0xe')](_0xd5f5('0xf'),_0x1a078d,util[_0xd5f5('0x10')](_0x41cef6,{'showHidden':![],'depth':null}));_0x2faf52(_0xd5f5('0x11'));}else if(!_0x4141c3){logger[_0xd5f5('0xe')](_0xd5f5('0x12'),_0x1a078d);_0x2faf52('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x34598f(_0x4141c3);}});}catch(_0x26f3be){_0x2faf52(_0x26f3be);}});}function ActiveDirectoryAuthenticate(_0x4de0e9,_0x85cc4b,_0x5aa485,_0x387fd7){var _0x213239,_0x3d9a3e;if(!isActiveDirectoryConfigured(config)){logger[_0xd5f5('0xe')](_0xd5f5('0x13'),_0x85cc4b);return _0x387fd7(null,![],{'message':_0xd5f5('0x11')});}return db['Setting'][_0xd5f5('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xd5f5('0x15')],'raw':!![]})[_0xd5f5('0x16')](function(_0x49e266){_0x213239=_0x49e266;if(!_0x213239[_0xd5f5('0x17')]){logger[_0xd5f5('0xe')](_0xd5f5('0x18'),_0x85cc4b);throw new Error(_0xd5f5('0x11'));}return _0x4de0e9[_0xd5f5('0x14')]({'attributes':['id',_0xd5f5('0x19'),'password',_0xd5f5('0x1a'),_0xd5f5('0x1b'),_0xd5f5('0x1c'),_0xd5f5('0x1d'),_0xd5f5('0x1e'),_0xd5f5('0x1f')],'where':{'name':_0x85cc4b,'role':{'$or':['admin',_0xd5f5('0x20'),_0xd5f5('0x21')]},'adSsoEnabled':!![]}});})[_0xd5f5('0x16')](function(_0x10848a){if(!_0x10848a||_0x10848a&&_0x10848a[_0xd5f5('0x19')]!==_0x85cc4b){throw new Error(_0xd5f5('0x11'));}_0x3d9a3e=_0x10848a;var _0x4b14e4=_0x3d9a3e[_0xd5f5('0x19')]+'@'+config[_0xd5f5('0xa')]['domain'];return adAuthenticate(config['activedirectory'],_0x4b14e4,_0x5aa485);})['then'](function(_0x12ebd8){if(_0x3d9a3e[_0xd5f5('0x1c')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x213239[_0xd5f5('0x15')]>0x0){if(_0x3d9a3e[_0xd5f5('0x1d')]){if(moment(_0x3d9a3e['blockedAt'])[_0xd5f5('0x22')](_0x213239[_0xd5f5('0x15')],'minutes')>moment()){throw new Error(_0xd5f5('0x11'));}return utils[_0xd5f5('0x23')](_0x3d9a3e,0x0,![],null)[_0xd5f5('0x16')](function(){return utils[_0xd5f5('0x24')](_0x3d9a3e);})['then'](function(){return _0x387fd7(null,_0x3d9a3e);});}else{return utils['getLicense'](_0x3d9a3e)['then'](function(){return _0x387fd7(null,_0x3d9a3e);});}}else{return utils['getLicense'](_0x3d9a3e)['then'](function(){return _0x387fd7(null,_0x3d9a3e);});}})[_0xd5f5('0x25')](function(_0x50177b){return _0x387fd7(null,![],_0x50177b);});}function handleError(_0x80a0df,_0x227fcb,_0xdbbf58){return _0x80a0df[_0xd5f5('0x26')](_0x227fcb||0x1f4)[_0xd5f5('0x27')]({'message':_0xdbbf58?_0xdbbf58['message']||_0xdbbf58:''});}exports[_0xd5f5('0x28')]=function(_0x50d2fc,_0x31960a,_0x36ed2f){passport[_0xd5f5('0x29')]('ad-login',function(_0x535f92,_0xe058a9,_0xa7ab60){var _0x5ea408=_0x535f92||_0xa7ab60;if(_0x5ea408){return handleError(_0x31960a,0x191,_0x5ea408);}if(!_0xe058a9){return handleError(_0x31960a,0x194,{'message':_0xd5f5('0x2a')});}else{var _0x433620={'payload':{'id':_0xe058a9['id'],'role':_0xe058a9[_0xd5f5('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xd5f5('0x2b')](_0x433620)[_0xd5f5('0x16')](function(_0x488e6b){_0x31960a[_0xd5f5('0x2c')]({'id':_0xe058a9['id'],'token':_0x488e6b,'statusCall':'','isAlreadyLogged':_0xe058a9[_0xd5f5('0x1f')]});});}})(_0x50d2fc,_0x31960a,_0x36ed2f);};passport[_0xd5f5('0x2d')]('ad-login',new LocalStrategy({'usernameField':_0xd5f5('0x19'),'passwordField':_0xd5f5('0x2e')},function(_0x2e7d4d,_0x5e361a,_0x436880){return ActiveDirectoryAuthenticate(db[_0xd5f5('0x2f')],_0x2e7d4d,_0x5e361a,_0x436880);}));
\ No newline at end of file
+var _0x9da6=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','admin','user','disabled','add','minutes','clearBlockUser','getLicense','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport-local','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','baseDN','url','domain','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xee259c,_0x1d54c2){var _0x1eafb2=function(_0x4bf9c0){while(--_0x4bf9c0){_0xee259c['push'](_0xee259c['shift']());}};_0x1eafb2(++_0x1d54c2);}(_0x9da6,0xa6));var _0x69da=function(_0x18dc14,_0x12e682){_0x18dc14=_0x18dc14-0x0;var _0x3321ae=_0x9da6[_0x18dc14];return _0x3321ae;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x69da('0x0'))['Strategy'];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0x69da('0x1'));var db=require(_0x69da('0x2'))['db'];var authService=require(_0x69da('0x3'));var utils=require(_0x69da('0x4'));var config=require('../../config/environment');var logger=require(_0x69da('0x5'))(_0x69da('0x6'));function isActiveDirectoryConfigured(_0xb34092){var _0x126d33=![];if(typeof _0xb34092[_0x69da('0x7')]!=='undefined'){_0x126d33=_0xb34092[_0x69da('0x7')][_0x69da('0x8')]&&_0xb34092['activedirectory'][_0x69da('0x9')]&&_0xb34092[_0x69da('0x7')][_0x69da('0xa')];}return _0x126d33;}function adAuthenticate(_0x2a1707,_0x2a315b,_0x2a1abd){return new BPromise(function(_0xefc810,_0x509b7c){try{var _0x3fab0c=new ActiveDirectory(_0x2a1707);_0x3fab0c['authenticate'](_0x2a315b,_0x2a1abd,function(_0x508111,_0x51d04f){if(_0x508111){logger[_0x69da('0xb')]('Error\x20authenticate\x20%s:\x20%s',_0x2a315b,util[_0x69da('0xc')](_0x508111,{'showHidden':![],'depth':null}));_0x509b7c(_0x69da('0xd'));}else if(!_0x51d04f){logger[_0x69da('0xb')](_0x69da('0xe'),_0x2a315b);_0x509b7c(_0x69da('0xd'));}else{_0xefc810(_0x51d04f);}});}catch(_0x526959){_0x509b7c(_0x526959);}});}function ActiveDirectoryAuthenticate(_0x3dd616,_0x500390,_0x4d9e78,_0x5028da){var _0x27a880,_0x21953d;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x500390);return _0x5028da(null,![],{'message':_0x69da('0xd')});}return db[_0x69da('0xf')][_0x69da('0x10')]({'where':{'id':0x1},'attributes':[_0x69da('0x11'),_0x69da('0x12')],'raw':!![]})[_0x69da('0x13')](function(_0x41b527){_0x27a880=_0x41b527;if(!_0x27a880[_0x69da('0x11')]){logger['error'](_0x69da('0x14'),_0x500390);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x3dd616[_0x69da('0x10')]({'attributes':['id',_0x69da('0x15'),_0x69da('0x16'),_0x69da('0x17'),_0x69da('0x18'),'disabled',_0x69da('0x19'),_0x69da('0x1a'),'online'],'where':{'name':_0x500390,'role':{'$or':[_0x69da('0x1b'),_0x69da('0x1c'),'agent']},'adSsoEnabled':!![]}});})[_0x69da('0x13')](function(_0x3d4c23){if(!_0x3d4c23||_0x3d4c23&&_0x3d4c23[_0x69da('0x15')]!==_0x500390){throw new Error(_0x69da('0xd'));}_0x21953d=_0x3d4c23;var _0x18b397=_0x21953d[_0x69da('0x15')]+'@'+config[_0x69da('0x7')][_0x69da('0xa')];return adAuthenticate(config[_0x69da('0x7')],_0x18b397,_0x4d9e78);})[_0x69da('0x13')](function(_0x54d1b0){if(_0x21953d[_0x69da('0x1d')]){throw new Error(_0x69da('0xd'));}if(_0x27a880[_0x69da('0x12')]>0x0){if(_0x21953d[_0x69da('0x19')]){if(moment(_0x21953d[_0x69da('0x1a')])[_0x69da('0x1e')](_0x27a880[_0x69da('0x12')],_0x69da('0x1f'))>moment()){throw new Error(_0x69da('0xd'));}return utils[_0x69da('0x20')](_0x21953d,0x0,![],null)[_0x69da('0x13')](function(){return utils[_0x69da('0x21')](_0x21953d);})[_0x69da('0x13')](function(){return _0x5028da(null,_0x21953d);});}else{return utils[_0x69da('0x21')](_0x21953d)[_0x69da('0x13')](function(){return _0x5028da(null,_0x21953d);});}}else{return utils[_0x69da('0x21')](_0x21953d)[_0x69da('0x13')](function(){return _0x5028da(null,_0x21953d);});}})['catch'](function(_0x5a8d33){return _0x5028da(null,![],_0x5a8d33);});}function handleError(_0x121e2e,_0x4d18b2,_0x3cd856){return _0x121e2e['status'](_0x4d18b2||0x1f4)[_0x69da('0x22')]({'message':_0x3cd856?_0x3cd856[_0x69da('0x23')]||_0x3cd856:''});}exports[_0x69da('0x24')]=function(_0x7081e4,_0x2d08f1,_0x5a5eb3){passport[_0x69da('0x25')](_0x69da('0x26'),function(_0x4ba43d,_0x61eb5,_0xb99e08){var _0x5183ab=_0x4ba43d||_0xb99e08;if(_0x5183ab){return handleError(_0x2d08f1,0x191,_0x5183ab);}if(!_0x61eb5){return handleError(_0x2d08f1,0x194,{'message':_0x69da('0x27')});}else{var _0x652fd9={'payload':{'id':_0x61eb5['id'],'role':_0x61eb5['role']},'options':{'expiresIn':0x15180}};return authService[_0x69da('0x28')](_0x652fd9)[_0x69da('0x13')](function(_0x30b2da){_0x2d08f1[_0x69da('0x29')]({'id':_0x61eb5['id'],'token':_0x30b2da,'statusCall':'','isAlreadyLogged':_0x61eb5[_0x69da('0x2a')]});});}})(_0x7081e4,_0x2d08f1,_0x5a5eb3);};passport[_0x69da('0x2b')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x69da('0x16')},function(_0x57bf23,_0x2f7dd5,_0x5dfc66){return ActiveDirectoryAuthenticate(db[_0x69da('0x2c')],_0x57bf23,_0x2f7dd5,_0x5dfc66);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index a25e508..a1f235f 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x20e2=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x177e72,_0x28bf32){var _0x392698=function(_0x45a052){while(--_0x45a052){_0x177e72['push'](_0x177e72['shift']());}};_0x392698(++_0x28bf32);}(_0x20e2,0x1c3));var _0x220e=function(_0x3f4f99,_0x673680){_0x3f4f99=_0x3f4f99-0x0;var _0xde7221=_0x20e2[_0x3f4f99];return _0xde7221;};'use strict';var express=require('express');var router=express[_0x220e('0x0')]();var controller=require(_0x220e('0x1'));router[_0x220e('0x2')]('/',controller[_0x220e('0x3')]);module[_0x220e('0x4')]=router;
\ No newline at end of file
+var _0xb501=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x26505f,_0x3aca29){var _0x3ebdc3=function(_0x11b83d){while(--_0x11b83d){_0x26505f['push'](_0x26505f['shift']());}};_0x3ebdc3(++_0x3aca29);}(_0xb501,0xdc));var _0x1b50=function(_0x58db31,_0x4b4ca2){_0x58db31=_0x58db31-0x0;var _0x5c2c19=_0xb501[_0x58db31];return _0x5c2c19;};'use strict';var express=require('express');var router=express[_0x1b50('0x0')]();var controller=require(_0x1b50('0x1'));router[_0x1b50('0x2')]('/',controller[_0x1b50('0x3')]);module[_0x1b50('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 0dae410..ca219fb 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x1ea92e,_0x3dcf0e){var _0x2afe32=function(_0x3fe338){while(--_0x3fe338){_0x1ea92e['push'](_0x1ea92e['shift']());}};_0x2afe32(++_0x3dcf0e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0x169a44,_0x2597e4){_0x169a44=_0x169a44-0x0;var _0x2e02a4=_0x7a54[_0x169a44];return _0x2e02a4;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 8343cb6..f3ca627 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 _0x87a4=['/callback','callback','isMiddleware','login','exports','express','passport','../user/user.controller.js','../../components/auth/service'];(function(_0x1d99f1,_0x284c97){var _0x595325=function(_0x41e059){while(--_0x41e059){_0x1d99f1['push'](_0x1d99f1['shift']());}};_0x595325(++_0x284c97);}(_0x87a4,0x12e));var _0x487a=function(_0x1adf0e,_0x3bd542){_0x1adf0e=_0x1adf0e-0x0;var _0x460f14=_0x87a4[_0x1adf0e];return _0x460f14;};'use strict';var express=require(_0x487a('0x0'));var passport=require(_0x487a('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x487a('0x2'));var authService=require(_0x487a('0x3'));router['get']('/',controller['login']);router['get'](_0x487a('0x4'),controller[_0x487a('0x5')],authService[_0x487a('0x6')],userController[_0x487a('0x7')],authService['setTokenCookie']);module[_0x487a('0x8')]=router;
\ No newline at end of file
+var _0xffcc=['setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js','get','callback','login'];(function(_0x2a187,_0x2fcfe7){var _0xd0786d=function(_0x39cd74){while(--_0x39cd74){_0x2a187['push'](_0x2a187['shift']());}};_0xd0786d(++_0x2fcfe7);}(_0xffcc,0x112));var _0xcffc=function(_0x8b46fd,_0x3ff643){_0x8b46fd=_0x8b46fd-0x0;var _0x1ebf86=_0xffcc[_0x8b46fd];return _0x1ebf86;};'use strict';var express=require('express');var passport=require(_0xcffc('0x0'));var router=express['Router']();var controller=require(_0xcffc('0x1'));var userController=require(_0xcffc('0x2'));var authService=require('../../components/auth/service');router['get']('/',controller['login']);router[_0xcffc('0x3')]('/callback',controller[_0xcffc('0x4')],authService['isMiddleware'],userController[_0xcffc('0x5')],authService[_0xcffc('0x6')]);module[_0xcffc('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index b5de359..2188167 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 _0x325c=['lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blockedAt','user','agent','then','name','loginAttempts','blocked','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','error','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','User','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','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordHistory','use','passport','passport-local','Strategy','jayson/promise'];(function(_0x1c6abb,_0x5884e6){var _0x2aee50=function(_0x3e3c96){while(--_0x3e3c96){_0x1c6abb['push'](_0x1c6abb['shift']());}};_0x2aee50(++_0x5884e6);}(_0x325c,0x96));var _0xc325=function(_0x49775a,_0x28de4f){_0x49775a=_0x49775a-0x0;var _0x4fc888=_0x325c[_0x49775a];return _0x4fc888;};'use strict';var util=require('util');var passport=require(_0xc325('0x0'));var LocalStrategy=require(_0xc325('0x1'))[_0xc325('0x2')];var jayson=require(_0xc325('0x3'));var _=require(_0xc325('0x4'));var rs=require('randomstring');var moment=require(_0xc325('0x5'));var db=require(_0xc325('0x6'))['db'];var authService=require(_0xc325('0x7'));var utils=require(_0xc325('0x8'));var client=jayson[_0xc325('0x9')][_0xc325('0xa')]({'port':0x232b});function localAuthenticate(_0x2fff39,_0x3b62fe,_0x3e35e4,_0x686b03){var _0x16dd0d,_0x2e053a;return db[_0xc325('0xb')][_0xc325('0xc')]({'where':{'id':0x1},'attributes':[_0xc325('0xd'),_0xc325('0xe')],'raw':!![]})['then'](function(_0x3a7ae6){_0x16dd0d=_0x3a7ae6;return _0x2fff39[_0xc325('0xc')]({'attributes':['id','name',_0xc325('0xf'),_0xc325('0x10'),_0xc325('0x11'),_0xc325('0x12'),'blocked',_0xc325('0x13'),'loginAttempts'],'where':{'name':_0x3b62fe,'role':{'$or':['admin',_0xc325('0x14'),_0xc325('0x15')]}}});})[_0xc325('0x16')](function(_0x85b83c){if(!_0x85b83c||_0x85b83c&&_0x85b83c[_0xc325('0x17')]!==_0x3b62fe){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2e053a=_0x85b83c;return _0x2e053a;}})[_0xc325('0x16')](function(){_0x2e053a['authenticate'](_0x3e35e4,function(_0x158d30,_0x680757){var _0x213884=_0x2e053a[_0xc325('0x18')]+0x1;if(_0x158d30){return _0x686b03(_0x158d30);}else if(!_0x680757){if(_0x2e053a['disabled']){return _0x686b03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x16dd0d[_0xc325('0xd')]>0x0){if(_0x2e053a[_0xc325('0x19')]){if(_0x16dd0d[_0xc325('0xe')]>0x0){if(moment(_0x2e053a[_0xc325('0x13')])[_0xc325('0x1a')](_0x16dd0d[_0xc325('0xe')],_0xc325('0x1b'))>moment()){return _0x686b03(null,![],{'message':_0xc325('0x1c')});}else{return utils[_0xc325('0x1d')](_0x2e053a,_0x213884,![],null)[_0xc325('0x16')](function(){return _0x686b03(null,![],{'message':_0xc325('0x1c')});});}}else{return _0x686b03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x213884>=_0x16dd0d[_0xc325('0xd')]){return utils[_0xc325('0x1d')](_0x2e053a,0x0,!![],moment())['then'](function(){return _0x686b03(null,![],{'message':_0xc325('0x1c')});});}else{return utils['clearBlockUser'](_0x2e053a,_0x213884,![],null)['then'](function(){return _0x686b03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x686b03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2e053a[_0xc325('0x12')]){return _0x686b03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x16dd0d[_0xc325('0xd')]>0x0){if(_0x2e053a[_0xc325('0x19')]){if(_0x16dd0d[_0xc325('0xe')]>0x0){if(moment(_0x2e053a['blockedAt'])['add'](_0x16dd0d[_0xc325('0xe')],_0xc325('0x1b'))>moment()){return _0x686b03(null,![],{'message':_0xc325('0x1c')});}else{return utils[_0xc325('0x1d')](_0x2e053a,0x0,![],null)[_0xc325('0x16')](function(){return utils[_0xc325('0x1e')](_0x2e053a);})['then'](function(){return _0x686b03(null,_0x2e053a);});}}else{return _0x686b03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc325('0x1d')](_0x2e053a,0x0,![],null)[_0xc325('0x16')](function(){return utils[_0xc325('0x1e')](_0x2e053a);})[_0xc325('0x16')](function(){return _0x686b03(null,_0x2e053a);})[_0xc325('0x1f')](function(_0x4d2216){return _0x686b03(null,![],_0x4d2216);});}}else{if(_0x2e053a[_0xc325('0x19')]){return _0x686b03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc325('0x1e')](_0x2e053a)[_0xc325('0x16')](function(){return _0x686b03(null,_0x2e053a);});}}}});})[_0xc325('0x1f')](function(_0x1091be){return _0x686b03(null,![],_0x1091be);});}function sendServiceMail(_0x23fe68){return db['MailAccount'][_0xc325('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc325('0x17'),_0xc325('0x21')],'include':[{'model':db[_0xc325('0x22')],'as':_0xc325('0x23'),'include':[{'model':db[_0xc325('0x24')],'as':'CloudProvider'}]}]})[_0xc325('0x16')](function(_0x485f14){if(!_0x485f14){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5bdaec=_0x485f14[_0xc325('0x25')]();var _0xa8973f={'account':_0x5bdaec,'message':_['merge']({'from':util[_0xc325('0x26')](_0xc325('0x27'),_0x485f14[_0xc325('0x17')],_0x485f14['email']||_0x485f14[_0xc325('0x23')]['user'])},_0x23fe68)};return client[_0xc325('0x28')]('SendMail',_0xa8973f);})['then'](function(_0x496da8){if(_0x496da8['error']){throw new Error(util[_0xc325('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x496da8[_0xc325('0x29')][_0xc325('0x2a')]||JSON[_0xc325('0x2b')](_0x496da8[_0xc325('0x29')])));}return!![];});}function handleError(_0x2d442d,_0x174f0e,_0x323c65){return _0x2d442d['status'](_0x174f0e||0x1f4)[_0xc325('0x2c')]({'message':_0x323c65?_0x323c65['message']||_0x323c65:''});}exports[_0xc325('0x2d')]=function(_0x30eda9,_0x25766e,_0x1384cb){passport['authenticate'](_0xc325('0x2e'),function(_0x22b3ef,_0x4506a2,_0x2570e9){var _0xa62122=_0x22b3ef||_0x2570e9;if(_0xa62122){return handleError(_0x25766e,0x191,_0xa62122);}if(!_0x4506a2){return handleError(_0x25766e,0x194,{'message':_0xc325('0x2f')});}else{var _0x13c984={'payload':{'id':_0x4506a2['id'],'role':_0x4506a2[_0xc325('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xc325('0x30')](_0x13c984)[_0xc325('0x16')](function(_0x133d60){_0x25766e[_0xc325('0x31')]({'id':_0x4506a2['id'],'token':_0x133d60,'statusCall':'','isAlreadyLogged':_0x4506a2[_0xc325('0x32')]});});}})(_0x30eda9,_0x25766e,_0x1384cb);};exports[_0xc325('0x33')]=function(_0x12b322,_0x3dfb3e){if(!_0x12b322[_0xc325('0x34')][_0xc325('0x21')]){return handleError(_0x3dfb3e,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1610ab=rs[_0xc325('0x35')]();_0x12b322['body'][_0xc325('0x21')]=_0x12b322[_0xc325('0x34')]['email'][_0xc325('0x36')]()['toLowerCase']();var _0x27fa69;return db['Setting'][_0xc325('0xc')]({'where':{'id':0x1},'attributes':[_0xc325('0xd'),'blockDuration'],'raw':!![]})[_0xc325('0x16')](function(_0x4d1d3a){_0x27fa69=_0x4d1d3a;return db[_0xc325('0x37')]['find']({'where':{'email':_0x12b322[_0xc325('0x34')][_0xc325('0x21')]}});})['then'](function(_0x18bfeb){if(!_0x18bfeb){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x18bfeb[_0xc325('0x12')]){throw new Error(_0xc325('0x38'));}if(_0x18bfeb[_0xc325('0x19')]){if(moment(_0x18bfeb[_0xc325('0x13')])[_0xc325('0x1a')](_0x27fa69[_0xc325('0xe')],_0xc325('0x1b'))>moment()){throw new Error(_0xc325('0x39'));}else{_0x18bfeb[_0xc325('0x19')]=![];_0x18bfeb[_0xc325('0x13')]=null;}}_0x18bfeb[_0xc325('0x3a')]=_0x1610ab;_0x18bfeb[_0xc325('0x3b')]=Date[_0xc325('0x3c')]()+0x36ee80;return _0x18bfeb[_0xc325('0x3d')]();})[_0xc325('0x16')](function(){return sendServiceMail({'to':_0x12b322[_0xc325('0x34')][_0xc325('0x21')],'subject':_0xc325('0x3e'),'text':_0xc325('0x3f')+_0xc325('0x40')+_0xc325('0x41')+_0x12b322[_0xc325('0x42')][_0xc325('0x43')]+'/reset/'+_0x1610ab+'\x0a\x0a'+_0xc325('0x44')});})[_0xc325('0x16')](function(){_0x3dfb3e[_0xc325('0x45')](0xc8)['send']({'message':_0xc325('0x46')});})[_0xc325('0x1f')](function(_0xebae56){return handleError(_0x3dfb3e,0x1f4,_0xebae56);});};exports['reset']=function(_0x1fe5f2,_0x3afefe){return db[_0xc325('0x37')]['find']({'where':{'resetPasswordToken':_0x1fe5f2[_0xc325('0x47')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc325('0x3c')]()}}})[_0xc325('0x16')](function(_0x743746){if(!_0x743746){throw new Error(_0xc325('0x48'));}return db['Setting'][_0xc325('0xc')]({'attributes':['id',_0xc325('0x49'),'enforcePasswordHistory',_0xc325('0x4a')]})[_0xc325('0x16')](function(_0x2f5244){if(_0x2f5244[_0xc325('0x49')])authService['validatePasswordPattern'](_0x1fe5f2[_0xc325('0x34')][_0xc325('0xf')]);if(!_0x2f5244['enforcePasswordHistory']||!_0x743746['previousPasswords'])return _0x743746;authService[_0xc325('0x4b')](_0x1fe5f2[_0xc325('0x34')][_0xc325('0xf')],_0x743746['previousPasswords'],_0x2f5244[_0xc325('0x4a')]);return _0x743746;})[_0xc325('0x16')](function(){_0x743746[_0xc325('0xf')]=_0x1fe5f2['body'][_0xc325('0xf')];_0x743746['resetPasswordToken']=null;_0x743746[_0xc325('0x3b')]=null;return _0x743746[_0xc325('0x3d')]();});})[_0xc325('0x16')](function(){_0x3afefe[_0xc325('0x45')](0xc8)[_0xc325('0x2c')]({'message':'Password\x20reset!'});})[_0xc325('0x1f')](function(_0x5a7d99){return handleError(_0x3afefe,0x1f4,_0x5a7d99);});};passport[_0xc325('0x4c')](_0xc325('0x2e'),new LocalStrategy({'usernameField':_0xc325('0x17'),'passwordField':_0xc325('0xf')},function(_0x12e0d7,_0x447e92,_0xa775ef){return localAuthenticate(db[_0xc325('0x37')],_0x12e0d7,_0x447e92,_0xa775ef);}));
\ No newline at end of file
+var _0xac32=['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','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x392632,_0x418adf){var _0x39df4f=function(_0x2ad576){while(--_0x2ad576){_0x392632['push'](_0x392632['shift']());}};_0x39df4f(++_0x418adf);}(_0xac32,0x111));var _0x2ac3=function(_0x258d81,_0x41ebde){_0x258d81=_0x258d81-0x0;var _0x7d0e3c=_0xac32[_0x258d81];return _0x7d0e3c;};'use strict';var util=require(_0x2ac3('0x0'));var passport=require(_0x2ac3('0x1'));var LocalStrategy=require(_0x2ac3('0x2'))[_0x2ac3('0x3')];var jayson=require('jayson/promise');var _=require(_0x2ac3('0x4'));var rs=require(_0x2ac3('0x5'));var moment=require(_0x2ac3('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x2ac3('0x7'));var utils=require(_0x2ac3('0x8'));var client=jayson[_0x2ac3('0x9')][_0x2ac3('0xa')]({'port':0x232b});function localAuthenticate(_0x4e9fc9,_0x10b292,_0x301ff2,_0x3a96d7){var _0x2ac1ab,_0x5a5ebe;return db[_0x2ac3('0xb')][_0x2ac3('0xc')]({'where':{'id':0x1},'attributes':[_0x2ac3('0xd'),'blockDuration'],'raw':!![]})[_0x2ac3('0xe')](function(_0x56287c){_0x2ac1ab=_0x56287c;return _0x4e9fc9[_0x2ac3('0xc')]({'attributes':['id',_0x2ac3('0xf'),_0x2ac3('0x10'),_0x2ac3('0x11'),'role',_0x2ac3('0x12'),_0x2ac3('0x13'),_0x2ac3('0x14'),'loginAttempts'],'where':{'name':_0x10b292,'role':{'$or':[_0x2ac3('0x15'),_0x2ac3('0x16'),_0x2ac3('0x17')]}}});})[_0x2ac3('0xe')](function(_0x780d2b){if(!_0x780d2b||_0x780d2b&&_0x780d2b[_0x2ac3('0xf')]!==_0x10b292){throw new Error(_0x2ac3('0x18'));}else{_0x5a5ebe=_0x780d2b;return _0x5a5ebe;}})[_0x2ac3('0xe')](function(){_0x5a5ebe[_0x2ac3('0x19')](_0x301ff2,function(_0x3cf1dc,_0x124eb9){var _0x3a2209=_0x5a5ebe[_0x2ac3('0x1a')]+0x1;if(_0x3cf1dc){return _0x3a96d7(_0x3cf1dc);}else if(!_0x124eb9){if(_0x5a5ebe[_0x2ac3('0x12')]){return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});}else if(_0x2ac1ab[_0x2ac3('0xd')]>0x0){if(_0x5a5ebe['blocked']){if(_0x2ac1ab[_0x2ac3('0x1b')]>0x0){if(moment(_0x5a5ebe[_0x2ac3('0x14')])[_0x2ac3('0x1c')](_0x2ac1ab[_0x2ac3('0x1b')],_0x2ac3('0x1d'))>moment()){return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});}else{return utils['clearBlockUser'](_0x5a5ebe,_0x3a2209,![],null)['then'](function(){return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});});}}else{return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});}}else{if(_0x3a2209>=_0x2ac1ab['allowedLoginAttempts']){return utils[_0x2ac3('0x1e')](_0x5a5ebe,0x0,!![],moment())[_0x2ac3('0xe')](function(){return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});});}else{return utils[_0x2ac3('0x1e')](_0x5a5ebe,_0x3a2209,![],null)[_0x2ac3('0xe')](function(){return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});});}}}else{return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});}}else{if(_0x5a5ebe[_0x2ac3('0x12')]){return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});}else if(_0x2ac1ab[_0x2ac3('0xd')]>0x0){if(_0x5a5ebe['blocked']){if(_0x2ac1ab['blockDuration']>0x0){if(moment(_0x5a5ebe[_0x2ac3('0x14')])[_0x2ac3('0x1c')](_0x2ac1ab['blockDuration'],_0x2ac3('0x1d'))>moment()){return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});}else{return utils[_0x2ac3('0x1e')](_0x5a5ebe,0x0,![],null)['then'](function(){return utils[_0x2ac3('0x1f')](_0x5a5ebe);})[_0x2ac3('0xe')](function(){return _0x3a96d7(null,_0x5a5ebe);});}}else{return _0x3a96d7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x5a5ebe,0x0,![],null)[_0x2ac3('0xe')](function(){return utils['getLicense'](_0x5a5ebe);})[_0x2ac3('0xe')](function(){return _0x3a96d7(null,_0x5a5ebe);})[_0x2ac3('0x20')](function(_0x5c0ce0){return _0x3a96d7(null,![],_0x5c0ce0);});}}else{if(_0x5a5ebe[_0x2ac3('0x13')]){return _0x3a96d7(null,![],{'message':_0x2ac3('0x18')});}else{return utils[_0x2ac3('0x1f')](_0x5a5ebe)[_0x2ac3('0xe')](function(){return _0x3a96d7(null,_0x5a5ebe);});}}}});})[_0x2ac3('0x20')](function(_0x556481){return _0x3a96d7(null,![],_0x556481);});}function sendServiceMail(_0x13b6ee){return db[_0x2ac3('0x21')][_0x2ac3('0x22')]({'where':{'service':!![]},'attributes':['id',_0x2ac3('0xf'),_0x2ac3('0x23')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x2ac3('0x24')],'as':'CloudProvider'}]}]})['then'](function(_0x3f6ee6){if(!_0x3f6ee6){throw new Error(_0x2ac3('0x25'));}var _0x4475c0=_0x3f6ee6[_0x2ac3('0x26')]();var _0x3622da={'account':_0x4475c0,'message':_['merge']({'from':util[_0x2ac3('0x27')]('\x22%s\x22\x20<%s>',_0x3f6ee6[_0x2ac3('0xf')],_0x3f6ee6[_0x2ac3('0x23')]||_0x3f6ee6['Smtp'][_0x2ac3('0x16')])},_0x13b6ee)};return client[_0x2ac3('0x28')](_0x2ac3('0x29'),_0x3622da);})[_0x2ac3('0xe')](function(_0x32a4c5){if(_0x32a4c5['error']){throw new Error(util[_0x2ac3('0x27')](_0x2ac3('0x2a'),_0x32a4c5[_0x2ac3('0x2b')][_0x2ac3('0x2c')]||JSON[_0x2ac3('0x2d')](_0x32a4c5['error'])));}return!![];});}function handleError(_0x210e32,_0x3b3a2c,_0x4e75de){return _0x210e32[_0x2ac3('0x2e')](_0x3b3a2c||0x1f4)[_0x2ac3('0x2f')]({'message':_0x4e75de?_0x4e75de['message']||_0x4e75de:''});}exports['login']=function(_0x9aa2f6,_0x1f8d25,_0x5b89bd){passport[_0x2ac3('0x19')](_0x2ac3('0x30'),function(_0x5e26bb,_0x376a7d,_0x5ea0df){var _0x376d80=_0x5e26bb||_0x5ea0df;if(_0x376d80){return handleError(_0x1f8d25,0x191,_0x376d80);}if(!_0x376a7d){return handleError(_0x1f8d25,0x194,{'message':_0x2ac3('0x31')});}else{var _0x2a4bcc={'payload':{'id':_0x376a7d['id'],'role':_0x376a7d['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2a4bcc)[_0x2ac3('0xe')](function(_0x30fa66){_0x1f8d25[_0x2ac3('0x32')]({'id':_0x376a7d['id'],'token':_0x30fa66,'statusCall':'','isAlreadyLogged':_0x376a7d[_0x2ac3('0x33')]});});}})(_0x9aa2f6,_0x1f8d25,_0x5b89bd);};exports[_0x2ac3('0x34')]=function(_0x318e6e,_0x580c31){if(!_0x318e6e['body'][_0x2ac3('0x23')]){return handleError(_0x580c31,0x1f4,{'message':_0x2ac3('0x35')});}var _0x38a591=rs['generate']();_0x318e6e[_0x2ac3('0x36')][_0x2ac3('0x23')]=_0x318e6e['body'][_0x2ac3('0x23')][_0x2ac3('0x37')]()[_0x2ac3('0x38')]();var _0x4577f4;return db['Setting'][_0x2ac3('0xc')]({'where':{'id':0x1},'attributes':[_0x2ac3('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0xddb3ef){_0x4577f4=_0xddb3ef;return db['User']['find']({'where':{'email':_0x318e6e['body'][_0x2ac3('0x23')]}});})[_0x2ac3('0xe')](function(_0x151785){if(!_0x151785){throw new Error(_0x2ac3('0x39'));}if(_0x151785[_0x2ac3('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x151785['blocked']){if(moment(_0x151785[_0x2ac3('0x14')])[_0x2ac3('0x1c')](_0x4577f4[_0x2ac3('0x1b')],'minutes')>moment()){throw new Error(_0x2ac3('0x3a'));}else{_0x151785['blocked']=![];_0x151785['blockedAt']=null;}}_0x151785['resetPasswordToken']=_0x38a591;_0x151785[_0x2ac3('0x3b')]=Date[_0x2ac3('0x3c')]()+0x36ee80;return _0x151785[_0x2ac3('0x3d')]();})[_0x2ac3('0xe')](function(){return sendServiceMail({'to':_0x318e6e[_0x2ac3('0x36')][_0x2ac3('0x23')],'subject':_0x2ac3('0x3e'),'text':_0x2ac3('0x3f')+_0x2ac3('0x40')+'https://'+_0x318e6e[_0x2ac3('0x41')][_0x2ac3('0x42')]+_0x2ac3('0x43')+_0x38a591+'\x0a\x0a'+_0x2ac3('0x44')});})[_0x2ac3('0xe')](function(){_0x580c31[_0x2ac3('0x2e')](0xc8)[_0x2ac3('0x2f')]({'message':_0x2ac3('0x45')});})[_0x2ac3('0x20')](function(_0x3d648d){return handleError(_0x580c31,0x1f4,_0x3d648d);});};exports[_0x2ac3('0x46')]=function(_0xd93dc,_0x159922){return db[_0x2ac3('0x47')][_0x2ac3('0x22')]({'where':{'resetPasswordToken':_0xd93dc[_0x2ac3('0x48')][_0x2ac3('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x2ac3('0xe')](function(_0x1381c8){if(!_0x1381c8){throw new Error(_0x2ac3('0x4a'));}return db[_0x2ac3('0xb')][_0x2ac3('0xc')]({'attributes':['id','securePassword',_0x2ac3('0x4b'),_0x2ac3('0x4c')]})[_0x2ac3('0xe')](function(_0x1d1c2d){if(_0x1d1c2d[_0x2ac3('0x4d')])authService[_0x2ac3('0x4e')](_0xd93dc[_0x2ac3('0x36')][_0x2ac3('0x10')]);if(!_0x1d1c2d[_0x2ac3('0x4b')]||!_0x1381c8['previousPasswords'])return _0x1381c8;authService[_0x2ac3('0x4f')](_0xd93dc[_0x2ac3('0x36')][_0x2ac3('0x10')],_0x1381c8[_0x2ac3('0x50')],_0x1d1c2d[_0x2ac3('0x4c')]);return _0x1381c8;})[_0x2ac3('0xe')](function(){_0x1381c8[_0x2ac3('0x10')]=_0xd93dc[_0x2ac3('0x36')][_0x2ac3('0x10')];_0x1381c8['resetPasswordToken']=null;_0x1381c8[_0x2ac3('0x3b')]=null;return _0x1381c8[_0x2ac3('0x3d')]();});})['then'](function(){_0x159922[_0x2ac3('0x2e')](0xc8)[_0x2ac3('0x2f')]({'message':_0x2ac3('0x51')});})[_0x2ac3('0x20')](function(_0x2d11e0){return handleError(_0x159922,0x1f4,_0x2d11e0);});};passport[_0x2ac3('0x52')](_0x2ac3('0x30'),new LocalStrategy({'usernameField':_0x2ac3('0xf'),'passwordField':'password'},function(_0x17e58a,_0x285064,_0x105b49){return localAuthenticate(db[_0x2ac3('0x47')],_0x17e58a,_0x285064,_0x105b49);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index d6724a8..97eac36 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 _0x9714=['express','Router','login','post','/forgot','forgot','/reset/:token','exports'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x9714,0xa0));var _0x4971=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0x9714[_0x4e697a];return _0x88850c;};'use strict';var express=require(_0x4971('0x0'));var router=express[_0x4971('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x4971('0x2')]);router[_0x4971('0x3')](_0x4971('0x4'),controller[_0x4971('0x5')]);router[_0x4971('0x3')](_0x4971('0x6'),controller['reset']);module[_0x4971('0x7')]=router;
\ No newline at end of file
+var _0x8fe4=['post','login','/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller'];(function(_0x4659b5,_0xd07142){var _0x2cd685=function(_0x89afc){while(--_0x89afc){_0x4659b5['push'](_0x4659b5['shift']());}};_0x2cd685(++_0xd07142);}(_0x8fe4,0xf0));var _0x48fe=function(_0x111213,_0x3b29d4){_0x111213=_0x111213-0x0;var _0x34b86a=_0x8fe4[_0x111213];return _0x34b86a;};'use strict';var express=require(_0x48fe('0x0'));var router=express[_0x48fe('0x1')]();var controller=require(_0x48fe('0x2'));router[_0x48fe('0x3')]('/',controller[_0x48fe('0x4')]);router[_0x48fe('0x3')](_0x48fe('0x5'),controller[_0x48fe('0x6')]);router[_0x48fe('0x3')](_0x48fe('0x7'),controller['reset']);module[_0x48fe('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index dcf5dc5..6e6db64 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 _0xe654=['BOOLEAN','sequelize','exports','STRING'];(function(_0x743abc,_0x84a83){var _0x5ceb31=function(_0x43857e){while(--_0x43857e){_0x743abc['push'](_0x743abc['shift']());}};_0x5ceb31(++_0x84a83);}(_0xe654,0x1ad));var _0x4e65=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe654[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x4e65('0x0'));module[_0x4e65('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x4e65('0x2')]},'description':{'type':Sequelize[_0x4e65('0x2')]},'status':{'type':Sequelize[_0x4e65('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8cf4=['BOOLEAN','INTEGER','STRING'];(function(_0x3ca7b1,_0x50b9c5){var _0x1e042c=function(_0x589efe){while(--_0x589efe){_0x3ca7b1['push'](_0x3ca7b1['shift']());}};_0x1e042c(++_0x50b9c5);}(_0x8cf4,0x1ee));var _0x48cf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8cf4[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x48cf('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x48cf('0x0')]},'description':{'type':Sequelize[_0x48cf('0x0')]},'status':{'type':Sequelize[_0x48cf('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x48cf('0x2')],'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 460ef90..8f45d58 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 _0xc738=['request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','Condition','omit','ids','findOne','length','getConditions','addActions','Action','getActions','zip-dir'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xc738,0x18a));var _0x8c73=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0xc738[_0x127a60];return _0xc1f6a3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c73('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c73('0x1'));var moment=require('moment');var BPromise=require(_0x8c73('0x2'));var Mustache=require(_0x8c73('0x3'));var util=require(_0x8c73('0x4'));var path=require(_0x8c73('0x5'));var sox=require(_0x8c73('0x6'));var csv=require(_0x8c73('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c73('0x8'));var _=require('lodash');var squel=require(_0x8c73('0x9'));var crypto=require(_0x8c73('0xa'));var jsforce=require(_0x8c73('0xb'));var deskjs=require(_0x8c73('0xc'));var toCsv=require(_0x8c73('0x7'));var querystring=require(_0x8c73('0xd'));var Papa=require('papaparse');var Redis=require(_0x8c73('0xe'));var authService=require(_0x8c73('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c73('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x8c73('0x11'));var licenseUtil=require(_0x8c73('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1de4d1,_0x138654){_0x138654=_0x138654||0xcc;return function(_0x690c7){if(_0x690c7){return _0x1de4d1[_0x8c73('0x13')](_0x138654);}return _0x1de4d1[_0x8c73('0x14')](_0x138654)[_0x8c73('0x15')]();};}function respondWithResult(_0x5b578a,_0x303eda){_0x303eda=_0x303eda||0xc8;return function(_0x456702){if(_0x456702){return _0x5b578a[_0x8c73('0x14')](_0x303eda)['json'](_0x456702);}};}function respondWithFilteredResult(_0x49447d,_0x278061){return function(_0x2e4096){if(_0x2e4096){var _0x5a9963=typeof _0x278061[_0x8c73('0x16')]===_0x8c73('0x17')&&typeof _0x278061[_0x8c73('0x18')]===_0x8c73('0x17');var _0x386717=_0x2e4096[_0x8c73('0x19')];var _0x3bcb44=_0x5a9963?0x0:_0x278061[_0x8c73('0x16')];var _0x204fb4=_0x5a9963?_0x2e4096[_0x8c73('0x19')]:_0x278061[_0x8c73('0x16')]+_0x278061[_0x8c73('0x18')];var _0x52e93c;if(_0x204fb4>=_0x386717){_0x204fb4=_0x386717;_0x52e93c=0xc8;}else{_0x52e93c=0xce;}_0x49447d['status'](_0x52e93c);return _0x49447d[_0x8c73('0x1a')](_0x8c73('0x1b'),_0x3bcb44+'-'+_0x204fb4+'/'+_0x386717)[_0x8c73('0x1c')](_0x2e4096);}return null;};}function patchUpdates(_0x5b8d2e){return function(_0x2c6789){try{jsonpatch[_0x8c73('0x1d')](_0x2c6789,_0x5b8d2e,!![]);}catch(_0x19b14f){return BPromise[_0x8c73('0x1e')](_0x19b14f);}return _0x2c6789[_0x8c73('0x1f')]();};}function saveUpdates(_0x2b7d4b,_0xbeeecb){return function(_0xcac2f7){if(_0xcac2f7){return _0xcac2f7['update'](_0x2b7d4b)[_0x8c73('0x20')](function(_0x3f2bfe){return _0x3f2bfe;});}return null;};}function removeEntity(_0x774cfb,_0x49ebfd){return function(_0x58ed95){if(_0x58ed95){return _0x58ed95[_0x8c73('0x21')]()[_0x8c73('0x20')](function(){_0x774cfb[_0x8c73('0x14')](0xcc)[_0x8c73('0x15')]();});}};}function handleEntityNotFound(_0x2e4cbd,_0x4761ae){return function(_0x580535){if(!_0x580535){_0x2e4cbd[_0x8c73('0x13')](0x194);}return _0x580535;};}function handleError(_0x4d0c4a,_0x27652d){_0x27652d=_0x27652d||0x1f4;return function(_0x2d0658){logger[_0x8c73('0x22')](_0x2d0658['stack']);if(_0x2d0658[_0x8c73('0x23')]){delete _0x2d0658[_0x8c73('0x23')];}_0x4d0c4a[_0x8c73('0x14')](_0x27652d)[_0x8c73('0x24')](_0x2d0658);};}exports[_0x8c73('0x25')]=function(_0xbaac60,_0x427332){var _0x590c72={},_0x3eb387={},_0x129d6e={'count':0x0,'rows':[]};var _0x5f88c7=_[_0x8c73('0x26')](db[_0x8c73('0x27')][_0x8c73('0x28')],function(_0x397c48){return{'name':_0x397c48[_0x8c73('0x29')],'type':_0x397c48[_0x8c73('0x2a')][_0x8c73('0x2b')]};});_0x3eb387['model']=_[_0x8c73('0x26')](_0x5f88c7,_0x8c73('0x23'));_0x3eb387[_0x8c73('0x2c')]=_['keys'](_0xbaac60[_0x8c73('0x2c')]);_0x3eb387[_0x8c73('0x2d')]=_[_0x8c73('0x2e')](_0x3eb387[_0x8c73('0x2f')],_0x3eb387[_0x8c73('0x2c')]);_0x590c72[_0x8c73('0x30')]=_[_0x8c73('0x2e')](_0x3eb387[_0x8c73('0x2f')],qs[_0x8c73('0x31')](_0xbaac60[_0x8c73('0x2c')]['fields']));_0x590c72['attributes']=_0x590c72[_0x8c73('0x30')]['length']?_0x590c72['attributes']:_0x3eb387['model'];if(!_0xbaac60[_0x8c73('0x2c')][_0x8c73('0x32')](_0x8c73('0x33'))){_0x590c72[_0x8c73('0x18')]=qs[_0x8c73('0x18')](_0xbaac60[_0x8c73('0x2c')]['limit']);_0x590c72[_0x8c73('0x16')]=qs[_0x8c73('0x16')](_0xbaac60['query'][_0x8c73('0x16')]);}_0x590c72[_0x8c73('0x34')]=qs[_0x8c73('0x35')](_0xbaac60[_0x8c73('0x2c')]['sort']);_0x590c72[_0x8c73('0x36')]=qs[_0x8c73('0x2d')](_[_0x8c73('0x37')](_0xbaac60['query'],_0x3eb387['filters']),_0x5f88c7);if(_0xbaac60[_0x8c73('0x2c')][_0x8c73('0x38')]){_0x590c72[_0x8c73('0x36')]=_[_0x8c73('0x39')](_0x590c72[_0x8c73('0x36')],{'$or':_[_0x8c73('0x26')](_0x5f88c7,function(_0x202311){if(_0x202311['type']!=='VIRTUAL'){var _0x353788={};_0x353788[_0x202311[_0x8c73('0x23')]]={'$like':'%'+_0xbaac60['query'][_0x8c73('0x38')]+'%'};return _0x353788;}})});}_0x590c72=_[_0x8c73('0x39')]({},_0x590c72,_0xbaac60[_0x8c73('0x3a')]);var _0x64d3f={'where':_0x590c72['where']};return db[_0x8c73('0x27')]['count'](_0x64d3f)[_0x8c73('0x20')](function(_0x40d7ea){_0x129d6e[_0x8c73('0x19')]=_0x40d7ea;if(_0xbaac60[_0x8c73('0x2c')][_0x8c73('0x3b')]){_0x590c72[_0x8c73('0x3c')]=[{'all':!![]}];}return db[_0x8c73('0x27')][_0x8c73('0x3d')](_0x590c72);})[_0x8c73('0x20')](function(_0x19f9e7){_0x129d6e[_0x8c73('0x3e')]=_0x19f9e7;return _0x129d6e;})[_0x8c73('0x20')](respondWithFilteredResult(_0x427332,_0x590c72))[_0x8c73('0x3f')](handleError(_0x427332,null));};exports['show']=function(_0x42c111,_0x4e2606){var _0x228882={'raw':![],'where':{'id':_0x42c111[_0x8c73('0x40')]['id']}},_0x366773={};_0x366773['model']=_['keys'](db['Automation'][_0x8c73('0x28')]);_0x366773['query']=_[_0x8c73('0x41')](_0x42c111['query']);_0x366773[_0x8c73('0x2d')]=_['intersection'](_0x366773['model'],_0x366773[_0x8c73('0x2c')]);_0x228882[_0x8c73('0x30')]=_[_0x8c73('0x2e')](_0x366773[_0x8c73('0x2f')],qs[_0x8c73('0x31')](_0x42c111[_0x8c73('0x2c')][_0x8c73('0x31')]));_0x228882['attributes']=_0x228882['attributes']['length']?_0x228882['attributes']:_0x366773[_0x8c73('0x2f')];if(_0x42c111[_0x8c73('0x2c')]['includeAll']){_0x228882[_0x8c73('0x3c')]=[{'all':!![]}];}_0x228882=_[_0x8c73('0x39')]({},_0x228882,_0x42c111['options']);return db[_0x8c73('0x27')][_0x8c73('0x42')](_0x228882)['then'](handleEntityNotFound(_0x4e2606,null))[_0x8c73('0x20')](respondWithResult(_0x4e2606,null))[_0x8c73('0x3f')](handleError(_0x4e2606,null));};exports[_0x8c73('0x43')]=function(_0x719c3a,_0x1499f7){return db[_0x8c73('0x27')][_0x8c73('0x43')](_0x719c3a[_0x8c73('0x44')],{})[_0x8c73('0x20')](respondWithResult(_0x1499f7,0xc9))[_0x8c73('0x3f')](handleError(_0x1499f7,null));};exports[_0x8c73('0x45')]=function(_0x48e119,_0xbfd284){if(_0x48e119[_0x8c73('0x44')]['id']){delete _0x48e119[_0x8c73('0x44')]['id'];}return db[_0x8c73('0x27')][_0x8c73('0x42')]({'where':{'id':_0x48e119[_0x8c73('0x40')]['id']}})[_0x8c73('0x20')](handleEntityNotFound(_0xbfd284,null))[_0x8c73('0x20')](saveUpdates(_0x48e119[_0x8c73('0x44')],null))[_0x8c73('0x20')](respondWithResult(_0xbfd284,null))[_0x8c73('0x3f')](handleError(_0xbfd284,null));};exports[_0x8c73('0x21')]=function(_0x182fb7,_0x38a965){return db[_0x8c73('0x27')][_0x8c73('0x42')]({'where':{'id':_0x182fb7[_0x8c73('0x40')]['id']}})[_0x8c73('0x20')](handleEntityNotFound(_0x38a965,null))[_0x8c73('0x20')](removeEntity(_0x38a965,null))['catch'](handleError(_0x38a965,null));};exports['addConditions']=function(_0x1497ab,_0x129186,_0x2de2b8){return db[_0x8c73('0x46')][_0x8c73('0x42')]({'where':{'id':_0x1497ab['params']['id']}})[_0x8c73('0x20')](handleEntityNotFound(_0x129186,null))[_0x8c73('0x20')](function(_0x34206d){if(_0x34206d){return _0x34206d['addConditions'](_0x1497ab[_0x8c73('0x44')]['ids'],_[_0x8c73('0x47')](_0x1497ab[_0x8c73('0x44')],[_0x8c73('0x48'),'id'])||{});}})['then'](respondWithResult(_0x129186,null))[_0x8c73('0x3f')](handleError(_0x129186,null));};exports['getConditions']=function(_0x46bdb8,_0x32fbfa,_0x1c7e2f){var _0x145062={};var _0x33a1f6={};var _0x181b5a;var _0x4611b4;return db[_0x8c73('0x27')][_0x8c73('0x49')]({'where':{'id':_0x46bdb8['params']['id']}})[_0x8c73('0x20')](handleEntityNotFound(_0x32fbfa,null))['then'](function(_0x3140bf){if(_0x3140bf){_0x181b5a=_0x3140bf;_0x33a1f6[_0x8c73('0x2f')]=_['keys'](db[_0x8c73('0x46')]['rawAttributes']);_0x33a1f6[_0x8c73('0x2c')]=_[_0x8c73('0x41')](_0x46bdb8[_0x8c73('0x2c')]);_0x33a1f6[_0x8c73('0x2d')]=_['intersection'](_0x33a1f6[_0x8c73('0x2f')],_0x33a1f6[_0x8c73('0x2c')]);_0x145062['attributes']=_[_0x8c73('0x2e')](_0x33a1f6[_0x8c73('0x2f')],qs[_0x8c73('0x31')](_0x46bdb8[_0x8c73('0x2c')]['fields']));_0x145062[_0x8c73('0x30')]=_0x145062[_0x8c73('0x30')][_0x8c73('0x4a')]?_0x145062[_0x8c73('0x30')]:_0x33a1f6[_0x8c73('0x2f')];_0x145062['order']=qs['sort'](_0x46bdb8[_0x8c73('0x2c')][_0x8c73('0x35')]);_0x145062[_0x8c73('0x36')]=qs[_0x8c73('0x2d')](_[_0x8c73('0x37')](_0x46bdb8[_0x8c73('0x2c')],_0x33a1f6[_0x8c73('0x2d')]));if(_0x46bdb8['query'][_0x8c73('0x38')]){_0x145062[_0x8c73('0x36')]=_[_0x8c73('0x39')](_0x145062[_0x8c73('0x36')],{'$or':_[_0x8c73('0x26')](_0x145062[_0x8c73('0x30')],function(_0x215ae0){var _0x46d187={};_0x46d187[_0x215ae0]={'$like':'%'+_0x46bdb8[_0x8c73('0x2c')][_0x8c73('0x38')]+'%'};return _0x46d187;})});}_0x145062=_['merge']({},_0x145062,_0x46bdb8[_0x8c73('0x3a')]);return _0x181b5a[_0x8c73('0x4b')](_0x145062);}})['then'](function(_0x22a2cc){if(_0x22a2cc){_0x4611b4=_0x22a2cc['length'];if(!_0x46bdb8[_0x8c73('0x2c')][_0x8c73('0x32')](_0x8c73('0x33'))){_0x145062[_0x8c73('0x18')]=qs[_0x8c73('0x18')](_0x46bdb8[_0x8c73('0x2c')][_0x8c73('0x18')]);_0x145062['offset']=qs[_0x8c73('0x16')](_0x46bdb8[_0x8c73('0x2c')][_0x8c73('0x16')]);}return _0x181b5a[_0x8c73('0x4b')](_0x145062);}})[_0x8c73('0x20')](function(_0x11f849){if(_0x11f849){return _0x11f849?{'count':_0x4611b4,'rows':_0x11f849}:null;}})[_0x8c73('0x20')](respondWithResult(_0x32fbfa,null))[_0x8c73('0x3f')](handleError(_0x32fbfa,null));};exports[_0x8c73('0x4c')]=function(_0x2c93fb,_0x248a96,_0x31e464){return db[_0x8c73('0x4d')][_0x8c73('0x42')]({'where':{'id':_0x2c93fb[_0x8c73('0x40')]['id']}})['then'](handleEntityNotFound(_0x248a96,null))['then'](function(_0x5f548c){if(_0x5f548c){return _0x5f548c['addActions'](_0x2c93fb['body'][_0x8c73('0x48')],_[_0x8c73('0x47')](_0x2c93fb[_0x8c73('0x44')],[_0x8c73('0x48'),'id'])||{});}})['then'](respondWithResult(_0x248a96,null))[_0x8c73('0x3f')](handleError(_0x248a96,null));};exports[_0x8c73('0x4e')]=function(_0x366dce,_0x59a26e,_0x17f853){var _0x34a7ca={};var _0x56a594={};var _0x43336c;var _0x487049;return db['Automation'][_0x8c73('0x49')]({'where':{'id':_0x366dce[_0x8c73('0x40')]['id']}})[_0x8c73('0x20')](handleEntityNotFound(_0x59a26e,null))[_0x8c73('0x20')](function(_0x1934d7){if(_0x1934d7){_0x43336c=_0x1934d7;_0x56a594['model']=_['keys'](db[_0x8c73('0x4d')][_0x8c73('0x28')]);_0x56a594[_0x8c73('0x2c')]=_[_0x8c73('0x41')](_0x366dce[_0x8c73('0x2c')]);_0x56a594[_0x8c73('0x2d')]=_[_0x8c73('0x2e')](_0x56a594[_0x8c73('0x2f')],_0x56a594['query']);_0x34a7ca['attributes']=_[_0x8c73('0x2e')](_0x56a594[_0x8c73('0x2f')],qs['fields'](_0x366dce[_0x8c73('0x2c')][_0x8c73('0x31')]));_0x34a7ca[_0x8c73('0x30')]=_0x34a7ca[_0x8c73('0x30')][_0x8c73('0x4a')]?_0x34a7ca[_0x8c73('0x30')]:_0x56a594[_0x8c73('0x2f')];_0x34a7ca[_0x8c73('0x34')]=qs['sort'](_0x366dce['query'][_0x8c73('0x35')]);_0x34a7ca['where']=qs[_0x8c73('0x2d')](_['pick'](_0x366dce['query'],_0x56a594[_0x8c73('0x2d')]));if(_0x366dce['query'][_0x8c73('0x38')]){_0x34a7ca['where']=_[_0x8c73('0x39')](_0x34a7ca[_0x8c73('0x36')],{'$or':_[_0x8c73('0x26')](_0x34a7ca[_0x8c73('0x30')],function(_0x1e62fc){var _0x477b28={};_0x477b28[_0x1e62fc]={'$like':'%'+_0x366dce[_0x8c73('0x2c')][_0x8c73('0x38')]+'%'};return _0x477b28;})});}_0x34a7ca=_[_0x8c73('0x39')]({},_0x34a7ca,_0x366dce[_0x8c73('0x3a')]);return _0x43336c[_0x8c73('0x4e')](_0x34a7ca);}})['then'](function(_0x56889b){if(_0x56889b){_0x487049=_0x56889b[_0x8c73('0x4a')];if(!_0x366dce['query'][_0x8c73('0x32')](_0x8c73('0x33'))){_0x34a7ca['limit']=qs[_0x8c73('0x18')](_0x366dce[_0x8c73('0x2c')][_0x8c73('0x18')]);_0x34a7ca['offset']=qs[_0x8c73('0x16')](_0x366dce['query'][_0x8c73('0x16')]);}return _0x43336c[_0x8c73('0x4e')](_0x34a7ca);}})[_0x8c73('0x20')](function(_0x39c77f){if(_0x39c77f){return _0x39c77f?{'count':_0x487049,'rows':_0x39c77f}:null;}})[_0x8c73('0x20')](respondWithResult(_0x59a26e,null))['catch'](handleError(_0x59a26e,null));};
\ No newline at end of file
+var _0xcb47=['include','find','body','destroy','addConditions','Condition','ids','omit','getConditions','pick','hasOwnProperty','addActions','Action','getActions','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','send','index','map','Automation','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','merge','type','options','includeAll','findAll','rows','catch','show','params'];(function(_0x237097,_0x2f6e40){var _0x1ec864=function(_0x2c6c94){while(--_0x2c6c94){_0x237097['push'](_0x237097['shift']());}};_0x1ec864(++_0x2f6e40);}(_0xcb47,0x1cc));var _0x7cb4=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0xcb47[_0x3ae2b2];return _0x1dbf00;};'use strict';var emlformat=require(_0x7cb4('0x0'));var rimraf=require(_0x7cb4('0x1'));var zipdir=require(_0x7cb4('0x2'));var jsonpatch=require(_0x7cb4('0x3'));var rp=require(_0x7cb4('0x4'));var moment=require('moment');var BPromise=require(_0x7cb4('0x5'));var Mustache=require(_0x7cb4('0x6'));var util=require('util');var path=require(_0x7cb4('0x7'));var sox=require(_0x7cb4('0x8'));var csv=require(_0x7cb4('0x9'));var ejs=require(_0x7cb4('0xa'));var fs=require('fs');var fs_extra=require(_0x7cb4('0xb'));var _=require(_0x7cb4('0xc'));var squel=require(_0x7cb4('0xd'));var crypto=require(_0x7cb4('0xe'));var jsforce=require(_0x7cb4('0xf'));var deskjs=require(_0x7cb4('0x10'));var toCsv=require(_0x7cb4('0x9'));var querystring=require(_0x7cb4('0x11'));var Papa=require(_0x7cb4('0x12'));var Redis=require(_0x7cb4('0x13'));var authService=require(_0x7cb4('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7cb4('0x15'));var hardwareService=require(_0x7cb4('0x16'));var logger=require(_0x7cb4('0x17'))(_0x7cb4('0x18'));var utils=require(_0x7cb4('0x19'));var config=require(_0x7cb4('0x1a'));var licenseUtil=require(_0x7cb4('0x1b'));var db=require(_0x7cb4('0x1c'))['db'];function respondWithStatusCode(_0x562668,_0x143803){_0x143803=_0x143803||0xcc;return function(_0x1e1068){if(_0x1e1068){return _0x562668['sendStatus'](_0x143803);}return _0x562668[_0x7cb4('0x1d')](_0x143803)[_0x7cb4('0x1e')]();};}function respondWithResult(_0x205ff8,_0x3f411e){_0x3f411e=_0x3f411e||0xc8;return function(_0x5d4e4e){if(_0x5d4e4e){return _0x205ff8['status'](_0x3f411e)['json'](_0x5d4e4e);}};}function respondWithFilteredResult(_0x48f799,_0x22c7bc){return function(_0x18ec8d){if(_0x18ec8d){var _0x305ac3=typeof _0x22c7bc[_0x7cb4('0x1f')]==='undefined'&&typeof _0x22c7bc['limit']===_0x7cb4('0x20');var _0xbd2f91=_0x18ec8d[_0x7cb4('0x21')];var _0x2b2eb5=_0x305ac3?0x0:_0x22c7bc[_0x7cb4('0x1f')];var _0x1276d7=_0x305ac3?_0x18ec8d['count']:_0x22c7bc[_0x7cb4('0x1f')]+_0x22c7bc[_0x7cb4('0x22')];var _0x1e93cd;if(_0x1276d7>=_0xbd2f91){_0x1276d7=_0xbd2f91;_0x1e93cd=0xc8;}else{_0x1e93cd=0xce;}_0x48f799[_0x7cb4('0x1d')](_0x1e93cd);return _0x48f799[_0x7cb4('0x23')](_0x7cb4('0x24'),_0x2b2eb5+'-'+_0x1276d7+'/'+_0xbd2f91)[_0x7cb4('0x25')](_0x18ec8d);}return null;};}function patchUpdates(_0x479684){return function(_0x1c276){try{jsonpatch[_0x7cb4('0x26')](_0x1c276,_0x479684,!![]);}catch(_0x3301aa){return BPromise[_0x7cb4('0x27')](_0x3301aa);}return _0x1c276[_0x7cb4('0x28')]();};}function saveUpdates(_0x340923,_0x38a251){return function(_0x37b3cf){if(_0x37b3cf){return _0x37b3cf[_0x7cb4('0x29')](_0x340923)[_0x7cb4('0x2a')](function(_0x2c69cf){return _0x2c69cf;});}return null;};}function removeEntity(_0x4a70cf,_0x4cb69c){return function(_0x1d5337){if(_0x1d5337){return _0x1d5337['destroy']()[_0x7cb4('0x2a')](function(){_0x4a70cf[_0x7cb4('0x1d')](0xcc)[_0x7cb4('0x1e')]();});}};}function handleEntityNotFound(_0x445415,_0x2dd25b){return function(_0x1d1e21){if(!_0x1d1e21){_0x445415[_0x7cb4('0x2b')](0x194);}return _0x1d1e21;};}function handleError(_0xa67c8f,_0x4c782e){_0x4c782e=_0x4c782e||0x1f4;return function(_0x58ee58){logger[_0x7cb4('0x2c')](_0x58ee58['stack']);if(_0x58ee58[_0x7cb4('0x2d')]){delete _0x58ee58['name'];}_0xa67c8f['status'](_0x4c782e)[_0x7cb4('0x2e')](_0x58ee58);};}exports[_0x7cb4('0x2f')]=function(_0xe61bed,_0x163394){var _0x39a695={},_0x581bc4={},_0x323444={'count':0x0,'rows':[]};var _0x28e7e7=_[_0x7cb4('0x30')](db[_0x7cb4('0x31')][_0x7cb4('0x32')],function(_0x474c21){return{'name':_0x474c21[_0x7cb4('0x33')],'type':_0x474c21['type'][_0x7cb4('0x34')]};});_0x581bc4['model']=_[_0x7cb4('0x30')](_0x28e7e7,_0x7cb4('0x2d'));_0x581bc4[_0x7cb4('0x35')]=_[_0x7cb4('0x36')](_0xe61bed[_0x7cb4('0x35')]);_0x581bc4['filters']=_[_0x7cb4('0x37')](_0x581bc4[_0x7cb4('0x38')],_0x581bc4[_0x7cb4('0x35')]);_0x39a695['attributes']=_['intersection'](_0x581bc4[_0x7cb4('0x38')],qs[_0x7cb4('0x39')](_0xe61bed[_0x7cb4('0x35')]['fields']));_0x39a695[_0x7cb4('0x3a')]=_0x39a695[_0x7cb4('0x3a')][_0x7cb4('0x3b')]?_0x39a695['attributes']:_0x581bc4[_0x7cb4('0x38')];if(!_0xe61bed[_0x7cb4('0x35')]['hasOwnProperty'](_0x7cb4('0x3c'))){_0x39a695[_0x7cb4('0x22')]=qs['limit'](_0xe61bed[_0x7cb4('0x35')][_0x7cb4('0x22')]);_0x39a695[_0x7cb4('0x1f')]=qs['offset'](_0xe61bed[_0x7cb4('0x35')][_0x7cb4('0x1f')]);}_0x39a695[_0x7cb4('0x3d')]=qs[_0x7cb4('0x3e')](_0xe61bed['query'][_0x7cb4('0x3e')]);_0x39a695[_0x7cb4('0x3f')]=qs[_0x7cb4('0x40')](_['pick'](_0xe61bed[_0x7cb4('0x35')],_0x581bc4[_0x7cb4('0x40')]),_0x28e7e7);if(_0xe61bed[_0x7cb4('0x35')]['filter']){_0x39a695[_0x7cb4('0x3f')]=_[_0x7cb4('0x41')](_0x39a695['where'],{'$or':_['map'](_0x28e7e7,function(_0x578dce){if(_0x578dce[_0x7cb4('0x42')]!=='VIRTUAL'){var _0x26ceb0={};_0x26ceb0[_0x578dce[_0x7cb4('0x2d')]]={'$like':'%'+_0xe61bed[_0x7cb4('0x35')]['filter']+'%'};return _0x26ceb0;}})});}_0x39a695=_[_0x7cb4('0x41')]({},_0x39a695,_0xe61bed[_0x7cb4('0x43')]);var _0x3c8bf0={'where':_0x39a695[_0x7cb4('0x3f')]};return db[_0x7cb4('0x31')][_0x7cb4('0x21')](_0x3c8bf0)[_0x7cb4('0x2a')](function(_0x416ff7){_0x323444[_0x7cb4('0x21')]=_0x416ff7;if(_0xe61bed[_0x7cb4('0x35')][_0x7cb4('0x44')]){_0x39a695['include']=[{'all':!![]}];}return db[_0x7cb4('0x31')][_0x7cb4('0x45')](_0x39a695);})[_0x7cb4('0x2a')](function(_0x45d167){_0x323444[_0x7cb4('0x46')]=_0x45d167;return _0x323444;})['then'](respondWithFilteredResult(_0x163394,_0x39a695))[_0x7cb4('0x47')](handleError(_0x163394,null));};exports[_0x7cb4('0x48')]=function(_0x20e0ff,_0x2306c5){var _0x4b2e30={'raw':![],'where':{'id':_0x20e0ff[_0x7cb4('0x49')]['id']}},_0x2aaf1f={};_0x2aaf1f[_0x7cb4('0x38')]=_[_0x7cb4('0x36')](db[_0x7cb4('0x31')][_0x7cb4('0x32')]);_0x2aaf1f[_0x7cb4('0x35')]=_['keys'](_0x20e0ff[_0x7cb4('0x35')]);_0x2aaf1f[_0x7cb4('0x40')]=_[_0x7cb4('0x37')](_0x2aaf1f['model'],_0x2aaf1f[_0x7cb4('0x35')]);_0x4b2e30[_0x7cb4('0x3a')]=_[_0x7cb4('0x37')](_0x2aaf1f[_0x7cb4('0x38')],qs['fields'](_0x20e0ff[_0x7cb4('0x35')]['fields']));_0x4b2e30['attributes']=_0x4b2e30[_0x7cb4('0x3a')][_0x7cb4('0x3b')]?_0x4b2e30[_0x7cb4('0x3a')]:_0x2aaf1f['model'];if(_0x20e0ff[_0x7cb4('0x35')][_0x7cb4('0x44')]){_0x4b2e30[_0x7cb4('0x4a')]=[{'all':!![]}];}_0x4b2e30=_[_0x7cb4('0x41')]({},_0x4b2e30,_0x20e0ff['options']);return db[_0x7cb4('0x31')][_0x7cb4('0x4b')](_0x4b2e30)[_0x7cb4('0x2a')](handleEntityNotFound(_0x2306c5,null))[_0x7cb4('0x2a')](respondWithResult(_0x2306c5,null))[_0x7cb4('0x47')](handleError(_0x2306c5,null));};exports['create']=function(_0x22624d,_0x3058c4){return db[_0x7cb4('0x31')]['create'](_0x22624d[_0x7cb4('0x4c')],{})['then'](respondWithResult(_0x3058c4,0xc9))[_0x7cb4('0x47')](handleError(_0x3058c4,null));};exports[_0x7cb4('0x29')]=function(_0x48d1ce,_0x5666c9){if(_0x48d1ce['body']['id']){delete _0x48d1ce['body']['id'];}return db[_0x7cb4('0x31')][_0x7cb4('0x4b')]({'where':{'id':_0x48d1ce[_0x7cb4('0x49')]['id']}})[_0x7cb4('0x2a')](handleEntityNotFound(_0x5666c9,null))[_0x7cb4('0x2a')](saveUpdates(_0x48d1ce[_0x7cb4('0x4c')],null))[_0x7cb4('0x2a')](respondWithResult(_0x5666c9,null))[_0x7cb4('0x47')](handleError(_0x5666c9,null));};exports[_0x7cb4('0x4d')]=function(_0x15ddae,_0x57149a){return db[_0x7cb4('0x31')]['find']({'where':{'id':_0x15ddae[_0x7cb4('0x49')]['id']}})[_0x7cb4('0x2a')](handleEntityNotFound(_0x57149a,null))[_0x7cb4('0x2a')](removeEntity(_0x57149a,null))[_0x7cb4('0x47')](handleError(_0x57149a,null));};exports[_0x7cb4('0x4e')]=function(_0x4c630c,_0x194c56,_0x5c8918){return db[_0x7cb4('0x4f')][_0x7cb4('0x4b')]({'where':{'id':_0x4c630c[_0x7cb4('0x49')]['id']}})[_0x7cb4('0x2a')](handleEntityNotFound(_0x194c56,null))[_0x7cb4('0x2a')](function(_0x4c951a){if(_0x4c951a){return _0x4c951a['addConditions'](_0x4c630c[_0x7cb4('0x4c')][_0x7cb4('0x50')],_[_0x7cb4('0x51')](_0x4c630c[_0x7cb4('0x4c')],['ids','id'])||{});}})[_0x7cb4('0x2a')](respondWithResult(_0x194c56,null))[_0x7cb4('0x47')](handleError(_0x194c56,null));};exports[_0x7cb4('0x52')]=function(_0x180e96,_0x5084d3,_0x52afa5){var _0xab5ba={};var _0x4eb9ff={};var _0x26a3e0;var _0x220e9a;return db[_0x7cb4('0x31')]['findOne']({'where':{'id':_0x180e96[_0x7cb4('0x49')]['id']}})['then'](handleEntityNotFound(_0x5084d3,null))['then'](function(_0x2fb6eb){if(_0x2fb6eb){_0x26a3e0=_0x2fb6eb;_0x4eb9ff[_0x7cb4('0x38')]=_['keys'](db[_0x7cb4('0x4f')]['rawAttributes']);_0x4eb9ff[_0x7cb4('0x35')]=_[_0x7cb4('0x36')](_0x180e96[_0x7cb4('0x35')]);_0x4eb9ff[_0x7cb4('0x40')]=_[_0x7cb4('0x37')](_0x4eb9ff['model'],_0x4eb9ff[_0x7cb4('0x35')]);_0xab5ba[_0x7cb4('0x3a')]=_[_0x7cb4('0x37')](_0x4eb9ff['model'],qs[_0x7cb4('0x39')](_0x180e96[_0x7cb4('0x35')]['fields']));_0xab5ba[_0x7cb4('0x3a')]=_0xab5ba['attributes'][_0x7cb4('0x3b')]?_0xab5ba[_0x7cb4('0x3a')]:_0x4eb9ff['model'];_0xab5ba[_0x7cb4('0x3d')]=qs[_0x7cb4('0x3e')](_0x180e96['query'][_0x7cb4('0x3e')]);_0xab5ba[_0x7cb4('0x3f')]=qs[_0x7cb4('0x40')](_[_0x7cb4('0x53')](_0x180e96[_0x7cb4('0x35')],_0x4eb9ff['filters']));if(_0x180e96[_0x7cb4('0x35')]['filter']){_0xab5ba[_0x7cb4('0x3f')]=_[_0x7cb4('0x41')](_0xab5ba['where'],{'$or':_[_0x7cb4('0x30')](_0xab5ba[_0x7cb4('0x3a')],function(_0x1e91c7){var _0x140c13={};_0x140c13[_0x1e91c7]={'$like':'%'+_0x180e96[_0x7cb4('0x35')]['filter']+'%'};return _0x140c13;})});}_0xab5ba=_['merge']({},_0xab5ba,_0x180e96[_0x7cb4('0x43')]);return _0x26a3e0[_0x7cb4('0x52')](_0xab5ba);}})[_0x7cb4('0x2a')](function(_0x2bf0b3){if(_0x2bf0b3){_0x220e9a=_0x2bf0b3[_0x7cb4('0x3b')];if(!_0x180e96['query'][_0x7cb4('0x54')](_0x7cb4('0x3c'))){_0xab5ba[_0x7cb4('0x22')]=qs[_0x7cb4('0x22')](_0x180e96[_0x7cb4('0x35')][_0x7cb4('0x22')]);_0xab5ba[_0x7cb4('0x1f')]=qs[_0x7cb4('0x1f')](_0x180e96['query'][_0x7cb4('0x1f')]);}return _0x26a3e0[_0x7cb4('0x52')](_0xab5ba);}})[_0x7cb4('0x2a')](function(_0x55e735){if(_0x55e735){return _0x55e735?{'count':_0x220e9a,'rows':_0x55e735}:null;}})['then'](respondWithResult(_0x5084d3,null))[_0x7cb4('0x47')](handleError(_0x5084d3,null));};exports[_0x7cb4('0x55')]=function(_0x5a8b52,_0x6ff886,_0x4c386a){return db[_0x7cb4('0x56')][_0x7cb4('0x4b')]({'where':{'id':_0x5a8b52[_0x7cb4('0x49')]['id']}})[_0x7cb4('0x2a')](handleEntityNotFound(_0x6ff886,null))[_0x7cb4('0x2a')](function(_0x5cb66e){if(_0x5cb66e){return _0x5cb66e[_0x7cb4('0x55')](_0x5a8b52['body']['ids'],_[_0x7cb4('0x51')](_0x5a8b52[_0x7cb4('0x4c')],['ids','id'])||{});}})[_0x7cb4('0x2a')](respondWithResult(_0x6ff886,null))['catch'](handleError(_0x6ff886,null));};exports[_0x7cb4('0x57')]=function(_0x52654d,_0x5988b9,_0x1f5cf8){var _0xb0c4a0={};var _0x192533={};var _0x36f258;var _0x2ed07c;return db[_0x7cb4('0x31')]['findOne']({'where':{'id':_0x52654d[_0x7cb4('0x49')]['id']}})[_0x7cb4('0x2a')](handleEntityNotFound(_0x5988b9,null))[_0x7cb4('0x2a')](function(_0x7f6f5b){if(_0x7f6f5b){_0x36f258=_0x7f6f5b;_0x192533[_0x7cb4('0x38')]=_[_0x7cb4('0x36')](db[_0x7cb4('0x56')][_0x7cb4('0x32')]);_0x192533['query']=_[_0x7cb4('0x36')](_0x52654d['query']);_0x192533[_0x7cb4('0x40')]=_[_0x7cb4('0x37')](_0x192533[_0x7cb4('0x38')],_0x192533[_0x7cb4('0x35')]);_0xb0c4a0[_0x7cb4('0x3a')]=_['intersection'](_0x192533['model'],qs[_0x7cb4('0x39')](_0x52654d[_0x7cb4('0x35')][_0x7cb4('0x39')]));_0xb0c4a0[_0x7cb4('0x3a')]=_0xb0c4a0[_0x7cb4('0x3a')][_0x7cb4('0x3b')]?_0xb0c4a0['attributes']:_0x192533['model'];_0xb0c4a0[_0x7cb4('0x3d')]=qs[_0x7cb4('0x3e')](_0x52654d[_0x7cb4('0x35')][_0x7cb4('0x3e')]);_0xb0c4a0[_0x7cb4('0x3f')]=qs[_0x7cb4('0x40')](_[_0x7cb4('0x53')](_0x52654d[_0x7cb4('0x35')],_0x192533['filters']));if(_0x52654d['query'][_0x7cb4('0x58')]){_0xb0c4a0[_0x7cb4('0x3f')]=_['merge'](_0xb0c4a0['where'],{'$or':_[_0x7cb4('0x30')](_0xb0c4a0[_0x7cb4('0x3a')],function(_0x56cf4d){var _0x3df133={};_0x3df133[_0x56cf4d]={'$like':'%'+_0x52654d[_0x7cb4('0x35')][_0x7cb4('0x58')]+'%'};return _0x3df133;})});}_0xb0c4a0=_[_0x7cb4('0x41')]({},_0xb0c4a0,_0x52654d[_0x7cb4('0x43')]);return _0x36f258[_0x7cb4('0x57')](_0xb0c4a0);}})[_0x7cb4('0x2a')](function(_0x5251bd){if(_0x5251bd){_0x2ed07c=_0x5251bd[_0x7cb4('0x3b')];if(!_0x52654d[_0x7cb4('0x35')][_0x7cb4('0x54')](_0x7cb4('0x3c'))){_0xb0c4a0[_0x7cb4('0x22')]=qs[_0x7cb4('0x22')](_0x52654d[_0x7cb4('0x35')][_0x7cb4('0x22')]);_0xb0c4a0['offset']=qs[_0x7cb4('0x1f')](_0x52654d[_0x7cb4('0x35')][_0x7cb4('0x1f')]);}return _0x36f258['getActions'](_0xb0c4a0);}})[_0x7cb4('0x2a')](function(_0x85b462){if(_0x85b462){return _0x85b462?{'count':_0x2ed07c,'rows':_0x85b462}:null;}})[_0x7cb4('0x2a')](respondWithResult(_0x5988b9,null))[_0x7cb4('0x47')](handleError(_0x5988b9,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 147f4f2..3d481e8 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 _0x9cf2=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./automation.attributes','exports','Automation'];(function(_0x17035c,_0x4128f1){var _0x5adf50=function(_0xa0335c){while(--_0xa0335c){_0x17035c['push'](_0x17035c['shift']());}};_0x5adf50(++_0x4128f1);}(_0x9cf2,0x1bd));var _0x29cf=function(_0x512e16,_0x4f7249){_0x512e16=_0x512e16-0x0;var _0xedb9bd=_0x9cf2[_0x512e16];return _0xedb9bd;};'use strict';var _=require(_0x29cf('0x0'));var util=require(_0x29cf('0x1'));var logger=require(_0x29cf('0x2'))(_0x29cf('0x3'));var moment=require(_0x29cf('0x4'));var BPromise=require(_0x29cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29cf('0x6'));var rimraf=require('rimraf');var config=require(_0x29cf('0x7'));var attributes=require(_0x29cf('0x8'));module[_0x29cf('0x9')]=function(_0x3a7a04,_0x4cc76b){return _0x3a7a04['define'](_0x29cf('0xa'),attributes,{'tableName':_0x29cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb45f=['define','Automation','tools_automations','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x1e5318,_0x1d06a6){var _0x5131de=function(_0x3dd1c9){while(--_0x3dd1c9){_0x1e5318['push'](_0x1e5318['shift']());}};_0x5131de(++_0x1d06a6);}(_0xb45f,0x7b));var _0xfb45=function(_0x3e88d8,_0x3806f0){_0x3e88d8=_0x3e88d8-0x0;var _0x30d1c6=_0xb45f[_0x3e88d8];return _0x30d1c6;};'use strict';var _=require('lodash');var util=require(_0xfb45('0x0'));var logger=require(_0xfb45('0x1'))(_0xfb45('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfb45('0x3'));var fs=require('fs');var path=require(_0xfb45('0x4'));var rimraf=require(_0xfb45('0x5'));var config=require(_0xfb45('0x6'));var attributes=require(_0xfb45('0x7'));module[_0xfb45('0x8')]=function(_0x5dd53d,_0x1683b0){return _0x5dd53d[_0xfb45('0x9')](_0xfb45('0xa'),attributes,{'tableName':_0xfb45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 731a80d..c101185 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 _0xc5b3=['client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0xc5b3[_0x1a0600];return _0x734670;};'use strict';var _=require(_0x3c5b('0x0'));var util=require(_0x3c5b('0x1'));var moment=require(_0x3c5b('0x2'));var BPromise=require(_0x3c5b('0x3'));var rs=require(_0x3c5b('0x4'));var fs=require('fs');var Redis=require(_0x3c5b('0x5'));var db=require(_0x3c5b('0x6'))['db'];var utils=require(_0x3c5b('0x7'));var logger=require('../../config/logger')(_0x3c5b('0x8'));var config=require(_0x3c5b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3c5b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7a363e,_0x4730e9,_0x894f97){return new BPromise(function(_0xae86a0,_0x32586d){return client[_0x3c5b('0xb')](_0x7a363e,_0x894f97)[_0x3c5b('0xc')](function(_0x5f5df9){logger[_0x3c5b('0xd')](_0x3c5b('0xe'),_0x4730e9,_0x3c5b('0xf'));logger[_0x3c5b('0x10')](_0x3c5b('0x11'),_0x4730e9,'request\x20sent',JSON[_0x3c5b('0x12')](_0x5f5df9));if(_0x5f5df9[_0x3c5b('0x13')]){if(_0x5f5df9[_0x3c5b('0x13')][_0x3c5b('0x14')]===0x1f4){logger[_0x3c5b('0x13')](_0x3c5b('0xe'),_0x4730e9,_0x5f5df9[_0x3c5b('0x13')]['message']);return _0x32586d(_0x5f5df9[_0x3c5b('0x13')][_0x3c5b('0x15')]);}logger[_0x3c5b('0x13')](_0x3c5b('0xe'),_0x4730e9,_0x5f5df9['error'][_0x3c5b('0x15')]);return _0xae86a0(_0x5f5df9['error'][_0x3c5b('0x15')]);}else{logger[_0x3c5b('0xd')]('Automation,\x20%s,\x20%s',_0x4730e9,_0x3c5b('0xf'));_0xae86a0(_0x5f5df9[_0x3c5b('0x16')]['message']);}})[_0x3c5b('0x17')](function(_0x1cbe52){logger[_0x3c5b('0x13')]('Automation,\x20%s,\x20%s',_0x4730e9,_0x1cbe52);_0x32586d(_0x1cbe52);});});}
\ No newline at end of file
+var _0x6f75=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0x6f75,0x71));var _0x56f7=function(_0x13efd3,_0x1b4309){_0x13efd3=_0x13efd3-0x0;var _0x5bdca7=_0x6f75[_0x13efd3];return _0x5bdca7;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var moment=require(_0x56f7('0x2'));var BPromise=require(_0x56f7('0x3'));var rs=require(_0x56f7('0x4'));var fs=require('fs');var Redis=require(_0x56f7('0x5'));var db=require(_0x56f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x7'))(_0x56f7('0x8'));var config=require(_0x56f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x137d14,_0xcc51b1,_0x4b5dcc){return new BPromise(function(_0x184bf7,_0x5155ff){return client['request'](_0x137d14,_0x4b5dcc)[_0x56f7('0xa')](function(_0x1e607c){logger[_0x56f7('0xb')](_0x56f7('0xc'),_0xcc51b1,_0x56f7('0xd'));logger[_0x56f7('0xe')](_0x56f7('0xf'),_0xcc51b1,_0x56f7('0xd'),JSON[_0x56f7('0x10')](_0x1e607c));if(_0x1e607c[_0x56f7('0x11')]){if(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x12')]===0x1f4){logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c['error'][_0x56f7('0x13')]);return _0x5155ff(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);return _0x184bf7(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0xcc51b1,_0x56f7('0xd'));_0x184bf7(_0x1e607c[_0x56f7('0x14')][_0x56f7('0x13')]);}})[_0x56f7('0x15')](function(_0x40fb77){logger[_0x56f7('0x11')]('Automation,\x20%s,\x20%s',_0xcc51b1,_0x40fb77);_0x5155ff(_0x40fb77);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 3ab10f4..7642088 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 _0xb2ff=['show','/:id/conditions','post','create','addConditions','/:id/actions','addActions','put','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id'];(function(_0x1c22ac,_0x4c86bd){var _0x4c867a=function(_0x370c7d){while(--_0x370c7d){_0x1c22ac['push'](_0x1c22ac['shift']());}};_0x4c867a(++_0x4c86bd);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2ff[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var path=require('path');var timeout=require(_0xfb2f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfb2f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfb2f('0x4'));var controller=require(_0xfb2f('0x5'));router[_0xfb2f('0x6')]('/',auth[_0xfb2f('0x7')](),controller['index']);router['get'](_0xfb2f('0x8'),auth['isAuthenticated'](),controller[_0xfb2f('0x9')]);router[_0xfb2f('0x6')](_0xfb2f('0xa'),auth[_0xfb2f('0x7')](),controller['getConditions']);router[_0xfb2f('0x6')]('/:id/actions',auth[_0xfb2f('0x7')](),controller['getActions']);router[_0xfb2f('0xb')]('/',auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xc')]);router[_0xfb2f('0xb')](_0xfb2f('0xa'),auth['isAuthenticated'](),controller[_0xfb2f('0xd')]);router[_0xfb2f('0xb')](_0xfb2f('0xe'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0xf')]);router[_0xfb2f('0x10')](_0xfb2f('0x8'),auth[_0xfb2f('0x7')](),controller['update']);router[_0xfb2f('0x11')](_0xfb2f('0x8'),auth[_0xfb2f('0x7')](),controller[_0xfb2f('0x12')]);module[_0xfb2f('0x13')]=router;
\ No newline at end of file
+var _0x0048=['show','/:id/conditions','/:id/actions','post','isAuthenticated','addConditions','addActions','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','index','get','/:id'];(function(_0x1f6128,_0xe9ae3){var _0x5ac79f=function(_0x3066f0){while(--_0x3066f0){_0x1f6128['push'](_0x1f6128['shift']());}};_0x5ac79f(++_0xe9ae3);}(_0x0048,0x129));var _0x8004=function(_0x1ce834,_0x48dac9){_0x1ce834=_0x1ce834-0x0;var _0x248554=_0x0048[_0x1ce834];return _0x248554;};'use strict';var multer=require('multer');var util=require(_0x8004('0x0'));var path=require(_0x8004('0x1'));var timeout=require('connect-timeout');var express=require(_0x8004('0x2'));var router=express[_0x8004('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8004('0x4'));var interaction=require(_0x8004('0x5'));var config=require(_0x8004('0x6'));var controller=require(_0x8004('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8004('0x8')]);router[_0x8004('0x9')](_0x8004('0xa'),auth['isAuthenticated'](),controller[_0x8004('0xb')]);router[_0x8004('0x9')](_0x8004('0xc'),auth['isAuthenticated'](),controller['getConditions']);router['get'](_0x8004('0xd'),auth['isAuthenticated'](),controller['getActions']);router[_0x8004('0xe')]('/',auth[_0x8004('0xf')](),controller['create']);router['post'](_0x8004('0xc'),auth[_0x8004('0xf')](),controller[_0x8004('0x10')]);router[_0x8004('0xe')](_0x8004('0xd'),auth[_0x8004('0xf')](),controller[_0x8004('0x11')]);router['put'](_0x8004('0xa'),auth[_0x8004('0xf')](),controller[_0x8004('0x12')]);router[_0x8004('0x13')](_0x8004('0xa'),auth[_0x8004('0xf')](),controller[_0x8004('0x14')]);module[_0x8004('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 68b0dc8..1cf2dfd 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 _0xef6a=['INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','BOOLEAN'];(function(_0x51d1ae,_0x22ab91){var _0x44959d=function(_0x19f122){while(--_0x19f122){_0x51d1ae['push'](_0x51d1ae['shift']());}};_0x44959d(++_0x22ab91);}(_0xef6a,0x1b8));var _0xaef6=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xef6a[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require('sequelize');module[_0xaef6('0x0')]={'name':{'type':Sequelize[_0xaef6('0x1')],'unique':_0xaef6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xaef6('0x1')]},'active':{'type':Sequelize[_0xaef6('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xaef6('0x4')](0x4)[_0xaef6('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xaef6('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xaef6('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xaef6('0x4')](0x3)[_0xaef6('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaef6('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaef6('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xaef6('0x4')](0x5)[_0xaef6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaef6('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xaef6('0x4')](0x5)[_0xaef6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaef6('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xaef6('0x4')](0x3)[_0xaef6('0x5')],'defaultValue':0x3,'comment':_0xaef6('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xaef6('0x4')](0x3)[_0xaef6('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xaef6('0xc')},'dialTimezone':{'type':Sequelize[_0xaef6('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xaef6('0x1')],'defaultValue':_0xaef6('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xaef6('0xe')](_0xaef6('0xf'),'never',_0xaef6('0x10')),'defaultValue':_0xaef6('0xf')},'dialAMDActive':{'type':Sequelize[_0xaef6('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xaef6('0x4')](0x9)[_0xaef6('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xaef6('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xaef6('0x4')](0x9)[_0xaef6('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xaef6('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xaef6('0x4')](0x9)[_0xaef6('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xaef6('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xaef6('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaef6('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xaef6('0x4')](0x9)[_0xaef6('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xaef6('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xaef6('0x4')](0x9)[_0xaef6('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xaef6('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xaef6('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xaef6('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xaef6('0x4')](0x5)[_0xaef6('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xaef6('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xaef6('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xaef6('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xaef6('0xe')](_0xaef6('0x1a'),_0xaef6('0x1b')),'defaultValue':_0xaef6('0x1a')},'dialPrefix':{'type':Sequelize[_0xaef6('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xaef6('0x1c')},'dialCutDigit':{'type':Sequelize[_0xaef6('0x4')](0x3)[_0xaef6('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xaef6('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xaef6('0x4')](0x3)[_0xaef6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xaef6('0x4')](0x5)[_0xaef6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaef6('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xaef6('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xaef6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaef6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xaef6('0x4')](0x3)[_0xaef6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaef6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xaef6('0x4')](0x5)[_0xaef6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaef6('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xaef6('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaef6('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xaef6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xaef6('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xaef6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xaef6('0x24')}};
\ No newline at end of file
+var _0xf19d=['BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr'];(function(_0xe79d9f,_0x15231d){var _0x5c77fa=function(_0x40a65a){while(--_0x40a65a){_0xe79d9f['push'](_0xe79d9f['shift']());}};_0x5c77fa(++_0x15231d);}(_0xf19d,0x1b7));var _0xdf19=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xf19d[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require(_0xdf19('0x0'));module[_0xdf19('0x1')]={'name':{'type':Sequelize[_0xdf19('0x2')],'unique':_0xdf19('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdf19('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xdf19('0x2')]},'active':{'type':Sequelize[_0xdf19('0x5')],'defaultValue':0x0,'comment':_0xdf19('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xdf19('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdf19('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdf19('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdf19('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdf19('0x9')](0x3)[_0xdf19('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)[_0xdf19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdf19('0x9')](0x5)[_0xdf19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf19('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdf19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf19('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)[_0xdf19('0x7')],'defaultValue':0x3,'comment':_0xdf19('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdf19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)[_0xdf19('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdf19('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdf19('0x2')],'defaultValue':_0xdf19('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xdf19('0xf')](_0xdf19('0x10'),_0xdf19('0x11'),_0xdf19('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xdf19('0x5')],'defaultValue':0x0,'comment':_0xdf19('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xdf19('0x9')](0x9)[_0xdf19('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdf19('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xdf19('0x9')](0x9)[_0xdf19('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdf19('0x9')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdf19('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xdf19('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdf19('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xdf19('0x9')](0x9)[_0xdf19('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdf19('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdf19('0x9')](0x9)[_0xdf19('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdf19('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdf19('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdf19('0x9')](0x9)[_0xdf19('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdf19('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xdf19('0x1b'),'ASC'),'defaultValue':_0xdf19('0x1b')},'dialPrefix':{'type':Sequelize[_0xdf19('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xdf19('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xdf19('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdf19('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)[_0xdf19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdf19('0x9')](0x5)[_0xdf19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf19('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)[_0xdf19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf19('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdf19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)[_0xdf19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf19('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdf19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf19('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)[_0xdf19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf19('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf19('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdf19('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdf19('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdf19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdf19('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index cf86145..9db74c8 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 _0x39d0=['into','cm_hopper','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','cm_hopper_additional_phones','cmHopperId','h.id','OrderBy','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','undefined','limit','offset','Content-Range','reject','update','then','get','IvrCampaigns','destroy','error','stack','name','send','index','map','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','Campaign','count','includeAll','include','catch','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','updatedAt','createdAt','UserProfileResource','getHoppers','CmHopper','CampaignId','rows','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','findOne','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','always','insert'];(function(_0x131162,_0x4c2814){var _0x45285d=function(_0x19fb1f){while(--_0x19fb1f){_0x131162['push'](_0x131162['shift']());}};_0x45285d(++_0x4c2814);}(_0x39d0,0x144));var _0x039d=function(_0x4835fc,_0x53ffb5){_0x4835fc=_0x4835fc-0x0;var _0x295770=_0x39d0[_0x4835fc];return _0x295770;};'use strict';var emlformat=require(_0x039d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x039d('0x1'));var rp=require(_0x039d('0x2'));var moment=require(_0x039d('0x3'));var BPromise=require(_0x039d('0x4'));var Mustache=require(_0x039d('0x5'));var util=require('util');var path=require(_0x039d('0x6'));var sox=require(_0x039d('0x7'));var csv=require(_0x039d('0x8'));var ejs=require(_0x039d('0x9'));var fs=require('fs');var fs_extra=require(_0x039d('0xa'));var _=require(_0x039d('0xb'));var squel=require(_0x039d('0xc'));var crypto=require(_0x039d('0xd'));var jsforce=require(_0x039d('0xe'));var deskjs=require(_0x039d('0xf'));var toCsv=require(_0x039d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x039d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x039d('0x11'));var as=require(_0x039d('0x12'));var hardwareService=require(_0x039d('0x13'));var logger=require(_0x039d('0x14'))('api');var utils=require(_0x039d('0x15'));var config=require(_0x039d('0x16'));var licenseUtil=require(_0x039d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9930eb,_0x111f41){_0x111f41=_0x111f41||0xcc;return function(_0x24de67){if(_0x24de67){return _0x9930eb[_0x039d('0x18')](_0x111f41);}return _0x9930eb[_0x039d('0x19')](_0x111f41)[_0x039d('0x1a')]();};}function respondWithResult(_0x3147c0,_0x54cf8e){_0x54cf8e=_0x54cf8e||0xc8;return function(_0x4dc3a4){if(_0x4dc3a4){return _0x3147c0[_0x039d('0x19')](_0x54cf8e)[_0x039d('0x1b')](_0x4dc3a4);}};}function respondWithFilteredResult(_0x33e289,_0x138193){return function(_0x24c16f){if(_0x24c16f){var _0x330966=typeof _0x138193['offset']===_0x039d('0x1c')&&typeof _0x138193[_0x039d('0x1d')]===_0x039d('0x1c');var _0x4dfc0c=_0x24c16f['count'];var _0xaedb24=_0x330966?0x0:_0x138193[_0x039d('0x1e')];var _0x360233=_0x330966?_0x24c16f['count']:_0x138193['offset']+_0x138193[_0x039d('0x1d')];var _0x37ff76;if(_0x360233>=_0x4dfc0c){_0x360233=_0x4dfc0c;_0x37ff76=0xc8;}else{_0x37ff76=0xce;}_0x33e289['status'](_0x37ff76);return _0x33e289['set'](_0x039d('0x1f'),_0xaedb24+'-'+_0x360233+'/'+_0x4dfc0c)['json'](_0x24c16f);}return null;};}function patchUpdates(_0x2a8602){return function(_0x1e526e){try{jsonpatch['apply'](_0x1e526e,_0x2a8602,!![]);}catch(_0x2e33e1){return BPromise[_0x039d('0x20')](_0x2e33e1);}return _0x1e526e['save']();};}function saveUpdates(_0x6e1cb9,_0x15dcaa){return function(_0xd5c776){if(_0xd5c776){return _0xd5c776[_0x039d('0x21')](_0x6e1cb9)[_0x039d('0x22')](function(_0x5b9ade){return _0x5b9ade;});}return null;};}function removeEntity(_0x2f21b7,_0x7e230f){return function(_0x15b103){if(_0x15b103){return _0x15b103['destroy']()[_0x039d('0x22')](function(){var _0x4a3177=_0x15b103[_0x039d('0x23')]({'plain':!![]});var _0x109b2b=_0x039d('0x24');return db['UserProfileResource'][_0x039d('0x25')]({'where':{'type':_0x109b2b,'resourceId':_0x4a3177['id']}})[_0x039d('0x22')](function(){return _0x15b103;});})[_0x039d('0x22')](function(){_0x2f21b7[_0x039d('0x19')](0xcc)[_0x039d('0x1a')]();});}};}function handleEntityNotFound(_0x1ef877,_0x3ad778){return function(_0x170e34){if(!_0x170e34){_0x1ef877[_0x039d('0x18')](0x194);}return _0x170e34;};}function handleError(_0x9da588,_0x33f704){_0x33f704=_0x33f704||0x1f4;return function(_0x38ff1e){logger[_0x039d('0x26')](_0x38ff1e[_0x039d('0x27')]);if(_0x38ff1e[_0x039d('0x28')]){delete _0x38ff1e[_0x039d('0x28')];}_0x9da588[_0x039d('0x19')](_0x33f704)[_0x039d('0x29')](_0x38ff1e);};}exports[_0x039d('0x2a')]=function(_0xf477c5,_0x1f89a5){var _0xf074d8={},_0xf32a01={},_0x2eef2b={'count':0x0,'rows':[]};var _0x1babe4=_[_0x039d('0x2b')](db['Campaign']['rawAttributes'],function(_0x12ee85){return{'name':_0x12ee85['fieldName'],'type':_0x12ee85['type'][_0x039d('0x2c')]};});_0xf32a01[_0x039d('0x2d')]=_[_0x039d('0x2b')](_0x1babe4,_0x039d('0x28'));_0xf32a01[_0x039d('0x2e')]=_[_0x039d('0x2f')](_0xf477c5['query']);_0xf32a01['filters']=_[_0x039d('0x30')](_0xf32a01[_0x039d('0x2d')],_0xf32a01['query']);_0xf074d8[_0x039d('0x31')]=_[_0x039d('0x30')](_0xf32a01['model'],qs[_0x039d('0x32')](_0xf477c5[_0x039d('0x2e')][_0x039d('0x32')]));_0xf074d8[_0x039d('0x31')]=_0xf074d8['attributes']['length']?_0xf074d8[_0x039d('0x31')]:_0xf32a01[_0x039d('0x2d')];if(!_0xf477c5[_0x039d('0x2e')][_0x039d('0x33')](_0x039d('0x34'))){_0xf074d8['limit']=qs[_0x039d('0x1d')](_0xf477c5[_0x039d('0x2e')][_0x039d('0x1d')]);_0xf074d8[_0x039d('0x1e')]=qs[_0x039d('0x1e')](_0xf477c5['query'][_0x039d('0x1e')]);}_0xf074d8[_0x039d('0x35')]=qs[_0x039d('0x36')](_0xf477c5['query'][_0x039d('0x36')]);_0xf074d8[_0x039d('0x37')]=qs[_0x039d('0x38')](_[_0x039d('0x39')](_0xf477c5['query'],_0xf32a01[_0x039d('0x38')]),_0x1babe4);if(_0xf477c5[_0x039d('0x2e')][_0x039d('0x3a')]){_0xf074d8[_0x039d('0x37')]=_['merge'](_0xf074d8['where'],{'$or':_[_0x039d('0x2b')](_0x1babe4,function(_0x1b83ba){if(_0x1b83ba[_0x039d('0x3b')]!==_0x039d('0x3c')){var _0xbb1a62={};_0xbb1a62[_0x1b83ba['name']]={'$like':'%'+_0xf477c5[_0x039d('0x2e')]['filter']+'%'};return _0xbb1a62;}})});}_0xf074d8=_[_0x039d('0x3d')]({},_0xf074d8,_0xf477c5['options']);var _0x40df67={'where':_0xf074d8[_0x039d('0x37')]};return db[_0x039d('0x3e')][_0x039d('0x3f')](_0x40df67)['then'](function(_0x397d9e){_0x2eef2b[_0x039d('0x3f')]=_0x397d9e;if(_0xf477c5['query'][_0x039d('0x40')]){_0xf074d8[_0x039d('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0xf074d8);})[_0x039d('0x22')](function(_0x4485dc){_0x2eef2b['rows']=_0x4485dc;return _0x2eef2b;})[_0x039d('0x22')](respondWithFilteredResult(_0x1f89a5,_0xf074d8))[_0x039d('0x42')](handleError(_0x1f89a5,null));};exports[_0x039d('0x43')]=function(_0x13e74c,_0x3c39ec){var _0x35da4d={'raw':![],'where':{'id':_0x13e74c[_0x039d('0x44')]['id']}},_0x18f09e={};_0x18f09e['model']=_['keys'](db['Campaign'][_0x039d('0x45')]);_0x18f09e[_0x039d('0x2e')]=_['keys'](_0x13e74c[_0x039d('0x2e')]);_0x18f09e[_0x039d('0x38')]=_[_0x039d('0x30')](_0x18f09e[_0x039d('0x2d')],_0x18f09e[_0x039d('0x2e')]);_0x35da4d['attributes']=_[_0x039d('0x30')](_0x18f09e[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x13e74c[_0x039d('0x2e')]['fields']));_0x35da4d[_0x039d('0x31')]=_0x35da4d[_0x039d('0x31')]['length']?_0x35da4d['attributes']:_0x18f09e['model'];if(_0x13e74c[_0x039d('0x2e')]['includeAll']){_0x35da4d[_0x039d('0x41')]=[{'all':!![]}];}_0x35da4d=_[_0x039d('0x3d')]({},_0x35da4d,_0x13e74c[_0x039d('0x46')]);return db[_0x039d('0x3e')]['find'](_0x35da4d)[_0x039d('0x22')](handleEntityNotFound(_0x3c39ec,null))[_0x039d('0x22')](respondWithResult(_0x3c39ec,null))[_0x039d('0x42')](handleError(_0x3c39ec,null));};exports['create']=function(_0x207835,_0x763622){return db[_0x039d('0x3e')][_0x039d('0x47')](_0x207835[_0x039d('0x48')],{})[_0x039d('0x22')](function(_0x11642b){var _0x1efc9e=_0x207835[_0x039d('0x49')]['get']({'plain':!![]});if(!_0x1efc9e)throw new Error(_0x039d('0x4a'));if(_0x1efc9e[_0x039d('0x4b')]===_0x039d('0x49')){var _0x6a7798=_0x11642b[_0x039d('0x23')]({'plain':!![]});var _0x43c3f5=_0x039d('0x24');return db[_0x039d('0x4c')][_0x039d('0x4d')]({'where':{'name':_0x43c3f5,'userProfileId':_0x1efc9e['userProfileId']},'raw':!![]})[_0x039d('0x22')](function(_0x4f6323){if(_0x4f6323&&_0x4f6323[_0x039d('0x4e')]===0x0){return db['UserProfileResource'][_0x039d('0x47')]({'name':_0x6a7798[_0x039d('0x28')],'resourceId':_0x6a7798['id'],'type':_0x4f6323['name'],'sectionId':_0x4f6323['id']},{})['then'](function(){return _0x11642b;});}else{return _0x11642b;}})[_0x039d('0x42')](function(_0x226628){logger[_0x039d('0x26')](_0x039d('0x4f'),_0x226628);throw _0x226628;});}return _0x11642b;})[_0x039d('0x22')](respondWithResult(_0x763622,0xc9))['catch'](handleError(_0x763622,null));};exports['clone']=function(_0x482c77,_0x3613a5){var _0x56834c={'where':{'id':_0x482c77['params']['id']}},_0x45cd5b={};_0x45cd5b[_0x039d('0x2d')]=_[_0x039d('0x2f')](db['Campaign'][_0x039d('0x45')]);_0x56834c[_0x039d('0x31')]=_['intersection'](_0x45cd5b[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x482c77[_0x039d('0x2e')][_0x039d('0x32')]));_0x56834c[_0x039d('0x31')]=_0x56834c[_0x039d('0x31')][_0x039d('0x50')]?_0x56834c[_0x039d('0x31')]:_0x45cd5b[_0x039d('0x2d')];if(_0x482c77[_0x039d('0x2e')][_0x039d('0x40')]){_0x56834c[_0x039d('0x41')]=[{'all':!![]}];}_0x56834c=_['merge']({},_0x56834c,_0x482c77[_0x039d('0x46')]);return db[_0x039d('0x3e')][_0x039d('0x4d')](_0x56834c)[_0x039d('0x22')](handleEntityNotFound(_0x3613a5,null))[_0x039d('0x22')](function(_0x56b61c){if(_0x56b61c){var _0x4f8559=_0x56b61c[_0x039d('0x23')]({'plain':!![]});_0x4f8559=qs['omit'](_0x4f8559,['id','createdAt',_0x039d('0x51')]);_0x482c77[_0x039d('0x48')]=_['omit'](_0x482c77[_0x039d('0x48')],['id',_0x039d('0x52'),'updatedAt']);return db[_0x039d('0x3e')][_0x039d('0x47')](_[_0x039d('0x3d')](_0x4f8559,_0x482c77['body']),{'include':_0x482c77[_0x039d('0x2e')][_0x039d('0x40')]?[{'all':!![]}]:undefined})[_0x039d('0x22')](function(_0x4729dc){var _0x536bce=_0x482c77['user'][_0x039d('0x23')]({'plain':!![]});if(!_0x536bce)throw new Error(_0x039d('0x4a'));if(_0x536bce[_0x039d('0x4b')]===_0x039d('0x49')){var _0x44ab8a=_0x4729dc[_0x039d('0x23')]({'plain':!![]});var _0x5b3083=_0x039d('0x24');return db[_0x039d('0x4c')][_0x039d('0x4d')]({'where':{'name':_0x5b3083,'userProfileId':_0x536bce['userProfileId']},'raw':!![]})[_0x039d('0x22')](function(_0x14ed0f){if(_0x14ed0f&&_0x14ed0f[_0x039d('0x4e')]===0x0){return db[_0x039d('0x53')][_0x039d('0x47')]({'name':_0x44ab8a[_0x039d('0x28')],'resourceId':_0x44ab8a['id'],'type':_0x14ed0f['name'],'sectionId':_0x14ed0f['id']},{})[_0x039d('0x22')](function(){return _0x4729dc;});}else{return _0x4729dc;}})['catch'](function(_0x5c29b0){logger[_0x039d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c29b0);throw _0x5c29b0;});}return _0x4729dc;});}})[_0x039d('0x22')](respondWithResult(_0x3613a5,0xc9))[_0x039d('0x42')](handleError(_0x3613a5,null));};exports['update']=function(_0x338a03,_0x2fbf5f){if(_0x338a03['body']['id']){delete _0x338a03[_0x039d('0x48')]['id'];}return db['Campaign'][_0x039d('0x4d')]({'where':{'id':_0x338a03[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x2fbf5f,null))[_0x039d('0x22')](saveUpdates(_0x338a03[_0x039d('0x48')],null))[_0x039d('0x22')](respondWithResult(_0x2fbf5f,null))[_0x039d('0x42')](handleError(_0x2fbf5f,null));};exports[_0x039d('0x25')]=function(_0x2eeb5d,_0x3f8fc2){return db['Campaign'][_0x039d('0x4d')]({'where':{'id':_0x2eeb5d[_0x039d('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f8fc2,null))[_0x039d('0x22')](removeEntity(_0x3f8fc2,null))[_0x039d('0x42')](handleError(_0x3f8fc2,null));};exports[_0x039d('0x54')]=function(_0x3de906,_0xb8c3a0,_0x345e23){var _0x6bfc15={'raw':!![],'where':{}};var _0x4256a8={};var _0x12d02c={'count':0x0,'rows':[]};return db[_0x039d('0x3e')]['findOne']({'where':{'id':_0x3de906[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0xb8c3a0,null))[_0x039d('0x22')](function(_0x2304b3){if(_0x2304b3){_0x4256a8[_0x039d('0x2d')]=_[_0x039d('0x2f')](db[_0x039d('0x55')]['rawAttributes']);_0x4256a8[_0x039d('0x2e')]=_['keys'](_0x3de906[_0x039d('0x2e')]);_0x4256a8['filters']=_['intersection'](_0x4256a8[_0x039d('0x2d')],_0x4256a8[_0x039d('0x2e')]);_0x6bfc15[_0x039d('0x31')]=_['intersection'](_0x4256a8[_0x039d('0x2d')],qs['fields'](_0x3de906['query'][_0x039d('0x32')]));_0x6bfc15[_0x039d('0x31')]=_0x6bfc15['attributes'][_0x039d('0x50')]?_0x6bfc15['attributes']:_0x4256a8[_0x039d('0x2d')];if(!_0x3de906[_0x039d('0x2e')]['hasOwnProperty'](_0x039d('0x34'))){_0x6bfc15[_0x039d('0x1d')]=qs['limit'](_0x3de906[_0x039d('0x2e')][_0x039d('0x1d')]);_0x6bfc15['offset']=qs[_0x039d('0x1e')](_0x3de906[_0x039d('0x2e')][_0x039d('0x1e')]);}_0x6bfc15['order']=qs['sort'](_0x3de906[_0x039d('0x2e')][_0x039d('0x36')]);_0x6bfc15[_0x039d('0x37')]=qs[_0x039d('0x38')](_[_0x039d('0x39')](_0x3de906[_0x039d('0x2e')],_0x4256a8[_0x039d('0x38')]));_0x6bfc15[_0x039d('0x37')][_0x039d('0x56')]=_0x2304b3['id'];if(_0x3de906[_0x039d('0x2e')]['filter']){_0x6bfc15[_0x039d('0x37')]=_[_0x039d('0x3d')](_0x6bfc15['where'],{'$or':_['map'](_0x6bfc15[_0x039d('0x31')],function(_0x2dc97f){var _0x3172e0={};_0x3172e0[_0x2dc97f]={'$like':'%'+_0x3de906[_0x039d('0x2e')][_0x039d('0x3a')]+'%'};return _0x3172e0;})});}_0x6bfc15=_[_0x039d('0x3d')]({},_0x6bfc15,_0x3de906[_0x039d('0x46')]);return db[_0x039d('0x55')][_0x039d('0x3f')]({'where':_0x6bfc15[_0x039d('0x37')]})[_0x039d('0x22')](function(_0x298786){_0x12d02c[_0x039d('0x3f')]=_0x298786;if(_0x3de906['query']['includeAll']){_0x6bfc15[_0x039d('0x41')]=[{'all':!![]}];}return db[_0x039d('0x55')]['findAll'](_0x6bfc15);})[_0x039d('0x22')](function(_0x4c7d3e){_0x12d02c[_0x039d('0x57')]=_0x4c7d3e;return _0x12d02c;});}})[_0x039d('0x22')](respondWithFilteredResult(_0xb8c3a0,_0x6bfc15))[_0x039d('0x42')](handleError(_0xb8c3a0,null));};exports['getHopperHistories']=function(_0x4bbefe,_0x285da7,_0x5595a0){var _0x322b44={'raw':!![],'where':{}};var _0x5e451b={};var _0x102d68={'count':0x0,'rows':[]};return db[_0x039d('0x3e')]['findOne']({'where':{'id':_0x4bbefe[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x285da7,null))[_0x039d('0x22')](function(_0x3c95ea){if(_0x3c95ea){_0x5e451b['model']=_[_0x039d('0x2f')](db[_0x039d('0x58')][_0x039d('0x45')]);_0x5e451b[_0x039d('0x2e')]=_[_0x039d('0x2f')](_0x4bbefe[_0x039d('0x2e')]);_0x5e451b[_0x039d('0x38')]=_[_0x039d('0x30')](_0x5e451b[_0x039d('0x2d')],_0x5e451b[_0x039d('0x2e')]);_0x322b44[_0x039d('0x31')]=_['intersection'](_0x5e451b[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x4bbefe[_0x039d('0x2e')][_0x039d('0x32')]));_0x322b44[_0x039d('0x31')]=_0x322b44[_0x039d('0x31')]['length']?_0x322b44[_0x039d('0x31')]:_0x5e451b['model'];if(!_0x4bbefe['query']['hasOwnProperty'](_0x039d('0x34'))){_0x322b44[_0x039d('0x1d')]=qs[_0x039d('0x1d')](_0x4bbefe[_0x039d('0x2e')][_0x039d('0x1d')]);_0x322b44[_0x039d('0x1e')]=qs[_0x039d('0x1e')](_0x4bbefe['query'][_0x039d('0x1e')]);}_0x322b44[_0x039d('0x35')]=qs['sort'](_0x4bbefe[_0x039d('0x2e')][_0x039d('0x36')]);_0x322b44[_0x039d('0x37')]=qs['filters'](_['pick'](_0x4bbefe[_0x039d('0x2e')],_0x5e451b[_0x039d('0x38')]));_0x322b44[_0x039d('0x37')]['CampaignId']=_0x3c95ea['id'];if(_0x4bbefe[_0x039d('0x2e')][_0x039d('0x3a')]){_0x322b44[_0x039d('0x37')]=_[_0x039d('0x3d')](_0x322b44[_0x039d('0x37')],{'$or':_[_0x039d('0x2b')](_0x322b44[_0x039d('0x31')],function(_0x1d42c8){var _0x3a6bb4={};_0x3a6bb4[_0x1d42c8]={'$like':'%'+_0x4bbefe[_0x039d('0x2e')][_0x039d('0x3a')]+'%'};return _0x3a6bb4;})});}_0x322b44=_[_0x039d('0x3d')]({},_0x322b44,_0x4bbefe[_0x039d('0x46')]);return db[_0x039d('0x58')][_0x039d('0x3f')]({'where':_0x322b44[_0x039d('0x37')]})[_0x039d('0x22')](function(_0x2d7e97){_0x102d68[_0x039d('0x3f')]=_0x2d7e97;if(_0x4bbefe[_0x039d('0x2e')][_0x039d('0x40')]){_0x322b44[_0x039d('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x039d('0x59')](_0x322b44);})[_0x039d('0x22')](function(_0x3f8be2){_0x102d68['rows']=_0x3f8be2;return _0x102d68;});}})[_0x039d('0x22')](respondWithFilteredResult(_0x285da7,_0x322b44))[_0x039d('0x42')](handleError(_0x285da7,null));};exports[_0x039d('0x5a')]=function(_0x52666f,_0x107679,_0x2c03ab){var _0x17200c={'raw':!![],'where':{}};var _0x5e1b33={};var _0x2c1982={'count':0x0,'rows':[]};return db[_0x039d('0x3e')]['findOne']({'where':{'id':_0x52666f[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x107679,null))[_0x039d('0x22')](function(_0x46c177){if(_0x46c177){_0x5e1b33[_0x039d('0x2d')]=_[_0x039d('0x2f')](db[_0x039d('0x5b')][_0x039d('0x45')]);_0x5e1b33[_0x039d('0x2e')]=_['keys'](_0x52666f[_0x039d('0x2e')]);_0x5e1b33[_0x039d('0x38')]=_['intersection'](_0x5e1b33[_0x039d('0x2d')],_0x5e1b33['query']);_0x17200c[_0x039d('0x31')]=_[_0x039d('0x30')](_0x5e1b33[_0x039d('0x2d')],qs['fields'](_0x52666f[_0x039d('0x2e')][_0x039d('0x32')]));_0x17200c['attributes']=_0x17200c[_0x039d('0x31')]['length']?_0x17200c[_0x039d('0x31')]:_0x5e1b33[_0x039d('0x2d')];if(!_0x52666f[_0x039d('0x2e')][_0x039d('0x33')]('nolimit')){_0x17200c[_0x039d('0x1d')]=qs[_0x039d('0x1d')](_0x52666f[_0x039d('0x2e')][_0x039d('0x1d')]);_0x17200c[_0x039d('0x1e')]=qs[_0x039d('0x1e')](_0x52666f['query'][_0x039d('0x1e')]);}_0x17200c[_0x039d('0x35')]=qs[_0x039d('0x36')](_0x52666f[_0x039d('0x2e')][_0x039d('0x36')]);_0x17200c[_0x039d('0x37')]=qs[_0x039d('0x38')](_[_0x039d('0x39')](_0x52666f[_0x039d('0x2e')],_0x5e1b33[_0x039d('0x38')]));_0x17200c[_0x039d('0x37')][_0x039d('0x56')]=_0x46c177['id'];if(_0x52666f[_0x039d('0x2e')][_0x039d('0x3a')]){_0x17200c[_0x039d('0x37')]=_[_0x039d('0x3d')](_0x17200c['where'],{'$or':_[_0x039d('0x2b')](_0x17200c['attributes'],function(_0x1e4942){var _0x266096={};_0x266096[_0x1e4942]={'$like':'%'+_0x52666f[_0x039d('0x2e')][_0x039d('0x3a')]+'%'};return _0x266096;})});}_0x17200c=_[_0x039d('0x3d')]({},_0x17200c,_0x52666f[_0x039d('0x46')]);return db['CmHopperFinal'][_0x039d('0x3f')]({'where':_0x17200c[_0x039d('0x37')]})[_0x039d('0x22')](function(_0x281c42){_0x2c1982[_0x039d('0x3f')]=_0x281c42;if(_0x52666f[_0x039d('0x2e')][_0x039d('0x40')]){_0x17200c[_0x039d('0x41')]=[{'all':!![]}];}return db[_0x039d('0x5b')][_0x039d('0x59')](_0x17200c);})[_0x039d('0x22')](function(_0x1a3fb6){_0x2c1982['rows']=_0x1a3fb6;return _0x2c1982;});}})[_0x039d('0x22')](respondWithFilteredResult(_0x107679,_0x17200c))[_0x039d('0x42')](handleError(_0x107679,null));};exports['getHopperBlacks']=function(_0x3f8cc3,_0x5d4328,_0x47b3f2){var _0x2468c8={'raw':!![],'where':{}};var _0x402091={};var _0x393145={'count':0x0,'rows':[]};return db[_0x039d('0x3e')][_0x039d('0x5c')]({'where':{'id':_0x3f8cc3[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x5d4328,null))[_0x039d('0x22')](function(_0x3239b8){if(_0x3239b8){_0x402091[_0x039d('0x2d')]=_['keys'](db[_0x039d('0x5d')][_0x039d('0x45')]);_0x402091[_0x039d('0x2e')]=_[_0x039d('0x2f')](_0x3f8cc3[_0x039d('0x2e')]);_0x402091[_0x039d('0x38')]=_[_0x039d('0x30')](_0x402091[_0x039d('0x2d')],_0x402091[_0x039d('0x2e')]);_0x2468c8[_0x039d('0x31')]=_[_0x039d('0x30')](_0x402091[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x3f8cc3[_0x039d('0x2e')][_0x039d('0x32')]));_0x2468c8[_0x039d('0x31')]=_0x2468c8['attributes']['length']?_0x2468c8[_0x039d('0x31')]:_0x402091[_0x039d('0x2d')];if(!_0x3f8cc3[_0x039d('0x2e')][_0x039d('0x33')](_0x039d('0x34'))){_0x2468c8[_0x039d('0x1d')]=qs[_0x039d('0x1d')](_0x3f8cc3[_0x039d('0x2e')][_0x039d('0x1d')]);_0x2468c8[_0x039d('0x1e')]=qs[_0x039d('0x1e')](_0x3f8cc3[_0x039d('0x2e')][_0x039d('0x1e')]);}_0x2468c8[_0x039d('0x35')]=qs[_0x039d('0x36')](_0x3f8cc3[_0x039d('0x2e')][_0x039d('0x36')]);_0x2468c8[_0x039d('0x37')]=qs['filters'](_[_0x039d('0x39')](_0x3f8cc3[_0x039d('0x2e')],_0x402091['filters']));_0x2468c8[_0x039d('0x37')]['CampaignId']=_0x3239b8['id'];if(_0x3f8cc3[_0x039d('0x2e')][_0x039d('0x3a')]){_0x2468c8[_0x039d('0x37')]=_[_0x039d('0x3d')](_0x2468c8['where'],{'$or':_['map'](_0x2468c8[_0x039d('0x31')],function(_0x1558c3){var _0x483097={};_0x483097[_0x1558c3]={'$like':'%'+_0x3f8cc3[_0x039d('0x2e')][_0x039d('0x3a')]+'%'};return _0x483097;})});}_0x2468c8=_[_0x039d('0x3d')]({},_0x2468c8,_0x3f8cc3[_0x039d('0x46')]);return db[_0x039d('0x5d')][_0x039d('0x3f')]({'where':_0x2468c8['where']})[_0x039d('0x22')](function(_0x3cd9ff){_0x393145[_0x039d('0x3f')]=_0x3cd9ff;if(_0x3f8cc3[_0x039d('0x2e')][_0x039d('0x40')]){_0x2468c8[_0x039d('0x41')]=[{'all':!![]}];}return db[_0x039d('0x5d')]['findAll'](_0x2468c8);})['then'](function(_0x4021f0){_0x393145[_0x039d('0x57')]=_0x4021f0;return _0x393145;});}})[_0x039d('0x22')](respondWithFilteredResult(_0x5d4328,_0x2468c8))['catch'](handleError(_0x5d4328,null));};exports[_0x039d('0x5e')]=function(_0x601405,_0x40aa7b,_0xe171e9){var _0x75447b={};var _0x1f6425={};var _0x4f81a1;var _0x10de9f;return db['Campaign']['findOne']({'where':{'id':_0x601405['params']['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x40aa7b,null))[_0x039d('0x22')](function(_0x2206f3){if(_0x2206f3){_0x4f81a1=_0x2206f3;_0x1f6425['model']=_[_0x039d('0x2f')](db[_0x039d('0x5f')][_0x039d('0x45')]);_0x1f6425['query']=_['keys'](_0x601405[_0x039d('0x2e')]);_0x1f6425[_0x039d('0x38')]=_[_0x039d('0x30')](_0x1f6425[_0x039d('0x2d')],_0x1f6425[_0x039d('0x2e')]);_0x75447b[_0x039d('0x31')]=_[_0x039d('0x30')](_0x1f6425[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x601405[_0x039d('0x2e')][_0x039d('0x32')]));_0x75447b[_0x039d('0x31')]=_0x75447b['attributes'][_0x039d('0x50')]?_0x75447b['attributes']:_0x1f6425[_0x039d('0x2d')];_0x75447b['order']=qs[_0x039d('0x36')](_0x601405['query'][_0x039d('0x36')]);_0x75447b[_0x039d('0x37')]=qs[_0x039d('0x38')](_['pick'](_0x601405[_0x039d('0x2e')],_0x1f6425['filters']));if(_0x601405['query'][_0x039d('0x3a')]){_0x75447b[_0x039d('0x37')]=_[_0x039d('0x3d')](_0x75447b['where'],{'$or':_[_0x039d('0x2b')](_0x75447b[_0x039d('0x31')],function(_0x853111){var _0x3279e2={};_0x3279e2[_0x853111]={'$like':'%'+_0x601405[_0x039d('0x2e')][_0x039d('0x3a')]+'%'};return _0x3279e2;})});}_0x75447b=_[_0x039d('0x3d')]({},_0x75447b,_0x601405[_0x039d('0x46')]);return _0x4f81a1[_0x039d('0x5e')](_0x75447b);}})[_0x039d('0x22')](function(_0x50938a){if(_0x50938a){_0x10de9f=_0x50938a[_0x039d('0x50')];if(!_0x601405[_0x039d('0x2e')][_0x039d('0x33')]('nolimit')){_0x75447b[_0x039d('0x1d')]=qs[_0x039d('0x1d')](_0x601405['query'][_0x039d('0x1d')]);_0x75447b[_0x039d('0x1e')]=qs['offset'](_0x601405[_0x039d('0x2e')][_0x039d('0x1e')]);}return _0x4f81a1[_0x039d('0x5e')](_0x75447b);}})['then'](function(_0x4ba749){if(_0x4ba749){return _0x4ba749?{'count':_0x10de9f,'rows':_0x4ba749}:null;}})[_0x039d('0x22')](respondWithResult(_0x40aa7b,null))[_0x039d('0x42')](handleError(_0x40aa7b,null));};exports[_0x039d('0x60')]=function(_0x4b2a2d,_0x1bedc0,_0x372c50){var _0x1d9e51,_0x34af30;var _0x13d85d=[];var _0x278d69=moment()[_0x039d('0x61')](_0x039d('0x62'));return db[_0x039d('0x3e')][_0x039d('0x4d')]({'where':{'id':_0x4b2a2d[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x1bedc0,null))[_0x039d('0x22')](function(_0x328f00){if(_0x328f00){_0x34af30=_0x328f00;return _0x328f00[_0x039d('0x60')](_0x4b2a2d[_0x039d('0x48')][_0x039d('0x63')],_[_0x039d('0x64')](_0x4b2a2d[_0x039d('0x48')],[_0x039d('0x63'),'id'])||{});}return null;})[_0x039d('0x65')](function(_0x3cdaff){var _0x3c8b9d;var _0xb03b44;_0x1d9e51=_0x3cdaff||[];var _0xdd86ad=[];if(_0x3cdaff){for(var _0x1a6c95=0x0;_0x1a6c95<_0x3cdaff['length'];_0x1a6c95+=0x1){var _0x5e6aa1=_0x3cdaff[_0x1a6c95][_0x039d('0x23')]({'plain':!![]});_0x34af30[_0x039d('0x66')]=_0x4b2a2d[_0x039d('0x48')][_0x039d('0x66')]?_0x4b2a2d[_0x039d('0x48')][_0x039d('0x66')]:_0x34af30['dialCheckDuplicateType'];switch(_0x34af30[_0x039d('0x66')]){case _0x039d('0x67'):_0x3c8b9d=squel[_0x039d('0x68')]()[_0x039d('0x69')](_0x039d('0x6a'))['fromQuery'](['phone',_0x039d('0x6b'),_0x039d('0x6c'),_0x039d('0x6d'),_0x039d('0x56'),_0x039d('0x52'),_0x039d('0x51')],squel[_0x039d('0x6e')]()[_0x039d('0x6f')](_0x039d('0x70'),_0x039d('0x70'))[_0x039d('0x6f')](_0x039d('0x71'),_0x039d('0x6b'))[_0x039d('0x6f')]('id','ContactId')[_0x039d('0x6f')](_0x5e6aa1[_0x039d('0x72')][_0x039d('0x73')](),_0x039d('0x6d'))[_0x039d('0x6f')](_0x4b2a2d[_0x039d('0x44')]['id'][_0x039d('0x73')](),_0x039d('0x56'))['field']('\x27'+_0x278d69+'\x27','createdAt')[_0x039d('0x6f')]('\x27'+_0x278d69+'\x27',_0x039d('0x51'))[_0x039d('0x74')](_0x039d('0x75'))[_0x039d('0x37')](_0x039d('0x76'))[_0x039d('0x37')](_0x039d('0x77'),_0x5e6aa1[_0x039d('0x72')][_0x039d('0x73')]())[_0x039d('0x37')](_0x039d('0x78'))[_0x039d('0x37')](_0x039d('0x79'),squel[_0x039d('0x6e')]()['field'](_0x039d('0x7a'))[_0x039d('0x74')](_0x039d('0x7b'))[_0x039d('0x37')]('CampaignId\x20=\x20?',_0x4b2a2d[_0x039d('0x44')]['id'][_0x039d('0x73')]()))[_0x039d('0x37')](_0x039d('0x79'),squel[_0x039d('0x6e')]()['field'](_0x039d('0x7c'))[_0x039d('0x74')]('cm_hopper')[_0x039d('0x37')](_0x039d('0x7d'),_0x4b2a2d[_0x039d('0x44')]['id'][_0x039d('0x73')]())))['toString']();break;case _0x039d('0x7e'):_0x3c8b9d=squel[_0x039d('0x68')]()[_0x039d('0x69')](_0x039d('0x6a'))[_0x039d('0x7f')](['phone',_0x039d('0x6b'),_0x039d('0x6c'),_0x039d('0x6d'),_0x039d('0x56'),'createdAt',_0x039d('0x51')],squel[_0x039d('0x6e')]()['field']('phone',_0x039d('0x70'))[_0x039d('0x6f')]('NOW()',_0x039d('0x6b'))['field']('id',_0x039d('0x6c'))[_0x039d('0x6f')](_0x5e6aa1[_0x039d('0x72')][_0x039d('0x73')](),_0x039d('0x6d'))[_0x039d('0x6f')](_0x4b2a2d[_0x039d('0x44')]['id'][_0x039d('0x73')](),_0x039d('0x56'))[_0x039d('0x6f')]('\x27'+_0x278d69+'\x27',_0x039d('0x52'))[_0x039d('0x6f')]('\x27'+_0x278d69+'\x27',_0x039d('0x51'))[_0x039d('0x74')](_0x039d('0x75'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x5e6aa1[_0x039d('0x72')][_0x039d('0x73')]())[_0x039d('0x37')](_0x039d('0x78'))[_0x039d('0x37')](_0x039d('0x79'),squel[_0x039d('0x6e')]()[_0x039d('0x6f')](_0x039d('0x7c'))[_0x039d('0x74')](_0x039d('0x6a'))[_0x039d('0x37')](_0x039d('0x7d'),_0x4b2a2d[_0x039d('0x44')]['id'][_0x039d('0x73')]())))[_0x039d('0x73')]();break;default:_0x3c8b9d=squel[_0x039d('0x68')]()[_0x039d('0x69')](_0x039d('0x6a'))['fromQuery']([_0x039d('0x70'),_0x039d('0x6b'),'ContactId',_0x039d('0x6d'),_0x039d('0x56'),_0x039d('0x52'),_0x039d('0x51')],squel[_0x039d('0x6e')]()['field'](_0x039d('0x70'),_0x039d('0x70'))['field'](_0x039d('0x71'),'scheduledAt')['field']('id',_0x039d('0x6c'))[_0x039d('0x6f')](_0x5e6aa1['CmListId'][_0x039d('0x73')](),_0x039d('0x6d'))[_0x039d('0x6f')](_0x4b2a2d[_0x039d('0x44')]['id']['toString'](),_0x039d('0x56'))[_0x039d('0x6f')]('\x27'+_0x278d69+'\x27',_0x039d('0x52'))[_0x039d('0x6f')]('\x27'+_0x278d69+'\x27',_0x039d('0x51'))['from'](_0x039d('0x75'))[_0x039d('0x37')](_0x039d('0x76'))['where']('ListId\x20=\x20?',_0x5e6aa1[_0x039d('0x72')][_0x039d('0x73')]())[_0x039d('0x37')](_0x039d('0x78')))['toString']();}_0xb03b44=squel['insert']()['into'](_0x039d('0x80'))[_0x039d('0x7f')]([_0x039d('0x81'),_0x039d('0x6b'),_0x039d('0x70'),'OrderBy','createdAt',_0x039d('0x51')],squel[_0x039d('0x6e')]()['field'](_0x039d('0x82'),'id')[_0x039d('0x6f')](_0x039d('0x71'),'scheduledAt')['field']('ci.item',_0x039d('0x70'))['field']('ci.OrderBY',_0x039d('0x83'))[_0x039d('0x6f')]('\x27'+_0x278d69+'\x27',_0x039d('0x52'))[_0x039d('0x6f')]('\x27'+_0x278d69+'\x27',_0x039d('0x51'))['from']('cm_contact_has_items','ci')[_0x039d('0x84')](_0x039d('0x6a'),'h',_0x039d('0x85'))['where']('h.ListId\x20=\x20?',_0x5e6aa1['CmListId'][_0x039d('0x73')]())[_0x039d('0x37')](_0x039d('0x86'),_0x4b2a2d[_0x039d('0x44')]['id']['toString']())[_0x039d('0x37')](_0x039d('0x87'),_0x278d69))[_0x039d('0x73')]();_0xdd86ad['push'](db[_0x039d('0x88')]['query'](_0x3c8b9d));_0x13d85d[_0x039d('0x89')](db[_0x039d('0x88')][_0x039d('0x2e')](_0xb03b44));}return BPromise['all'](_0xdd86ad);}})[_0x039d('0x22')](function(){return BPromise[_0x039d('0x8a')](_0x13d85d);})[_0x039d('0x22')](function(){return _0x1d9e51;})['then'](respondWithResult(_0x1bedc0,null))['catch'](handleError(_0x1bedc0,null));};exports[_0x039d('0x8b')]=function(_0x363d6d,_0x4aedab,_0x7f77fe){return db[_0x039d('0x3e')][_0x039d('0x4d')]({'where':{'id':_0x363d6d['params']['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x4aedab,null))[_0x039d('0x22')](function(_0x200f24){if(_0x200f24){return _0x200f24[_0x039d('0x8b')](_0x363d6d[_0x039d('0x2e')]['ids']);}})[_0x039d('0x22')](function(_0x193021){if(_0x193021){return db[_0x039d('0x55')][_0x039d('0x25')]({'where':{'ListId':_0x363d6d['query']['ids'],'CampaignId':_0x363d6d[_0x039d('0x44')]['id']}})[_0x039d('0x22')](function(){return _0x193021;});}})[_0x039d('0x22')](respondWithStatusCode(_0x4aedab,null))[_0x039d('0x42')](handleError(_0x4aedab,null));};exports['getBlackLists']=function(_0x25a310,_0x11a835,_0x31f666){var _0x46752d={};var _0x20b012={};var _0x48a38b;var _0x394251;return db[_0x039d('0x3e')]['findOne']({'where':{'id':_0x25a310[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x11a835,null))[_0x039d('0x22')](function(_0x11146f){if(_0x11146f){_0x48a38b=_0x11146f;_0x20b012[_0x039d('0x2d')]=_[_0x039d('0x2f')](db[_0x039d('0x5f')][_0x039d('0x45')]);_0x20b012[_0x039d('0x2e')]=_[_0x039d('0x2f')](_0x25a310[_0x039d('0x2e')]);_0x20b012[_0x039d('0x38')]=_[_0x039d('0x30')](_0x20b012[_0x039d('0x2d')],_0x20b012[_0x039d('0x2e')]);_0x46752d[_0x039d('0x31')]=_[_0x039d('0x30')](_0x20b012[_0x039d('0x2d')],qs[_0x039d('0x32')](_0x25a310[_0x039d('0x2e')][_0x039d('0x32')]));_0x46752d[_0x039d('0x31')]=_0x46752d[_0x039d('0x31')][_0x039d('0x50')]?_0x46752d[_0x039d('0x31')]:_0x20b012[_0x039d('0x2d')];_0x46752d[_0x039d('0x35')]=qs[_0x039d('0x36')](_0x25a310[_0x039d('0x2e')][_0x039d('0x36')]);_0x46752d['where']=qs[_0x039d('0x38')](_[_0x039d('0x39')](_0x25a310[_0x039d('0x2e')],_0x20b012['filters']));if(_0x25a310['query'][_0x039d('0x3a')]){_0x46752d['where']=_[_0x039d('0x3d')](_0x46752d[_0x039d('0x37')],{'$or':_[_0x039d('0x2b')](_0x46752d['attributes'],function(_0x50c6a2){var _0x5b549e={};_0x5b549e[_0x50c6a2]={'$like':'%'+_0x25a310[_0x039d('0x2e')][_0x039d('0x3a')]+'%'};return _0x5b549e;})});}_0x46752d=_[_0x039d('0x3d')]({},_0x46752d,_0x25a310[_0x039d('0x46')]);return _0x48a38b['getBlackLists'](_0x46752d);}})[_0x039d('0x22')](function(_0x17ae98){if(_0x17ae98){_0x394251=_0x17ae98[_0x039d('0x50')];if(!_0x25a310[_0x039d('0x2e')][_0x039d('0x33')](_0x039d('0x34'))){_0x46752d[_0x039d('0x1d')]=qs[_0x039d('0x1d')](_0x25a310[_0x039d('0x2e')][_0x039d('0x1d')]);_0x46752d[_0x039d('0x1e')]=qs[_0x039d('0x1e')](_0x25a310[_0x039d('0x2e')][_0x039d('0x1e')]);}return _0x48a38b[_0x039d('0x8c')](_0x46752d);}})[_0x039d('0x22')](function(_0x4fdfe2){if(_0x4fdfe2){return _0x4fdfe2?{'count':_0x394251,'rows':_0x4fdfe2}:null;}})[_0x039d('0x22')](respondWithResult(_0x11a835,null))[_0x039d('0x42')](handleError(_0x11a835,null));};exports[_0x039d('0x8d')]=function(_0x241ce5,_0x1f9bc7,_0xb512a7){var _0xe543d4,_0x28b87b;var _0x4f03bb=[];var _0x2be376=moment()[_0x039d('0x61')](_0x039d('0x62'));return db[_0x039d('0x3e')][_0x039d('0x4d')]({'where':{'id':_0x241ce5[_0x039d('0x44')]['id']}})[_0x039d('0x22')](handleEntityNotFound(_0x1f9bc7,null))[_0x039d('0x22')](function(_0x4d7133){if(_0x4d7133){_0x28b87b=_0x4d7133;return _0x4d7133[_0x039d('0x8d')](_0x241ce5[_0x039d('0x48')]['ids'],_[_0x039d('0x64')](_0x241ce5[_0x039d('0x48')],[_0x039d('0x63'),'id'])||{});}return null;})[_0x039d('0x65')](function(_0x19a016){var _0x3cf081;var _0x573eed;_0xe543d4=_0x19a016||[];var _0xc8fe5b=[];if(_0x19a016){for(var _0x39154b=0x0;_0x39154b<_0x19a016['length'];_0x39154b+=0x1){var _0x1eaefe=_0x19a016[_0x39154b][_0x039d('0x23')]({'plain':!![]});_0x3cf081=squel[_0x039d('0x68')]()[_0x039d('0x69')]('cm_hopper_black')[_0x039d('0x7f')]([_0x039d('0x70'),'ContactId','ListId',_0x039d('0x56'),_0x039d('0x52'),_0x039d('0x51')],squel[_0x039d('0x6e')]()['field'](_0x039d('0x70'),_0x039d('0x70'))[_0x039d('0x6f')]('id',_0x039d('0x6c'))[_0x039d('0x6f')](_0x1eaefe[_0x039d('0x72')][_0x039d('0x73')](),_0x039d('0x6d'))['field'](_0x241ce5[_0x039d('0x44')]['id'][_0x039d('0x73')](),_0x039d('0x56'))[_0x039d('0x6f')](_0x039d('0x71'),_0x039d('0x52'))[_0x039d('0x6f')](_0x039d('0x71'),_0x039d('0x51'))[_0x039d('0x74')](_0x039d('0x75'))[_0x039d('0x37')](_0x039d('0x76'))[_0x039d('0x37')](_0x039d('0x77'),_0x1eaefe[_0x039d('0x72')]['toString']())[_0x039d('0x37')](_0x039d('0x78')))[_0x039d('0x73')]();_0xc8fe5b['push'](db[_0x039d('0x88')]['query'](_0x3cf081));}return BPromise[_0x039d('0x8a')](_0xc8fe5b);}})[_0x039d('0x22')](function(){return _0xe543d4;})[_0x039d('0x22')](respondWithResult(_0x1f9bc7,null))[_0x039d('0x42')](handleError(_0x1f9bc7,null));};exports[_0x039d('0x8e')]=function(_0x1c70f1,_0x129de4,_0x3da412){return db[_0x039d('0x3e')][_0x039d('0x4d')]({'where':{'id':_0x1c70f1[_0x039d('0x44')]['id']}})['then'](handleEntityNotFound(_0x129de4,null))[_0x039d('0x22')](function(_0x562a05){if(_0x562a05){return _0x562a05[_0x039d('0x8e')](_0x1c70f1[_0x039d('0x2e')][_0x039d('0x63')]);}})[_0x039d('0x22')](function(_0x39cbd3){if(_0x39cbd3){return db[_0x039d('0x5d')][_0x039d('0x25')]({'where':{'ListId':_0x1c70f1[_0x039d('0x2e')][_0x039d('0x63')],'CampaignId':_0x1c70f1['params']['id']}})[_0x039d('0x22')](function(){return _0x39cbd3;});}})[_0x039d('0x22')](respondWithStatusCode(_0x129de4,null))['catch'](handleError(_0x129de4,null));};
\ No newline at end of file
+var _0xda66=['../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','get','IvrCampaigns','destroy','sendStatus','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','order','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x32e786,_0x4f8a4d){var _0x13ab55=function(_0x3fe0fa){while(--_0x3fe0fa){_0x32e786['push'](_0x32e786['shift']());}};_0x13ab55(++_0x4f8a4d);}(_0xda66,0x7f));var _0x6da6=function(_0x3c3e20,_0x50ec3f){_0x3c3e20=_0x3c3e20-0x0;var _0x5e43e9=_0xda66[_0x3c3e20];return _0x5e43e9;};'use strict';var emlformat=require(_0x6da6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6da6('0x1'));var jsonpatch=require(_0x6da6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6da6('0x3'));var util=require(_0x6da6('0x4'));var path=require(_0x6da6('0x5'));var sox=require(_0x6da6('0x6'));var csv=require(_0x6da6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6da6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6da6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6da6('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6da6('0xb'));var Redis=require(_0x6da6('0xc'));var authService=require(_0x6da6('0xd'));var qs=require(_0x6da6('0xe'));var as=require(_0x6da6('0xf'));var hardwareService=require(_0x6da6('0x10'));var logger=require(_0x6da6('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6da6('0x12'));var licenseUtil=require(_0x6da6('0x13'));var db=require(_0x6da6('0x14'))['db'];function respondWithStatusCode(_0xa7da31,_0x57d6ad){_0x57d6ad=_0x57d6ad||0xcc;return function(_0x118ac9){if(_0x118ac9){return _0xa7da31['sendStatus'](_0x57d6ad);}return _0xa7da31[_0x6da6('0x15')](_0x57d6ad)[_0x6da6('0x16')]();};}function respondWithResult(_0x173238,_0x44290c){_0x44290c=_0x44290c||0xc8;return function(_0x18a255){if(_0x18a255){return _0x173238[_0x6da6('0x15')](_0x44290c)[_0x6da6('0x17')](_0x18a255);}};}function respondWithFilteredResult(_0x58d817,_0x557e72){return function(_0x50393e){if(_0x50393e){var _0x57348f=typeof _0x557e72['offset']==='undefined'&&typeof _0x557e72[_0x6da6('0x18')]===_0x6da6('0x19');var _0x321c67=_0x50393e[_0x6da6('0x1a')];var _0x2fd36d=_0x57348f?0x0:_0x557e72['offset'];var _0x2bf7d9=_0x57348f?_0x50393e[_0x6da6('0x1a')]:_0x557e72[_0x6da6('0x1b')]+_0x557e72['limit'];var _0x10f673;if(_0x2bf7d9>=_0x321c67){_0x2bf7d9=_0x321c67;_0x10f673=0xc8;}else{_0x10f673=0xce;}_0x58d817['status'](_0x10f673);return _0x58d817[_0x6da6('0x1c')](_0x6da6('0x1d'),_0x2fd36d+'-'+_0x2bf7d9+'/'+_0x321c67)[_0x6da6('0x17')](_0x50393e);}return null;};}function patchUpdates(_0xd63d5b){return function(_0x59b347){try{jsonpatch[_0x6da6('0x1e')](_0x59b347,_0xd63d5b,!![]);}catch(_0x37f406){return BPromise['reject'](_0x37f406);}return _0x59b347[_0x6da6('0x1f')]();};}function saveUpdates(_0x17f731,_0x3ff78b){return function(_0x2366e7){if(_0x2366e7){return _0x2366e7['update'](_0x17f731)[_0x6da6('0x20')](function(_0x34bf25){return _0x34bf25;});}return null;};}function removeEntity(_0x3b7340,_0xe1d27e){return function(_0x48ff63){if(_0x48ff63){return _0x48ff63['destroy']()[_0x6da6('0x20')](function(){var _0x39fb46=_0x48ff63[_0x6da6('0x21')]({'plain':!![]});var _0x30269f=_0x6da6('0x22');return db['UserProfileResource'][_0x6da6('0x23')]({'where':{'type':_0x30269f,'resourceId':_0x39fb46['id']}})[_0x6da6('0x20')](function(){return _0x48ff63;});})[_0x6da6('0x20')](function(){_0x3b7340[_0x6da6('0x15')](0xcc)[_0x6da6('0x16')]();});}};}function handleEntityNotFound(_0x3a3903,_0x15262a){return function(_0x575f7d){if(!_0x575f7d){_0x3a3903[_0x6da6('0x24')](0x194);}return _0x575f7d;};}function handleError(_0x263989,_0x2274ad){_0x2274ad=_0x2274ad||0x1f4;return function(_0x1cd1a4){logger[_0x6da6('0x25')](_0x1cd1a4[_0x6da6('0x26')]);if(_0x1cd1a4[_0x6da6('0x27')]){delete _0x1cd1a4[_0x6da6('0x27')];}_0x263989[_0x6da6('0x15')](_0x2274ad)[_0x6da6('0x28')](_0x1cd1a4);};}exports[_0x6da6('0x29')]=function(_0x5c380b,_0x3d4572){var _0x4b7e10={},_0x945988={},_0x414d68={'count':0x0,'rows':[]};var _0x357b2d=_[_0x6da6('0x2a')](db[_0x6da6('0x2b')][_0x6da6('0x2c')],function(_0x53fad5){return{'name':_0x53fad5[_0x6da6('0x2d')],'type':_0x53fad5[_0x6da6('0x2e')][_0x6da6('0x2f')]};});_0x945988['model']=_[_0x6da6('0x2a')](_0x357b2d,'name');_0x945988[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x5c380b[_0x6da6('0x30')]);_0x945988[_0x6da6('0x32')]=_['intersection'](_0x945988[_0x6da6('0x33')],_0x945988[_0x6da6('0x30')]);_0x4b7e10[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x945988['model'],qs['fields'](_0x5c380b[_0x6da6('0x30')]['fields']));_0x4b7e10[_0x6da6('0x34')]=_0x4b7e10[_0x6da6('0x34')]['length']?_0x4b7e10[_0x6da6('0x34')]:_0x945988['model'];if(!_0x5c380b[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0x4b7e10[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x5c380b[_0x6da6('0x30')][_0x6da6('0x18')]);_0x4b7e10['offset']=qs['offset'](_0x5c380b['query']['offset']);}_0x4b7e10['order']=qs[_0x6da6('0x38')](_0x5c380b[_0x6da6('0x30')][_0x6da6('0x38')]);_0x4b7e10[_0x6da6('0x39')]=qs[_0x6da6('0x32')](_['pick'](_0x5c380b[_0x6da6('0x30')],_0x945988[_0x6da6('0x32')]),_0x357b2d);if(_0x5c380b[_0x6da6('0x30')]['filter']){_0x4b7e10[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0x4b7e10[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x357b2d,function(_0x19ae4c){if(_0x19ae4c[_0x6da6('0x2e')]!=='VIRTUAL'){var _0x22cd85={};_0x22cd85[_0x19ae4c[_0x6da6('0x27')]]={'$like':'%'+_0x5c380b[_0x6da6('0x30')][_0x6da6('0x3b')]+'%'};return _0x22cd85;}})});}_0x4b7e10=_[_0x6da6('0x3a')]({},_0x4b7e10,_0x5c380b[_0x6da6('0x3c')]);var _0x3733d4={'where':_0x4b7e10[_0x6da6('0x39')]};return db[_0x6da6('0x2b')][_0x6da6('0x1a')](_0x3733d4)[_0x6da6('0x20')](function(_0x14ede3){_0x414d68['count']=_0x14ede3;if(_0x5c380b[_0x6da6('0x30')][_0x6da6('0x3d')]){_0x4b7e10[_0x6da6('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0x6da6('0x3f')](_0x4b7e10);})['then'](function(_0x40bd0e){_0x414d68[_0x6da6('0x40')]=_0x40bd0e;return _0x414d68;})['then'](respondWithFilteredResult(_0x3d4572,_0x4b7e10))[_0x6da6('0x41')](handleError(_0x3d4572,null));};exports['show']=function(_0x588175,_0x9601e2){var _0x13e970={'raw':![],'where':{'id':_0x588175[_0x6da6('0x42')]['id']}},_0x1611df={};_0x1611df[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x2b')][_0x6da6('0x2c')]);_0x1611df[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x588175[_0x6da6('0x30')]);_0x1611df[_0x6da6('0x32')]=_['intersection'](_0x1611df[_0x6da6('0x33')],_0x1611df[_0x6da6('0x30')]);_0x13e970[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x1611df['model'],qs[_0x6da6('0x43')](_0x588175['query'][_0x6da6('0x43')]));_0x13e970['attributes']=_0x13e970[_0x6da6('0x34')][_0x6da6('0x44')]?_0x13e970[_0x6da6('0x34')]:_0x1611df[_0x6da6('0x33')];if(_0x588175[_0x6da6('0x30')][_0x6da6('0x3d')]){_0x13e970['include']=[{'all':!![]}];}_0x13e970=_['merge']({},_0x13e970,_0x588175[_0x6da6('0x3c')]);return db[_0x6da6('0x2b')][_0x6da6('0x45')](_0x13e970)['then'](handleEntityNotFound(_0x9601e2,null))[_0x6da6('0x20')](respondWithResult(_0x9601e2,null))[_0x6da6('0x41')](handleError(_0x9601e2,null));};exports[_0x6da6('0x46')]=function(_0x22e236,_0xc54684){return db[_0x6da6('0x2b')][_0x6da6('0x46')](_0x22e236[_0x6da6('0x47')],{})[_0x6da6('0x20')](function(_0x21f968){var _0x2076be=_0x22e236[_0x6da6('0x48')][_0x6da6('0x21')]({'plain':!![]});if(!_0x2076be)throw new Error(_0x6da6('0x49'));if(_0x2076be[_0x6da6('0x4a')]===_0x6da6('0x48')){var _0x2a6761=_0x21f968[_0x6da6('0x21')]({'plain':!![]});var _0x4121fd=_0x6da6('0x22');return db[_0x6da6('0x4b')][_0x6da6('0x45')]({'where':{'name':_0x4121fd,'userProfileId':_0x2076be[_0x6da6('0x4c')]},'raw':!![]})[_0x6da6('0x20')](function(_0x20bc74){if(_0x20bc74&&_0x20bc74[_0x6da6('0x4d')]===0x0){return db[_0x6da6('0x4e')][_0x6da6('0x46')]({'name':_0x2a6761[_0x6da6('0x27')],'resourceId':_0x2a6761['id'],'type':_0x20bc74[_0x6da6('0x27')],'sectionId':_0x20bc74['id']},{})[_0x6da6('0x20')](function(){return _0x21f968;});}else{return _0x21f968;}})[_0x6da6('0x41')](function(_0x3e468c){logger[_0x6da6('0x25')](_0x6da6('0x4f'),_0x3e468c);throw _0x3e468c;});}return _0x21f968;})[_0x6da6('0x20')](respondWithResult(_0xc54684,0xc9))[_0x6da6('0x41')](handleError(_0xc54684,null));};exports['clone']=function(_0x177a4e,_0x46cb75){var _0x401f57={'where':{'id':_0x177a4e[_0x6da6('0x42')]['id']}},_0x51f0f9={};_0x51f0f9[_0x6da6('0x33')]=_['keys'](db[_0x6da6('0x2b')][_0x6da6('0x2c')]);_0x401f57[_0x6da6('0x34')]=_['intersection'](_0x51f0f9[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x177a4e[_0x6da6('0x30')][_0x6da6('0x43')]));_0x401f57[_0x6da6('0x34')]=_0x401f57[_0x6da6('0x34')]['length']?_0x401f57[_0x6da6('0x34')]:_0x51f0f9[_0x6da6('0x33')];if(_0x177a4e[_0x6da6('0x30')]['includeAll']){_0x401f57['include']=[{'all':!![]}];}_0x401f57=_['merge']({},_0x401f57,_0x177a4e['options']);return db[_0x6da6('0x2b')][_0x6da6('0x45')](_0x401f57)[_0x6da6('0x20')](handleEntityNotFound(_0x46cb75,null))[_0x6da6('0x20')](function(_0x2de317){if(_0x2de317){var _0x25925b=_0x2de317[_0x6da6('0x21')]({'plain':!![]});_0x25925b=qs[_0x6da6('0x50')](_0x25925b,['id',_0x6da6('0x51'),'updatedAt']);_0x177a4e[_0x6da6('0x47')]=_[_0x6da6('0x50')](_0x177a4e[_0x6da6('0x47')],['id',_0x6da6('0x51'),_0x6da6('0x52')]);return db[_0x6da6('0x2b')][_0x6da6('0x46')](_[_0x6da6('0x3a')](_0x25925b,_0x177a4e[_0x6da6('0x47')]),{'include':_0x177a4e['query'][_0x6da6('0x3d')]?[{'all':!![]}]:undefined})[_0x6da6('0x20')](function(_0xd76a95){var _0x3826f4=_0x177a4e[_0x6da6('0x48')][_0x6da6('0x21')]({'plain':!![]});if(!_0x3826f4)throw new Error(_0x6da6('0x49'));if(_0x3826f4[_0x6da6('0x4a')]===_0x6da6('0x48')){var _0x30e35c=_0xd76a95[_0x6da6('0x21')]({'plain':!![]});var _0x57c710=_0x6da6('0x22');return db['UserProfileSection'][_0x6da6('0x45')]({'where':{'name':_0x57c710,'userProfileId':_0x3826f4[_0x6da6('0x4c')]},'raw':!![]})[_0x6da6('0x20')](function(_0x1c3dbc){if(_0x1c3dbc&&_0x1c3dbc[_0x6da6('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x30e35c[_0x6da6('0x27')],'resourceId':_0x30e35c['id'],'type':_0x1c3dbc['name'],'sectionId':_0x1c3dbc['id']},{})['then'](function(){return _0xd76a95;});}else{return _0xd76a95;}})[_0x6da6('0x41')](function(_0x416483){logger['error'](_0x6da6('0x4f'),_0x416483);throw _0x416483;});}return _0xd76a95;});}})['then'](respondWithResult(_0x46cb75,0xc9))[_0x6da6('0x41')](handleError(_0x46cb75,null));};exports['update']=function(_0x36a671,_0x1620e7){if(_0x36a671['body']['id']){delete _0x36a671[_0x6da6('0x47')]['id'];}return db[_0x6da6('0x2b')]['find']({'where':{'id':_0x36a671[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x1620e7,null))['then'](saveUpdates(_0x36a671['body'],null))[_0x6da6('0x20')](respondWithResult(_0x1620e7,null))[_0x6da6('0x41')](handleError(_0x1620e7,null));};exports[_0x6da6('0x23')]=function(_0x10f976,_0x4b0e98){return db[_0x6da6('0x2b')]['find']({'where':{'id':_0x10f976[_0x6da6('0x42')]['id']}})['then'](handleEntityNotFound(_0x4b0e98,null))[_0x6da6('0x20')](removeEntity(_0x4b0e98,null))[_0x6da6('0x41')](handleError(_0x4b0e98,null));};exports[_0x6da6('0x53')]=function(_0x380ab7,_0xe5277c,_0x42fc41){var _0xc6505c={'raw':!![],'where':{}};var _0x5dfbcf={};var _0x58764f={'count':0x0,'rows':[]};return db[_0x6da6('0x2b')][_0x6da6('0x54')]({'where':{'id':_0x380ab7[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0xe5277c,null))[_0x6da6('0x20')](function(_0x3667e3){if(_0x3667e3){_0x5dfbcf['model']=_[_0x6da6('0x31')](db[_0x6da6('0x55')][_0x6da6('0x2c')]);_0x5dfbcf[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x380ab7['query']);_0x5dfbcf[_0x6da6('0x32')]=_[_0x6da6('0x35')](_0x5dfbcf['model'],_0x5dfbcf[_0x6da6('0x30')]);_0xc6505c['attributes']=_[_0x6da6('0x35')](_0x5dfbcf[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x380ab7[_0x6da6('0x30')][_0x6da6('0x43')]));_0xc6505c['attributes']=_0xc6505c[_0x6da6('0x34')]['length']?_0xc6505c[_0x6da6('0x34')]:_0x5dfbcf[_0x6da6('0x33')];if(!_0x380ab7[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0xc6505c[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x380ab7['query']['limit']);_0xc6505c[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x380ab7[_0x6da6('0x30')][_0x6da6('0x1b')]);}_0xc6505c[_0x6da6('0x56')]=qs[_0x6da6('0x38')](_0x380ab7[_0x6da6('0x30')][_0x6da6('0x38')]);_0xc6505c['where']=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x380ab7[_0x6da6('0x30')],_0x5dfbcf[_0x6da6('0x32')]));_0xc6505c[_0x6da6('0x39')][_0x6da6('0x58')]=_0x3667e3['id'];if(_0x380ab7[_0x6da6('0x30')][_0x6da6('0x3b')]){_0xc6505c[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0xc6505c['where'],{'$or':_[_0x6da6('0x2a')](_0xc6505c[_0x6da6('0x34')],function(_0x2773ad){var _0x3b12e2={};_0x3b12e2[_0x2773ad]={'$like':'%'+_0x380ab7[_0x6da6('0x30')][_0x6da6('0x3b')]+'%'};return _0x3b12e2;})});}_0xc6505c=_[_0x6da6('0x3a')]({},_0xc6505c,_0x380ab7[_0x6da6('0x3c')]);return db[_0x6da6('0x55')][_0x6da6('0x1a')]({'where':_0xc6505c['where']})['then'](function(_0x320fab){_0x58764f['count']=_0x320fab;if(_0x380ab7['query'][_0x6da6('0x3d')]){_0xc6505c[_0x6da6('0x3e')]=[{'all':!![]}];}return db[_0x6da6('0x55')]['findAll'](_0xc6505c);})[_0x6da6('0x20')](function(_0x2b8a4c){_0x58764f[_0x6da6('0x40')]=_0x2b8a4c;return _0x58764f;});}})[_0x6da6('0x20')](respondWithFilteredResult(_0xe5277c,_0xc6505c))['catch'](handleError(_0xe5277c,null));};exports[_0x6da6('0x59')]=function(_0x48bb49,_0x46648d,_0x4487ad){var _0x287042={'raw':!![],'where':{}};var _0x4848e8={};var _0x2658e3={'count':0x0,'rows':[]};return db[_0x6da6('0x2b')]['findOne']({'where':{'id':_0x48bb49[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x46648d,null))[_0x6da6('0x20')](function(_0x4b11a8){if(_0x4b11a8){_0x4848e8[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x5a')][_0x6da6('0x2c')]);_0x4848e8[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x48bb49[_0x6da6('0x30')]);_0x4848e8['filters']=_[_0x6da6('0x35')](_0x4848e8[_0x6da6('0x33')],_0x4848e8[_0x6da6('0x30')]);_0x287042['attributes']=_['intersection'](_0x4848e8[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x48bb49[_0x6da6('0x30')][_0x6da6('0x43')]));_0x287042[_0x6da6('0x34')]=_0x287042['attributes'][_0x6da6('0x44')]?_0x287042['attributes']:_0x4848e8[_0x6da6('0x33')];if(!_0x48bb49[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0x287042[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x48bb49[_0x6da6('0x30')]['limit']);_0x287042['offset']=qs['offset'](_0x48bb49[_0x6da6('0x30')][_0x6da6('0x1b')]);}_0x287042['order']=qs[_0x6da6('0x38')](_0x48bb49[_0x6da6('0x30')]['sort']);_0x287042[_0x6da6('0x39')]=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x48bb49[_0x6da6('0x30')],_0x4848e8[_0x6da6('0x32')]));_0x287042[_0x6da6('0x39')][_0x6da6('0x58')]=_0x4b11a8['id'];if(_0x48bb49[_0x6da6('0x30')][_0x6da6('0x3b')]){_0x287042['where']=_['merge'](_0x287042[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x287042[_0x6da6('0x34')],function(_0x140d6d){var _0x1fef4d={};_0x1fef4d[_0x140d6d]={'$like':'%'+_0x48bb49[_0x6da6('0x30')]['filter']+'%'};return _0x1fef4d;})});}_0x287042=_[_0x6da6('0x3a')]({},_0x287042,_0x48bb49[_0x6da6('0x3c')]);return db['CmHopperHistory'][_0x6da6('0x1a')]({'where':_0x287042[_0x6da6('0x39')]})[_0x6da6('0x20')](function(_0x4c7492){_0x2658e3[_0x6da6('0x1a')]=_0x4c7492;if(_0x48bb49[_0x6da6('0x30')][_0x6da6('0x3d')]){_0x287042[_0x6da6('0x3e')]=[{'all':!![]}];}return db[_0x6da6('0x5a')][_0x6da6('0x3f')](_0x287042);})[_0x6da6('0x20')](function(_0x25db84){_0x2658e3[_0x6da6('0x40')]=_0x25db84;return _0x2658e3;});}})[_0x6da6('0x20')](respondWithFilteredResult(_0x46648d,_0x287042))[_0x6da6('0x41')](handleError(_0x46648d,null));};exports[_0x6da6('0x5b')]=function(_0x483f72,_0x169e82,_0x3f50ee){var _0x273626={'raw':!![],'where':{}};var _0x3f4407={};var _0x57dc3c={'count':0x0,'rows':[]};return db[_0x6da6('0x2b')][_0x6da6('0x54')]({'where':{'id':_0x483f72['params']['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x169e82,null))[_0x6da6('0x20')](function(_0x4cc9dd){if(_0x4cc9dd){_0x3f4407[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x5c')]['rawAttributes']);_0x3f4407[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x483f72[_0x6da6('0x30')]);_0x3f4407[_0x6da6('0x32')]=_[_0x6da6('0x35')](_0x3f4407['model'],_0x3f4407[_0x6da6('0x30')]);_0x273626[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x3f4407[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x483f72[_0x6da6('0x30')][_0x6da6('0x43')]));_0x273626[_0x6da6('0x34')]=_0x273626[_0x6da6('0x34')]['length']?_0x273626[_0x6da6('0x34')]:_0x3f4407[_0x6da6('0x33')];if(!_0x483f72['query']['hasOwnProperty'](_0x6da6('0x37'))){_0x273626[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x483f72['query'][_0x6da6('0x18')]);_0x273626[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x483f72['query']['offset']);}_0x273626[_0x6da6('0x56')]=qs['sort'](_0x483f72[_0x6da6('0x30')][_0x6da6('0x38')]);_0x273626['where']=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x483f72[_0x6da6('0x30')],_0x3f4407[_0x6da6('0x32')]));_0x273626[_0x6da6('0x39')][_0x6da6('0x58')]=_0x4cc9dd['id'];if(_0x483f72['query'][_0x6da6('0x3b')]){_0x273626['where']=_[_0x6da6('0x3a')](_0x273626[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x273626['attributes'],function(_0x3d267f){var _0xaba7d7={};_0xaba7d7[_0x3d267f]={'$like':'%'+_0x483f72['query'][_0x6da6('0x3b')]+'%'};return _0xaba7d7;})});}_0x273626=_['merge']({},_0x273626,_0x483f72['options']);return db[_0x6da6('0x5c')]['count']({'where':_0x273626[_0x6da6('0x39')]})['then'](function(_0x3bae7c){_0x57dc3c['count']=_0x3bae7c;if(_0x483f72[_0x6da6('0x30')][_0x6da6('0x3d')]){_0x273626['include']=[{'all':!![]}];}return db[_0x6da6('0x5c')][_0x6da6('0x3f')](_0x273626);})[_0x6da6('0x20')](function(_0x2e74c9){_0x57dc3c[_0x6da6('0x40')]=_0x2e74c9;return _0x57dc3c;});}})[_0x6da6('0x20')](respondWithFilteredResult(_0x169e82,_0x273626))[_0x6da6('0x41')](handleError(_0x169e82,null));};exports[_0x6da6('0x5d')]=function(_0x281b11,_0x5547e9,_0x2f270c){var _0x7b9951={'raw':!![],'where':{}};var _0x2c824c={};var _0x4987be={'count':0x0,'rows':[]};return db[_0x6da6('0x2b')][_0x6da6('0x54')]({'where':{'id':_0x281b11[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x5547e9,null))[_0x6da6('0x20')](function(_0x359066){if(_0x359066){_0x2c824c[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x5e')]['rawAttributes']);_0x2c824c[_0x6da6('0x30')]=_[_0x6da6('0x31')](_0x281b11[_0x6da6('0x30')]);_0x2c824c[_0x6da6('0x32')]=_['intersection'](_0x2c824c['model'],_0x2c824c[_0x6da6('0x30')]);_0x7b9951[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x2c824c['model'],qs[_0x6da6('0x43')](_0x281b11[_0x6da6('0x30')][_0x6da6('0x43')]));_0x7b9951['attributes']=_0x7b9951[_0x6da6('0x34')]['length']?_0x7b9951[_0x6da6('0x34')]:_0x2c824c[_0x6da6('0x33')];if(!_0x281b11[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0x7b9951[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x281b11[_0x6da6('0x30')][_0x6da6('0x18')]);_0x7b9951[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x281b11[_0x6da6('0x30')]['offset']);}_0x7b9951[_0x6da6('0x56')]=qs[_0x6da6('0x38')](_0x281b11['query']['sort']);_0x7b9951[_0x6da6('0x39')]=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x281b11['query'],_0x2c824c[_0x6da6('0x32')]));_0x7b9951[_0x6da6('0x39')][_0x6da6('0x58')]=_0x359066['id'];if(_0x281b11[_0x6da6('0x30')][_0x6da6('0x3b')]){_0x7b9951[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0x7b9951[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x7b9951[_0x6da6('0x34')],function(_0x23192d){var _0x13a0ff={};_0x13a0ff[_0x23192d]={'$like':'%'+_0x281b11['query'][_0x6da6('0x3b')]+'%'};return _0x13a0ff;})});}_0x7b9951=_[_0x6da6('0x3a')]({},_0x7b9951,_0x281b11[_0x6da6('0x3c')]);return db[_0x6da6('0x5e')]['count']({'where':_0x7b9951[_0x6da6('0x39')]})[_0x6da6('0x20')](function(_0x4aac02){_0x4987be[_0x6da6('0x1a')]=_0x4aac02;if(_0x281b11['query']['includeAll']){_0x7b9951[_0x6da6('0x3e')]=[{'all':!![]}];}return db[_0x6da6('0x5e')][_0x6da6('0x3f')](_0x7b9951);})['then'](function(_0xba036d){_0x4987be[_0x6da6('0x40')]=_0xba036d;return _0x4987be;});}})[_0x6da6('0x20')](respondWithFilteredResult(_0x5547e9,_0x7b9951))['catch'](handleError(_0x5547e9,null));};exports['getLists']=function(_0x2ad2f8,_0x410cb2,_0x4cc417){var _0x189ac2={};var _0x2c7407={};var _0x406990;var _0x4cad70;return db[_0x6da6('0x2b')][_0x6da6('0x54')]({'where':{'id':_0x2ad2f8[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x410cb2,null))[_0x6da6('0x20')](function(_0x4ebb94){if(_0x4ebb94){_0x406990=_0x4ebb94;_0x2c7407['model']=_[_0x6da6('0x31')](db[_0x6da6('0x5f')][_0x6da6('0x2c')]);_0x2c7407['query']=_['keys'](_0x2ad2f8[_0x6da6('0x30')]);_0x2c7407['filters']=_['intersection'](_0x2c7407[_0x6da6('0x33')],_0x2c7407[_0x6da6('0x30')]);_0x189ac2[_0x6da6('0x34')]=_['intersection'](_0x2c7407['model'],qs[_0x6da6('0x43')](_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x43')]));_0x189ac2[_0x6da6('0x34')]=_0x189ac2[_0x6da6('0x34')][_0x6da6('0x44')]?_0x189ac2[_0x6da6('0x34')]:_0x2c7407[_0x6da6('0x33')];_0x189ac2[_0x6da6('0x56')]=qs[_0x6da6('0x38')](_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x38')]);_0x189ac2[_0x6da6('0x39')]=qs[_0x6da6('0x32')](_[_0x6da6('0x57')](_0x2ad2f8[_0x6da6('0x30')],_0x2c7407[_0x6da6('0x32')]));if(_0x2ad2f8['query'][_0x6da6('0x3b')]){_0x189ac2[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0x189ac2['where'],{'$or':_[_0x6da6('0x2a')](_0x189ac2[_0x6da6('0x34')],function(_0x1658f7){var _0x368ca7={};_0x368ca7[_0x1658f7]={'$like':'%'+_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x3b')]+'%'};return _0x368ca7;})});}_0x189ac2=_[_0x6da6('0x3a')]({},_0x189ac2,_0x2ad2f8[_0x6da6('0x3c')]);return _0x406990[_0x6da6('0x60')](_0x189ac2);}})[_0x6da6('0x20')](function(_0x915306){if(_0x915306){_0x4cad70=_0x915306['length'];if(!_0x2ad2f8['query'][_0x6da6('0x36')](_0x6da6('0x37'))){_0x189ac2['limit']=qs[_0x6da6('0x18')](_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x18')]);_0x189ac2[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x2ad2f8[_0x6da6('0x30')][_0x6da6('0x1b')]);}return _0x406990[_0x6da6('0x60')](_0x189ac2);}})['then'](function(_0x3e9997){if(_0x3e9997){return _0x3e9997?{'count':_0x4cad70,'rows':_0x3e9997}:null;}})[_0x6da6('0x20')](respondWithResult(_0x410cb2,null))[_0x6da6('0x41')](handleError(_0x410cb2,null));};exports[_0x6da6('0x61')]=function(_0x5f10fd,_0x2c7e8e,_0x218110){var _0x40ba25,_0x59c435;var _0x18e81c=[];var _0x657eea=moment()[_0x6da6('0x62')](_0x6da6('0x63'));return db['Campaign']['find']({'where':{'id':_0x5f10fd[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x2c7e8e,null))[_0x6da6('0x20')](function(_0x215c02){if(_0x215c02){_0x59c435=_0x215c02;return _0x215c02[_0x6da6('0x61')](_0x5f10fd[_0x6da6('0x47')][_0x6da6('0x64')],_[_0x6da6('0x50')](_0x5f10fd[_0x6da6('0x47')],['ids','id'])||{});}return null;})['spread'](function(_0x4097ca){var _0x49b13d;var _0x2af6d9;_0x40ba25=_0x4097ca||[];var _0x15710e=[];if(_0x4097ca){for(var _0x553198=0x0;_0x553198<_0x4097ca[_0x6da6('0x44')];_0x553198+=0x1){var _0x265a50=_0x4097ca[_0x553198][_0x6da6('0x21')]({'plain':!![]});_0x59c435['dialCheckDuplicateType']=_0x5f10fd['body'][_0x6da6('0x65')]?_0x5f10fd[_0x6da6('0x47')][_0x6da6('0x65')]:_0x59c435['dialCheckDuplicateType'];switch(_0x59c435[_0x6da6('0x65')]){case _0x6da6('0x66'):_0x49b13d=squel[_0x6da6('0x67')]()[_0x6da6('0x68')](_0x6da6('0x69'))[_0x6da6('0x6a')]([_0x6da6('0x6b'),_0x6da6('0x6c'),_0x6da6('0x6d'),'ListId',_0x6da6('0x58'),_0x6da6('0x51'),_0x6da6('0x52')],squel[_0x6da6('0x6e')]()[_0x6da6('0x6f')](_0x6da6('0x6b'),_0x6da6('0x6b'))[_0x6da6('0x6f')](_0x6da6('0x70'),_0x6da6('0x6c'))[_0x6da6('0x6f')]('id',_0x6da6('0x6d'))['field'](_0x265a50['CmListId']['toString'](),'ListId')['field'](_0x5f10fd[_0x6da6('0x42')]['id'][_0x6da6('0x71')](),_0x6da6('0x58'))[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27',_0x6da6('0x51'))['field']('\x27'+_0x657eea+'\x27',_0x6da6('0x52'))['from'](_0x6da6('0x72'))['where'](_0x6da6('0x73'))['where'](_0x6da6('0x74'),_0x265a50[_0x6da6('0x75')][_0x6da6('0x71')]())[_0x6da6('0x39')](_0x6da6('0x76'))[_0x6da6('0x39')](_0x6da6('0x77'),squel['select']()[_0x6da6('0x6f')](_0x6da6('0x78'))[_0x6da6('0x79')](_0x6da6('0x7a'))[_0x6da6('0x39')](_0x6da6('0x7b'),_0x5f10fd[_0x6da6('0x42')]['id'][_0x6da6('0x71')]()))[_0x6da6('0x39')](_0x6da6('0x77'),squel['select']()[_0x6da6('0x6f')](_0x6da6('0x7c'))[_0x6da6('0x79')](_0x6da6('0x69'))[_0x6da6('0x39')](_0x6da6('0x7b'),_0x5f10fd[_0x6da6('0x42')]['id']['toString']())))[_0x6da6('0x71')]();break;case _0x6da6('0x7d'):_0x49b13d=squel[_0x6da6('0x67')]()[_0x6da6('0x68')](_0x6da6('0x69'))['fromQuery']([_0x6da6('0x6b'),_0x6da6('0x6c'),_0x6da6('0x6d'),_0x6da6('0x7e'),'CampaignId',_0x6da6('0x51'),'updatedAt'],squel[_0x6da6('0x6e')]()[_0x6da6('0x6f')](_0x6da6('0x6b'),'phone')[_0x6da6('0x6f')](_0x6da6('0x70'),_0x6da6('0x6c'))['field']('id','ContactId')[_0x6da6('0x6f')](_0x265a50[_0x6da6('0x75')][_0x6da6('0x71')](),_0x6da6('0x7e'))[_0x6da6('0x6f')](_0x5f10fd[_0x6da6('0x42')]['id']['toString'](),_0x6da6('0x58'))[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27','createdAt')[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27',_0x6da6('0x52'))[_0x6da6('0x79')]('cm_contacts')[_0x6da6('0x39')]('deletedAt\x20IS\x20NULL')[_0x6da6('0x39')]('ListId\x20=\x20?',_0x265a50[_0x6da6('0x75')]['toString']())[_0x6da6('0x39')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x6da6('0x77'),squel[_0x6da6('0x6e')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x6da6('0x69'))[_0x6da6('0x39')](_0x6da6('0x7b'),_0x5f10fd[_0x6da6('0x42')]['id'][_0x6da6('0x71')]())))[_0x6da6('0x71')]();break;default:_0x49b13d=squel['insert']()[_0x6da6('0x68')]('cm_hopper')[_0x6da6('0x6a')]([_0x6da6('0x6b'),'scheduledAt',_0x6da6('0x6d'),'ListId',_0x6da6('0x58'),_0x6da6('0x51'),_0x6da6('0x52')],squel['select']()[_0x6da6('0x6f')](_0x6da6('0x6b'),'phone')[_0x6da6('0x6f')]('NOW()',_0x6da6('0x6c'))['field']('id',_0x6da6('0x6d'))['field'](_0x265a50[_0x6da6('0x75')][_0x6da6('0x71')](),'ListId')[_0x6da6('0x6f')](_0x5f10fd[_0x6da6('0x42')]['id']['toString'](),_0x6da6('0x58'))[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27',_0x6da6('0x51'))['field']('\x27'+_0x657eea+'\x27',_0x6da6('0x52'))[_0x6da6('0x79')]('cm_contacts')[_0x6da6('0x39')](_0x6da6('0x73'))[_0x6da6('0x39')](_0x6da6('0x74'),_0x265a50[_0x6da6('0x75')]['toString']())[_0x6da6('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x6da6('0x71')]();}_0x2af6d9=squel[_0x6da6('0x67')]()[_0x6da6('0x68')](_0x6da6('0x7f'))[_0x6da6('0x6a')](['cmHopperId',_0x6da6('0x6c'),_0x6da6('0x6b'),_0x6da6('0x80'),_0x6da6('0x51'),_0x6da6('0x52')],squel[_0x6da6('0x6e')]()['field'](_0x6da6('0x81'),'id')['field'](_0x6da6('0x70'),'scheduledAt')['field'](_0x6da6('0x82'),'phone')[_0x6da6('0x6f')](_0x6da6('0x83'),_0x6da6('0x80'))[_0x6da6('0x6f')]('\x27'+_0x657eea+'\x27',_0x6da6('0x51'))['field']('\x27'+_0x657eea+'\x27',_0x6da6('0x52'))[_0x6da6('0x79')](_0x6da6('0x84'),'ci')[_0x6da6('0x85')](_0x6da6('0x69'),'h',_0x6da6('0x86'))['where']('h.ListId\x20=\x20?',_0x265a50[_0x6da6('0x75')][_0x6da6('0x71')]())['where'](_0x6da6('0x87'),_0x5f10fd[_0x6da6('0x42')]['id'][_0x6da6('0x71')]())['where'](_0x6da6('0x88'),_0x657eea))[_0x6da6('0x71')]();_0x15710e[_0x6da6('0x89')](db[_0x6da6('0x8a')][_0x6da6('0x30')](_0x49b13d));_0x18e81c['push'](db[_0x6da6('0x8a')]['query'](_0x2af6d9));}return BPromise[_0x6da6('0x8b')](_0x15710e);}})['then'](function(){return BPromise[_0x6da6('0x8b')](_0x18e81c);})[_0x6da6('0x20')](function(){return _0x40ba25;})['then'](respondWithResult(_0x2c7e8e,null))[_0x6da6('0x41')](handleError(_0x2c7e8e,null));};exports[_0x6da6('0x8c')]=function(_0xfa1e50,_0x36835e,_0x41c904){return db[_0x6da6('0x2b')][_0x6da6('0x45')]({'where':{'id':_0xfa1e50[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x36835e,null))[_0x6da6('0x20')](function(_0x104f4f){if(_0x104f4f){return _0x104f4f[_0x6da6('0x8c')](_0xfa1e50['query'][_0x6da6('0x64')]);}})[_0x6da6('0x20')](function(_0x1fcf7c){if(_0x1fcf7c){return db['CmHopper'][_0x6da6('0x23')]({'where':{'ListId':_0xfa1e50['query'][_0x6da6('0x64')],'CampaignId':_0xfa1e50[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](function(){return _0x1fcf7c;});}})['then'](respondWithStatusCode(_0x36835e,null))[_0x6da6('0x41')](handleError(_0x36835e,null));};exports[_0x6da6('0x8d')]=function(_0x2495bc,_0x184e1d,_0x5ec7d4){var _0x33eb6e={};var _0x47a9a5={};var _0x105c80;var _0x355141;return db[_0x6da6('0x2b')]['findOne']({'where':{'id':_0x2495bc['params']['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x184e1d,null))[_0x6da6('0x20')](function(_0xb8d491){if(_0xb8d491){_0x105c80=_0xb8d491;_0x47a9a5[_0x6da6('0x33')]=_[_0x6da6('0x31')](db[_0x6da6('0x5f')][_0x6da6('0x2c')]);_0x47a9a5[_0x6da6('0x30')]=_['keys'](_0x2495bc['query']);_0x47a9a5[_0x6da6('0x32')]=_['intersection'](_0x47a9a5[_0x6da6('0x33')],_0x47a9a5[_0x6da6('0x30')]);_0x33eb6e[_0x6da6('0x34')]=_[_0x6da6('0x35')](_0x47a9a5[_0x6da6('0x33')],qs[_0x6da6('0x43')](_0x2495bc[_0x6da6('0x30')][_0x6da6('0x43')]));_0x33eb6e['attributes']=_0x33eb6e[_0x6da6('0x34')][_0x6da6('0x44')]?_0x33eb6e[_0x6da6('0x34')]:_0x47a9a5[_0x6da6('0x33')];_0x33eb6e[_0x6da6('0x56')]=qs[_0x6da6('0x38')](_0x2495bc[_0x6da6('0x30')]['sort']);_0x33eb6e[_0x6da6('0x39')]=qs['filters'](_[_0x6da6('0x57')](_0x2495bc['query'],_0x47a9a5['filters']));if(_0x2495bc[_0x6da6('0x30')][_0x6da6('0x3b')]){_0x33eb6e[_0x6da6('0x39')]=_[_0x6da6('0x3a')](_0x33eb6e[_0x6da6('0x39')],{'$or':_[_0x6da6('0x2a')](_0x33eb6e[_0x6da6('0x34')],function(_0x57ae45){var _0x118826={};_0x118826[_0x57ae45]={'$like':'%'+_0x2495bc[_0x6da6('0x30')][_0x6da6('0x3b')]+'%'};return _0x118826;})});}_0x33eb6e=_[_0x6da6('0x3a')]({},_0x33eb6e,_0x2495bc[_0x6da6('0x3c')]);return _0x105c80[_0x6da6('0x8d')](_0x33eb6e);}})[_0x6da6('0x20')](function(_0x4f91cd){if(_0x4f91cd){_0x355141=_0x4f91cd[_0x6da6('0x44')];if(!_0x2495bc[_0x6da6('0x30')][_0x6da6('0x36')](_0x6da6('0x37'))){_0x33eb6e[_0x6da6('0x18')]=qs[_0x6da6('0x18')](_0x2495bc['query'][_0x6da6('0x18')]);_0x33eb6e[_0x6da6('0x1b')]=qs[_0x6da6('0x1b')](_0x2495bc['query'][_0x6da6('0x1b')]);}return _0x105c80[_0x6da6('0x8d')](_0x33eb6e);}})[_0x6da6('0x20')](function(_0x52d5db){if(_0x52d5db){return _0x52d5db?{'count':_0x355141,'rows':_0x52d5db}:null;}})[_0x6da6('0x20')](respondWithResult(_0x184e1d,null))[_0x6da6('0x41')](handleError(_0x184e1d,null));};exports[_0x6da6('0x8e')]=function(_0x1af412,_0x48e581,_0x56e2b8){var _0x21e4f7,_0x24052e;var _0x20ee4d=[];var _0x5af63b=moment()[_0x6da6('0x62')](_0x6da6('0x63'));return db[_0x6da6('0x2b')][_0x6da6('0x45')]({'where':{'id':_0x1af412['params']['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x48e581,null))['then'](function(_0xf18937){if(_0xf18937){_0x24052e=_0xf18937;return _0xf18937['addBlackLists'](_0x1af412[_0x6da6('0x47')]['ids'],_[_0x6da6('0x50')](_0x1af412[_0x6da6('0x47')],[_0x6da6('0x64'),'id'])||{});}return null;})[_0x6da6('0x8f')](function(_0x3f7e65){var _0x52ec7e;var _0x462f7b;_0x21e4f7=_0x3f7e65||[];var _0xe76ff9=[];if(_0x3f7e65){for(var _0x142e7e=0x0;_0x142e7e<_0x3f7e65[_0x6da6('0x44')];_0x142e7e+=0x1){var _0x5f544d=_0x3f7e65[_0x142e7e][_0x6da6('0x21')]({'plain':!![]});_0x52ec7e=squel[_0x6da6('0x67')]()[_0x6da6('0x68')](_0x6da6('0x90'))[_0x6da6('0x6a')]([_0x6da6('0x6b'),_0x6da6('0x6d'),'ListId','CampaignId',_0x6da6('0x51'),_0x6da6('0x52')],squel[_0x6da6('0x6e')]()['field'](_0x6da6('0x6b'),_0x6da6('0x6b'))[_0x6da6('0x6f')]('id',_0x6da6('0x6d'))['field'](_0x5f544d['CmListId'][_0x6da6('0x71')](),'ListId')[_0x6da6('0x6f')](_0x1af412[_0x6da6('0x42')]['id'][_0x6da6('0x71')](),_0x6da6('0x58'))[_0x6da6('0x6f')](_0x6da6('0x70'),'createdAt')[_0x6da6('0x6f')](_0x6da6('0x70'),_0x6da6('0x52'))[_0x6da6('0x79')]('cm_contacts')[_0x6da6('0x39')](_0x6da6('0x73'))[_0x6da6('0x39')](_0x6da6('0x74'),_0x5f544d['CmListId']['toString']())['where'](_0x6da6('0x76')))[_0x6da6('0x71')]();_0xe76ff9[_0x6da6('0x89')](db[_0x6da6('0x8a')][_0x6da6('0x30')](_0x52ec7e));}return BPromise[_0x6da6('0x8b')](_0xe76ff9);}})['then'](function(){return _0x21e4f7;})[_0x6da6('0x20')](respondWithResult(_0x48e581,null))['catch'](handleError(_0x48e581,null));};exports[_0x6da6('0x91')]=function(_0x369109,_0x1b7113,_0x39d7df){return db[_0x6da6('0x2b')][_0x6da6('0x45')]({'where':{'id':_0x369109[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](handleEntityNotFound(_0x1b7113,null))['then'](function(_0x478689){if(_0x478689){return _0x478689['removeBlackLists'](_0x369109[_0x6da6('0x30')]['ids']);}})['then'](function(_0x4203f5){if(_0x4203f5){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x369109[_0x6da6('0x30')]['ids'],'CampaignId':_0x369109[_0x6da6('0x42')]['id']}})[_0x6da6('0x20')](function(){return _0x4203f5;});}})['then'](respondWithStatusCode(_0x1b7113,null))[_0x6da6('0x41')](handleError(_0x1b7113,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 388ddc0..6044caa 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(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_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(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 9fd417a..8095994 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 _0x2060=['Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2060,0x1be));var _0x0206=function(_0x57f295,_0x4ca3c4){_0x57f295=_0x57f295-0x0;var _0x51fd23=_0x2060[_0x57f295];return _0x51fd23;};'use strict';var _=require(_0x0206('0x0'));var util=require('util');var moment=require(_0x0206('0x1'));var BPromise=require(_0x0206('0x2'));var rs=require(_0x0206('0x3'));var fs=require('fs');var Redis=require(_0x0206('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0206('0x5'));var logger=require(_0x0206('0x6'))('rpc');var config=require(_0x0206('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0206('0x8')][_0x0206('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x529d59,_0x2eda0e,_0x5c8dbb){return new BPromise(function(_0x4ffb51,_0x46dd94){return client[_0x0206('0xa')](_0x529d59,_0x5c8dbb)[_0x0206('0xb')](function(_0x194718){logger[_0x0206('0xc')](_0x0206('0xd'),_0x2eda0e,_0x0206('0xe'));logger[_0x0206('0xf')](_0x0206('0x10'),_0x2eda0e,_0x0206('0xe'),JSON[_0x0206('0x11')](_0x194718));if(_0x194718['error']){if(_0x194718['error'][_0x0206('0x12')]===0x1f4){logger[_0x0206('0x13')]('Campaign,\x20%s,\x20%s',_0x2eda0e,_0x194718[_0x0206('0x13')][_0x0206('0x14')]);return _0x46dd94(_0x194718[_0x0206('0x13')]['message']);}logger[_0x0206('0x13')](_0x0206('0xd'),_0x2eda0e,_0x194718[_0x0206('0x13')][_0x0206('0x14')]);return _0x4ffb51(_0x194718['error'][_0x0206('0x14')]);}else{logger['info'](_0x0206('0xd'),_0x2eda0e,_0x0206('0xe'));_0x4ffb51(_0x194718[_0x0206('0x15')][_0x0206('0x14')]);}})[_0x0206('0x16')](function(_0x26c261){logger['error']('Campaign,\x20%s,\x20%s',_0x2eda0e,_0x26c261);_0x46dd94(_0x26c261);});});}exports[_0x0206('0x17')]=function(_0x5641df){var _0x58291b=this;return new Promise(function(_0x2db2da,_0x3ecd80){return db[_0x0206('0x18')][_0x0206('0x19')]({'raw':_0x5641df['options']?_0x5641df[_0x0206('0x1a')][_0x0206('0x1b')]===undefined?!![]:![]:!![],'where':_0x5641df[_0x0206('0x1a')]?_0x5641df[_0x0206('0x1a')][_0x0206('0x1c')]||null:null,'attributes':_0x5641df[_0x0206('0x1a')]?_0x5641df[_0x0206('0x1a')][_0x0206('0x1d')]||null:null,'limit':_0x5641df['options']?_0x5641df[_0x0206('0x1a')]['limit']||null:null,'include':_0x5641df['options']?_0x5641df[_0x0206('0x1a')]['include']?_[_0x0206('0x1e')](_0x5641df[_0x0206('0x1a')][_0x0206('0x1f')],function(_0x4c5452){return{'model':db[_0x4c5452[_0x0206('0x20')]],'as':_0x4c5452['as'],'attributes':_0x4c5452[_0x0206('0x1d')],'include':_0x4c5452[_0x0206('0x1f')]?_['map'](_0x4c5452['include'],function(_0x3b9890){return{'model':db[_0x3b9890[_0x0206('0x20')]],'as':_0x3b9890['as'],'attributes':_0x3b9890['attributes'],'include':_0x3b9890[_0x0206('0x1f')]?_[_0x0206('0x1e')](_0x3b9890[_0x0206('0x1f')],function(_0x38ebfe){return{'model':db[_0x38ebfe[_0x0206('0x20')]],'as':_0x38ebfe['as'],'attributes':_0x38ebfe['attributes']};}):[]};}):[]};}):[]:[]})[_0x0206('0xb')](function(_0x18513c){logger[_0x0206('0xc')]('GetCampaign',_0x5641df);logger[_0x0206('0xf')](_0x0206('0x17'),_0x5641df,JSON[_0x0206('0x11')](_0x18513c));_0x2db2da(_0x18513c);})['catch'](function(_0xe6320c){logger[_0x0206('0x13')]('GetCampaign',_0xe6320c[_0x0206('0x14')],_0x5641df);_0x3ecd80(_0x58291b[_0x0206('0x13')](0x1f4,_0xe6320c[_0x0206('0x14')]));});});};
\ No newline at end of file
+var _0xde13=['stringify','error','message','result','catch','GetCampaign','Campaign','options','raw','attributes','limit','include','map','model','then','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x32d2b0,_0x46dd6e){var _0x29ab56=function(_0x38477f){while(--_0x38477f){_0x32d2b0['push'](_0x32d2b0['shift']());}};_0x29ab56(++_0x46dd6e);}(_0xde13,0x146));var _0x3de1=function(_0x41b90b,_0x50066f){_0x41b90b=_0x41b90b-0x0;var _0x4a84fb=_0xde13[_0x41b90b];return _0x4a84fb;};'use strict';var _=require(_0x3de1('0x0'));var util=require(_0x3de1('0x1'));var moment=require(_0x3de1('0x2'));var BPromise=require(_0x3de1('0x3'));var rs=require(_0x3de1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3de1('0x5'))['db'];var utils=require(_0x3de1('0x6'));var logger=require(_0x3de1('0x7'))('rpc');var config=require(_0x3de1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3de1('0x9')][_0x3de1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d2169,_0x34291a,_0x5f1aff){return new BPromise(function(_0x11df45,_0x41b5bb){return client[_0x3de1('0xb')](_0x3d2169,_0x5f1aff)['then'](function(_0x4eb503){logger['info'](_0x3de1('0xc'),_0x34291a,_0x3de1('0xd'));logger[_0x3de1('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x34291a,_0x3de1('0xd'),JSON[_0x3de1('0xf')](_0x4eb503));if(_0x4eb503[_0x3de1('0x10')]){if(_0x4eb503['error']['code']===0x1f4){logger[_0x3de1('0x10')]('Campaign,\x20%s,\x20%s',_0x34291a,_0x4eb503['error']['message']);return _0x41b5bb(_0x4eb503[_0x3de1('0x10')][_0x3de1('0x11')]);}logger[_0x3de1('0x10')](_0x3de1('0xc'),_0x34291a,_0x4eb503['error'][_0x3de1('0x11')]);return _0x11df45(_0x4eb503['error'][_0x3de1('0x11')]);}else{logger['info'](_0x3de1('0xc'),_0x34291a,_0x3de1('0xd'));_0x11df45(_0x4eb503[_0x3de1('0x12')]['message']);}})[_0x3de1('0x13')](function(_0x25f619){logger[_0x3de1('0x10')](_0x3de1('0xc'),_0x34291a,_0x25f619);_0x41b5bb(_0x25f619);});});}exports[_0x3de1('0x14')]=function(_0x510e5a){var _0x19254b=this;return new Promise(function(_0x5a10f2,_0x1e5a06){return db[_0x3de1('0x15')]['findAll']({'raw':_0x510e5a[_0x3de1('0x16')]?_0x510e5a['options'][_0x3de1('0x17')]===undefined?!![]:![]:!![],'where':_0x510e5a[_0x3de1('0x16')]?_0x510e5a[_0x3de1('0x16')]['where']||null:null,'attributes':_0x510e5a[_0x3de1('0x16')]?_0x510e5a[_0x3de1('0x16')][_0x3de1('0x18')]||null:null,'limit':_0x510e5a['options']?_0x510e5a[_0x3de1('0x16')][_0x3de1('0x19')]||null:null,'include':_0x510e5a['options']?_0x510e5a['options'][_0x3de1('0x1a')]?_[_0x3de1('0x1b')](_0x510e5a[_0x3de1('0x16')][_0x3de1('0x1a')],function(_0x242ab0){return{'model':db[_0x242ab0[_0x3de1('0x1c')]],'as':_0x242ab0['as'],'attributes':_0x242ab0[_0x3de1('0x18')],'include':_0x242ab0[_0x3de1('0x1a')]?_['map'](_0x242ab0['include'],function(_0x9873fa){return{'model':db[_0x9873fa[_0x3de1('0x1c')]],'as':_0x9873fa['as'],'attributes':_0x9873fa[_0x3de1('0x18')],'include':_0x9873fa[_0x3de1('0x1a')]?_[_0x3de1('0x1b')](_0x9873fa['include'],function(_0x5985b2){return{'model':db[_0x5985b2['model']],'as':_0x5985b2['as'],'attributes':_0x5985b2['attributes']};}):[]};}):[]};}):[]:[]})[_0x3de1('0x1d')](function(_0xc6537a){logger[_0x3de1('0x1e')](_0x3de1('0x14'),_0x510e5a);logger[_0x3de1('0xe')](_0x3de1('0x14'),_0x510e5a,JSON[_0x3de1('0xf')](_0xc6537a));_0x5a10f2(_0xc6537a);})[_0x3de1('0x13')](function(_0x898786){logger[_0x3de1('0x10')](_0x3de1('0x14'),_0x898786[_0x3de1('0x11')],_0x510e5a);_0x1e5a06(_0x19254b['error'](0x1f4,_0x898786['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index b100da0..7150c10 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 _0x18a5=['destroy','removeLists','removeBlackLists','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addLists','addBlackLists','put','update','delete'];(function(_0x24cf7f,_0xcda231){var _0x4c6742=function(_0x2469db){while(--_0x2469db){_0x24cf7f['push'](_0x24cf7f['shift']());}};_0x4c6742(++_0xcda231);}(_0x18a5,0x164));var _0x518a=function(_0x395bd2,_0x4e0a20){_0x395bd2=_0x395bd2-0x0;var _0x518dc4=_0x18a5[_0x395bd2];return _0x518dc4;};'use strict';var multer=require(_0x518a('0x0'));var util=require(_0x518a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x518a('0x2'));var router=express['Router']();var fs_extra=require(_0x518a('0x3'));var auth=require(_0x518a('0x4'));var interaction=require(_0x518a('0x5'));var config=require(_0x518a('0x6'));var controller=require(_0x518a('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x518a('0x8')](_0x518a('0x9'),auth[_0x518a('0xa')](),controller[_0x518a('0xb')]);router[_0x518a('0x8')](_0x518a('0xc'),auth[_0x518a('0xa')](),controller[_0x518a('0xd')]);router[_0x518a('0x8')](_0x518a('0xe'),auth[_0x518a('0xa')](),controller[_0x518a('0xf')]);router[_0x518a('0x8')](_0x518a('0x10'),auth[_0x518a('0xa')](),controller['getHopperFinals']);router[_0x518a('0x8')]('/:id/hopper_black',auth[_0x518a('0xa')](),controller['getHopperBlacks']);router[_0x518a('0x8')](_0x518a('0x11'),auth[_0x518a('0xa')](),controller[_0x518a('0x12')]);router[_0x518a('0x8')](_0x518a('0x13'),auth[_0x518a('0xa')](),controller['getBlackLists']);router[_0x518a('0x14')]('/',auth[_0x518a('0xa')](),controller[_0x518a('0x15')]);router['post'](_0x518a('0x16'),auth[_0x518a('0xa')](),controller['clone']);router['post'](_0x518a('0x11'),auth['isAuthenticated'](),controller[_0x518a('0x17')]);router[_0x518a('0x14')](_0x518a('0x13'),auth[_0x518a('0xa')](),controller[_0x518a('0x18')]);router[_0x518a('0x19')](_0x518a('0x9'),auth[_0x518a('0xa')](),controller[_0x518a('0x1a')]);router[_0x518a('0x1b')](_0x518a('0x9'),auth[_0x518a('0xa')](),controller[_0x518a('0x1c')]);router['delete'](_0x518a('0x11'),auth['isAuthenticated'](),controller[_0x518a('0x1d')]);router['delete'](_0x518a('0x13'),auth[_0x518a('0xa')](),controller[_0x518a('0x1e')]);module[_0x518a('0x1f')]=router;
\ No newline at end of file
+var _0xf9f7=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','addLists','/:id/blacklists','addBlackLists','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers'];(function(_0x3162d2,_0x5608e1){var _0x228fbf=function(_0x3942b8){while(--_0x3942b8){_0x3162d2['push'](_0x3162d2['shift']());}};_0x228fbf(++_0x5608e1);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x3a1dec,_0x1f943f){_0x3a1dec=_0x3a1dec-0x0;var _0x60ede0=_0xf9f7[_0x3a1dec];return _0x60ede0;};'use strict';var multer=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var path=require(_0x7f9f('0x2'));var timeout=require(_0x7f9f('0x3'));var express=require(_0x7f9f('0x4'));var router=express[_0x7f9f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7f9f('0x6'));var config=require(_0x7f9f('0x7'));var controller=require(_0x7f9f('0x8'));router[_0x7f9f('0x9')]('/',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0xb')]);router['get'](_0x7f9f('0xc'),auth[_0x7f9f('0xa')](),controller[_0x7f9f('0xd')]);router[_0x7f9f('0x9')](_0x7f9f('0xe'),auth['isAuthenticated'](),controller[_0x7f9f('0xf')]);router[_0x7f9f('0x9')](_0x7f9f('0x10'),auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x11')]);router[_0x7f9f('0x9')](_0x7f9f('0x12'),auth['isAuthenticated'](),controller[_0x7f9f('0x13')]);router[_0x7f9f('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x7f9f('0x14')]);router['get'](_0x7f9f('0x15'),auth[_0x7f9f('0xa')](),controller['getLists']);router[_0x7f9f('0x9')]('/:id/blacklists',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x16')]);router[_0x7f9f('0x17')]('/',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x18')]);router['post'](_0x7f9f('0x19'),auth[_0x7f9f('0xa')](),controller['clone']);router[_0x7f9f('0x17')]('/:id/lists',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x1a')]);router[_0x7f9f('0x17')](_0x7f9f('0x1b'),auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x1c')]);router['put'](_0x7f9f('0xc'),auth[_0x7f9f('0xa')](),controller['update']);router[_0x7f9f('0x1d')]('/:id',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x1e')]);router[_0x7f9f('0x1d')](_0x7f9f('0x15'),auth['isAuthenticated'](),controller[_0x7f9f('0x1f')]);router['delete']('/:id/blacklists',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x20')]);module[_0x7f9f('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index e6d2b87..7fa9dde 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 _0xd9cf=['medium','VIRTUAL','sequelize','STRING','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd9cf,0x19c));var _0xfd9c=function(_0x3856d1,_0x39feb0){_0x3856d1=_0x3856d1-0x0;var _0x2b6824=_0xd9cf[_0x3856d1];return _0x2b6824;};'use strict';var Sequelize=require(_0xfd9c('0x0'));module['exports']={'key':{'type':Sequelize[_0xfd9c('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xfd9c('0x2')],'length':_0xfd9c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfd9c('0x1')]},'name':{'type':Sequelize[_0xfd9c('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x4940=['key','exports','STRING','TEXT','medium','VIRTUAL','getDataValue'];(function(_0x2b43f4,_0x26227b){var _0x540009=function(_0x1a2467){while(--_0x1a2467){_0x2b43f4['push'](_0x2b43f4['shift']());}};_0x540009(++_0x26227b);}(_0x4940,0xe1));var _0x0494=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x4940[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module[_0x0494('0x0')]={'key':{'type':Sequelize[_0x0494('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x0494('0x2')],'length':_0x0494('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0494('0x1')]},'name':{'type':Sequelize[_0x0494('0x4')],'get':function(){return this[_0x0494('0x5')](_0x0494('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f047d6c..09d19df 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 _0xe61b=['UserProfileSection','CannedAnswers','userProfileId','UserProfileResource','error','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','then','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xe61b,0xad));var _0xbe61=function(_0x34b1b8,_0x54c9bf){_0x34b1b8=_0x34b1b8-0x0;var _0x542dd8=_0xe61b[_0x34b1b8];return _0x542dd8;};'use strict';var emlformat=require(_0xbe61('0x0'));var rimraf=require(_0xbe61('0x1'));var zipdir=require(_0xbe61('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe61('0x3'));var moment=require(_0xbe61('0x4'));var BPromise=require(_0xbe61('0x5'));var Mustache=require(_0xbe61('0x6'));var util=require(_0xbe61('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbe61('0x8'));var crypto=require(_0xbe61('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbe61('0xa'));var toCsv=require(_0xbe61('0xb'));var querystring=require(_0xbe61('0xc'));var Papa=require(_0xbe61('0xd'));var Redis=require(_0xbe61('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbe61('0xf'));var as=require(_0xbe61('0x10'));var hardwareService=require(_0xbe61('0x11'));var logger=require('../../config/logger')(_0xbe61('0x12'));var utils=require('../../config/utils');var config=require(_0xbe61('0x13'));var licenseUtil=require(_0xbe61('0x14'));var db=require(_0xbe61('0x15'))['db'];function respondWithStatusCode(_0xc67b2f,_0x29fe4f){_0x29fe4f=_0x29fe4f||0xcc;return function(_0x11256f){if(_0x11256f){return _0xc67b2f[_0xbe61('0x16')](_0x29fe4f);}return _0xc67b2f[_0xbe61('0x17')](_0x29fe4f)['end']();};}function respondWithResult(_0x2a282b,_0x4bcba7){_0x4bcba7=_0x4bcba7||0xc8;return function(_0x4e8afe){if(_0x4e8afe){return _0x2a282b[_0xbe61('0x17')](_0x4bcba7)[_0xbe61('0x18')](_0x4e8afe);}};}function respondWithFilteredResult(_0x15b87d,_0x59cecf){return function(_0x151081){if(_0x151081){var _0xb95d7b=typeof _0x59cecf[_0xbe61('0x19')]===_0xbe61('0x1a')&&typeof _0x59cecf['limit']===_0xbe61('0x1a');var _0x256529=_0x151081[_0xbe61('0x1b')];var _0x168c2b=_0xb95d7b?0x0:_0x59cecf[_0xbe61('0x19')];var _0x556a3f=_0xb95d7b?_0x151081[_0xbe61('0x1b')]:_0x59cecf['offset']+_0x59cecf['limit'];var _0x3a96c5;if(_0x556a3f>=_0x256529){_0x556a3f=_0x256529;_0x3a96c5=0xc8;}else{_0x3a96c5=0xce;}_0x15b87d['status'](_0x3a96c5);return _0x15b87d[_0xbe61('0x1c')](_0xbe61('0x1d'),_0x168c2b+'-'+_0x556a3f+'/'+_0x256529)[_0xbe61('0x18')](_0x151081);}return null;};}function patchUpdates(_0x7cb326){return function(_0x20bbb1){try{jsonpatch[_0xbe61('0x1e')](_0x20bbb1,_0x7cb326,!![]);}catch(_0x5657e6){return BPromise['reject'](_0x5657e6);}return _0x20bbb1[_0xbe61('0x1f')]();};}function saveUpdates(_0x53107a,_0x261b7c){return function(_0x428de9){if(_0x428de9){return _0x428de9[_0xbe61('0x20')](_0x53107a)['then'](function(_0x205ac4){return _0x205ac4;});}return null;};}function removeEntity(_0xb3ce7d,_0x4904a6){return function(_0x2b779a){if(_0x2b779a){return _0x2b779a[_0xbe61('0x21')]()['then'](function(){var _0x52dc3f=_0x2b779a[_0xbe61('0x22')]({'plain':!![]});var _0x700643='CannedAnswers';return db['UserProfileResource'][_0xbe61('0x21')]({'where':{'type':_0x700643,'resourceId':_0x52dc3f['id']}})['then'](function(){return _0x2b779a;});})[_0xbe61('0x23')](function(){_0xb3ce7d[_0xbe61('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7eb8,_0x4b53aa){return function(_0x14358c){if(!_0x14358c){_0x3a7eb8['sendStatus'](0x194);}return _0x14358c;};}function handleError(_0x399467,_0x52de8f){_0x52de8f=_0x52de8f||0x1f4;return function(_0x589e09){logger['error'](_0x589e09[_0xbe61('0x24')]);if(_0x589e09[_0xbe61('0x25')]){delete _0x589e09[_0xbe61('0x25')];}_0x399467[_0xbe61('0x17')](_0x52de8f)[_0xbe61('0x26')](_0x589e09);};}exports[_0xbe61('0x27')]=function(_0x31823b,_0x3d6af2){var _0xf89eef={},_0x501b7c={},_0x326f56={'count':0x0,'rows':[]};var _0x55fde3=_['map'](db[_0xbe61('0x28')][_0xbe61('0x29')],function(_0x1fa080){return{'name':_0x1fa080[_0xbe61('0x2a')],'type':_0x1fa080[_0xbe61('0x2b')][_0xbe61('0x2c')]};});_0x501b7c[_0xbe61('0x2d')]=_['map'](_0x55fde3,_0xbe61('0x25'));_0x501b7c['query']=_[_0xbe61('0x2e')](_0x31823b['query']);_0x501b7c[_0xbe61('0x2f')]=_[_0xbe61('0x30')](_0x501b7c[_0xbe61('0x2d')],_0x501b7c[_0xbe61('0x31')]);_0xf89eef[_0xbe61('0x32')]=_[_0xbe61('0x30')](_0x501b7c[_0xbe61('0x2d')],qs['fields'](_0x31823b['query'][_0xbe61('0x33')]));_0xf89eef[_0xbe61('0x32')]=_0xf89eef[_0xbe61('0x32')][_0xbe61('0x34')]?_0xf89eef[_0xbe61('0x32')]:_0x501b7c['model'];if(!_0x31823b[_0xbe61('0x31')][_0xbe61('0x35')](_0xbe61('0x36'))){_0xf89eef[_0xbe61('0x37')]=qs[_0xbe61('0x37')](_0x31823b[_0xbe61('0x31')]['limit']);_0xf89eef[_0xbe61('0x19')]=qs['offset'](_0x31823b[_0xbe61('0x31')][_0xbe61('0x19')]);}_0xf89eef[_0xbe61('0x38')]=qs[_0xbe61('0x39')](_0x31823b['query']['sort']);_0xf89eef[_0xbe61('0x3a')]=qs['filters'](_[_0xbe61('0x3b')](_0x31823b[_0xbe61('0x31')],_0x501b7c[_0xbe61('0x2f')]),_0x55fde3);if(_0x31823b[_0xbe61('0x31')][_0xbe61('0x3c')]){_0xf89eef[_0xbe61('0x3a')]=_['merge'](_0xf89eef[_0xbe61('0x3a')],{'$or':[{'key':{'$like':'%'+_0x31823b[_0xbe61('0x31')][_0xbe61('0x3c')]+'%'}},{'value':{'$like':'%'+_0x31823b['query']['filter']+'%'}}]});}_0xf89eef=_[_0xbe61('0x3d')]({},_0xf89eef,_0x31823b[_0xbe61('0x3e')]);var _0x2b60={'where':_0xf89eef[_0xbe61('0x3a')]};return db[_0xbe61('0x28')]['count'](_0x2b60)['then'](function(_0xf900d2){_0x326f56['count']=_0xf900d2;if(_0x31823b['query'][_0xbe61('0x3f')]){_0xf89eef[_0xbe61('0x40')]=[{'all':!![]}];}return db[_0xbe61('0x28')][_0xbe61('0x41')](_0xf89eef);})[_0xbe61('0x23')](function(_0x51e968){_0x326f56['rows']=_0x51e968;return _0x326f56;})[_0xbe61('0x23')](respondWithFilteredResult(_0x3d6af2,_0xf89eef))['catch'](handleError(_0x3d6af2,null));};exports[_0xbe61('0x42')]=function(_0x1b96cf,_0x1d694b){var _0x5cee48={'raw':!![],'where':{'id':_0x1b96cf[_0xbe61('0x43')]['id']}},_0x1b2dbc={};_0x1b2dbc[_0xbe61('0x2d')]=_[_0xbe61('0x2e')](db[_0xbe61('0x28')][_0xbe61('0x29')]);_0x1b2dbc[_0xbe61('0x31')]=_[_0xbe61('0x2e')](_0x1b96cf[_0xbe61('0x31')]);_0x1b2dbc[_0xbe61('0x2f')]=_[_0xbe61('0x30')](_0x1b2dbc[_0xbe61('0x2d')],_0x1b2dbc['query']);_0x5cee48[_0xbe61('0x32')]=_[_0xbe61('0x30')](_0x1b2dbc['model'],qs['fields'](_0x1b96cf[_0xbe61('0x31')][_0xbe61('0x33')]));_0x5cee48['attributes']=_0x5cee48[_0xbe61('0x32')][_0xbe61('0x34')]?_0x5cee48[_0xbe61('0x32')]:_0x1b2dbc[_0xbe61('0x2d')];if(_0x1b96cf[_0xbe61('0x31')]['includeAll']){_0x5cee48['include']=[{'all':!![]}];}_0x5cee48=_[_0xbe61('0x3d')]({},_0x5cee48,_0x1b96cf[_0xbe61('0x3e')]);return db[_0xbe61('0x28')][_0xbe61('0x44')](_0x5cee48)[_0xbe61('0x23')](handleEntityNotFound(_0x1d694b,null))[_0xbe61('0x23')](respondWithResult(_0x1d694b,null))[_0xbe61('0x45')](handleError(_0x1d694b,null));};exports[_0xbe61('0x20')]=function(_0x4ca17c,_0x279fef){if(_0x4ca17c['body']['id']){delete _0x4ca17c['body']['id'];}return db[_0xbe61('0x28')][_0xbe61('0x44')]({'where':{'id':_0x4ca17c[_0xbe61('0x43')]['id']}})[_0xbe61('0x23')](handleEntityNotFound(_0x279fef,null))[_0xbe61('0x23')](saveUpdates(_0x4ca17c[_0xbe61('0x46')],null))[_0xbe61('0x23')](respondWithResult(_0x279fef,null))['catch'](handleError(_0x279fef,null));};exports[_0xbe61('0x21')]=function(_0x354fae,_0xc26b1c){return db[_0xbe61('0x28')][_0xbe61('0x44')]({'where':{'id':_0x354fae['params']['id']}})[_0xbe61('0x23')](handleEntityNotFound(_0xc26b1c,null))[_0xbe61('0x23')](removeEntity(_0xc26b1c,null))['catch'](handleError(_0xc26b1c,null));};exports[_0xbe61('0x47')]=function(_0x533530,_0xcbd6e3){var _0xf1ecba={'key':_0x533530[_0xbe61('0x46')][_0xbe61('0x2c')]};if(_0x533530[_0xbe61('0x46')][_0xbe61('0x48')]){_0xf1ecba[_0xbe61('0x48')]=_0x533530[_0xbe61('0x46')][_0xbe61('0x48')];}else if(_0x533530[_0xbe61('0x46')][_0xbe61('0x49')]){_0xf1ecba['SmsAccountId']=_0x533530[_0xbe61('0x46')][_0xbe61('0x49')];}else if(_0x533530[_0xbe61('0x46')][_0xbe61('0x4a')]){_0xf1ecba['OpenchannelAccountId']=_0x533530[_0xbe61('0x46')]['OpenchannelAccountId'];}else if(_0x533530[_0xbe61('0x46')][_0xbe61('0x4b')]){_0xf1ecba[_0xbe61('0x4b')]=_0x533530[_0xbe61('0x46')][_0xbe61('0x4b')];}return db[_0xbe61('0x28')][_0xbe61('0x44')]({'where':_0xf1ecba})[_0xbe61('0x23')](function(_0x6138ef){if(_0x6138ef){throw new db['Sequelize']['ValidationError'](_0xbe61('0x4c'));}return db[_0xbe61('0x28')][_0xbe61('0x47')](_0x533530[_0xbe61('0x46')]);})[_0xbe61('0x23')](function(_0x10261d){var _0x4bd691=_0x533530[_0xbe61('0x4d')][_0xbe61('0x22')]({'plain':!![]});if(!_0x4bd691)throw new Error(_0xbe61('0x4e'));if(_0x4bd691['role']==='user'){var _0x3d66f5=_0x10261d[_0xbe61('0x22')]({'plain':!![]});return db[_0xbe61('0x4f')]['find']({'where':{'name':_0xbe61('0x50'),'userProfileId':_0x4bd691[_0xbe61('0x51')]},'raw':!![]})[_0xbe61('0x23')](function(_0x386b00){if(_0x386b00&&_0x386b00['autoAssociation']===0x0){return db[_0xbe61('0x52')]['create']({'name':_0x3d66f5[_0xbe61('0x25')],'resourceId':_0x3d66f5['id'],'type':_0x386b00[_0xbe61('0x25')],'sectionId':_0x386b00['id']},{})[_0xbe61('0x23')](function(){return _0x10261d;});}else{return _0x10261d;}})[_0xbe61('0x45')](function(_0x509a21){logger[_0xbe61('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x509a21);throw _0x509a21;});}return _0x10261d;})['then'](respondWithResult(_0xcbd6e3,0xc9))[_0xbe61('0x45')](handleError(_0xcbd6e3,null));};
\ No newline at end of file
+var _0x7e96=['catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','CannedAnswers','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x7e96,0x1e4));var _0x67e9=function(_0x503350,_0x3fbbb8){_0x503350=_0x503350-0x0;var _0x49e615=_0x7e96[_0x503350];return _0x49e615;};'use strict';var emlformat=require(_0x67e9('0x0'));var rimraf=require(_0x67e9('0x1'));var zipdir=require(_0x67e9('0x2'));var jsonpatch=require(_0x67e9('0x3'));var rp=require(_0x67e9('0x4'));var moment=require(_0x67e9('0x5'));var BPromise=require(_0x67e9('0x6'));var Mustache=require(_0x67e9('0x7'));var util=require(_0x67e9('0x8'));var path=require('path');var sox=require(_0x67e9('0x9'));var csv=require(_0x67e9('0xa'));var ejs=require(_0x67e9('0xb'));var fs=require('fs');var fs_extra=require(_0x67e9('0xc'));var _=require('lodash');var squel=require(_0x67e9('0xd'));var crypto=require(_0x67e9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x67e9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x67e9('0x10'));var Papa=require(_0x67e9('0x11'));var Redis=require(_0x67e9('0x12'));var authService=require(_0x67e9('0x13'));var qs=require(_0x67e9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67e9('0x15'));var logger=require(_0x67e9('0x16'))(_0x67e9('0x17'));var utils=require('../../config/utils');var config=require(_0x67e9('0x18'));var licenseUtil=require(_0x67e9('0x19'));var db=require(_0x67e9('0x1a'))['db'];function respondWithStatusCode(_0x377419,_0x20adef){_0x20adef=_0x20adef||0xcc;return function(_0x1122e7){if(_0x1122e7){return _0x377419[_0x67e9('0x1b')](_0x20adef);}return _0x377419[_0x67e9('0x1c')](_0x20adef)[_0x67e9('0x1d')]();};}function respondWithResult(_0x33321f,_0x19375e){_0x19375e=_0x19375e||0xc8;return function(_0x4bd267){if(_0x4bd267){return _0x33321f[_0x67e9('0x1c')](_0x19375e)[_0x67e9('0x1e')](_0x4bd267);}};}function respondWithFilteredResult(_0x540a07,_0x2f5408){return function(_0x428487){if(_0x428487){var _0x425364=typeof _0x2f5408[_0x67e9('0x1f')]===_0x67e9('0x20')&&typeof _0x2f5408[_0x67e9('0x21')]==='undefined';var _0x8cc9d9=_0x428487[_0x67e9('0x22')];var _0x28bc7=_0x425364?0x0:_0x2f5408[_0x67e9('0x1f')];var _0x317c50=_0x425364?_0x428487['count']:_0x2f5408['offset']+_0x2f5408[_0x67e9('0x21')];var _0x362f7b;if(_0x317c50>=_0x8cc9d9){_0x317c50=_0x8cc9d9;_0x362f7b=0xc8;}else{_0x362f7b=0xce;}_0x540a07[_0x67e9('0x1c')](_0x362f7b);return _0x540a07[_0x67e9('0x23')]('Content-Range',_0x28bc7+'-'+_0x317c50+'/'+_0x8cc9d9)[_0x67e9('0x1e')](_0x428487);}return null;};}function patchUpdates(_0x25a1ee){return function(_0x33aaba){try{jsonpatch[_0x67e9('0x24')](_0x33aaba,_0x25a1ee,!![]);}catch(_0x3038fb){return BPromise[_0x67e9('0x25')](_0x3038fb);}return _0x33aaba[_0x67e9('0x26')]();};}function saveUpdates(_0x3bb8e7,_0x230f8d){return function(_0x453dab){if(_0x453dab){return _0x453dab[_0x67e9('0x27')](_0x3bb8e7)['then'](function(_0x516ea1){return _0x516ea1;});}return null;};}function removeEntity(_0x31d5d7,_0x139331){return function(_0x2c5a0e){if(_0x2c5a0e){return _0x2c5a0e[_0x67e9('0x28')]()[_0x67e9('0x29')](function(){var _0x5d186e=_0x2c5a0e['get']({'plain':!![]});var _0x58c358=_0x67e9('0x2a');return db[_0x67e9('0x2b')]['destroy']({'where':{'type':_0x58c358,'resourceId':_0x5d186e['id']}})[_0x67e9('0x29')](function(){return _0x2c5a0e;});})[_0x67e9('0x29')](function(){_0x31d5d7[_0x67e9('0x1c')](0xcc)[_0x67e9('0x1d')]();});}};}function handleEntityNotFound(_0x377466,_0x78e176){return function(_0x450a95){if(!_0x450a95){_0x377466['sendStatus'](0x194);}return _0x450a95;};}function handleError(_0x3c4b24,_0x588be7){_0x588be7=_0x588be7||0x1f4;return function(_0x3c6d8b){logger[_0x67e9('0x2c')](_0x3c6d8b['stack']);if(_0x3c6d8b[_0x67e9('0x2d')]){delete _0x3c6d8b[_0x67e9('0x2d')];}_0x3c4b24[_0x67e9('0x1c')](_0x588be7)[_0x67e9('0x2e')](_0x3c6d8b);};}exports[_0x67e9('0x2f')]=function(_0x570f5a,_0x1ca9c9){var _0x54c456={},_0x383560={},_0x3ac090={'count':0x0,'rows':[]};var _0x5b98d2=_[_0x67e9('0x30')](db['CannedAnswer'][_0x67e9('0x31')],function(_0x3b1401){return{'name':_0x3b1401[_0x67e9('0x32')],'type':_0x3b1401[_0x67e9('0x33')][_0x67e9('0x34')]};});_0x383560[_0x67e9('0x35')]=_[_0x67e9('0x30')](_0x5b98d2,_0x67e9('0x2d'));_0x383560[_0x67e9('0x36')]=_[_0x67e9('0x37')](_0x570f5a[_0x67e9('0x36')]);_0x383560[_0x67e9('0x38')]=_[_0x67e9('0x39')](_0x383560[_0x67e9('0x35')],_0x383560[_0x67e9('0x36')]);_0x54c456[_0x67e9('0x3a')]=_[_0x67e9('0x39')](_0x383560[_0x67e9('0x35')],qs[_0x67e9('0x3b')](_0x570f5a[_0x67e9('0x36')]['fields']));_0x54c456['attributes']=_0x54c456[_0x67e9('0x3a')][_0x67e9('0x3c')]?_0x54c456[_0x67e9('0x3a')]:_0x383560[_0x67e9('0x35')];if(!_0x570f5a[_0x67e9('0x36')][_0x67e9('0x3d')](_0x67e9('0x3e'))){_0x54c456[_0x67e9('0x21')]=qs[_0x67e9('0x21')](_0x570f5a[_0x67e9('0x36')]['limit']);_0x54c456['offset']=qs[_0x67e9('0x1f')](_0x570f5a[_0x67e9('0x36')]['offset']);}_0x54c456[_0x67e9('0x3f')]=qs[_0x67e9('0x40')](_0x570f5a['query']['sort']);_0x54c456['where']=qs[_0x67e9('0x38')](_['pick'](_0x570f5a[_0x67e9('0x36')],_0x383560[_0x67e9('0x38')]),_0x5b98d2);if(_0x570f5a[_0x67e9('0x36')]['filter']){_0x54c456[_0x67e9('0x41')]=_['merge'](_0x54c456[_0x67e9('0x41')],{'$or':[{'key':{'$like':'%'+_0x570f5a[_0x67e9('0x36')][_0x67e9('0x42')]+'%'}},{'value':{'$like':'%'+_0x570f5a[_0x67e9('0x36')]['filter']+'%'}}]});}_0x54c456=_[_0x67e9('0x43')]({},_0x54c456,_0x570f5a[_0x67e9('0x44')]);var _0x26008d={'where':_0x54c456[_0x67e9('0x41')]};return db[_0x67e9('0x45')]['count'](_0x26008d)[_0x67e9('0x29')](function(_0x33e217){_0x3ac090['count']=_0x33e217;if(_0x570f5a['query'][_0x67e9('0x46')]){_0x54c456[_0x67e9('0x47')]=[{'all':!![]}];}return db[_0x67e9('0x45')][_0x67e9('0x48')](_0x54c456);})[_0x67e9('0x29')](function(_0x4b8ce3){_0x3ac090[_0x67e9('0x49')]=_0x4b8ce3;return _0x3ac090;})[_0x67e9('0x29')](respondWithFilteredResult(_0x1ca9c9,_0x54c456))[_0x67e9('0x4a')](handleError(_0x1ca9c9,null));};exports[_0x67e9('0x4b')]=function(_0x1d7eb0,_0x4d8b4e){var _0x35a91c={'raw':!![],'where':{'id':_0x1d7eb0[_0x67e9('0x4c')]['id']}},_0x20b331={};_0x20b331['model']=_[_0x67e9('0x37')](db[_0x67e9('0x45')][_0x67e9('0x31')]);_0x20b331[_0x67e9('0x36')]=_[_0x67e9('0x37')](_0x1d7eb0[_0x67e9('0x36')]);_0x20b331[_0x67e9('0x38')]=_['intersection'](_0x20b331[_0x67e9('0x35')],_0x20b331[_0x67e9('0x36')]);_0x35a91c['attributes']=_[_0x67e9('0x39')](_0x20b331[_0x67e9('0x35')],qs[_0x67e9('0x3b')](_0x1d7eb0['query'][_0x67e9('0x3b')]));_0x35a91c[_0x67e9('0x3a')]=_0x35a91c[_0x67e9('0x3a')][_0x67e9('0x3c')]?_0x35a91c[_0x67e9('0x3a')]:_0x20b331[_0x67e9('0x35')];if(_0x1d7eb0[_0x67e9('0x36')][_0x67e9('0x46')]){_0x35a91c[_0x67e9('0x47')]=[{'all':!![]}];}_0x35a91c=_['merge']({},_0x35a91c,_0x1d7eb0[_0x67e9('0x44')]);return db[_0x67e9('0x45')][_0x67e9('0x4d')](_0x35a91c)['then'](handleEntityNotFound(_0x4d8b4e,null))['then'](respondWithResult(_0x4d8b4e,null))['catch'](handleError(_0x4d8b4e,null));};exports[_0x67e9('0x27')]=function(_0x4f59fa,_0x2411fd){if(_0x4f59fa['body']['id']){delete _0x4f59fa[_0x67e9('0x4e')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x4f59fa['params']['id']}})[_0x67e9('0x29')](handleEntityNotFound(_0x2411fd,null))[_0x67e9('0x29')](saveUpdates(_0x4f59fa[_0x67e9('0x4e')],null))[_0x67e9('0x29')](respondWithResult(_0x2411fd,null))[_0x67e9('0x4a')](handleError(_0x2411fd,null));};exports['destroy']=function(_0x57da5d,_0x11654d){return db[_0x67e9('0x45')][_0x67e9('0x4d')]({'where':{'id':_0x57da5d[_0x67e9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x11654d,null))[_0x67e9('0x29')](removeEntity(_0x11654d,null))[_0x67e9('0x4a')](handleError(_0x11654d,null));};exports[_0x67e9('0x4f')]=function(_0x2cf950,_0x526ecf){var _0x13f510={'key':_0x2cf950['body'][_0x67e9('0x34')]};if(_0x2cf950[_0x67e9('0x4e')][_0x67e9('0x50')]){_0x13f510['MailAccountId']=_0x2cf950[_0x67e9('0x4e')][_0x67e9('0x50')];}else if(_0x2cf950[_0x67e9('0x4e')][_0x67e9('0x51')]){_0x13f510[_0x67e9('0x51')]=_0x2cf950[_0x67e9('0x4e')][_0x67e9('0x51')];}else if(_0x2cf950[_0x67e9('0x4e')][_0x67e9('0x52')]){_0x13f510[_0x67e9('0x52')]=_0x2cf950['body'][_0x67e9('0x52')];}else if(_0x2cf950[_0x67e9('0x4e')][_0x67e9('0x53')]){_0x13f510[_0x67e9('0x53')]=_0x2cf950[_0x67e9('0x4e')][_0x67e9('0x53')];}return db[_0x67e9('0x45')][_0x67e9('0x4d')]({'where':_0x13f510})[_0x67e9('0x29')](function(_0x51e212){if(_0x51e212){throw new db[(_0x67e9('0x54'))][(_0x67e9('0x55'))](_0x67e9('0x56'));}return db['CannedAnswer'][_0x67e9('0x4f')](_0x2cf950[_0x67e9('0x4e')]);})[_0x67e9('0x29')](function(_0xaa1947){var _0x148ae4=_0x2cf950[_0x67e9('0x57')]['get']({'plain':!![]});if(!_0x148ae4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x148ae4[_0x67e9('0x58')]===_0x67e9('0x57')){var _0x3941a1=_0xaa1947[_0x67e9('0x59')]({'plain':!![]});return db[_0x67e9('0x5a')][_0x67e9('0x4d')]({'where':{'name':'CannedAnswers','userProfileId':_0x148ae4[_0x67e9('0x5b')]},'raw':!![]})['then'](function(_0x2d744f){if(_0x2d744f&&_0x2d744f['autoAssociation']===0x0){return db['UserProfileResource'][_0x67e9('0x4f')]({'name':_0x3941a1[_0x67e9('0x2d')],'resourceId':_0x3941a1['id'],'type':_0x2d744f[_0x67e9('0x2d')],'sectionId':_0x2d744f['id']},{})[_0x67e9('0x29')](function(){return _0xaa1947;});}else{return _0xaa1947;}})[_0x67e9('0x4a')](function(_0x10c200){logger[_0x67e9('0x2c')](_0x67e9('0x5c'),_0x10c200);throw _0x10c200;});}return _0xaa1947;})[_0x67e9('0x29')](respondWithResult(_0x526ecf,0xc9))[_0x67e9('0x4a')](handleError(_0x526ecf,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 29f3380..563b600 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 _0xca0d=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','rimraf'];(function(_0x501c4c,_0x30ce7f){var _0x318509=function(_0x2f5c93){while(--_0x2f5c93){_0x501c4c['push'](_0x501c4c['shift']());}};_0x318509(++_0x30ce7f);}(_0xca0d,0x17b));var _0xdca0=function(_0x3f267c,_0x150415){_0x3f267c=_0x3f267c-0x0;var _0x124815=_0xca0d[_0x3f267c];return _0x124815;};'use strict';var _=require(_0xdca0('0x0'));var util=require(_0xdca0('0x1'));var logger=require(_0xdca0('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdca0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdca0('0x4'));var config=require(_0xdca0('0x5'));var attributes=require(_0xdca0('0x6'));module[_0xdca0('0x7')]=function(_0x2af9b7,_0x1897b8){return _0x2af9b7[_0xdca0('0x8')](_0xdca0('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdca0('0xa'),'collate':_0xdca0('0xb')});};
\ No newline at end of file
+var _0xda51=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','util','request-promise','path'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xda51,0x7f));var _0x1da5=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xda51[_0x21f9c2];return _0x3da17f;};'use strict';var _=require('lodash');var util=require(_0x1da5('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1da5('0x1'));var fs=require('fs');var path=require(_0x1da5('0x2'));var rimraf=require(_0x1da5('0x3'));var config=require(_0x1da5('0x4'));var attributes=require(_0x1da5('0x5'));module[_0x1da5('0x6')]=function(_0xb8ba6f,_0x5b191b){return _0xb8ba6f[_0x1da5('0x7')]('CannedAnswer',attributes,{'tableName':_0x1da5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1da5('0x9'),'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 0fe1965..90faecd 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(_0x300361,_0x1e6ad5){var _0x2a7301=function(_0x441fe6){while(--_0x441fe6){_0x300361['push'](_0x300361['shift']());}};_0x2a7301(++_0x1e6ad5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x2ebcb9,_0x3819cf){var _0x25714a=function(_0x1b0a4f){while(--_0x1b0a4f){_0x2ebcb9['push'](_0x2ebcb9['shift']());}};_0x25714a(++_0x3819cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 f877c66..d1d3d52 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 _0x8be8=['update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x1efcaa,_0x508b7e){var _0x4e5dd9=function(_0x2ef160){while(--_0x2ef160){_0x1efcaa['push'](_0x1efcaa['shift']());}};_0x4e5dd9(++_0x508b7e);}(_0x8be8,0x1e3));var _0x88be=function(_0x41c03d,_0x11991f){_0x41c03d=_0x41c03d-0x0;var _0x4428e4=_0x8be8[_0x41c03d];return _0x4428e4;};'use strict';var multer=require('multer');var util=require(_0x88be('0x0'));var path=require(_0x88be('0x1'));var timeout=require(_0x88be('0x2'));var express=require(_0x88be('0x3'));var router=express[_0x88be('0x4')]();var fs_extra=require(_0x88be('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x88be('0x6'));var config=require(_0x88be('0x7'));var controller=require(_0x88be('0x8'));router[_0x88be('0x9')]('/',auth[_0x88be('0xa')](),controller[_0x88be('0xb')]);router[_0x88be('0x9')](_0x88be('0xc'),auth['isAuthenticated'](),controller[_0x88be('0xd')]);router[_0x88be('0xe')]('/',auth[_0x88be('0xa')](),controller[_0x88be('0xf')]);router[_0x88be('0x10')](_0x88be('0xc'),auth[_0x88be('0xa')](),controller[_0x88be('0x11')]);router[_0x88be('0x12')](_0x88be('0xc'),auth[_0x88be('0xa')](),controller['destroy']);module[_0x88be('0x13')]=router;
\ No newline at end of file
+var _0x81b9=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x81b9,0xa9));var _0x981b=function(_0x34ae74,_0x9b28fa){_0x34ae74=_0x34ae74-0x0;var _0x3ebfbc=_0x81b9[_0x34ae74];return _0x3ebfbc;};'use strict';var multer=require(_0x981b('0x0'));var util=require(_0x981b('0x1'));var path=require('path');var timeout=require(_0x981b('0x2'));var express=require(_0x981b('0x3'));var router=express[_0x981b('0x4')]();var fs_extra=require(_0x981b('0x5'));var auth=require(_0x981b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x981b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x981b('0x8')](_0x981b('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x981b('0xa')](),controller[_0x981b('0xb')]);router[_0x981b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x981b('0xd')]);router[_0x981b('0xe')](_0x981b('0x9'),auth[_0x981b('0xa')](),controller[_0x981b('0xf')]);module[_0x981b('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 0cbb306..17d625c 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 _0x22d5=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x3b4d50,_0x4f8332){var _0x27cffc=function(_0x5117cd){while(--_0x5117cd){_0x3b4d50['push'](_0x3b4d50['shift']());}};_0x27cffc(++_0x4f8332);}(_0x22d5,0xc5));var _0x522d=function(_0x4f8722,_0x47e4ae){_0x4f8722=_0x4f8722-0x0;var _0x1430eb=_0x22d5[_0x4f8722];return _0x1430eb;};'use strict';var Sequelize=require(_0x522d('0x0'));module[_0x522d('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x522d('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x522d('0x3')]},'dst':{'type':Sequelize[_0x522d('0x3')]},'dcontext':{'type':Sequelize[_0x522d('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x522d('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x522d('0x3')]},'duration':{'type':Sequelize[_0x522d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x522d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x522d('0x3')]},'amaflags':{'type':Sequelize[_0x522d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x522d('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x522d('0x3')]},'linkedid':{'type':Sequelize[_0x522d('0x3')]},'sequence':{'type':Sequelize[_0x522d('0x3')]},'peeraccount':{'type':Sequelize[_0x522d('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x522d('0x3')]}};
\ No newline at end of file
+var _0xdb76=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x36c8b0,_0x3d63e3){var _0x1d3145=function(_0x29de60){while(--_0x29de60){_0x36c8b0['push'](_0x36c8b0['shift']());}};_0x1d3145(++_0x3d63e3);}(_0xdb76,0x1be));var _0x6db7=function(_0xaa3699,_0x173245){_0xaa3699=_0xaa3699-0x0;var _0x17ab5c=_0xdb76[_0xaa3699];return _0x17ab5c;};'use strict';var Sequelize=require(_0x6db7('0x0'));module[_0x6db7('0x1')]={'calldate':{'type':Sequelize[_0x6db7('0x2')],'allowNull':![],'defaultValue':_0x6db7('0x3')},'clid':{'type':Sequelize[_0x6db7('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x6db7('0x4')]},'dcontext':{'type':Sequelize[_0x6db7('0x4')]},'channel':{'type':Sequelize[_0x6db7('0x4')]},'dstchannel':{'type':Sequelize[_0x6db7('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6db7('0x4')]},'duration':{'type':Sequelize[_0x6db7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6db7('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6db7('0x4')]},'amaflags':{'type':Sequelize[_0x6db7('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6db7('0x4')]},'uniqueid':{'type':Sequelize[_0x6db7('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x6db7('0x4')]},'peeraccount':{'type':Sequelize[_0x6db7('0x4')]},'type':{'type':Sequelize[_0x6db7('0x4')]},'tag':{'type':Sequelize[_0x6db7('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 7a3b4a2..3f6d5af 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 _0x99c9=['merge','options','include','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','map','Cdr','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','filter'];(function(_0x3b2c66,_0x1bf0ee){var _0x1f16f9=function(_0x5d1570){while(--_0x5d1570){_0x3b2c66['push'](_0x3b2c66['shift']());}};_0x1f16f9(++_0x1bf0ee);}(_0x99c9,0x13c));var _0x999c=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x99c9[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x999c('0x0'));var rimraf=require(_0x999c('0x1'));var zipdir=require(_0x999c('0x2'));var jsonpatch=require(_0x999c('0x3'));var rp=require(_0x999c('0x4'));var moment=require(_0x999c('0x5'));var BPromise=require(_0x999c('0x6'));var Mustache=require('mustache');var util=require(_0x999c('0x7'));var path=require(_0x999c('0x8'));var sox=require(_0x999c('0x9'));var csv=require(_0x999c('0xa'));var ejs=require(_0x999c('0xb'));var fs=require('fs');var fs_extra=require(_0x999c('0xc'));var _=require(_0x999c('0xd'));var squel=require(_0x999c('0xe'));var crypto=require(_0x999c('0xf'));var jsforce=require(_0x999c('0x10'));var deskjs=require(_0x999c('0x11'));var toCsv=require(_0x999c('0xa'));var querystring=require(_0x999c('0x12'));var Papa=require(_0x999c('0x13'));var Redis=require('ioredis');var authService=require(_0x999c('0x14'));var qs=require(_0x999c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x999c('0x16'));var logger=require(_0x999c('0x17'))(_0x999c('0x18'));var utils=require(_0x999c('0x19'));var config=require(_0x999c('0x1a'));var licenseUtil=require(_0x999c('0x1b'));var db=require(_0x999c('0x1c'))['db'];function respondWithStatusCode(_0x3d7c6d,_0x2e5f7e){_0x2e5f7e=_0x2e5f7e||0xcc;return function(_0x44a5bc){if(_0x44a5bc){return _0x3d7c6d[_0x999c('0x1d')](_0x2e5f7e);}return _0x3d7c6d[_0x999c('0x1e')](_0x2e5f7e)['end']();};}function respondWithResult(_0x15f812,_0xd14862){_0xd14862=_0xd14862||0xc8;return function(_0x4f2916){if(_0x4f2916){return _0x15f812['status'](_0xd14862)['json'](_0x4f2916);}};}function respondWithFilteredResult(_0x161434,_0xb3e981){return function(_0x203a73){if(_0x203a73){var _0x116f08=typeof _0xb3e981[_0x999c('0x1f')]==='undefined'&&typeof _0xb3e981[_0x999c('0x20')]===_0x999c('0x21');var _0x2b6126=_0x203a73[_0x999c('0x22')];var _0x110486=_0x116f08?0x0:_0xb3e981['offset'];var _0x1b327f=_0x116f08?_0x203a73[_0x999c('0x22')]:_0xb3e981[_0x999c('0x1f')]+_0xb3e981[_0x999c('0x20')];var _0x32c66c;if(_0x1b327f>=_0x2b6126){_0x1b327f=_0x2b6126;_0x32c66c=0xc8;}else{_0x32c66c=0xce;}_0x161434['status'](_0x32c66c);return _0x161434[_0x999c('0x23')](_0x999c('0x24'),_0x110486+'-'+_0x1b327f+'/'+_0x2b6126)[_0x999c('0x25')](_0x203a73);}return null;};}function patchUpdates(_0x1ec406){return function(_0xceb421){try{jsonpatch[_0x999c('0x26')](_0xceb421,_0x1ec406,!![]);}catch(_0x4a2865){return BPromise[_0x999c('0x27')](_0x4a2865);}return _0xceb421[_0x999c('0x28')]();};}function saveUpdates(_0x24f637,_0x2bcfc9){return function(_0x1c6e55){if(_0x1c6e55){return _0x1c6e55[_0x999c('0x29')](_0x24f637)[_0x999c('0x2a')](function(_0x2a7986){return _0x2a7986;});}return null;};}function removeEntity(_0x4002d2,_0x281720){return function(_0x2cfd83){if(_0x2cfd83){return _0x2cfd83['destroy']()[_0x999c('0x2a')](function(){_0x4002d2[_0x999c('0x1e')](0xcc)[_0x999c('0x2b')]();});}};}function handleEntityNotFound(_0x2e9d58,_0x2256fd){return function(_0x15d102){if(!_0x15d102){_0x2e9d58['sendStatus'](0x194);}return _0x15d102;};}function handleError(_0x4755c2,_0x43293f){_0x43293f=_0x43293f||0x1f4;return function(_0x1c866f){logger['error'](_0x1c866f[_0x999c('0x2c')]);if(_0x1c866f[_0x999c('0x2d')]){delete _0x1c866f['name'];}_0x4755c2[_0x999c('0x1e')](_0x43293f)['send'](_0x1c866f);};}exports['index']=function(_0xedf57d,_0x42cb25){var _0x457df3={},_0x2de6d5={},_0x3737e9={'count':0x0,'rows':[]};var _0x42c2e8=_[_0x999c('0x2e')](db[_0x999c('0x2f')][_0x999c('0x30')],function(_0x3b836a){return{'name':_0x3b836a['fieldName'],'type':_0x3b836a[_0x999c('0x31')][_0x999c('0x32')]};});_0x2de6d5[_0x999c('0x33')]=_[_0x999c('0x2e')](_0x42c2e8,_0x999c('0x2d'));_0x2de6d5[_0x999c('0x34')]=_[_0x999c('0x35')](_0xedf57d[_0x999c('0x34')]);_0x2de6d5['filters']=_['intersection'](_0x2de6d5[_0x999c('0x33')],_0x2de6d5[_0x999c('0x34')]);_0x457df3[_0x999c('0x36')]=_[_0x999c('0x37')](_0x2de6d5['model'],qs[_0x999c('0x38')](_0xedf57d[_0x999c('0x34')][_0x999c('0x38')]));_0x457df3[_0x999c('0x36')]=_0x457df3['attributes']['length']?_0x457df3[_0x999c('0x36')]:_0x2de6d5[_0x999c('0x33')];if(!_0xedf57d[_0x999c('0x34')][_0x999c('0x39')](_0x999c('0x3a'))){_0x457df3[_0x999c('0x20')]=qs[_0x999c('0x20')](_0xedf57d['query']['limit']);_0x457df3['offset']=qs[_0x999c('0x1f')](_0xedf57d[_0x999c('0x34')]['offset']);}_0x457df3['order']=qs['sort'](_0xedf57d[_0x999c('0x34')][_0x999c('0x3b')]);_0x457df3[_0x999c('0x3c')]=qs[_0x999c('0x3d')](_['pick'](_0xedf57d[_0x999c('0x34')],_0x2de6d5[_0x999c('0x3d')]),_0x42c2e8);if(_0xedf57d['query']['filter']){_0x457df3[_0x999c('0x3c')]=_['merge'](_0x457df3[_0x999c('0x3c')],{'$or':_['map'](_0x42c2e8,function(_0x3605a3){if(_0x3605a3[_0x999c('0x31')]!==_0x999c('0x3e')){var _0xcd729={};_0xcd729[_0x3605a3['name']]={'$like':'%'+_0xedf57d['query'][_0x999c('0x3f')]+'%'};return _0xcd729;}})});}_0x457df3=_[_0x999c('0x40')]({},_0x457df3,_0xedf57d[_0x999c('0x41')]);var _0xf26ba3={'where':_0x457df3['where']};return db[_0x999c('0x2f')][_0x999c('0x22')](_0xf26ba3)[_0x999c('0x2a')](function(_0x5fa1de){_0x3737e9['count']=_0x5fa1de;if(_0xedf57d[_0x999c('0x34')]['includeAll']){_0x457df3[_0x999c('0x42')]=[{'all':!![]}];}return db[_0x999c('0x2f')]['findAll'](_0x457df3);})[_0x999c('0x2a')](function(_0x357915){_0x3737e9[_0x999c('0x43')]=_0x357915;return _0x3737e9;})[_0x999c('0x2a')](respondWithFilteredResult(_0x42cb25,_0x457df3))[_0x999c('0x44')](handleError(_0x42cb25,null));};exports[_0x999c('0x45')]=function(_0xa6b0f1,_0x3edf69){var _0x4ef478={'raw':!![],'where':{'id':_0xa6b0f1['params']['id']}},_0x563e11={};_0x563e11['model']=_[_0x999c('0x35')](db[_0x999c('0x2f')][_0x999c('0x30')]);_0x563e11[_0x999c('0x34')]=_[_0x999c('0x35')](_0xa6b0f1['query']);_0x563e11[_0x999c('0x3d')]=_[_0x999c('0x37')](_0x563e11[_0x999c('0x33')],_0x563e11[_0x999c('0x34')]);_0x4ef478[_0x999c('0x36')]=_['intersection'](_0x563e11[_0x999c('0x33')],qs[_0x999c('0x38')](_0xa6b0f1[_0x999c('0x34')][_0x999c('0x38')]));_0x4ef478[_0x999c('0x36')]=_0x4ef478[_0x999c('0x36')][_0x999c('0x46')]?_0x4ef478[_0x999c('0x36')]:_0x563e11[_0x999c('0x33')];if(_0xa6b0f1['query']['includeAll']){_0x4ef478[_0x999c('0x42')]=[{'all':!![]}];}_0x4ef478=_[_0x999c('0x40')]({},_0x4ef478,_0xa6b0f1[_0x999c('0x41')]);return db[_0x999c('0x2f')][_0x999c('0x47')](_0x4ef478)[_0x999c('0x2a')](handleEntityNotFound(_0x3edf69,null))[_0x999c('0x2a')](respondWithResult(_0x3edf69,null))[_0x999c('0x44')](handleError(_0x3edf69,null));};exports[_0x999c('0x48')]=function(_0x26ebd7,_0x3457d6){return db['Cdr'][_0x999c('0x48')](_0x26ebd7[_0x999c('0x49')],{})[_0x999c('0x2a')](respondWithResult(_0x3457d6,0xc9))[_0x999c('0x44')](handleError(_0x3457d6,null));};exports[_0x999c('0x29')]=function(_0x386be6,_0x11f3bf){if(_0x386be6[_0x999c('0x49')]['id']){delete _0x386be6['body']['id'];}return db[_0x999c('0x2f')][_0x999c('0x47')]({'where':{'id':_0x386be6[_0x999c('0x4a')]['id']}})[_0x999c('0x2a')](handleEntityNotFound(_0x11f3bf,null))[_0x999c('0x2a')](saveUpdates(_0x386be6[_0x999c('0x49')],null))[_0x999c('0x2a')](respondWithResult(_0x11f3bf,null))['catch'](handleError(_0x11f3bf,null));};exports['destroy']=function(_0x1139f6,_0x3f134a){return db[_0x999c('0x2f')][_0x999c('0x47')]({'where':{'id':_0x1139f6[_0x999c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f134a,null))[_0x999c('0x2a')](removeEntity(_0x3f134a,null))[_0x999c('0x44')](handleError(_0x3f134a,null));};exports[_0x999c('0x4b')]=function(_0x11cc72,_0x5c066e){return db[_0x999c('0x2f')]['describe']()[_0x999c('0x2a')](respondWithResult(_0x5c066e,null))[_0x999c('0x44')](handleError(_0x5c066e,null));};
\ No newline at end of file
+var _0xd6d6=['key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type'];(function(_0x6dcc3b,_0x506e51){var _0x2dea27=function(_0x24e40e){while(--_0x24e40e){_0x6dcc3b['push'](_0x6dcc3b['shift']());}};_0x2dea27(++_0x506e51);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4c38e4,_0x3f9d7b){_0x4c38e4=_0x4c38e4-0x0;var _0x453a84=_0xd6d6[_0x4c38e4];return _0x453a84;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x2d')](_0xde3272,'name');_0x8a9a84[_0x6d6d('0x34')]=_['keys'](_0x553645[_0x6d6d('0x34')]);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x553645['query'][_0x6d6d('0x38')]));_0x5273cd[_0x6d6d('0x37')]=_0x5273cd[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x5273cd[_0x6d6d('0x37')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x34')][_0x6d6d('0x3a')](_0x6d6d('0x3b'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1e')]);_0x5273cd[_0x6d6d('0x1f')]=qs['offset'](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1f')]);}_0x5273cd[_0x6d6d('0x3c')]=qs[_0x6d6d('0x3d')](_0x553645['query']['sort']);_0x5273cd[_0x6d6d('0x3e')]=qs[_0x6d6d('0x35')](_[_0x6d6d('0x3f')](_0x553645['query'],_0x8a9a84[_0x6d6d('0x35')]),_0xde3272);if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]){_0x5273cd[_0x6d6d('0x3e')]=_['merge'](_0x5273cd['where'],{'$or':_['map'](_0xde3272,function(_0x62620d){if(_0x62620d[_0x6d6d('0x31')]!==_0x6d6d('0x41')){var _0x22a49a={};_0x22a49a[_0x62620d['name']]={'$like':'%'+_0x553645[_0x6d6d('0x34')][_0x6d6d('0x40')]+'%'};return _0x22a49a;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x3d632c={'where':_0x5273cd[_0x6d6d('0x3e')]};return db['Cdr'][_0x6d6d('0x20')](_0x3d632c)[_0x6d6d('0x27')](function(_0x42aff0){_0x57341f[_0x6d6d('0x20')]=_0x42aff0;if(_0x553645[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x5273cd[_0x6d6d('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x6d6d('0x46')](_0x5273cd);})[_0x6d6d('0x27')](function(_0x16e177){_0x57341f[_0x6d6d('0x47')]=_0x16e177;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))['catch'](handleError(_0x3edcce,null));};exports[_0x6d6d('0x48')]=function(_0x39f2a9,_0x55dba8){var _0x452de2={'raw':!![],'where':{'id':_0x39f2a9[_0x6d6d('0x49')]['id']}},_0x50dc17={};_0x50dc17[_0x6d6d('0x33')]=_['keys'](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x50dc17[_0x6d6d('0x34')]=_[_0x6d6d('0x4a')](_0x39f2a9[_0x6d6d('0x34')]);_0x50dc17['filters']=_['intersection'](_0x50dc17[_0x6d6d('0x33')],_0x50dc17['query']);_0x452de2['attributes']=_[_0x6d6d('0x36')](_0x50dc17[_0x6d6d('0x33')],qs[_0x6d6d('0x38')](_0x39f2a9['query'][_0x6d6d('0x38')]));_0x452de2['attributes']=_0x452de2[_0x6d6d('0x37')][_0x6d6d('0x39')]?_0x452de2[_0x6d6d('0x37')]:_0x50dc17[_0x6d6d('0x33')];if(_0x39f2a9[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x452de2[_0x6d6d('0x45')]=[{'all':!![]}];}_0x452de2=_['merge']({},_0x452de2,_0x39f2a9[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')](_0x452de2)[_0x6d6d('0x27')](handleEntityNotFound(_0x55dba8,null))[_0x6d6d('0x27')](respondWithResult(_0x55dba8,null))[_0x6d6d('0x4c')](handleError(_0x55dba8,null));};exports[_0x6d6d('0x4d')]=function(_0x1d2b20,_0x24cec2){return db['Cdr']['create'](_0x1d2b20[_0x6d6d('0x4e')],{})[_0x6d6d('0x27')](respondWithResult(_0x24cec2,0xc9))[_0x6d6d('0x4c')](handleError(_0x24cec2,null));};exports[_0x6d6d('0x26')]=function(_0xe2a20e,_0x492834){if(_0xe2a20e[_0x6d6d('0x4e')]['id']){delete _0xe2a20e[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0xe2a20e[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x492834,null))[_0x6d6d('0x27')](saveUpdates(_0xe2a20e[_0x6d6d('0x4e')],null))[_0x6d6d('0x27')](respondWithResult(_0x492834,null))[_0x6d6d('0x4c')](handleError(_0x492834,null));};exports[_0x6d6d('0x28')]=function(_0x175e26,_0x4d9811){return db[_0x6d6d('0x2e')][_0x6d6d('0x4b')]({'where':{'id':_0x175e26[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x4d9811,null))[_0x6d6d('0x27')](removeEntity(_0x4d9811,null))['catch'](handleError(_0x4d9811,null));};exports[_0x6d6d('0x4f')]=function(_0x36bc5a,_0x45340b){return db['Cdr']['describe']()[_0x6d6d('0x27')](respondWithResult(_0x45340b,null))['catch'](handleError(_0x45340b,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index d4556c5..bd0962e 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x502211,_0x30c0e7){var _0x323391=function(_0x6ebdc0){while(--_0x6ebdc0){_0x502211['push'](_0x502211['shift']());}};_0x323391(++_0x30c0e7);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x7c220b,_0x28c84d){var _0x3b5f7e=function(_0x5af67e){while(--_0x5af67e){_0x7c220b['push'](_0x7c220b['shift']());}};_0x3b5f7e(++_0x28c84d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 704039c..1240a01 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 _0x2b86=['../../config/logger','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x9eb13e,_0x5d5531){var _0x1d7286=function(_0x49369f){while(--_0x49369f){_0x9eb13e['push'](_0x9eb13e['shift']());}};_0x1d7286(++_0x5d5531);}(_0x2b86,0x196));var _0x62b8=function(_0x378739,_0x5c8a7a){_0x378739=_0x378739-0x0;var _0x24471f=_0x2b86[_0x378739];return _0x24471f;};'use strict';var _=require(_0x62b8('0x0'));var util=require(_0x62b8('0x1'));var moment=require(_0x62b8('0x2'));var BPromise=require(_0x62b8('0x3'));var rs=require(_0x62b8('0x4'));var fs=require('fs');var Redis=require(_0x62b8('0x5'));var db=require(_0x62b8('0x6'))['db'];var utils=require(_0x62b8('0x7'));var logger=require(_0x62b8('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x62b8('0x9'));var client=jayson[_0x62b8('0xa')][_0x62b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d0d05,_0x1fdf78,_0x27a4f6){return new BPromise(function(_0x30b4e7,_0x28aac5){return client[_0x62b8('0xc')](_0x2d0d05,_0x27a4f6)['then'](function(_0x2ce483){logger[_0x62b8('0xd')](_0x62b8('0xe'),_0x1fdf78,_0x62b8('0xf'));logger[_0x62b8('0x10')](_0x62b8('0x11'),_0x1fdf78,_0x62b8('0xf'),JSON[_0x62b8('0x12')](_0x2ce483));if(_0x2ce483[_0x62b8('0x13')]){if(_0x2ce483['error']['code']===0x1f4){logger[_0x62b8('0x13')](_0x62b8('0xe'),_0x1fdf78,_0x2ce483['error'][_0x62b8('0x14')]);return _0x28aac5(_0x2ce483[_0x62b8('0x13')][_0x62b8('0x14')]);}logger[_0x62b8('0x13')](_0x62b8('0xe'),_0x1fdf78,_0x2ce483[_0x62b8('0x13')][_0x62b8('0x14')]);return _0x30b4e7(_0x2ce483[_0x62b8('0x13')][_0x62b8('0x14')]);}else{logger['info'](_0x62b8('0xe'),_0x1fdf78,_0x62b8('0xf'));_0x30b4e7(_0x2ce483[_0x62b8('0x15')][_0x62b8('0x14')]);}})[_0x62b8('0x16')](function(_0x70cf90){logger[_0x62b8('0x13')]('Cdr,\x20%s,\x20%s',_0x1fdf78,_0x70cf90);_0x28aac5(_0x70cf90);});});}
\ No newline at end of file
+var _0x6a0c=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent'];(function(_0x19d638,_0x1ca3d7){var _0x2db8b8=function(_0x510385){while(--_0x510385){_0x19d638['push'](_0x19d638['shift']());}};_0x2db8b8(++_0x1ca3d7);}(_0x6a0c,0x10e));var _0xc6a0=function(_0x111316,_0x5c4166){_0x111316=_0x111316-0x0;var _0x5dab09=_0x6a0c[_0x111316];return _0x5dab09;};'use strict';var _=require(_0xc6a0('0x0'));var util=require('util');var moment=require(_0xc6a0('0x1'));var BPromise=require(_0xc6a0('0x2'));var rs=require(_0xc6a0('0x3'));var fs=require('fs');var Redis=require(_0xc6a0('0x4'));var db=require(_0xc6a0('0x5'))['db'];var utils=require(_0xc6a0('0x6'));var logger=require('../../config/logger')(_0xc6a0('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6a0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x340461,_0x309f38,_0x48989b){return new BPromise(function(_0x5c9f1c,_0x4ded67){return client[_0xc6a0('0x9')](_0x340461,_0x48989b)['then'](function(_0x233ebb){logger[_0xc6a0('0xa')](_0xc6a0('0xb'),_0x309f38,'request\x20sent');logger[_0xc6a0('0xc')](_0xc6a0('0xd'),_0x309f38,'request\x20sent',JSON['stringify'](_0x233ebb));if(_0x233ebb[_0xc6a0('0xe')]){if(_0x233ebb[_0xc6a0('0xe')][_0xc6a0('0xf')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x309f38,_0x233ebb['error']['message']);return _0x4ded67(_0x233ebb[_0xc6a0('0xe')][_0xc6a0('0x10')]);}logger[_0xc6a0('0xe')](_0xc6a0('0xb'),_0x309f38,_0x233ebb[_0xc6a0('0xe')][_0xc6a0('0x10')]);return _0x5c9f1c(_0x233ebb[_0xc6a0('0xe')][_0xc6a0('0x10')]);}else{logger['info'](_0xc6a0('0xb'),_0x309f38,_0xc6a0('0x11'));_0x5c9f1c(_0x233ebb['result'][_0xc6a0('0x10')]);}})['catch'](function(_0x14d2c7){logger[_0xc6a0('0xe')](_0xc6a0('0xb'),_0x309f38,_0x14d2c7);_0x4ded67(_0x14d2c7);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 9a31613..a7b7611 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2f6e47,_0x40ba6b){var _0x29c331=function(_0x18d873){while(--_0x18d873){_0x2f6e47['push'](_0x2f6e47['shift']());}};_0x29c331(++_0x40ba6b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x3a0aef,_0x4815f2){var _0x837448=function(_0x2ccc78){while(--_0x2ccc78){_0x3a0aef['push'](_0x3a0aef['shift']());}};_0x837448(++_0x4815f2);}(_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 4a95ecf..c5a7e1e 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 _0x82f0=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x82f0,0x19c));var _0x082f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x82f0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x082f('0x0'));module[_0x082f('0x1')]={'priority':{'type':Sequelize[_0x082f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x082f('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x082f('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x082f('0x5')}};
\ No newline at end of file
+var _0x4631=['exports','INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x2023e1,_0xeca985){var _0x1fe133=function(_0x526d5f){while(--_0x526d5f){_0x2023e1['push'](_0x2023e1['shift']());}};_0x1fe133(++_0xeca985);}(_0x4631,0x18a));var _0x1463=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0x4631[_0x361d3f];return _0x320229;};'use strict';var Sequelize=require(_0x1463('0x0'));module[_0x1463('0x1')]={'priority':{'type':Sequelize[_0x1463('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1463('0x3')]},'interval':{'type':Sequelize[_0x1463('0x3')],'defaultValue':_0x1463('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index e8a6105..82e2983 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 _0x1bb2=['../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','show','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','include','merge','ChatApplication','find','catch','body','params','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x290a82,_0x37b7aa){var _0x4c9955=function(_0x288e31){while(--_0x288e31){_0x290a82['push'](_0x290a82['shift']());}};_0x4c9955(++_0x37b7aa);}(_0x1bb2,0x152));var _0x21bb=function(_0x3002a2,_0x514522){_0x3002a2=_0x3002a2-0x0;var _0x42524e=_0x1bb2[_0x3002a2];return _0x42524e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21bb('0x0'));var zipdir=require(_0x21bb('0x1'));var jsonpatch=require(_0x21bb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x21bb('0x3'));var Mustache=require(_0x21bb('0x4'));var util=require(_0x21bb('0x5'));var path=require(_0x21bb('0x6'));var sox=require(_0x21bb('0x7'));var csv=require(_0x21bb('0x8'));var ejs=require(_0x21bb('0x9'));var fs=require('fs');var fs_extra=require(_0x21bb('0xa'));var _=require(_0x21bb('0xb'));var squel=require(_0x21bb('0xc'));var crypto=require(_0x21bb('0xd'));var jsforce=require(_0x21bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x21bb('0x8'));var querystring=require('querystring');var Papa=require(_0x21bb('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x21bb('0x10'));var as=require(_0x21bb('0x11'));var hardwareService=require(_0x21bb('0x12'));var logger=require(_0x21bb('0x13'))(_0x21bb('0x14'));var utils=require(_0x21bb('0x15'));var config=require(_0x21bb('0x16'));var licenseUtil=require(_0x21bb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x231d5b,_0x3026eb){_0x3026eb=_0x3026eb||0xcc;return function(_0x516c76){if(_0x516c76){return _0x231d5b[_0x21bb('0x18')](_0x3026eb);}return _0x231d5b[_0x21bb('0x19')](_0x3026eb)['end']();};}function respondWithResult(_0x42ad54,_0xae34f3){_0xae34f3=_0xae34f3||0xc8;return function(_0x3444e1){if(_0x3444e1){return _0x42ad54[_0x21bb('0x19')](_0xae34f3)['json'](_0x3444e1);}};}function respondWithFilteredResult(_0x2eaa36,_0x589d0f){return function(_0x5eb3d2){if(_0x5eb3d2){var _0x18daa7=typeof _0x589d0f[_0x21bb('0x1a')]===_0x21bb('0x1b')&&typeof _0x589d0f[_0x21bb('0x1c')]===_0x21bb('0x1b');var _0x412d50=_0x5eb3d2[_0x21bb('0x1d')];var _0x15fc36=_0x18daa7?0x0:_0x589d0f[_0x21bb('0x1a')];var _0x17ee1d=_0x18daa7?_0x5eb3d2[_0x21bb('0x1d')]:_0x589d0f['offset']+_0x589d0f[_0x21bb('0x1c')];var _0x159ac6;if(_0x17ee1d>=_0x412d50){_0x17ee1d=_0x412d50;_0x159ac6=0xc8;}else{_0x159ac6=0xce;}_0x2eaa36[_0x21bb('0x19')](_0x159ac6);return _0x2eaa36['set'](_0x21bb('0x1e'),_0x15fc36+'-'+_0x17ee1d+'/'+_0x412d50)[_0x21bb('0x1f')](_0x5eb3d2);}return null;};}function patchUpdates(_0x271a9f){return function(_0x28899f){try{jsonpatch[_0x21bb('0x20')](_0x28899f,_0x271a9f,!![]);}catch(_0x44930d){return BPromise[_0x21bb('0x21')](_0x44930d);}return _0x28899f[_0x21bb('0x22')]();};}function saveUpdates(_0x169623,_0x3d4814){return function(_0x9f93a7){if(_0x9f93a7){return _0x9f93a7[_0x21bb('0x23')](_0x169623)['then'](function(_0x353019){return _0x353019;});}return null;};}function removeEntity(_0x2b2bc3,_0x358c1a){return function(_0x490266){if(_0x490266){return _0x490266[_0x21bb('0x24')]()[_0x21bb('0x25')](function(){_0x2b2bc3[_0x21bb('0x19')](0xcc)[_0x21bb('0x26')]();});}};}function handleEntityNotFound(_0x40d801,_0x3239e2){return function(_0x112412){if(!_0x112412){_0x40d801[_0x21bb('0x18')](0x194);}return _0x112412;};}function handleError(_0x4db3ad,_0x22a467){_0x22a467=_0x22a467||0x1f4;return function(_0xed3ab2){logger[_0x21bb('0x27')](_0xed3ab2[_0x21bb('0x28')]);if(_0xed3ab2['name']){delete _0xed3ab2[_0x21bb('0x29')];}_0x4db3ad[_0x21bb('0x19')](_0x22a467)[_0x21bb('0x2a')](_0xed3ab2);};}exports[_0x21bb('0x2b')]=function(_0xc6ae64,_0x2c09d6){var _0x20de34={'raw':!![],'where':{'id':_0xc6ae64['params']['id']}},_0x256974={};_0x256974[_0x21bb('0x2c')]=_[_0x21bb('0x2d')](db['ChatApplication'][_0x21bb('0x2e')]);_0x256974[_0x21bb('0x2f')]=_[_0x21bb('0x2d')](_0xc6ae64['query']);_0x256974[_0x21bb('0x30')]=_['intersection'](_0x256974[_0x21bb('0x2c')],_0x256974[_0x21bb('0x2f')]);_0x20de34[_0x21bb('0x31')]=_[_0x21bb('0x32')](_0x256974['model'],qs[_0x21bb('0x33')](_0xc6ae64[_0x21bb('0x2f')]['fields']));_0x20de34[_0x21bb('0x31')]=_0x20de34[_0x21bb('0x31')][_0x21bb('0x34')]?_0x20de34[_0x21bb('0x31')]:_0x256974[_0x21bb('0x2c')];if(_0xc6ae64[_0x21bb('0x2f')]['includeAll']){_0x20de34[_0x21bb('0x35')]=[{'all':!![]}];}_0x20de34=_[_0x21bb('0x36')]({},_0x20de34,_0xc6ae64['options']);return db[_0x21bb('0x37')][_0x21bb('0x38')](_0x20de34)['then'](handleEntityNotFound(_0x2c09d6,null))[_0x21bb('0x25')](respondWithResult(_0x2c09d6,null))[_0x21bb('0x39')](handleError(_0x2c09d6,null));};exports[_0x21bb('0x23')]=function(_0x3ac411,_0x58e25a){if(_0x3ac411['body']['id']){delete _0x3ac411[_0x21bb('0x3a')]['id'];}return db['ChatApplication'][_0x21bb('0x38')]({'where':{'id':_0x3ac411['params']['id']}})[_0x21bb('0x25')](handleEntityNotFound(_0x58e25a,null))[_0x21bb('0x25')](saveUpdates(_0x3ac411[_0x21bb('0x3a')],null))[_0x21bb('0x25')](respondWithResult(_0x58e25a,null))[_0x21bb('0x39')](handleError(_0x58e25a,null));};exports['destroy']=function(_0x50ad22,_0xee3a6b){return db[_0x21bb('0x37')][_0x21bb('0x38')]({'where':{'id':_0x50ad22[_0x21bb('0x3b')]['id']}})[_0x21bb('0x25')](handleEntityNotFound(_0xee3a6b,null))['then'](removeEntity(_0xee3a6b,null))['catch'](handleError(_0xee3a6b,null));};
\ No newline at end of file
+var _0x97e7=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','model','intersection','fields','attributes','includeAll','include','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x59004c,_0xaf71a5){var _0x3cbb8d=function(_0x224c6e){while(--_0x224c6e){_0x59004c['push'](_0x59004c['shift']());}};_0x3cbb8d(++_0xaf71a5);}(_0x97e7,0x1a1));var _0x797e=function(_0x4c77b8,_0x3f38b6){_0x4c77b8=_0x4c77b8-0x0;var _0x2f8918=_0x97e7[_0x4c77b8];return _0x2f8918;};'use strict';var emlformat=require(_0x797e('0x0'));var rimraf=require(_0x797e('0x1'));var zipdir=require(_0x797e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x797e('0x3'));var moment=require(_0x797e('0x4'));var BPromise=require(_0x797e('0x5'));var Mustache=require(_0x797e('0x6'));var util=require(_0x797e('0x7'));var path=require(_0x797e('0x8'));var sox=require(_0x797e('0x9'));var csv=require(_0x797e('0xa'));var ejs=require(_0x797e('0xb'));var fs=require('fs');var fs_extra=require(_0x797e('0xc'));var _=require(_0x797e('0xd'));var squel=require(_0x797e('0xe'));var crypto=require('crypto');var jsforce=require(_0x797e('0xf'));var deskjs=require(_0x797e('0x10'));var toCsv=require(_0x797e('0xa'));var querystring=require(_0x797e('0x11'));var Papa=require('papaparse');var Redis=require(_0x797e('0x12'));var authService=require(_0x797e('0x13'));var qs=require(_0x797e('0x14'));var as=require(_0x797e('0x15'));var hardwareService=require(_0x797e('0x16'));var logger=require(_0x797e('0x17'))(_0x797e('0x18'));var utils=require('../../config/utils');var config=require(_0x797e('0x19'));var licenseUtil=require(_0x797e('0x1a'));var db=require(_0x797e('0x1b'))['db'];function respondWithStatusCode(_0x5e924f,_0x23eb05){_0x23eb05=_0x23eb05||0xcc;return function(_0x5adb17){if(_0x5adb17){return _0x5e924f[_0x797e('0x1c')](_0x23eb05);}return _0x5e924f['status'](_0x23eb05)[_0x797e('0x1d')]();};}function respondWithResult(_0x437b80,_0x506fde){_0x506fde=_0x506fde||0xc8;return function(_0x318f6d){if(_0x318f6d){return _0x437b80['status'](_0x506fde)[_0x797e('0x1e')](_0x318f6d);}};}function respondWithFilteredResult(_0xfbd7a2,_0x27e5b6){return function(_0x1ccfaa){if(_0x1ccfaa){var _0x442ba0=typeof _0x27e5b6[_0x797e('0x1f')]===_0x797e('0x20')&&typeof _0x27e5b6[_0x797e('0x21')]===_0x797e('0x20');var _0x582288=_0x1ccfaa[_0x797e('0x22')];var _0x26469b=_0x442ba0?0x0:_0x27e5b6[_0x797e('0x1f')];var _0x47ca1f=_0x442ba0?_0x1ccfaa[_0x797e('0x22')]:_0x27e5b6[_0x797e('0x1f')]+_0x27e5b6['limit'];var _0x2c1657;if(_0x47ca1f>=_0x582288){_0x47ca1f=_0x582288;_0x2c1657=0xc8;}else{_0x2c1657=0xce;}_0xfbd7a2[_0x797e('0x23')](_0x2c1657);return _0xfbd7a2[_0x797e('0x24')](_0x797e('0x25'),_0x26469b+'-'+_0x47ca1f+'/'+_0x582288)[_0x797e('0x1e')](_0x1ccfaa);}return null;};}function patchUpdates(_0x57ddae){return function(_0x3cc7b4){try{jsonpatch['apply'](_0x3cc7b4,_0x57ddae,!![]);}catch(_0x544225){return BPromise['reject'](_0x544225);}return _0x3cc7b4['save']();};}function saveUpdates(_0x47bde9,_0x2f7bdc){return function(_0x323333){if(_0x323333){return _0x323333[_0x797e('0x26')](_0x47bde9)[_0x797e('0x27')](function(_0x1b03d0){return _0x1b03d0;});}return null;};}function removeEntity(_0x137aea,_0x41d4df){return function(_0x1023e7){if(_0x1023e7){return _0x1023e7[_0x797e('0x28')]()[_0x797e('0x27')](function(){_0x137aea[_0x797e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d5391,_0x1da25e){return function(_0x56e9c0){if(!_0x56e9c0){_0x3d5391[_0x797e('0x1c')](0x194);}return _0x56e9c0;};}function handleError(_0xe8bfa0,_0x2879e6){_0x2879e6=_0x2879e6||0x1f4;return function(_0x28189c){logger[_0x797e('0x29')](_0x28189c[_0x797e('0x2a')]);if(_0x28189c[_0x797e('0x2b')]){delete _0x28189c[_0x797e('0x2b')];}_0xe8bfa0[_0x797e('0x23')](_0x2879e6)[_0x797e('0x2c')](_0x28189c);};}exports[_0x797e('0x2d')]=function(_0x58e0ce,_0x281ade){var _0x3b540d={'raw':!![],'where':{'id':_0x58e0ce[_0x797e('0x2e')]['id']}},_0x3dbe9b={};_0x3dbe9b['model']=_[_0x797e('0x2f')](db[_0x797e('0x30')][_0x797e('0x31')]);_0x3dbe9b['query']=_[_0x797e('0x2f')](_0x58e0ce[_0x797e('0x32')]);_0x3dbe9b['filters']=_['intersection'](_0x3dbe9b[_0x797e('0x33')],_0x3dbe9b['query']);_0x3b540d['attributes']=_[_0x797e('0x34')](_0x3dbe9b[_0x797e('0x33')],qs['fields'](_0x58e0ce['query'][_0x797e('0x35')]));_0x3b540d[_0x797e('0x36')]=_0x3b540d[_0x797e('0x36')]['length']?_0x3b540d['attributes']:_0x3dbe9b['model'];if(_0x58e0ce[_0x797e('0x32')][_0x797e('0x37')]){_0x3b540d[_0x797e('0x38')]=[{'all':!![]}];}_0x3b540d=_['merge']({},_0x3b540d,_0x58e0ce[_0x797e('0x39')]);return db['ChatApplication'][_0x797e('0x3a')](_0x3b540d)[_0x797e('0x27')](handleEntityNotFound(_0x281ade,null))[_0x797e('0x27')](respondWithResult(_0x281ade,null))[_0x797e('0x3b')](handleError(_0x281ade,null));};exports['update']=function(_0x4f6b22,_0x5be6e1){if(_0x4f6b22[_0x797e('0x3c')]['id']){delete _0x4f6b22['body']['id'];}return db[_0x797e('0x30')]['find']({'where':{'id':_0x4f6b22[_0x797e('0x2e')]['id']}})[_0x797e('0x27')](handleEntityNotFound(_0x5be6e1,null))['then'](saveUpdates(_0x4f6b22[_0x797e('0x3c')],null))['then'](respondWithResult(_0x5be6e1,null))['catch'](handleError(_0x5be6e1,null));};exports['destroy']=function(_0x58e7d5,_0x40c347){return db[_0x797e('0x30')][_0x797e('0x3a')]({'where':{'id':_0x58e7d5[_0x797e('0x2e')]['id']}})['then'](handleEntityNotFound(_0x40c347,null))['then'](removeEntity(_0x40c347,null))['catch'](handleError(_0x40c347,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index e805530..07145df 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 _0x8811=['../../config/environment','./chatApplication.attributes','define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x8811,0x73));var _0x1881=function(_0x42edd9,_0x1e5ea1){_0x42edd9=_0x42edd9-0x0;var _0x5ef512=_0x8811[_0x42edd9];return _0x5ef512;};'use strict';var _=require(_0x1881('0x0'));var util=require(_0x1881('0x1'));var logger=require(_0x1881('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1881('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1881('0x4'));var rimraf=require(_0x1881('0x5'));var config=require(_0x1881('0x6'));var attributes=require(_0x1881('0x7'));module['exports']=function(_0x281294,_0x16bbdb){return _0x281294[_0x1881('0x8')](_0x1881('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1881('0xa')});};
\ No newline at end of file
+var _0x7ae7=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x31bc86,_0x1629b5){var _0x3da61e=function(_0x560836){while(--_0x560836){_0x31bc86['push'](_0x31bc86['shift']());}};_0x3da61e(++_0x1629b5);}(_0x7ae7,0xd9));var _0x77ae=function(_0x40ebc3,_0x5b7f78){_0x40ebc3=_0x40ebc3-0x0;var _0x1d8b08=_0x7ae7[_0x40ebc3];return _0x1d8b08;};'use strict';var _=require(_0x77ae('0x0'));var util=require(_0x77ae('0x1'));var logger=require('../../config/logger')(_0x77ae('0x2'));var moment=require(_0x77ae('0x3'));var BPromise=require(_0x77ae('0x4'));var rp=require(_0x77ae('0x5'));var fs=require('fs');var path=require(_0x77ae('0x6'));var rimraf=require(_0x77ae('0x7'));var config=require(_0x77ae('0x8'));var attributes=require(_0x77ae('0x9'));module[_0x77ae('0xa')]=function(_0x3dd200,_0x276be6){return _0x3dd200[_0x77ae('0xb')](_0x77ae('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x77ae('0xd'),'collate':_0x77ae('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 9735dd7..6092768 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 _0xd06f=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','info'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xd06f,0x1a7));var _0xfd06=function(_0x1f0448,_0xa2865f){_0x1f0448=_0x1f0448-0x0;var _0x16fe78=_0xd06f[_0x1f0448];return _0x16fe78;};'use strict';var _=require('lodash');var util=require(_0xfd06('0x0'));var moment=require(_0xfd06('0x1'));var BPromise=require(_0xfd06('0x2'));var rs=require(_0xfd06('0x3'));var fs=require('fs');var Redis=require(_0xfd06('0x4'));var db=require(_0xfd06('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfd06('0x6'));var client=jayson[_0xfd06('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x495e4a,_0x48b73d,_0x36f177){return new BPromise(function(_0xdc0750,_0x5499ff){return client['request'](_0x495e4a,_0x36f177)['then'](function(_0x458b4a){logger[_0xfd06('0x8')](_0xfd06('0x9'),_0x48b73d,_0xfd06('0xa'));logger[_0xfd06('0xb')](_0xfd06('0xc'),_0x48b73d,'request\x20sent',JSON['stringify'](_0x458b4a));if(_0x458b4a[_0xfd06('0xd')]){if(_0x458b4a[_0xfd06('0xd')][_0xfd06('0xe')]===0x1f4){logger[_0xfd06('0xd')](_0xfd06('0x9'),_0x48b73d,_0x458b4a['error'][_0xfd06('0xf')]);return _0x5499ff(_0x458b4a[_0xfd06('0xd')][_0xfd06('0xf')]);}logger[_0xfd06('0xd')](_0xfd06('0x9'),_0x48b73d,_0x458b4a['error'][_0xfd06('0xf')]);return _0xdc0750(_0x458b4a[_0xfd06('0xd')][_0xfd06('0xf')]);}else{logger[_0xfd06('0x8')](_0xfd06('0x9'),_0x48b73d,_0xfd06('0xa'));_0xdc0750(_0x458b4a[_0xfd06('0x10')]['message']);}})[_0xfd06('0x11')](function(_0x191ac9){logger[_0xfd06('0xd')]('ChatApplication,\x20%s,\x20%s',_0x48b73d,_0x191ac9);_0x5499ff(_0x191ac9);});});}
\ No newline at end of file
+var _0x9e20=['message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatApplication,\x20%s,\x20%s'];(function(_0x4b3cfe,_0x17a344){var _0x3f9e47=function(_0x1438c6){while(--_0x1438c6){_0x4b3cfe['push'](_0x4b3cfe['shift']());}};_0x3f9e47(++_0x17a344);}(_0x9e20,0x172));var _0x09e2=function(_0x21662d,_0x213eea){_0x21662d=_0x21662d-0x0;var _0x236c05=_0x9e20[_0x21662d];return _0x236c05;};'use strict';var _=require(_0x09e2('0x0'));var util=require(_0x09e2('0x1'));var moment=require(_0x09e2('0x2'));var BPromise=require(_0x09e2('0x3'));var rs=require(_0x09e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x09e2('0x5'));var logger=require(_0x09e2('0x6'))(_0x09e2('0x7'));var config=require(_0x09e2('0x8'));var jayson=require(_0x09e2('0x9'));var client=jayson[_0x09e2('0xa')][_0x09e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb5725a,_0x3ff34c,_0x215cb4){return new BPromise(function(_0x504bcd,_0x4d0ca1){return client[_0x09e2('0xc')](_0xb5725a,_0x215cb4)[_0x09e2('0xd')](function(_0x442f21){logger[_0x09e2('0xe')]('ChatApplication,\x20%s,\x20%s',_0x3ff34c,'request\x20sent');logger[_0x09e2('0xf')](_0x09e2('0x10'),_0x3ff34c,_0x09e2('0x11'),JSON[_0x09e2('0x12')](_0x442f21));if(_0x442f21[_0x09e2('0x13')]){if(_0x442f21[_0x09e2('0x13')]['code']===0x1f4){logger[_0x09e2('0x13')](_0x09e2('0x14'),_0x3ff34c,_0x442f21[_0x09e2('0x13')]['message']);return _0x4d0ca1(_0x442f21[_0x09e2('0x13')]['message']);}logger[_0x09e2('0x13')](_0x09e2('0x14'),_0x3ff34c,_0x442f21[_0x09e2('0x13')][_0x09e2('0x15')]);return _0x504bcd(_0x442f21['error'][_0x09e2('0x15')]);}else{logger[_0x09e2('0xe')](_0x09e2('0x14'),_0x3ff34c,_0x09e2('0x11'));_0x504bcd(_0x442f21[_0x09e2('0x16')][_0x09e2('0x15')]);}})['catch'](function(_0x1cb1d2){logger[_0x09e2('0x13')]('ChatApplication,\x20%s,\x20%s',_0x3ff34c,_0x1cb1d2);_0x4d0ca1(_0x1cb1d2);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 87b091d..2b0b61a 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 _0x2fe6=['../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x18d916,_0x522ebd){var _0x21830e=function(_0x1ad5c2){while(--_0x1ad5c2){_0x18d916['push'](_0x18d916['shift']());}};_0x21830e(++_0x522ebd);}(_0x2fe6,0x1da));var _0x62fe=function(_0x58cb4f,_0x3fc4ee){_0x58cb4f=_0x58cb4f-0x0;var _0x4a52cc=_0x2fe6[_0x58cb4f];return _0x4a52cc;};'use strict';var multer=require('multer');var util=require(_0x62fe('0x0'));var path=require(_0x62fe('0x1'));var timeout=require(_0x62fe('0x2'));var express=require(_0x62fe('0x3'));var router=express[_0x62fe('0x4')]();var fs_extra=require(_0x62fe('0x5'));var auth=require(_0x62fe('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x62fe('0x7'));var controller=require('./chatApplication.controller');router[_0x62fe('0x8')](_0x62fe('0x9'),auth[_0x62fe('0xa')](),controller['show']);router[_0x62fe('0xb')](_0x62fe('0x9'),auth['isAuthenticated'](),controller[_0x62fe('0xc')]);router[_0x62fe('0xd')](_0x62fe('0x9'),auth[_0x62fe('0xa')](),controller[_0x62fe('0xe')]);module[_0x62fe('0xf')]=router;
\ No newline at end of file
+var _0x556d=['show','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x556d,0x16c));var _0xd556=function(_0x164e5d,_0x1da231){_0x164e5d=_0x164e5d-0x0;var _0x476cfe=_0x556d[_0x164e5d];return _0x476cfe;};'use strict';var multer=require(_0xd556('0x0'));var util=require(_0xd556('0x1'));var path=require(_0xd556('0x2'));var timeout=require(_0xd556('0x3'));var express=require(_0xd556('0x4'));var router=express[_0xd556('0x5')]();var fs_extra=require(_0xd556('0x6'));var auth=require(_0xd556('0x7'));var interaction=require(_0xd556('0x8'));var config=require(_0xd556('0x9'));var controller=require(_0xd556('0xa'));router[_0xd556('0xb')](_0xd556('0xc'),auth[_0xd556('0xd')](),controller[_0xd556('0xe')]);router['put'](_0xd556('0xc'),auth['isAuthenticated'](),controller[_0xd556('0xf')]);router['delete'](_0xd556('0xc'),auth['isAuthenticated'](),controller[_0xd556('0x10')]);module[_0xd556('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index fcaf9bd..e54b43b 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 _0x9527=['STRING','exports'];(function(_0x143d26,_0x5dd1d6){var _0x130c43=function(_0x5323ec){while(--_0x5323ec){_0x143d26['push'](_0x143d26['shift']());}};_0x130c43(++_0x5dd1d6);}(_0x9527,0x135));var _0x7952=function(_0x823840,_0x27d075){_0x823840=_0x823840-0x0;var _0x547997=_0x9527[_0x823840];return _0x547997;};'use strict';var Sequelize=require('sequelize');module[_0x7952('0x0')]={'name':{'type':Sequelize[_0x7952('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7952('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd48e=['exports','STRING','BOOLEAN'];(function(_0x138ed5,_0x215001){var _0x14b804=function(_0x271f16){while(--_0x271f16){_0x138ed5['push'](_0x138ed5['shift']());}};_0x14b804(++_0x215001);}(_0xd48e,0x93));var _0xed48=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xd48e[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require('sequelize');module[_0xed48('0x0')]={'name':{'type':Sequelize[_0xed48('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xed48('0x1')]},'write':{'type':Sequelize[_0xed48('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 b4eb556..31d22a9 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 _0xcd6c=['findAll','rows','catch','show','params','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','User','hasOwnProperty','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','end','offset','undefined','count','limit','status','set','json','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x1c83c9,_0x2a0efc){var _0x49c840=function(_0x2945e2){while(--_0x2945e2){_0x1c83c9['push'](_0x1c83c9['shift']());}};_0x49c840(++_0x2a0efc);}(_0xcd6c,0x1a3));var _0xccd6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcd6c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xccd6('0x0'));var rimraf=require(_0xccd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xccd6('0x2'));var rp=require(_0xccd6('0x3'));var moment=require(_0xccd6('0x4'));var BPromise=require(_0xccd6('0x5'));var Mustache=require('mustache');var util=require(_0xccd6('0x6'));var path=require('path');var sox=require(_0xccd6('0x7'));var csv=require(_0xccd6('0x8'));var ejs=require(_0xccd6('0x9'));var fs=require('fs');var fs_extra=require(_0xccd6('0xa'));var _=require(_0xccd6('0xb'));var squel=require(_0xccd6('0xc'));var crypto=require(_0xccd6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xccd6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xccd6('0xf'));var Redis=require(_0xccd6('0x10'));var authService=require(_0xccd6('0x11'));var qs=require(_0xccd6('0x12'));var as=require(_0xccd6('0x13'));var hardwareService=require(_0xccd6('0x14'));var logger=require(_0xccd6('0x15'))('api');var utils=require(_0xccd6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xccd6('0x17'));var db=require('../../mysqldb')['db'];config[_0xccd6('0x18')]=_[_0xccd6('0x19')](config[_0xccd6('0x18')],{'host':_0xccd6('0x1a'),'port':0x18eb});var socket=require(_0xccd6('0x1b'))(new Redis(config[_0xccd6('0x18')]));require('./chatGroup.socket')[_0xccd6('0x1c')](socket);function respondWithStatusCode(_0xcc0481,_0x1ae6c9){_0x1ae6c9=_0x1ae6c9||0xcc;return function(_0xd97318){if(_0xd97318){return _0xcc0481['sendStatus'](_0x1ae6c9);}return _0xcc0481['status'](_0x1ae6c9)[_0xccd6('0x1d')]();};}function respondWithResult(_0x4b6ef3,_0x301fcc){_0x301fcc=_0x301fcc||0xc8;return function(_0x1be952){if(_0x1be952){return _0x4b6ef3['status'](_0x301fcc)['json'](_0x1be952);}};}function respondWithFilteredResult(_0x70cbd9,_0x461ef9){return function(_0x2be871){if(_0x2be871){var _0x2d90a9=typeof _0x461ef9[_0xccd6('0x1e')]===_0xccd6('0x1f')&&typeof _0x461ef9['limit']===_0xccd6('0x1f');var _0x873b40=_0x2be871[_0xccd6('0x20')];var _0x37b1fd=_0x2d90a9?0x0:_0x461ef9[_0xccd6('0x1e')];var _0x323739=_0x2d90a9?_0x2be871[_0xccd6('0x20')]:_0x461ef9[_0xccd6('0x1e')]+_0x461ef9[_0xccd6('0x21')];var _0x41c028;if(_0x323739>=_0x873b40){_0x323739=_0x873b40;_0x41c028=0xc8;}else{_0x41c028=0xce;}_0x70cbd9[_0xccd6('0x22')](_0x41c028);return _0x70cbd9[_0xccd6('0x23')]('Content-Range',_0x37b1fd+'-'+_0x323739+'/'+_0x873b40)[_0xccd6('0x24')](_0x2be871);}return null;};}function patchUpdates(_0x2becee){return function(_0x51fe96){try{jsonpatch[_0xccd6('0x25')](_0x51fe96,_0x2becee,!![]);}catch(_0x371c60){return BPromise[_0xccd6('0x26')](_0x371c60);}return _0x51fe96['save']();};}function saveUpdates(_0x52a31d,_0x50a050){return function(_0x586e29){if(_0x586e29){return _0x586e29[_0xccd6('0x27')](_0x52a31d)[_0xccd6('0x28')](function(_0x476e92){return _0x476e92;});}return null;};}function removeEntity(_0x11b65d,_0x19e94b){return function(_0x5d4756){if(_0x5d4756){return _0x5d4756[_0xccd6('0x29')]()[_0xccd6('0x28')](function(){_0x11b65d['status'](0xcc)[_0xccd6('0x1d')]();});}};}function handleEntityNotFound(_0x2b08bd,_0x4d337c){return function(_0xbbb75f){if(!_0xbbb75f){_0x2b08bd[_0xccd6('0x2a')](0x194);}return _0xbbb75f;};}function handleError(_0x13f690,_0x10e5ae){_0x10e5ae=_0x10e5ae||0x1f4;return function(_0x2f558e){logger[_0xccd6('0x2b')](_0x2f558e['stack']);if(_0x2f558e['name']){delete _0x2f558e[_0xccd6('0x2c')];}_0x13f690[_0xccd6('0x22')](_0x10e5ae)[_0xccd6('0x2d')](_0x2f558e);};}exports[_0xccd6('0x2e')]=function(_0x30c69a,_0x48d2a7){var _0x3b4dcb={},_0x3b4905={},_0x25c249={'count':0x0,'rows':[]};var _0x18e0ea=_[_0xccd6('0x2f')](db[_0xccd6('0x30')][_0xccd6('0x31')],function(_0x3a2518){return{'name':_0x3a2518[_0xccd6('0x32')],'type':_0x3a2518[_0xccd6('0x33')][_0xccd6('0x34')]};});_0x3b4905[_0xccd6('0x35')]=_[_0xccd6('0x2f')](_0x18e0ea,_0xccd6('0x2c'));_0x3b4905[_0xccd6('0x36')]=_[_0xccd6('0x37')](_0x30c69a[_0xccd6('0x36')]);_0x3b4905[_0xccd6('0x38')]=_[_0xccd6('0x39')](_0x3b4905['model'],_0x3b4905[_0xccd6('0x36')]);_0x3b4dcb[_0xccd6('0x3a')]=_[_0xccd6('0x39')](_0x3b4905[_0xccd6('0x35')],qs[_0xccd6('0x3b')](_0x30c69a[_0xccd6('0x36')][_0xccd6('0x3b')]));_0x3b4dcb[_0xccd6('0x3a')]=_0x3b4dcb['attributes'][_0xccd6('0x3c')]?_0x3b4dcb[_0xccd6('0x3a')]:_0x3b4905['model'];if(!_0x30c69a[_0xccd6('0x36')]['hasOwnProperty'](_0xccd6('0x3d'))){_0x3b4dcb[_0xccd6('0x21')]=qs[_0xccd6('0x21')](_0x30c69a[_0xccd6('0x36')]['limit']);_0x3b4dcb[_0xccd6('0x1e')]=qs[_0xccd6('0x1e')](_0x30c69a[_0xccd6('0x36')][_0xccd6('0x1e')]);}_0x3b4dcb['order']=qs[_0xccd6('0x3e')](_0x30c69a[_0xccd6('0x36')]['sort']);_0x3b4dcb[_0xccd6('0x3f')]=qs[_0xccd6('0x38')](_[_0xccd6('0x40')](_0x30c69a['query'],_0x3b4905[_0xccd6('0x38')]),_0x18e0ea);if(_0x30c69a[_0xccd6('0x36')][_0xccd6('0x41')]){_0x3b4dcb[_0xccd6('0x3f')]=_[_0xccd6('0x42')](_0x3b4dcb['where'],{'$or':_[_0xccd6('0x2f')](_0x18e0ea,function(_0x4f1a1b){if(_0x4f1a1b[_0xccd6('0x33')]!==_0xccd6('0x43')){var _0x22fbd1={};_0x22fbd1[_0x4f1a1b['name']]={'$like':'%'+_0x30c69a['query'][_0xccd6('0x41')]+'%'};return _0x22fbd1;}})});}_0x3b4dcb=_[_0xccd6('0x42')]({},_0x3b4dcb,_0x30c69a[_0xccd6('0x44')]);var _0x4da0d1={'where':_0x3b4dcb[_0xccd6('0x3f')]};return db[_0xccd6('0x30')][_0xccd6('0x20')](_0x4da0d1)['then'](function(_0x14f5d7){_0x25c249[_0xccd6('0x20')]=_0x14f5d7;if(_0x30c69a['query'][_0xccd6('0x45')]){_0x3b4dcb[_0xccd6('0x46')]=[{'all':!![]}];}return db[_0xccd6('0x30')][_0xccd6('0x47')](_0x3b4dcb);})[_0xccd6('0x28')](function(_0x153a38){_0x25c249[_0xccd6('0x48')]=_0x153a38;return _0x25c249;})[_0xccd6('0x28')](respondWithFilteredResult(_0x48d2a7,_0x3b4dcb))[_0xccd6('0x49')](handleError(_0x48d2a7,null));};exports[_0xccd6('0x4a')]=function(_0x2d28cd,_0x4fa307){var _0x175a20={'raw':!![],'where':{'id':_0x2d28cd[_0xccd6('0x4b')]['id']}},_0xe7717e={};_0xe7717e[_0xccd6('0x35')]=_[_0xccd6('0x37')](db[_0xccd6('0x30')]['rawAttributes']);_0xe7717e['query']=_[_0xccd6('0x37')](_0x2d28cd[_0xccd6('0x36')]);_0xe7717e['filters']=_[_0xccd6('0x39')](_0xe7717e['model'],_0xe7717e[_0xccd6('0x36')]);_0x175a20['attributes']=_['intersection'](_0xe7717e[_0xccd6('0x35')],qs['fields'](_0x2d28cd[_0xccd6('0x36')][_0xccd6('0x3b')]));_0x175a20['attributes']=_0x175a20['attributes'][_0xccd6('0x3c')]?_0x175a20[_0xccd6('0x3a')]:_0xe7717e[_0xccd6('0x35')];if(_0x2d28cd['query'][_0xccd6('0x45')]){_0x175a20[_0xccd6('0x46')]=[{'all':!![]}];}_0x175a20=_[_0xccd6('0x42')]({},_0x175a20,_0x2d28cd[_0xccd6('0x44')]);return db[_0xccd6('0x30')][_0xccd6('0x4c')](_0x175a20)[_0xccd6('0x28')](handleEntityNotFound(_0x4fa307,null))[_0xccd6('0x28')](respondWithResult(_0x4fa307,null))[_0xccd6('0x49')](handleError(_0x4fa307,null));};exports[_0xccd6('0x4d')]=function(_0x2c34d5,_0x5312c5){return db['ChatGroup'][_0xccd6('0x4d')](_0x2c34d5[_0xccd6('0x4e')],{})['then'](respondWithResult(_0x5312c5,0xc9))[_0xccd6('0x49')](handleError(_0x5312c5,null));};exports[_0xccd6('0x27')]=function(_0x549ce4,_0x344baa){if(_0x549ce4[_0xccd6('0x4e')]['id']){delete _0x549ce4[_0xccd6('0x4e')]['id'];}return db[_0xccd6('0x30')][_0xccd6('0x4c')]({'where':{'id':_0x549ce4[_0xccd6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x344baa,null))[_0xccd6('0x28')](saveUpdates(_0x549ce4[_0xccd6('0x4e')],null))[_0xccd6('0x28')](respondWithResult(_0x344baa,null))[_0xccd6('0x49')](handleError(_0x344baa,null));};exports[_0xccd6('0x29')]=function(_0x85bb6b,_0x145ebb){return db[_0xccd6('0x30')][_0xccd6('0x4c')]({'where':{'id':_0x85bb6b[_0xccd6('0x4b')]['id']}})[_0xccd6('0x28')](handleEntityNotFound(_0x145ebb,null))[_0xccd6('0x28')](removeEntity(_0x145ebb,null))[_0xccd6('0x49')](handleError(_0x145ebb,null));};exports[_0xccd6('0x4f')]=function(_0x607cff,_0x5b0d09){return db[_0xccd6('0x30')][_0xccd6('0x4f')]()['then'](respondWithResult(_0x5b0d09,null))[_0xccd6('0x49')](handleError(_0x5b0d09,null));};exports[_0xccd6('0x50')]=function(_0x456dbd,_0x42ce86,_0x299c8b){return db['ChatInternalMessage'][_0xccd6('0x20')]({'where':{'ChatGroupId':_0x456dbd['params']['id'],'ToId':_0x456dbd[_0xccd6('0x51')]['id'],'read':![]}})[_0xccd6('0x28')](function(_0x4af618){return{'id':_[_0xccd6('0x52')](_0x456dbd[_0xccd6('0x4b')]['id']),'count':_0x4af618};})[_0xccd6('0x28')](respondWithResult(_0x42ce86,null))[_0xccd6('0x49')](handleError(_0x42ce86,null));};exports[_0xccd6('0x53')]=function(_0x32624e,_0x2983af,_0xb4c245){return db[_0xccd6('0x30')][_0xccd6('0x4c')]({'where':{'id':_0x32624e[_0xccd6('0x4b')]['id']}})[_0xccd6('0x28')](handleEntityNotFound(_0x2983af,null))[_0xccd6('0x28')](function(_0x3819b0){if(_0x3819b0){return _0x3819b0[_0xccd6('0x53')](_0x32624e[_0xccd6('0x4e')][_0xccd6('0x54')],_[_0xccd6('0x55')](_0x32624e[_0xccd6('0x4e')],['ids','id'])||{});}})[_0xccd6('0x28')](respondWithResult(_0x2983af,null))['catch'](handleError(_0x2983af,null));};exports['getMembers']=function(_0x25e482,_0x13bacb,_0x4074a4){var _0x3f2d1d={};var _0x12fe45={};var _0xeb4141;var _0x4f5712;return db[_0xccd6('0x30')]['findOne']({'where':{'id':_0x25e482[_0xccd6('0x4b')]['id']}})[_0xccd6('0x28')](handleEntityNotFound(_0x13bacb,null))[_0xccd6('0x28')](function(_0x8ca994){if(_0x8ca994){_0xeb4141=_0x8ca994;_0x12fe45['model']=_[_0xccd6('0x37')](db[_0xccd6('0x56')][_0xccd6('0x31')]);_0x12fe45[_0xccd6('0x36')]=_['keys'](_0x25e482[_0xccd6('0x36')]);_0x12fe45['filters']=_[_0xccd6('0x39')](_0x12fe45['model'],_0x12fe45[_0xccd6('0x36')]);_0x3f2d1d[_0xccd6('0x3a')]=_[_0xccd6('0x39')](_0x12fe45[_0xccd6('0x35')],qs['fields'](_0x25e482[_0xccd6('0x36')]['fields']));_0x3f2d1d[_0xccd6('0x3a')]=_0x3f2d1d['attributes']['length']?_0x3f2d1d[_0xccd6('0x3a')]:_0x12fe45[_0xccd6('0x35')];_0x3f2d1d['order']=qs[_0xccd6('0x3e')](_0x25e482[_0xccd6('0x36')][_0xccd6('0x3e')]);_0x3f2d1d[_0xccd6('0x3f')]=qs[_0xccd6('0x38')](_[_0xccd6('0x40')](_0x25e482[_0xccd6('0x36')],_0x12fe45[_0xccd6('0x38')]));if(_0x25e482['query'][_0xccd6('0x41')]){_0x3f2d1d['where']=_[_0xccd6('0x42')](_0x3f2d1d[_0xccd6('0x3f')],{'$or':_[_0xccd6('0x2f')](_0x3f2d1d['attributes'],function(_0x16096f){var _0x1b9bb6={};_0x1b9bb6[_0x16096f]={'$like':'%'+_0x25e482[_0xccd6('0x36')][_0xccd6('0x41')]+'%'};return _0x1b9bb6;})});}_0x3f2d1d=_[_0xccd6('0x42')]({},_0x3f2d1d,_0x25e482['options']);return _0xeb4141['getMembers'](_0x3f2d1d);}})[_0xccd6('0x28')](function(_0x40121c){if(_0x40121c){_0x4f5712=_0x40121c[_0xccd6('0x3c')];if(!_0x25e482[_0xccd6('0x36')][_0xccd6('0x57')](_0xccd6('0x3d'))){_0x3f2d1d[_0xccd6('0x21')]=qs[_0xccd6('0x21')](_0x25e482[_0xccd6('0x36')]['limit']);_0x3f2d1d[_0xccd6('0x1e')]=qs[_0xccd6('0x1e')](_0x25e482[_0xccd6('0x36')]['offset']);}return _0xeb4141[_0xccd6('0x58')](_0x3f2d1d);}})[_0xccd6('0x28')](function(_0x34ed7f){if(_0x34ed7f){return _0x34ed7f?{'count':_0x4f5712,'rows':_0x34ed7f}:null;}})['then'](respondWithResult(_0x13bacb,null))[_0xccd6('0x49')](handleError(_0x13bacb,null));};exports[_0xccd6('0x59')]=function(_0x59cebb,_0x3dc14a,_0x24f2fb){return db['ChatGroup']['find']({'where':{'id':_0x59cebb[_0xccd6('0x4b')]['id']}})[_0xccd6('0x28')](handleEntityNotFound(_0x3dc14a,null))[_0xccd6('0x28')](function(_0x126cca){if(_0x126cca){return _0x126cca[_0xccd6('0x59')](_0x59cebb[_0xccd6('0x36')][_0xccd6('0x54')]);}})[_0xccd6('0x28')](respondWithStatusCode(_0x3dc14a,null))[_0xccd6('0x49')](handleError(_0x3dc14a,null));};exports[_0xccd6('0x5a')]=function(_0x2a0890,_0xb5cafe,_0xa2e4ef){if(_0x2a0890['body']['id']){delete _0x2a0890[_0xccd6('0x4e')]['id'];}return db[_0xccd6('0x30')][_0xccd6('0x4c')]({'where':{'id':_0x2a0890[_0xccd6('0x4b')]['id']}})[_0xccd6('0x28')](handleEntityNotFound(_0xb5cafe,null))['then'](function(_0x5f5adc){if(_0x5f5adc){_0x2a0890[_0xccd6('0x4e')][_0xccd6('0x5b')]=_0x5f5adc['id'];return db[_0xccd6('0x5c')]['create'](_0x2a0890['body']);}})[_0xccd6('0x28')](respondWithResult(_0xb5cafe,null))[_0xccd6('0x49')](handleError(_0xb5cafe,null));};exports[_0xccd6('0x5d')]=function(_0x4d1175,_0x58523d,_0x4cd571){var _0x2646e4={};var _0x2d131e={};var _0x4a999c;var _0x5373ac;return db[_0xccd6('0x30')][_0xccd6('0x5e')]({'where':{'id':_0x4d1175[_0xccd6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x58523d,null))['then'](function(_0x43a525){if(_0x43a525){_0x4a999c=_0x43a525;_0x2d131e[_0xccd6('0x35')]=_['keys'](db[_0xccd6('0x5c')][_0xccd6('0x31')]);_0x2d131e[_0xccd6('0x36')]=_[_0xccd6('0x37')](_0x4d1175[_0xccd6('0x36')]);_0x2d131e[_0xccd6('0x38')]=_['intersection'](_0x2d131e[_0xccd6('0x35')],_0x2d131e[_0xccd6('0x36')]);_0x2646e4['attributes']=_[_0xccd6('0x39')](_0x2d131e[_0xccd6('0x35')],qs[_0xccd6('0x3b')](_0x4d1175[_0xccd6('0x36')]['fields']));_0x2646e4[_0xccd6('0x3a')]=_0x2646e4[_0xccd6('0x3a')][_0xccd6('0x3c')]?_0x2646e4['attributes']:_0x2d131e[_0xccd6('0x35')];_0x2646e4['order']=qs[_0xccd6('0x3e')](_0x4d1175[_0xccd6('0x36')]['sort']);_0x2646e4[_0xccd6('0x3f')]=qs[_0xccd6('0x38')](_[_0xccd6('0x40')](_0x4d1175['query'],_0x2d131e[_0xccd6('0x38')]));if(_0x4d1175[_0xccd6('0x36')][_0xccd6('0x41')]){_0x2646e4[_0xccd6('0x3f')]=_['merge'](_0x2646e4['where'],{'$or':_[_0xccd6('0x2f')](_0x2646e4[_0xccd6('0x3a')],function(_0x2e37da){var _0x531318={};_0x531318[_0x2e37da]={'$like':'%'+_0x4d1175['query'][_0xccd6('0x41')]+'%'};return _0x531318;})});}if(_0x4d1175[_0xccd6('0x36')][_0xccd6('0x5f')]){var _0x3a3889=_0x4d1175[_0xccd6('0x36')]['$gte']['split'](',');var _0x57be95={};_0x57be95[_0x3a3889[0x0]]={'$gte':moment(_0x3a3889[0x1])[_0xccd6('0x60')](_0xccd6('0x61'))};_0x2646e4[_0xccd6('0x3f')]=_[_0xccd6('0x42')](_0x2646e4[_0xccd6('0x3f')],_0x57be95);}_0x2646e4=_[_0xccd6('0x42')]({},_0x2646e4,_0x4d1175[_0xccd6('0x44')]);return _0x4a999c[_0xccd6('0x5d')](_0x2646e4);}})['then'](function(_0x43fdec){if(_0x43fdec){_0x5373ac=_0x43fdec['length'];if(!_0x4d1175['query'][_0xccd6('0x57')]('nolimit')){_0x2646e4[_0xccd6('0x21')]=qs['limit'](_0x4d1175[_0xccd6('0x36')][_0xccd6('0x21')]);_0x2646e4['offset']=qs[_0xccd6('0x1e')](_0x4d1175[_0xccd6('0x36')][_0xccd6('0x1e')]);}return _0x4a999c[_0xccd6('0x5d')](_0x2646e4);}})[_0xccd6('0x28')](function(_0x3cd44f){if(_0x3cd44f){return _0x3cd44f?{'count':_0x5373ac,'rows':_0x3cd44f}:null;}})[_0xccd6('0x28')](respondWithResult(_0x58523d,null))[_0xccd6('0x49')](handleError(_0x58523d,null));};
\ No newline at end of file
+var _0x2503=['json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','ChatGroup','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','findOne','removeMembers','ids','addMessage','getMessages','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end'];(function(_0x21db42,_0x1c998c){var _0x493b0a=function(_0x544c8a){while(--_0x544c8a){_0x21db42['push'](_0x21db42['shift']());}};_0x493b0a(++_0x1c998c);}(_0x2503,0x110));var _0x3250=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2503[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3250('0x0'));var rimraf=require(_0x3250('0x1'));var zipdir=require(_0x3250('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3250('0x3'));var moment=require(_0x3250('0x4'));var BPromise=require(_0x3250('0x5'));var Mustache=require(_0x3250('0x6'));var util=require(_0x3250('0x7'));var path=require(_0x3250('0x8'));var sox=require(_0x3250('0x9'));var csv=require(_0x3250('0xa'));var ejs=require(_0x3250('0xb'));var fs=require('fs');var fs_extra=require(_0x3250('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3250('0xd'));var jsforce=require(_0x3250('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3250('0xa'));var querystring=require(_0x3250('0xf'));var Papa=require('papaparse');var Redis=require(_0x3250('0x10'));var authService=require(_0x3250('0x11'));var qs=require(_0x3250('0x12'));var as=require(_0x3250('0x13'));var hardwareService=require(_0x3250('0x14'));var logger=require(_0x3250('0x15'))(_0x3250('0x16'));var utils=require(_0x3250('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3250('0x18'));var db=require(_0x3250('0x19'))['db'];config[_0x3250('0x1a')]=_[_0x3250('0x1b')](config[_0x3250('0x1a')],{'host':_0x3250('0x1c'),'port':0x18eb});var socket=require(_0x3250('0x1d'))(new Redis(config[_0x3250('0x1a')]));require(_0x3250('0x1e'))['register'](socket);function respondWithStatusCode(_0x2c15e1,_0x3e2533){_0x3e2533=_0x3e2533||0xcc;return function(_0x2585f0){if(_0x2585f0){return _0x2c15e1[_0x3250('0x1f')](_0x3e2533);}return _0x2c15e1[_0x3250('0x20')](_0x3e2533)[_0x3250('0x21')]();};}function respondWithResult(_0x2358a9,_0x38e872){_0x38e872=_0x38e872||0xc8;return function(_0xa83344){if(_0xa83344){return _0x2358a9['status'](_0x38e872)[_0x3250('0x22')](_0xa83344);}};}function respondWithFilteredResult(_0x8d2f67,_0x4239ad){return function(_0x4b77da){if(_0x4b77da){var _0x3d5ba8=typeof _0x4239ad[_0x3250('0x23')]===_0x3250('0x24')&&typeof _0x4239ad['limit']===_0x3250('0x24');var _0x5707f2=_0x4b77da[_0x3250('0x25')];var _0x3837a3=_0x3d5ba8?0x0:_0x4239ad['offset'];var _0x3ee6bd=_0x3d5ba8?_0x4b77da['count']:_0x4239ad[_0x3250('0x23')]+_0x4239ad['limit'];var _0x1fb0c4;if(_0x3ee6bd>=_0x5707f2){_0x3ee6bd=_0x5707f2;_0x1fb0c4=0xc8;}else{_0x1fb0c4=0xce;}_0x8d2f67[_0x3250('0x20')](_0x1fb0c4);return _0x8d2f67[_0x3250('0x26')](_0x3250('0x27'),_0x3837a3+'-'+_0x3ee6bd+'/'+_0x5707f2)[_0x3250('0x22')](_0x4b77da);}return null;};}function patchUpdates(_0x5c8c0c){return function(_0x25f863){try{jsonpatch[_0x3250('0x28')](_0x25f863,_0x5c8c0c,!![]);}catch(_0x536382){return BPromise[_0x3250('0x29')](_0x536382);}return _0x25f863[_0x3250('0x2a')]();};}function saveUpdates(_0x4ec5d7,_0x1ee4c4){return function(_0x4556d9){if(_0x4556d9){return _0x4556d9[_0x3250('0x2b')](_0x4ec5d7)[_0x3250('0x2c')](function(_0x177dc6){return _0x177dc6;});}return null;};}function removeEntity(_0x38926a,_0x1f8454){return function(_0x13850b){if(_0x13850b){return _0x13850b[_0x3250('0x2d')]()['then'](function(){_0x38926a[_0x3250('0x20')](0xcc)[_0x3250('0x21')]();});}};}function handleEntityNotFound(_0x256f01,_0x6b785a){return function(_0x24005b){if(!_0x24005b){_0x256f01[_0x3250('0x1f')](0x194);}return _0x24005b;};}function handleError(_0x1c3fc8,_0x4c0020){_0x4c0020=_0x4c0020||0x1f4;return function(_0x1f4fbd){logger[_0x3250('0x2e')](_0x1f4fbd[_0x3250('0x2f')]);if(_0x1f4fbd['name']){delete _0x1f4fbd[_0x3250('0x30')];}_0x1c3fc8[_0x3250('0x20')](_0x4c0020)[_0x3250('0x31')](_0x1f4fbd);};}exports[_0x3250('0x32')]=function(_0xba91ac,_0x59305d){var _0x148f25={},_0x45908e={},_0x4116ee={'count':0x0,'rows':[]};var _0x3fd63b=_['map'](db['ChatGroup'][_0x3250('0x33')],function(_0x2d69c7){return{'name':_0x2d69c7[_0x3250('0x34')],'type':_0x2d69c7[_0x3250('0x35')][_0x3250('0x36')]};});_0x45908e['model']=_['map'](_0x3fd63b,_0x3250('0x30'));_0x45908e[_0x3250('0x37')]=_['keys'](_0xba91ac[_0x3250('0x37')]);_0x45908e[_0x3250('0x38')]=_[_0x3250('0x39')](_0x45908e[_0x3250('0x3a')],_0x45908e[_0x3250('0x37')]);_0x148f25['attributes']=_[_0x3250('0x39')](_0x45908e[_0x3250('0x3a')],qs[_0x3250('0x3b')](_0xba91ac[_0x3250('0x37')]['fields']));_0x148f25[_0x3250('0x3c')]=_0x148f25[_0x3250('0x3c')][_0x3250('0x3d')]?_0x148f25[_0x3250('0x3c')]:_0x45908e['model'];if(!_0xba91ac[_0x3250('0x37')][_0x3250('0x3e')](_0x3250('0x3f'))){_0x148f25[_0x3250('0x40')]=qs[_0x3250('0x40')](_0xba91ac['query'][_0x3250('0x40')]);_0x148f25[_0x3250('0x23')]=qs[_0x3250('0x23')](_0xba91ac['query'][_0x3250('0x23')]);}_0x148f25[_0x3250('0x41')]=qs[_0x3250('0x42')](_0xba91ac[_0x3250('0x37')][_0x3250('0x42')]);_0x148f25[_0x3250('0x43')]=qs[_0x3250('0x38')](_[_0x3250('0x44')](_0xba91ac['query'],_0x45908e['filters']),_0x3fd63b);if(_0xba91ac[_0x3250('0x37')]['filter']){_0x148f25[_0x3250('0x43')]=_['merge'](_0x148f25[_0x3250('0x43')],{'$or':_['map'](_0x3fd63b,function(_0x1d6866){if(_0x1d6866['type']!==_0x3250('0x45')){var _0x47bd79={};_0x47bd79[_0x1d6866['name']]={'$like':'%'+_0xba91ac['query'][_0x3250('0x46')]+'%'};return _0x47bd79;}})});}_0x148f25=_[_0x3250('0x47')]({},_0x148f25,_0xba91ac['options']);var _0x1d6d50={'where':_0x148f25[_0x3250('0x43')]};return db[_0x3250('0x48')][_0x3250('0x25')](_0x1d6d50)['then'](function(_0x17b9c8){_0x4116ee[_0x3250('0x25')]=_0x17b9c8;if(_0xba91ac[_0x3250('0x37')][_0x3250('0x49')]){_0x148f25[_0x3250('0x4a')]=[{'all':!![]}];}return db[_0x3250('0x48')][_0x3250('0x4b')](_0x148f25);})[_0x3250('0x2c')](function(_0xcba78e){_0x4116ee[_0x3250('0x4c')]=_0xcba78e;return _0x4116ee;})['then'](respondWithFilteredResult(_0x59305d,_0x148f25))[_0x3250('0x4d')](handleError(_0x59305d,null));};exports[_0x3250('0x4e')]=function(_0x56a76c,_0x39ac89){var _0x2d0a7c={'raw':!![],'where':{'id':_0x56a76c[_0x3250('0x4f')]['id']}},_0x2b5b50={};_0x2b5b50[_0x3250('0x3a')]=_[_0x3250('0x50')](db['ChatGroup'][_0x3250('0x33')]);_0x2b5b50[_0x3250('0x37')]=_[_0x3250('0x50')](_0x56a76c[_0x3250('0x37')]);_0x2b5b50['filters']=_[_0x3250('0x39')](_0x2b5b50[_0x3250('0x3a')],_0x2b5b50[_0x3250('0x37')]);_0x2d0a7c[_0x3250('0x3c')]=_['intersection'](_0x2b5b50[_0x3250('0x3a')],qs[_0x3250('0x3b')](_0x56a76c['query'][_0x3250('0x3b')]));_0x2d0a7c[_0x3250('0x3c')]=_0x2d0a7c[_0x3250('0x3c')]['length']?_0x2d0a7c['attributes']:_0x2b5b50[_0x3250('0x3a')];if(_0x56a76c[_0x3250('0x37')][_0x3250('0x49')]){_0x2d0a7c[_0x3250('0x4a')]=[{'all':!![]}];}_0x2d0a7c=_[_0x3250('0x47')]({},_0x2d0a7c,_0x56a76c[_0x3250('0x51')]);return db[_0x3250('0x48')][_0x3250('0x52')](_0x2d0a7c)['then'](handleEntityNotFound(_0x39ac89,null))[_0x3250('0x2c')](respondWithResult(_0x39ac89,null))[_0x3250('0x4d')](handleError(_0x39ac89,null));};exports['create']=function(_0x6009f0,_0x3c6b7e){return db[_0x3250('0x48')][_0x3250('0x53')](_0x6009f0['body'],{})['then'](respondWithResult(_0x3c6b7e,0xc9))[_0x3250('0x4d')](handleError(_0x3c6b7e,null));};exports[_0x3250('0x2b')]=function(_0x174664,_0x12aab4){if(_0x174664[_0x3250('0x54')]['id']){delete _0x174664['body']['id'];}return db[_0x3250('0x48')][_0x3250('0x52')]({'where':{'id':_0x174664[_0x3250('0x4f')]['id']}})['then'](handleEntityNotFound(_0x12aab4,null))[_0x3250('0x2c')](saveUpdates(_0x174664[_0x3250('0x54')],null))['then'](respondWithResult(_0x12aab4,null))[_0x3250('0x4d')](handleError(_0x12aab4,null));};exports[_0x3250('0x2d')]=function(_0x157ed7,_0x3a94a3){return db[_0x3250('0x48')][_0x3250('0x52')]({'where':{'id':_0x157ed7[_0x3250('0x4f')]['id']}})[_0x3250('0x2c')](handleEntityNotFound(_0x3a94a3,null))['then'](removeEntity(_0x3a94a3,null))['catch'](handleError(_0x3a94a3,null));};exports['describe']=function(_0x4e77be,_0xd11fde){return db[_0x3250('0x48')][_0x3250('0x55')]()[_0x3250('0x2c')](respondWithResult(_0xd11fde,null))[_0x3250('0x4d')](handleError(_0xd11fde,null));};exports[_0x3250('0x56')]=function(_0x50aa81,_0x3a07d4,_0x40a4e2){return db[_0x3250('0x57')][_0x3250('0x25')]({'where':{'ChatGroupId':_0x50aa81['params']['id'],'ToId':_0x50aa81[_0x3250('0x58')]['id'],'read':![]}})['then'](function(_0x4f286a){return{'id':_[_0x3250('0x59')](_0x50aa81[_0x3250('0x4f')]['id']),'count':_0x4f286a};})[_0x3250('0x2c')](respondWithResult(_0x3a07d4,null))[_0x3250('0x4d')](handleError(_0x3a07d4,null));};exports['addMembers']=function(_0x4ec593,_0xfda842,_0x262200){return db[_0x3250('0x48')][_0x3250('0x52')]({'where':{'id':_0x4ec593[_0x3250('0x4f')]['id']}})[_0x3250('0x2c')](handleEntityNotFound(_0xfda842,null))[_0x3250('0x2c')](function(_0x559754){if(_0x559754){return _0x559754[_0x3250('0x5a')](_0x4ec593[_0x3250('0x54')]['ids'],_[_0x3250('0x5b')](_0x4ec593[_0x3250('0x54')],['ids','id'])||{});}})[_0x3250('0x2c')](respondWithResult(_0xfda842,null))[_0x3250('0x4d')](handleError(_0xfda842,null));};exports[_0x3250('0x5c')]=function(_0x1837dc,_0x3cac52,_0x45e8bb){var _0x1a3692={};var _0x48f429={};var _0x25a415;var _0x2b2c70;return db['ChatGroup'][_0x3250('0x5d')]({'where':{'id':_0x1837dc[_0x3250('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3cac52,null))[_0x3250('0x2c')](function(_0xd42dfb){if(_0xd42dfb){_0x25a415=_0xd42dfb;_0x48f429['model']=_[_0x3250('0x50')](db['User'][_0x3250('0x33')]);_0x48f429[_0x3250('0x37')]=_['keys'](_0x1837dc['query']);_0x48f429[_0x3250('0x38')]=_[_0x3250('0x39')](_0x48f429[_0x3250('0x3a')],_0x48f429[_0x3250('0x37')]);_0x1a3692[_0x3250('0x3c')]=_[_0x3250('0x39')](_0x48f429[_0x3250('0x3a')],qs[_0x3250('0x3b')](_0x1837dc['query'][_0x3250('0x3b')]));_0x1a3692[_0x3250('0x3c')]=_0x1a3692[_0x3250('0x3c')][_0x3250('0x3d')]?_0x1a3692['attributes']:_0x48f429['model'];_0x1a3692[_0x3250('0x41')]=qs[_0x3250('0x42')](_0x1837dc['query'][_0x3250('0x42')]);_0x1a3692['where']=qs['filters'](_['pick'](_0x1837dc[_0x3250('0x37')],_0x48f429['filters']));if(_0x1837dc['query']['filter']){_0x1a3692['where']=_[_0x3250('0x47')](_0x1a3692[_0x3250('0x43')],{'$or':_['map'](_0x1a3692[_0x3250('0x3c')],function(_0x14e353){var _0x27d2ba={};_0x27d2ba[_0x14e353]={'$like':'%'+_0x1837dc[_0x3250('0x37')][_0x3250('0x46')]+'%'};return _0x27d2ba;})});}_0x1a3692=_[_0x3250('0x47')]({},_0x1a3692,_0x1837dc['options']);return _0x25a415[_0x3250('0x5c')](_0x1a3692);}})[_0x3250('0x2c')](function(_0x54cc44){if(_0x54cc44){_0x2b2c70=_0x54cc44[_0x3250('0x3d')];if(!_0x1837dc[_0x3250('0x37')][_0x3250('0x3e')]('nolimit')){_0x1a3692[_0x3250('0x40')]=qs['limit'](_0x1837dc[_0x3250('0x37')][_0x3250('0x40')]);_0x1a3692['offset']=qs[_0x3250('0x23')](_0x1837dc[_0x3250('0x37')][_0x3250('0x23')]);}return _0x25a415[_0x3250('0x5c')](_0x1a3692);}})[_0x3250('0x2c')](function(_0x3c2513){if(_0x3c2513){return _0x3c2513?{'count':_0x2b2c70,'rows':_0x3c2513}:null;}})[_0x3250('0x2c')](respondWithResult(_0x3cac52,null))[_0x3250('0x4d')](handleError(_0x3cac52,null));};exports[_0x3250('0x5e')]=function(_0x2b59c7,_0x56ea6e,_0x14da8e){return db[_0x3250('0x48')][_0x3250('0x52')]({'where':{'id':_0x2b59c7[_0x3250('0x4f')]['id']}})[_0x3250('0x2c')](handleEntityNotFound(_0x56ea6e,null))[_0x3250('0x2c')](function(_0x365395){if(_0x365395){return _0x365395[_0x3250('0x5e')](_0x2b59c7[_0x3250('0x37')][_0x3250('0x5f')]);}})[_0x3250('0x2c')](respondWithStatusCode(_0x56ea6e,null))[_0x3250('0x4d')](handleError(_0x56ea6e,null));};exports[_0x3250('0x60')]=function(_0x182294,_0x4250d0,_0x1b68d2){if(_0x182294['body']['id']){delete _0x182294[_0x3250('0x54')]['id'];}return db[_0x3250('0x48')][_0x3250('0x52')]({'where':{'id':_0x182294[_0x3250('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4250d0,null))[_0x3250('0x2c')](function(_0x4862ff){if(_0x4862ff){_0x182294[_0x3250('0x54')]['ChatGroupId']=_0x4862ff['id'];return db[_0x3250('0x57')][_0x3250('0x53')](_0x182294[_0x3250('0x54')]);}})[_0x3250('0x2c')](respondWithResult(_0x4250d0,null))[_0x3250('0x4d')](handleError(_0x4250d0,null));};exports[_0x3250('0x61')]=function(_0x33df7a,_0x2367f8,_0x148a30){var _0x27870d={};var _0x31b12c={};var _0x27150d;var _0x542ad1;return db[_0x3250('0x48')][_0x3250('0x5d')]({'where':{'id':_0x33df7a[_0x3250('0x4f')]['id']}})[_0x3250('0x2c')](handleEntityNotFound(_0x2367f8,null))['then'](function(_0x3796ff){if(_0x3796ff){_0x27150d=_0x3796ff;_0x31b12c[_0x3250('0x3a')]=_[_0x3250('0x50')](db[_0x3250('0x57')][_0x3250('0x33')]);_0x31b12c[_0x3250('0x37')]=_['keys'](_0x33df7a[_0x3250('0x37')]);_0x31b12c[_0x3250('0x38')]=_[_0x3250('0x39')](_0x31b12c['model'],_0x31b12c[_0x3250('0x37')]);_0x27870d[_0x3250('0x3c')]=_[_0x3250('0x39')](_0x31b12c['model'],qs[_0x3250('0x3b')](_0x33df7a[_0x3250('0x37')][_0x3250('0x3b')]));_0x27870d[_0x3250('0x3c')]=_0x27870d[_0x3250('0x3c')][_0x3250('0x3d')]?_0x27870d[_0x3250('0x3c')]:_0x31b12c[_0x3250('0x3a')];_0x27870d[_0x3250('0x41')]=qs[_0x3250('0x42')](_0x33df7a['query'][_0x3250('0x42')]);_0x27870d[_0x3250('0x43')]=qs[_0x3250('0x38')](_[_0x3250('0x44')](_0x33df7a[_0x3250('0x37')],_0x31b12c[_0x3250('0x38')]));if(_0x33df7a[_0x3250('0x37')][_0x3250('0x46')]){_0x27870d[_0x3250('0x43')]=_[_0x3250('0x47')](_0x27870d['where'],{'$or':_[_0x3250('0x62')](_0x27870d[_0x3250('0x3c')],function(_0x289304){var _0xfc851d={};_0xfc851d[_0x289304]={'$like':'%'+_0x33df7a['query'][_0x3250('0x46')]+'%'};return _0xfc851d;})});}if(_0x33df7a[_0x3250('0x37')][_0x3250('0x63')]){var _0x204376=_0x33df7a[_0x3250('0x37')][_0x3250('0x63')][_0x3250('0x64')](',');var _0x4f208b={};_0x4f208b[_0x204376[0x0]]={'$gte':moment(_0x204376[0x1])['format'](_0x3250('0x65'))};_0x27870d['where']=_['merge'](_0x27870d['where'],_0x4f208b);}_0x27870d=_[_0x3250('0x47')]({},_0x27870d,_0x33df7a[_0x3250('0x51')]);return _0x27150d[_0x3250('0x61')](_0x27870d);}})[_0x3250('0x2c')](function(_0x2fde54){if(_0x2fde54){_0x542ad1=_0x2fde54[_0x3250('0x3d')];if(!_0x33df7a[_0x3250('0x37')][_0x3250('0x3e')](_0x3250('0x3f'))){_0x27870d[_0x3250('0x40')]=qs['limit'](_0x33df7a['query'][_0x3250('0x40')]);_0x27870d[_0x3250('0x23')]=qs['offset'](_0x33df7a[_0x3250('0x37')][_0x3250('0x23')]);}return _0x27150d[_0x3250('0x61')](_0x27870d);}})[_0x3250('0x2c')](function(_0x39a6fc){if(_0x39a6fc){return _0x39a6fc?{'count':_0x542ad1,'rows':_0x39a6fc}:null;}})[_0x3250('0x2c')](respondWithResult(_0x2367f8,null))[_0x3250('0x4d')](handleError(_0x2367f8,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index c2fd793..86ce72a 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 _0x3823=['../../mysqldb','ChatGroup','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x3da241,_0xeba26a){var _0x43e156=function(_0x41ced1){while(--_0x41ced1){_0x3da241['push'](_0x3da241['shift']());}};_0x43e156(++_0xeba26a);}(_0x3823,0xb0));var _0x3382=function(_0x92ec1b,_0x882d2b){_0x92ec1b=_0x92ec1b-0x0;var _0x541de8=_0x3823[_0x92ec1b];return _0x541de8;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x3382('0x0'))['db'][_0x3382('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3382('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3382('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3c7f37){return function(_0x834bba,_0x420a9a,_0x19d80e){ChatGroupEvents['emit'](_0x3c7f37+':'+_0x834bba['id'],_0x834bba);ChatGroupEvents[_0x3382('0x4')](_0x3c7f37,_0x834bba);_0x19d80e(null);};}for(var e in events){if(events[_0x3382('0x5')](e)){var event=events[e];ChatGroup[_0x3382('0x6')](e,emitEvent(event));}}module[_0x3382('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x6f44=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x6f44,0x1ea));var _0x46f4=function(_0x41612b,_0x1f7510){_0x41612b=_0x41612b-0x0;var _0x2ef80d=_0x6f44[_0x41612b];return _0x2ef80d;};'use strict';var EventEmitter=require(_0x46f4('0x0'));var ChatGroup=require(_0x46f4('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x46f4('0x2')](0x0);var events={'afterCreate':_0x46f4('0x3'),'afterUpdate':_0x46f4('0x4'),'afterDestroy':_0x46f4('0x5')};function emitEvent(_0x4099a9){return function(_0x1e2554,_0x26f749,_0x200f8b){ChatGroupEvents[_0x46f4('0x6')](_0x4099a9+':'+_0x1e2554['id'],_0x1e2554);ChatGroupEvents['emit'](_0x4099a9,_0x1e2554);_0x200f8b(null);};}for(var e in events){if(events[_0x46f4('0x7')](e)){var event=events[e];ChatGroup[_0x46f4('0x8')](e,emitEvent(event));}}module[_0x46f4('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 5ae9e0a..62fd5e8 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 _0xd42b=['rimraf','../../config/environment','define','chat_groups','util','../../config/logger','api','moment','path'];(function(_0x2719d3,_0x30c25f){var _0x4cc222=function(_0x5bed61){while(--_0x5bed61){_0x2719d3['push'](_0x2719d3['shift']());}};_0x4cc222(++_0x30c25f);}(_0xd42b,0x1f3));var _0xbd42=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xd42b[_0x40d8d7];return _0x3454cc;};'use strict';var _=require('lodash');var util=require(_0xbd42('0x0'));var logger=require(_0xbd42('0x1'))(_0xbd42('0x2'));var moment=require(_0xbd42('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd42('0x4'));var rimraf=require(_0xbd42('0x5'));var config=require(_0xbd42('0x6'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x803ddf,_0x8512db){return _0x803ddf[_0xbd42('0x7')]('ChatGroup',attributes,{'tableName':_0xbd42('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3baa=['chat_groups','../../config/logger','api','moment','bluebird','path','define','ChatGroup'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x3baa,0x1d9));var _0xa3ba=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0x3baa[_0xb0fe92];return _0x41787f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa3ba('0x0'))(_0xa3ba('0x1'));var moment=require(_0xa3ba('0x2'));var BPromise=require(_0xa3ba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3ba('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module['exports']=function(_0x145d08,_0x25987d){return _0x145d08[_0xa3ba('0x5')](_0xa3ba('0x6'),attributes,{'tableName':_0xa3ba('0x7'),'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 9357378..eb9ea36 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 _0xdbd0=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x250b10,_0x52defa){var _0x20a519=function(_0xa83c93){while(--_0xa83c93){_0x250b10['push'](_0x250b10['shift']());}};_0x20a519(++_0x52defa);}(_0xdbd0,0x88));var _0x0dbd=function(_0x3ee09e,_0x1d0818){_0x3ee09e=_0x3ee09e-0x0;var _0x204f02=_0xdbd0[_0x3ee09e];return _0x204f02;};'use strict';var _=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var moment=require(_0x0dbd('0x2'));var BPromise=require(_0x0dbd('0x3'));var rs=require(_0x0dbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dbd('0x5'))['db'];var utils=require(_0x0dbd('0x6'));var logger=require(_0x0dbd('0x7'))('rpc');var config=require(_0x0dbd('0x8'));var jayson=require(_0x0dbd('0x9'));var client=jayson[_0x0dbd('0xa')][_0x0dbd('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0dbd('0xc')],{'host':_0x0dbd('0xd'),'port':0x18eb});var socket=require(_0x0dbd('0xe'))(new Redis(config[_0x0dbd('0xc')]));require(_0x0dbd('0xf'))[_0x0dbd('0x10')](socket);function respondWithRpcPromise(_0x5329e7,_0x55f318,_0x1a5e84){return new BPromise(function(_0x1e0d57,_0x86fd0){return client[_0x0dbd('0x11')](_0x5329e7,_0x1a5e84)[_0x0dbd('0x12')](function(_0x18e73c){logger[_0x0dbd('0x13')](_0x0dbd('0x14'),_0x55f318,'request\x20sent');logger[_0x0dbd('0x15')](_0x0dbd('0x16'),_0x55f318,_0x0dbd('0x17'),JSON['stringify'](_0x18e73c));if(_0x18e73c[_0x0dbd('0x18')]){if(_0x18e73c[_0x0dbd('0x18')][_0x0dbd('0x19')]===0x1f4){logger[_0x0dbd('0x18')](_0x0dbd('0x14'),_0x55f318,_0x18e73c[_0x0dbd('0x18')][_0x0dbd('0x1a')]);return _0x86fd0(_0x18e73c[_0x0dbd('0x18')][_0x0dbd('0x1a')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x55f318,_0x18e73c[_0x0dbd('0x18')][_0x0dbd('0x1a')]);return _0x1e0d57(_0x18e73c['error'][_0x0dbd('0x1a')]);}else{logger[_0x0dbd('0x13')]('ChatGroup,\x20%s,\x20%s',_0x55f318,'request\x20sent');_0x1e0d57(_0x18e73c[_0x0dbd('0x1b')][_0x0dbd('0x1a')]);}})[_0x0dbd('0x1c')](function(_0x5087d3){logger[_0x0dbd('0x18')](_0x0dbd('0x14'),_0x55f318,_0x5087d3);_0x86fd0(_0x5087d3);});});}
\ No newline at end of file
+var _0x2a9b=['stringify','error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x19de04,_0x1f9453){var _0x1cd3d2=function(_0x3e2850){while(--_0x3e2850){_0x19de04['push'](_0x19de04['shift']());}};_0x1cd3d2(++_0x1f9453);}(_0x2a9b,0x14b));var _0xb2a9=function(_0x36503d,_0x30ca19){_0x36503d=_0x36503d-0x0;var _0x579499=_0x2a9b[_0x36503d];return _0x579499;};'use strict';var _=require('lodash');var util=require(_0xb2a9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb2a9('0x1'));var fs=require('fs');var Redis=require(_0xb2a9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2a9('0x3'));var logger=require(_0xb2a9('0x4'))(_0xb2a9('0x5'));var config=require(_0xb2a9('0x6'));var jayson=require(_0xb2a9('0x7'));var client=jayson[_0xb2a9('0x8')][_0xb2a9('0x9')]({'port':0x232a});config[_0xb2a9('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb2a9('0xb'))[_0xb2a9('0xc')](socket);function respondWithRpcPromise(_0x4c46af,_0xcdac87,_0xe3a752){return new BPromise(function(_0x20c41c,_0x59f585){return client['request'](_0x4c46af,_0xe3a752)[_0xb2a9('0xd')](function(_0x32be75){logger[_0xb2a9('0xe')](_0xb2a9('0xf'),_0xcdac87,_0xb2a9('0x10'));logger[_0xb2a9('0x11')](_0xb2a9('0x12'),_0xcdac87,'request\x20sent',JSON[_0xb2a9('0x13')](_0x32be75));if(_0x32be75[_0xb2a9('0x14')]){if(_0x32be75[_0xb2a9('0x14')][_0xb2a9('0x15')]===0x1f4){logger[_0xb2a9('0x14')]('ChatGroup,\x20%s,\x20%s',_0xcdac87,_0x32be75[_0xb2a9('0x14')][_0xb2a9('0x16')]);return _0x59f585(_0x32be75[_0xb2a9('0x14')][_0xb2a9('0x16')]);}logger['error'](_0xb2a9('0xf'),_0xcdac87,_0x32be75['error']['message']);return _0x20c41c(_0x32be75[_0xb2a9('0x14')][_0xb2a9('0x16')]);}else{logger['info'](_0xb2a9('0xf'),_0xcdac87,'request\x20sent');_0x20c41c(_0x32be75[_0xb2a9('0x17')][_0xb2a9('0x16')]);}})[_0xb2a9('0x18')](function(_0x58c271){logger[_0xb2a9('0x14')]('ChatGroup,\x20%s,\x20%s',_0xcdac87,_0x58c271);_0x59f585(_0x58c271);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index f1ae635..b5d890d 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 _0x20fd=['register','length','./chatGroup.events','update','emit','removeListener'];(function(_0x3caf9f,_0xec59b8){var _0x203e82=function(_0x33a58e){while(--_0x33a58e){_0x3caf9f['push'](_0x3caf9f['shift']());}};_0x203e82(++_0xec59b8);}(_0x20fd,0x1a0));var _0xd20f=function(_0x3bbb74,_0x2dc0ef){_0x3bbb74=_0x3bbb74-0x0;var _0xc5dcbc=_0x20fd[_0x3bbb74];return _0xc5dcbc;};'use strict';var ChatGroupEvents=require(_0xd20f('0x0'));var events=['save','remove',_0xd20f('0x1')];function createListener(_0x44997e,_0x76554a){return function(_0xb11b25){_0x76554a[_0xd20f('0x2')](_0x44997e,_0xb11b25);};}function removeListener(_0x1e4d07,_0x262a8a){return function(){ChatGroupEvents[_0xd20f('0x3')](_0x1e4d07,_0x262a8a);};}exports[_0xd20f('0x4')]=function(_0x588bd9){for(var _0x52a9d3=0x0,_0x2056ce=events[_0xd20f('0x5')];_0x52a9d3<_0x2056ce;_0x52a9d3++){var _0x36cffb=events[_0x52a9d3];var _0x4adab9=createListener('chatGroup:'+_0x36cffb,_0x588bd9);ChatGroupEvents['on'](_0x36cffb,_0x4adab9);}};
\ No newline at end of file
+var _0x637b=['remove','emit','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x440469,_0xd6af33){var _0xe0c479=function(_0x29061a){while(--_0x29061a){_0x440469['push'](_0x440469['shift']());}};_0xe0c479(++_0xd6af33);}(_0x637b,0xfa));var _0xb637=function(_0x22ff81,_0x4b3c61){_0x22ff81=_0x22ff81-0x0;var _0x385c13=_0x637b[_0x22ff81];return _0x385c13;};'use strict';var ChatGroupEvents=require(_0xb637('0x0'));var events=[_0xb637('0x1'),_0xb637('0x2'),'update'];function createListener(_0x5650c7,_0x473c67){return function(_0xab5d3){_0x473c67[_0xb637('0x3')](_0x5650c7,_0xab5d3);};}function removeListener(_0xeea0be,_0x28e60f){return function(){ChatGroupEvents['removeListener'](_0xeea0be,_0x28e60f);};}exports[_0xb637('0x4')]=function(_0xf3f74c){for(var _0x54f299=0x0,_0x26b45a=events[_0xb637('0x5')];_0x54f299<_0x26b45a;_0x54f299++){var _0x562b1f=events[_0x54f299];var _0x39fdc8=createListener(_0xb637('0x6')+_0x562b1f,_0xf3f74c);ChatGroupEvents['on'](_0x562b1f,_0x39fdc8);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 9d53991..afa2a42 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 _0x5efb=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','addMembers','addMessage','put','delete','removeMembers','exports'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x5efb,0xa1));var _0xb5ef=function(_0x5259f7,_0xdcdc61){_0x5259f7=_0x5259f7-0x0;var _0x11e597=_0x5efb[_0x5259f7];return _0x11e597;};'use strict';var multer=require(_0xb5ef('0x0'));var util=require(_0xb5ef('0x1'));var path=require(_0xb5ef('0x2'));var timeout=require(_0xb5ef('0x3'));var express=require('express');var router=express[_0xb5ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb5ef('0x5'));var interaction=require(_0xb5ef('0x6'));var config=require(_0xb5ef('0x7'));var controller=require('./chatGroup.controller');router[_0xb5ef('0x8')]('/',auth[_0xb5ef('0x9')](),controller['index']);router[_0xb5ef('0x8')]('/describe',auth[_0xb5ef('0x9')](),controller['describe']);router[_0xb5ef('0x8')](_0xb5ef('0xa'),auth[_0xb5ef('0x9')](),controller['show']);router['get'](_0xb5ef('0xb'),auth[_0xb5ef('0x9')](),controller[_0xb5ef('0xc')]);router['get'](_0xb5ef('0xd'),auth[_0xb5ef('0x9')](),controller[_0xb5ef('0xe')]);router[_0xb5ef('0x8')]('/:id/messages',auth[_0xb5ef('0x9')](),controller[_0xb5ef('0xf')]);router[_0xb5ef('0x10')]('/',auth[_0xb5ef('0x9')](),controller['create']);router[_0xb5ef('0x10')]('/:id/members',auth[_0xb5ef('0x9')](),controller[_0xb5ef('0x11')]);router['post']('/:id/messages',auth[_0xb5ef('0x9')](),controller[_0xb5ef('0x12')]);router[_0xb5ef('0x13')](_0xb5ef('0xa'),auth[_0xb5ef('0x9')](),controller['update']);router[_0xb5ef('0x14')](_0xb5ef('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xb5ef('0x14')](_0xb5ef('0xd'),auth[_0xb5ef('0x9')](),controller[_0xb5ef('0x15')]);module[_0xb5ef('0x16')]=router;
\ No newline at end of file
+var _0xbda5=['fs-extra','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x29d736,_0x5d3711){var _0xf3e49b=function(_0x3ff27f){while(--_0x3ff27f){_0x29d736['push'](_0x29d736['shift']());}};_0xf3e49b(++_0x5d3711);}(_0xbda5,0x173));var _0x5bda=function(_0x227b53,_0x410a40){_0x227b53=_0x227b53-0x0;var _0x26b21a=_0xbda5[_0x227b53];return _0x26b21a;};'use strict';var multer=require(_0x5bda('0x0'));var util=require(_0x5bda('0x1'));var path=require('path');var timeout=require(_0x5bda('0x2'));var express=require(_0x5bda('0x3'));var router=express['Router']();var fs_extra=require(_0x5bda('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x5bda('0x5')](),controller[_0x5bda('0x6')]);router[_0x5bda('0x7')](_0x5bda('0x8'),auth['isAuthenticated'](),controller[_0x5bda('0x9')]);router[_0x5bda('0x7')](_0x5bda('0xa'),auth[_0x5bda('0x5')](),controller[_0x5bda('0xb')]);router[_0x5bda('0x7')]('/:id/unread',auth[_0x5bda('0x5')](),controller[_0x5bda('0xc')]);router[_0x5bda('0x7')](_0x5bda('0xd'),auth['isAuthenticated'](),controller[_0x5bda('0xe')]);router[_0x5bda('0x7')](_0x5bda('0xf'),auth[_0x5bda('0x5')](),controller[_0x5bda('0x10')]);router[_0x5bda('0x11')]('/',auth['isAuthenticated'](),controller[_0x5bda('0x12')]);router['post'](_0x5bda('0xd'),auth[_0x5bda('0x5')](),controller[_0x5bda('0x13')]);router['post'](_0x5bda('0xf'),auth[_0x5bda('0x5')](),controller['addMessage']);router[_0x5bda('0x14')](_0x5bda('0xa'),auth['isAuthenticated'](),controller[_0x5bda('0x15')]);router[_0x5bda('0x16')](_0x5bda('0xa'),auth[_0x5bda('0x5')](),controller[_0x5bda('0x17')]);router[_0x5bda('0x16')](_0x5bda('0xd'),auth[_0x5bda('0x5')](),controller['removeMembers']);module[_0x5bda('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 7b8e491..5548f29 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 _0x337f=['ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x337f,0x11f));var _0xf337=function(_0x553d0e,_0x159bb5){_0x553d0e=_0x553d0e-0x0;var _0x22c5f6=_0x337f[_0x553d0e];return _0x22c5f6;};'use strict';var Sequelize=require(_0xf337('0x0'));module[_0xf337('0x1')]={'closed':{'type':Sequelize[_0xf337('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xf337('0x3')](_0xf337('0x4'),_0xf337('0x5')),'defaultValue':_0xf337('0x4')},'ratingMessage':{'type':Sequelize[_0xf337('0x6')]},'pathTranscript':{'type':Sequelize[_0xf337('0x6')]},'mailTranscript':{'type':Sequelize[_0xf337('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf337('0x8')]},'disposition':{'type':Sequelize[_0xf337('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf337('0x7')]},'note':{'type':Sequelize[_0xf337('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf337('0x7')]},'osVersion':{'type':Sequelize[_0xf337('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf337('0x7')]},'deviceType':{'type':Sequelize[_0xf337('0x7')]},'referer':{'type':Sequelize[_0xf337('0x6')]},'customerIp':{'type':Sequelize[_0xf337('0x7')]},'formData':{'type':Sequelize[_0xf337('0x6')](_0xf337('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf337('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf337('0x7')]},'customerPort':{'type':Sequelize[_0xf337('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xf337('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf337('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4e76=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize'];(function(_0x15318c,_0x2e50e4){var _0x10d3ce=function(_0x2fecdd){while(--_0x2fecdd){_0x15318c['push'](_0x15318c['shift']());}};_0x10d3ce(++_0x2e50e4);}(_0x4e76,0x167));var _0x64e7=function(_0x346795,_0x2e860e){_0x346795=_0x346795-0x0;var _0x2f10e3=_0x4e76[_0x346795];return _0x2f10e3;};'use strict';var Sequelize=require(_0x64e7('0x0'));module[_0x64e7('0x1')]={'closed':{'type':Sequelize[_0x64e7('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x64e7('0x3')]},'ratingType':{'type':Sequelize[_0x64e7('0x4')](_0x64e7('0x5'),_0x64e7('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x64e7('0x7')]},'mailTranscript':{'type':Sequelize[_0x64e7('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x64e7('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x64e7('0x8')]},'note':{'type':Sequelize[_0x64e7('0x8')]},'browserName':{'type':Sequelize[_0x64e7('0x8')]},'browserVersion':{'type':Sequelize[_0x64e7('0x8')]},'osName':{'type':Sequelize[_0x64e7('0x8')]},'osVersion':{'type':Sequelize[_0x64e7('0x8')]},'deviceModel':{'type':Sequelize[_0x64e7('0x8')]},'deviceVendor':{'type':Sequelize[_0x64e7('0x8')]},'deviceType':{'type':Sequelize[_0x64e7('0x8')]},'referer':{'type':Sequelize[_0x64e7('0x7')]},'customerIp':{'type':Sequelize[_0x64e7('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x64e7('0x9'))},'read1stAt':{'type':Sequelize[_0x64e7('0xa')]},'lastMsgAt':{'type':Sequelize[_0x64e7('0xa')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x64e7('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x64e7('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x64e7('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x64e7('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x64e7('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index e06c446..202089d 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 _0xf163=['originalname','file','filename','mimetype','findOne','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','User','ContactId','Messages','UserId','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','fullname','MM/DD/YYYY\x20HH:mm:ss','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ChatMessage','ids','omit','filters','hasOwnProperty','sort','ChatInteractionId','filter','where','$gte','YYYY-MM-DD\x20HH:mm:ss','include','rows','nolimit','pick','includeAgent','push','addTags','setTags','Tag','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','firstName','attachments','createdAt','direction','Owner','get','mkdirSync','Chat','N.A.','browserName','referer','customerIp','customerPort','createReadStream','out','lastName','read','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','send','render','merge','contact','agent','interaction','index','map','ChatInteraction','fieldName','type','getOptions','findAll','chat','query','then','params','model','rawAttributes','keys','intersection','attributes','fields','length','includeAll','options','find','create','body','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooMetadata','user','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload'];(function(_0x12f4d2,_0x3a416e){var _0x488e5e=function(_0x43fe1e){while(--_0x43fe1e){_0x12f4d2['push'](_0x12f4d2['shift']());}};_0x488e5e(++_0x3a416e);}(_0xf163,0x1ec));var _0x3f16=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0xf163[_0x4eaa4c];return _0x15aec6;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x3f16('0x0'));var rp=require(_0x3f16('0x1'));var moment=require('moment');var BPromise=require(_0x3f16('0x2'));var Mustache=require(_0x3f16('0x3'));var util=require(_0x3f16('0x4'));var path=require('path');var ejs=require(_0x3f16('0x5'));var fs=require('fs');var _=require(_0x3f16('0x6'));var Redis=require(_0x3f16('0x7'));var interaction=require(_0x3f16('0x8'));var qs=require(_0x3f16('0x9'));var pdf=require(_0x3f16('0xa'));var logger=require('../../config/logger')(_0x3f16('0xb'));var config=require(_0x3f16('0xc'));var db=require(_0x3f16('0xd'))['db'];config[_0x3f16('0xe')]=_['defaults'](config[_0x3f16('0xe')],{'host':_0x3f16('0xf'),'port':0x18eb});var socket=require(_0x3f16('0x10'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3f16('0x11')][_0x3f16('0x12')]({'port':0x232b});var client9004=jayson[_0x3f16('0x11')][_0x3f16('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x3bdbb2,_0x15237c,_0x2d7781,_0x101dca){return new BPromise(function(_0x265e43,_0x592eaf){var _0x3fb33d=_0x101dca||client;return _0x3fb33d[_0x3f16('0x13')](_0x3bdbb2,_0x2d7781)['then'](function(_0x4d5eb5){logger[_0x3f16('0x14')](_0x3f16('0x15'),_0x15237c,_0x3f16('0x16'));logger[_0x3f16('0x17')](_0x3f16('0x18'),_0x15237c,'request\x20sent',JSON[_0x3f16('0x19')](_0x4d5eb5));if(_0x4d5eb5['error']){if(_0x4d5eb5[_0x3f16('0x1a')]['code']===0x1f4){logger['error'](_0x3f16('0x15'),_0x15237c,_0x4d5eb5[_0x3f16('0x1a')]['message']);return _0x592eaf(_0x4d5eb5['error'][_0x3f16('0x1b')]);}logger[_0x3f16('0x1a')](_0x3f16('0x15'),_0x15237c,_0x4d5eb5[_0x3f16('0x1a')][_0x3f16('0x1b')]);return _0x265e43(_0x4d5eb5[_0x3f16('0x1a')][_0x3f16('0x1b')]);}else{logger[_0x3f16('0x14')](_0x3f16('0x15'),_0x15237c,'request\x20sent');_0x265e43(_0x4d5eb5[_0x3f16('0x1c')][_0x3f16('0x1b')]);}})[_0x3f16('0x1d')](function(_0x2660d8){logger[_0x3f16('0x1a')](_0x3f16('0x15'),_0x15237c,_0x2660d8);_0x592eaf(_0x2660d8);});});}function respondWithStatusCode(_0x228c29,_0x31614a){_0x31614a=_0x31614a||0xcc;return function(_0x2a481c){if(_0x2a481c){return _0x228c29[_0x3f16('0x1e')](_0x31614a);}return _0x228c29['status'](_0x31614a)[_0x3f16('0x1f')]();};}function respondWithResult(_0x35f270,_0x3986e4){_0x3986e4=_0x3986e4||0xc8;return function(_0x2f55f7){if(_0x2f55f7){return _0x35f270[_0x3f16('0x20')](_0x3986e4)[_0x3f16('0x21')](_0x2f55f7);}};}function respondWithFilteredResult(_0x3b8155,_0x35b044){return function(_0x1b22c9){if(_0x1b22c9){var _0x478d7d=typeof _0x35b044[_0x3f16('0x22')]===_0x3f16('0x23')&&typeof _0x35b044[_0x3f16('0x24')]==='undefined';var _0x4ef0c2=_0x1b22c9[_0x3f16('0x25')];var _0x4a7c2b=_0x478d7d?0x0:_0x35b044[_0x3f16('0x22')];var _0x53c3ea=_0x478d7d?_0x1b22c9[_0x3f16('0x25')]:_0x35b044['offset']+_0x35b044['limit'];var _0xfdf9c;if(_0x53c3ea>=_0x4ef0c2){_0x53c3ea=_0x4ef0c2;_0xfdf9c=0xc8;}else{_0xfdf9c=0xce;}_0x3b8155['status'](_0xfdf9c);return _0x3b8155[_0x3f16('0x26')](_0x3f16('0x27'),_0x4a7c2b+'-'+_0x53c3ea+'/'+_0x4ef0c2)[_0x3f16('0x21')](_0x1b22c9);}return null;};}function saveUpdates(_0x44eba9){return function(_0x57d2f2){if(_0x57d2f2){return _0x57d2f2[_0x3f16('0x28')](_0x44eba9)['then'](function(_0x14aeb9){return _0x14aeb9;});}return null;};}function removeEntity(_0x480143){return function(_0x53f49f){if(_0x53f49f){return _0x53f49f[_0x3f16('0x29')]()['then'](function(){_0x480143[_0x3f16('0x20')](0xcc)[_0x3f16('0x1f')]();});}};}function handleEntityNotFound(_0x1050f9){return function(_0x2440d1){if(!_0x2440d1){_0x1050f9[_0x3f16('0x1e')](0x194);}return _0x2440d1;};}function handleError(_0x3bd86b,_0x1de7d3){_0x1de7d3=_0x1de7d3||0x1f4;return function(_0x11239a){logger['error'](_0x11239a[_0x3f16('0x2a')]);if(_0x11239a[_0x3f16('0x2b')]){delete _0x11239a[_0x3f16('0x2b')];}_0x3bd86b[_0x3f16('0x20')](_0x1de7d3)[_0x3f16('0x2c')](_0x11239a);};}function getMustacheRender(_0x24a4ba,_0x4d13ef){return Mustache[_0x3f16('0x2d')](_0x24a4ba,_[_0x3f16('0x2e')](_0x4d13ef['body'],{'contact':_0x4d13ef[_0x3f16('0x2f')],'message':_0x4d13ef['message'],'agent':_0x4d13ef[_0x3f16('0x30')],'interaction':_0x4d13ef[_0x3f16('0x31')],'account':_0x4d13ef['account']}))||'';}exports[_0x3f16('0x32')]=function(_0x110426,_0x3bf5ef){var _0x3fa6e6={};var _0x491885=_[_0x3f16('0x33')](db[_0x3f16('0x34')]['rawAttributes'],function(_0x383493){return{'name':_0x383493[_0x3f16('0x35')],'type':_0x383493[_0x3f16('0x36')]['key']};});_0x3fa6e6=qs[_0x3f16('0x37')](_0x491885,_0x110426);return interaction[_0x3f16('0x38')](_0x3f16('0x39'),_0x110426[_0x3f16('0x3a')],_0x110426['user'],_0x3fa6e6,_0x491885)[_0x3f16('0x3b')](respondWithFilteredResult(_0x3bf5ef,_0x3fa6e6))[_0x3f16('0x1d')](handleError(_0x3bf5ef,null));};exports['show']=function(_0xd98e09,_0x510376){var _0x33052d={'raw':![],'where':{'id':_0xd98e09[_0x3f16('0x3c')]['id']}},_0x2bf687={};_0x2bf687[_0x3f16('0x3d')]=_['keys'](db[_0x3f16('0x34')][_0x3f16('0x3e')]);_0x2bf687[_0x3f16('0x3a')]=_[_0x3f16('0x3f')](_0xd98e09[_0x3f16('0x3a')]);_0x2bf687['filters']=_[_0x3f16('0x40')](_0x2bf687['model'],_0x2bf687['query']);_0x33052d[_0x3f16('0x41')]=_['intersection'](_0x2bf687['model'],qs['fields'](_0xd98e09[_0x3f16('0x3a')][_0x3f16('0x42')]));_0x33052d['attributes']=_0x33052d[_0x3f16('0x41')][_0x3f16('0x43')]?_0x33052d[_0x3f16('0x41')]:_0x2bf687[_0x3f16('0x3d')];if(_0xd98e09['query'][_0x3f16('0x44')]){_0x33052d['include']=[{'all':!![]}];}_0x33052d=_[_0x3f16('0x2e')]({},_0x33052d,_0xd98e09[_0x3f16('0x45')]);return db['ChatInteraction'][_0x3f16('0x46')](_0x33052d)[_0x3f16('0x3b')](handleEntityNotFound(_0x510376,null))[_0x3f16('0x3b')](respondWithResult(_0x510376,null))['catch'](handleError(_0x510376,null));};exports['create']=function(_0x320468,_0x3b0397){return db['ChatInteraction'][_0x3f16('0x47')](_0x320468[_0x3f16('0x48')],{})[_0x3f16('0x3b')](respondWithResult(_0x3b0397,0xc9))[_0x3f16('0x1d')](handleError(_0x3b0397,null));};exports[_0x3f16('0x28')]=function(_0x1efd30,_0x34ab9f){if(_0x1efd30[_0x3f16('0x48')]['id']){delete _0x1efd30[_0x3f16('0x48')]['id'];}return db[_0x3f16('0x34')][_0x3f16('0x46')]({'where':{'id':_0x1efd30['params']['id']}})[_0x3f16('0x3b')](handleEntityNotFound(_0x34ab9f,null))[_0x3f16('0x3b')](saveUpdates(_0x1efd30['body'],null))[_0x3f16('0x3b')](respondWithResult(_0x34ab9f,null))[_0x3f16('0x1d')](handleError(_0x34ab9f,null));};exports[_0x3f16('0x29')]=function(_0xa27c5b,_0x127bb7){return db[_0x3f16('0x34')][_0x3f16('0x46')]({'where':{'id':_0xa27c5b[_0x3f16('0x3c')]['id']}})[_0x3f16('0x3b')](handleEntityNotFound(_0x127bb7,null))[_0x3f16('0x3b')](removeEntity(_0x127bb7,null))[_0x3f16('0x1d')](handleError(_0x127bb7,null));};exports[_0x3f16('0x49')]=function(_0xdd2169,_0x496bdd){return db[_0x3f16('0x34')][_0x3f16('0x49')]()[_0x3f16('0x3b')](respondWithResult(_0x496bdd,null))[_0x3f16('0x1d')](handleError(_0x496bdd,null));};exports[_0x3f16('0x4a')]=function(_0x3b3dc7,_0x2fd38d){var _0x16793c=_0x3b3dc7[_0x3f16('0x3c')]['id'];var _0xeb1272;var _0x28596a;var _0x3db6b4;return db[_0x3f16('0x34')]['findOne']({'where':{'id':_0x16793c}})[_0x3f16('0x3b')](function(_0x95ff0e){_0xeb1272=_0x95ff0e;return db[_0x3f16('0x4b')]['findOne']({'where':{'id':_0x95ff0e[_0x3f16('0x4c')]},'attributes':['id',_0x3f16('0x4d'),_0x3f16('0x4e'),'vidaooTopic','vidaooNote',_0x3f16('0x4f')],'raw':!![]});})[_0x3f16('0x3b')](function(_0x57314d){if(_0x57314d&&_0x57314d[_0x3f16('0x4d')]&&_0x57314d['vidaooEscalation']){_0x28596a=_0x57314d;var _0x644070={'interaction':{'id':_0x16793c},'agent':{'id':_0x3b3dc7[_0x3f16('0x50')]['id'],'name':_0x3b3dc7[_0x3f16('0x50')][_0x3f16('0x2b')],'fullname':_0x3b3dc7[_0x3f16('0x50')]['fullname'],'email':_0x3b3dc7[_0x3f16('0x50')][_0x3f16('0x51')]},'contact':_0x3b3dc7[_0x3f16('0x48')][_0x3f16('0x2f')],'account':_0x3b3dc7['body']['account']};var _0x4c6678={'rejectUnauthorized':![],'method':_0x3f16('0x52'),'url':_0x3f16('0x53'),'headers':{'X-APIKEY':_0x57314d[_0x3f16('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3b3dc7['user'][_0x3f16('0x51')]],'buttons':null,'topic':_0x28596a['vidaooTopic'],'note':_[_0x3f16('0x54')](_0x28596a[_0x3f16('0x55')])?null:getMustacheRender(_0x28596a[_0x3f16('0x55')],_0x644070),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x3f16('0x54')](_0x28596a[_0x3f16('0x4f')])){var _0x440ff4=getMustacheRender(_0x28596a[_0x3f16('0x4f')],_0x644070);var _0x40f8f0=JSON[_0x3f16('0x56')](_0x440ff4);_0x4c6678[_0x3f16('0x48')][_0x3f16('0x57')]=_0x40f8f0;}}catch(_0x5892fc){throw new db[(_0x3f16('0x58'))][(_0x3f16('0x59'))](_0x3f16('0x5a'));}return rp(_0x4c6678);}else{throw new db[(_0x3f16('0x58'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3f16('0x3b')](function(_0x132472){_0x3db6b4=_0x132472;if(_0x3db6b4['id']){var _0x111dde={'body':_0x3db6b4['join_url'],'ChatWebsiteId':_0x28596a['id'],'ChatInteractionId':_0xeb1272['id'],'direction':'out','UserId':_0x3b3dc7['user']['id']};return db['ChatMessage'][_0x3f16('0x47')](_0x111dde,{});}else{throw new db[(_0x3f16('0x58'))][(_0x3f16('0x59'))](_0x3f16('0x5b'));}})[_0x3f16('0x3b')](function(){return _0xeb1272[_0x3f16('0x5c')]({'vidaooSessionId':_0x3db6b4['id']});})[_0x3f16('0x3b')](respondWithResult(_0x2fd38d,null))[_0x3f16('0x1d')](handleError(_0x2fd38d,null));};exports[_0x3f16('0x5d')]=function(_0x1a79f7,_0x47885b){if(_0x1a79f7[_0x3f16('0x48')]['id']){delete _0x1a79f7['body']['id'];}return db[_0x3f16('0x34')][_0x3f16('0x46')]({'where':{'id':_0x1a79f7[_0x3f16('0x3c')]['id']},'include':[{'model':db[_0x3f16('0x5e')],'as':_0x3f16('0x5f')}]})['then'](handleEntityNotFound(_0x47885b,null))[_0x3f16('0x3b')](saveUpdates(_0x1a79f7['body'],null))['then'](respondWithResult(_0x47885b,null))['catch'](handleError(_0x47885b,null));};exports[_0x3f16('0x60')]=function(_0x1c07ba,_0xf3025b){if(_0x1c07ba[_0x3f16('0x48')]['id']){delete _0x1c07ba[_0x3f16('0x48')]['id'];}return db[_0x3f16('0x34')][_0x3f16('0x46')]({'where':{'id':_0x1c07ba[_0x3f16('0x3c')]['id']}})[_0x3f16('0x3b')](function(_0x18d74a){if(!_0x18d74a){logger['error'](_0x3f16('0x61'),_0x3f16('0x60'),0x194,'entity\x20not\x20found');_0xf3025b[_0x3f16('0x1e')](0x194);}else{if(_0x18d74a['UserId']){throw new db[(_0x3f16('0x58'))]['ValidationError'](_0x3f16('0x62'));}}return _0x18d74a;})[_0x3f16('0x3b')](function(_0x55cff2){if(_0x55cff2){return _0x55cff2[_0x3f16('0x28')]({'closed':_0x1c07ba['body'][_0x3f16('0x63')],'disposition':_0x1c07ba[_0x3f16('0x48')][_0x3f16('0x64')]})[_0x3f16('0x3b')](function(_0x87c5b){return _0x87c5b;});}})[_0x3f16('0x3b')](function(){return respondWithRpcPromise('AbandonInteraction',_0x3f16('0x60'),_0x1c07ba[_0x3f16('0x48')],client9004);})[_0x3f16('0x3b')](respondWithResult(_0xf3025b,null))['catch'](handleError(_0xf3025b,null));};exports[_0x3f16('0x65')]=function(_0x31691d,_0x3db514){_0x31691d['body']['name']=_0x31691d['file'][_0x3f16('0x66')];_0x31691d['body']['basename']=_0x31691d[_0x3f16('0x67')][_0x3f16('0x68')];_0x31691d[_0x3f16('0x48')]['type']=_0x31691d[_0x3f16('0x67')][_0x3f16('0x69')];return db['Attachment'][_0x3f16('0x47')](_0x31691d[_0x3f16('0x48')])[_0x3f16('0x3b')](respondWithResult(_0x3db514,0xc9))[_0x3f16('0x1d')](handleError(_0x3db514,null));};exports['attachmentDownload']=function(_0x537fee,_0x162dd4){return db['ChatInteraction'][_0x3f16('0x6a')]({'where':{'id':_0x537fee[_0x3f16('0x3c')]['id']},'raw':!![]})[_0x3f16('0x3b')](handleEntityNotFound(_0x162dd4,null))[_0x3f16('0x3b')](function(_0x467609){if(_0x467609){if(_0x467609['closed']){return _0x162dd4[_0x3f16('0x20')](0x193)[_0x3f16('0x21')]({'status':0x193,'message':_0x3f16('0x6b')});}return db[_0x3f16('0x6c')][_0x3f16('0x6a')]({'where':{'id':_0x537fee['query'][_0x3f16('0x6d')]},'raw':!![]})['then'](handleEntityNotFound(_0x162dd4,null));}})[_0x3f16('0x3b')](function(_0x55c39b){if(_0x55c39b){var _0x5191cb=_0x55c39b['ChatOfflineMessageId']!==null;var _0x5ac499=path[_0x3f16('0x6e')](config[_0x3f16('0x6f')],_0x3f16('0x70'));if(_0x5191cb){_0x5ac499=path[_0x3f16('0x6e')](_0x5ac499,_0x3f16('0x71'));}var _0xaec424=path[_0x3f16('0x6e')](_0x5ac499,_0x55c39b[_0x3f16('0x72')]);return _0x162dd4[_0x3f16('0x73')](_0xaec424);}})[_0x3f16('0x1d')](handleError(_0x162dd4,null));};exports[_0x3f16('0x74')]=function(_0x59221a,_0x135a31){var _0x545cc7=null;var _0x4b5ebb=null;var _0x70501=null;if(_0x59221a[_0x3f16('0x48')]['id']){delete _0x59221a[_0x3f16('0x48')]['id'];}if(_0x59221a[_0x3f16('0x48')][_0x3f16('0x75')]){_0x70501=path[_0x3f16('0x6e')](config[_0x3f16('0x6f')],_0x3f16('0x76'),util[_0x3f16('0x77')](_0x3f16('0x78'),Date[_0x3f16('0x79')]()));_0x59221a[_0x3f16('0x48')]['pathTranscript']=_0x70501;}return db[_0x3f16('0x34')]['find']({'where':{'id':_0x59221a[_0x3f16('0x3c')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x3f16('0x7a')],'as':_0x3f16('0x7a')}]}]})[_0x3f16('0x3b')](handleEntityNotFound(_0x135a31,null))['then'](saveUpdates(_0x59221a[_0x3f16('0x48')],null))[_0x3f16('0x3b')](function(_0x698381){if(_0x698381){_0x545cc7=_0x698381;return db[_0x3f16('0x4b')]['find']({'where':{'id':_0x545cc7['ChatWebsiteId']}});}})[_0x3f16('0x3b')](function(_0x43fdc2){if(_0x43fdc2){_0x4b5ebb=_0x43fdc2;return db[_0x3f16('0x5e')][_0x3f16('0x46')]({'where':{'id':_0x545cc7[_0x3f16('0x7b')]}});}})[_0x3f16('0x3b')](function(_0x98ad04){if(_0x98ad04){if(_0x70501){var _0x1f308b=null;for(var _0x281285=0x1;_0x281285<_0x545cc7[_0x3f16('0x7c')][_0x3f16('0x43')];++_0x281285){_0x1f308b=_0x545cc7['Messages'][_0x281285];var _0x3ba3e0=_0x1f308b[_0x3f16('0x7d')]?util['format']('%s%d',_0x4b5ebb[_0x3f16('0x7e')],_0x1f308b[_0x3f16('0x7d')]):'System';var _0x38292e=_0x59221a[_0x3f16('0x48')][_0x3f16('0x7f')]||util[_0x3f16('0x77')](_0x3f16('0x80'),_0x3f16('0x81'),_0x1f308b[_0x3f16('0x7b')]);switch(_0x4b5ebb[_0x3f16('0x82')]){case _0x3f16('0x83'):_0x3ba3e0=_0x1f308b[_0x3f16('0x7d')]?util[_0x3f16('0x77')](_0x3f16('0x80'),_0x4b5ebb[_0x3f16('0x7e')],_0x1f308b[_0x3f16('0x7d')]):_0x3f16('0x84');break;case _0x3f16('0x85'):_0x3ba3e0=_0x1f308b[_0x3f16('0x7d')]?_0x1f308b[_0x3f16('0x7a')][_0x3f16('0x86')]||_0x1f308b[_0x3f16('0x7a')]['fullname']:_0x3f16('0x84');break;case _0x3f16('0x87'):_0x3ba3e0=_0x1f308b[_0x3f16('0x7d')]?_0x1f308b['User'][_0x3f16('0x88')]:_0x3f16('0x84');break;default:_0x3ba3e0=_0x1f308b['UserId']?util[_0x3f16('0x77')](_0x3f16('0x80'),_0x4b5ebb['agentAlias'],_0x1f308b[_0x3f16('0x7d')]):'System';}var _0x2ef482=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x1f308b['createdAt'])['format'](_0x3f16('0x89')),_0x1f308b['direction']==='in'?_0x38292e:_0x3ba3e0,_0x1f308b[_0x3f16('0x48')]);if(!_0x1f308b[_0x3f16('0x8a')]){fs['appendFileSync'](_0x70501,_0x2ef482);}}return db['MailAccount'][_0x3f16('0x6a')]({'where':{'service':!![]},'include':[{'model':db[_0x3f16('0x8b')],'as':_0x3f16('0x8c'),'raw':!![],'include':[{'model':db[_0x3f16('0x8d')],'as':_0x3f16('0x8d'),'raw':!![]}]}]});}}})[_0x3f16('0x3b')](function(_0x3439e2){if(!_0x3439e2||!_0x3439e2['Smtp']||!_0x59221a['body'])return _0x545cc7;var _0x3c6a09=_0x3439e2[_0x3f16('0x8e')]();return respondWithRpcPromise('SendMail',_0x3f16('0x8f'),{'account':_0x3c6a09,'message':{'from':util[_0x3f16('0x77')](_0x3f16('0x90'),_0x3439e2[_0x3f16('0x2b')],_0x3439e2[_0x3f16('0x51')]||_0x3439e2[_0x3f16('0x8c')]['user']),'to':_0x59221a[_0x3f16('0x48')]['mailTranscript'],'subject':_0x3f16('0x91'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x59221a[_0x3f16('0x48')][_0x3f16('0x75')]),'attachments':[{'path':_0x70501}]}})[_0x3f16('0x3b')](function(){return _0x545cc7;})[_0x3f16('0x1d')](function(_0x588e5c){logger[_0x3f16('0x1a')](_0x588e5c);});})[_0x3f16('0x3b')](respondWithStatusCode(_0x135a31,0xc8))[_0x3f16('0x1d')](handleError(_0x135a31,null));};exports[_0x3f16('0x92')]=function(_0x24071b,_0x2ade5e){return db[_0x3f16('0x93')][_0x3f16('0x46')]({'where':{'id':_0x24071b[_0x3f16('0x3c')]['id']}})[_0x3f16('0x3b')](handleEntityNotFound(_0x2ade5e,null))[_0x3f16('0x3b')](function(_0x454930){if(_0x454930){return _0x454930[_0x3f16('0x92')](_0x24071b[_0x3f16('0x48')][_0x3f16('0x94')],_[_0x3f16('0x95')](_0x24071b[_0x3f16('0x48')],[_0x3f16('0x94'),'id'])||{});}})[_0x3f16('0x3b')](respondWithResult(_0x2ade5e,null))[_0x3f16('0x1d')](handleError(_0x2ade5e,null));};exports['getMessages']=function(_0x42d76e,_0xa99d2d){var _0x3a33d6={'raw':![],'where':{}};var _0x4c71d9={};var _0x34e37c={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3f16('0x6a')]({'where':{'id':_0x42d76e['params']['id']}})[_0x3f16('0x3b')](handleEntityNotFound(_0xa99d2d,null))[_0x3f16('0x3b')](function(_0x3e87fc){if(_0x3e87fc){_0x4c71d9[_0x3f16('0x3d')]=_[_0x3f16('0x3f')](db[_0x3f16('0x93')][_0x3f16('0x3e')]);_0x4c71d9[_0x3f16('0x3a')]=_[_0x3f16('0x3f')](_0x42d76e[_0x3f16('0x3a')]);_0x4c71d9[_0x3f16('0x96')]=_[_0x3f16('0x40')](_0x4c71d9[_0x3f16('0x3d')],_0x4c71d9[_0x3f16('0x3a')]);_0x3a33d6[_0x3f16('0x41')]=_['intersection'](_0x4c71d9[_0x3f16('0x3d')],qs[_0x3f16('0x42')](_0x42d76e[_0x3f16('0x3a')][_0x3f16('0x42')]));_0x3a33d6[_0x3f16('0x41')]=_0x3a33d6['attributes'][_0x3f16('0x43')]?_0x3a33d6[_0x3f16('0x41')]:_0x4c71d9[_0x3f16('0x3d')];if(!_0x42d76e[_0x3f16('0x3a')][_0x3f16('0x97')]('nolimit')){_0x3a33d6[_0x3f16('0x24')]=qs[_0x3f16('0x24')](_0x42d76e[_0x3f16('0x3a')]['limit']);_0x3a33d6['offset']=qs[_0x3f16('0x22')](_0x42d76e[_0x3f16('0x3a')][_0x3f16('0x22')]);}_0x3a33d6['order']=qs['sort'](_0x42d76e[_0x3f16('0x3a')][_0x3f16('0x98')]);_0x3a33d6['where']=qs[_0x3f16('0x96')](_['pick'](_0x42d76e[_0x3f16('0x3a')],_0x4c71d9['filters']));_0x3a33d6['where'][_0x3f16('0x99')]=_0x3e87fc['id'];if(_0x42d76e['query'][_0x3f16('0x9a')]){_0x3a33d6[_0x3f16('0x9b')]=_[_0x3f16('0x2e')](_0x3a33d6[_0x3f16('0x9b')],{'$or':_[_0x3f16('0x33')](_0x3a33d6[_0x3f16('0x41')],function(_0x5e1801){var _0x23033e={};_0x23033e[_0x5e1801]={'$like':'%'+_0x42d76e[_0x3f16('0x3a')][_0x3f16('0x9a')]+'%'};return _0x23033e;})});}if(_0x42d76e[_0x3f16('0x3a')][_0x3f16('0x9c')]){var _0x52d639=_0x42d76e[_0x3f16('0x3a')][_0x3f16('0x9c')]['split'](',');var _0xebdc77={};_0xebdc77[_0x52d639[0x0]]={'$gte':moment(_0x52d639[0x1])[_0x3f16('0x77')](_0x3f16('0x9d'))};_0x3a33d6['where']=_[_0x3f16('0x2e')](_0x3a33d6[_0x3f16('0x9b')],_0xebdc77);}_0x3a33d6=_[_0x3f16('0x2e')]({},_0x3a33d6,_0x42d76e[_0x3f16('0x45')]);return db[_0x3f16('0x93')]['count']({'where':_0x3a33d6[_0x3f16('0x9b')]})[_0x3f16('0x3b')](function(_0x54d5f1){_0x34e37c['count']=_0x54d5f1;if(_0x42d76e[_0x3f16('0x3a')][_0x3f16('0x44')]){_0x3a33d6[_0x3f16('0x9e')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x3a33d6);})[_0x3f16('0x3b')](function(_0x2eb5b1){_0x34e37c[_0x3f16('0x9f')]=_0x2eb5b1;return _0x34e37c;});}})['then'](respondWithFilteredResult(_0xa99d2d,_0x3a33d6))[_0x3f16('0x1d')](handleError(_0xa99d2d,null));};exports['getMyMessages']=function(_0x5e28c3,_0x420a5a){var _0x120148={'where':{}},_0x58a71c={},_0x524be1={'count':0x0,'rows':[]};return db[_0x3f16('0x34')][_0x3f16('0x6a')]({'where':{'id':_0x5e28c3[_0x3f16('0x3c')]['id']}})['then'](handleEntityNotFound(_0x420a5a,null))[_0x3f16('0x3b')](function(_0x513eea){if(_0x513eea){_0x58a71c[_0x3f16('0x3d')]=_['keys'](db['ChatMessage'][_0x3f16('0x3e')]);_0x58a71c[_0x3f16('0x3a')]=_[_0x3f16('0x3f')](_0x5e28c3['query']);_0x58a71c[_0x3f16('0x96')]=_['intersection'](_0x58a71c[_0x3f16('0x3d')],_0x58a71c['query']);_0x120148[_0x3f16('0x41')]=_[_0x3f16('0x40')](_0x58a71c[_0x3f16('0x3d')],qs[_0x3f16('0x42')](_0x5e28c3[_0x3f16('0x3a')][_0x3f16('0x42')]));_0x120148[_0x3f16('0x41')]=_0x120148[_0x3f16('0x41')][_0x3f16('0x43')]?_0x120148[_0x3f16('0x41')]:_0x58a71c[_0x3f16('0x3d')];if(!_0x5e28c3[_0x3f16('0x3a')]['hasOwnProperty'](_0x3f16('0xa0'))){_0x120148[_0x3f16('0x24')]=qs[_0x3f16('0x24')](_0x5e28c3['query']['limit']);_0x120148['offset']=qs[_0x3f16('0x22')](_0x5e28c3[_0x3f16('0x3a')][_0x3f16('0x22')]);}_0x120148['order']=qs[_0x3f16('0x98')](_0x5e28c3[_0x3f16('0x3a')][_0x3f16('0x98')]);_0x120148['where']=qs[_0x3f16('0x96')](_[_0x3f16('0xa1')](_0x5e28c3[_0x3f16('0x3a')],_0x58a71c['filters']));_0x120148['where'][_0x3f16('0x99')]=_0x513eea['id'];if(_0x5e28c3['query'][_0x3f16('0x9a')]){_0x120148[_0x3f16('0x9b')]=_[_0x3f16('0x2e')](_0x120148[_0x3f16('0x9b')],{'$or':_[_0x3f16('0x33')](_0x120148[_0x3f16('0x41')],function(_0x325d66){var _0x2a68d1={};_0x2a68d1[_0x325d66]={'$like':'%'+_0x5e28c3[_0x3f16('0x3a')][_0x3f16('0x9a')]+'%'};return _0x2a68d1;})});}_0x120148[_0x3f16('0x9b')][_0x3f16('0x8a')]=![];if(_0x5e28c3[_0x3f16('0x3a')]['id']){_0x120148[_0x3f16('0x9b')]['id']={'$gt':_0x5e28c3['query']['id']};}_0x120148=_['merge']({},_0x120148,_0x5e28c3[_0x3f16('0x45')]);return db[_0x3f16('0x93')][_0x3f16('0x25')]({'where':_0x120148[_0x3f16('0x9b')]})[_0x3f16('0x3b')](function(_0x2af2b4){_0x524be1[_0x3f16('0x25')]=_0x2af2b4;_0x120148[_0x3f16('0x9e')]=[];if(_0x5e28c3['query'][_0x3f16('0xa2')]){_0x120148[_0x3f16('0x9e')][_0x3f16('0xa3')]({'model':db[_0x3f16('0x7a')],'as':'User','attributes':['id','fullname',_0x3f16('0x86')]});}if(_0x5e28c3['query'][_0x3f16('0x44')]){_0x120148['include']=[{'all':!![]}];}return db['ChatMessage'][_0x3f16('0x38')](_0x120148);})[_0x3f16('0x3b')](function(_0x5ada33){_0x524be1['rows']=_0x5ada33;return _0x524be1;});}})[_0x3f16('0x3b')](respondWithFilteredResult(_0x420a5a,_0x120148))[_0x3f16('0x1d')](handleError(_0x420a5a,null));};exports[_0x3f16('0xa4')]=function(_0x2d1313,_0x5036eb){return db[_0x3f16('0x34')]['find']({'where':{'id':_0x2d1313[_0x3f16('0x3c')]['id']}})[_0x3f16('0x3b')](handleEntityNotFound(_0x5036eb,null))[_0x3f16('0x3b')](function(_0x333055){if(_0x333055){return _0x333055[_0x3f16('0xa5')](_0x2d1313['body']['ids'],_['omit'](_0x2d1313[_0x3f16('0x48')],['ids','id'])||{})['spread'](function(){return db[_0x3f16('0xa6')][_0x3f16('0x38')]({'attributes':['id',_0x3f16('0x2b'),'color'],'where':{'id':_0x2d1313['body'][_0x3f16('0x94')]}});})[_0x3f16('0x3b')](function(_0x32abd3){socket[_0x3f16('0xa7')](_0x3f16('0xa8'),{'id':Number(_0x2d1313['params']['id']),'tags':_0x32abd3||[]});return{'id':Number(_0x2d1313[_0x3f16('0x3c')]['id']),'tags':_0x32abd3||[]};});}})[_0x3f16('0x3b')](respondWithResult(_0x5036eb,null))[_0x3f16('0x1d')](handleError(_0x5036eb,null));};exports[_0x3f16('0xa9')]=function(_0x4bf03a,_0x14b10a){return db[_0x3f16('0x34')][_0x3f16('0x46')]({'where':{'id':_0x4bf03a[_0x3f16('0x3c')]['id']}})[_0x3f16('0x3b')](handleEntityNotFound(_0x14b10a,null))[_0x3f16('0x3b')](function(_0x4f7df3){if(_0x4f7df3){return _0x4f7df3['removeTags'](_0x4bf03a['query'][_0x3f16('0x94')]);}})['then'](respondWithStatusCode(_0x14b10a,null))[_0x3f16('0x1d')](handleError(_0x14b10a,null));};exports['download']=function(_0x490b16,_0x556ff6){var _0x124d7a=moment()[_0x3f16('0xaa')]()[_0x3f16('0xab')]();var _0x47e930=path[_0x3f16('0x6e')](config['root'],_0x3f16('0xac'),_0x3f16('0xad'),_0x3f16('0xae'));var _0x2d6d6c=path[_0x3f16('0x6e')](config[_0x3f16('0x6f')],_0x3f16('0xac'),_0x3f16('0xad'),'attachments');var _0x3f6a12=path[_0x3f16('0x6e')](_0x47e930,_0x124d7a);var _0x25aa11=util[_0x3f16('0x77')]('transcript-%d-%s.zip',_0x490b16[_0x3f16('0x3c')]['id'],_0x124d7a);var _0x3ddb46=path[_0x3f16('0x6e')](_0x47e930,_0x25aa11);var _0x3861a5=[];_0x3861a5[_0x3f16('0xa3')]({'model':db['User'],'as':_0x3f16('0x7a'),'attributes':['id','fullname'],'raw':!![]});_0x3861a5[_0x3f16('0xa3')]({'model':db[_0x3f16('0x5e')],'as':_0x3f16('0x5f'),'attributes':['id',_0x3f16('0xaf'),'lastName'],'raw':!![]});if(_0x490b16['query'][_0x3f16('0xb0')]){_0x3861a5[_0x3f16('0xa3')]({'model':db[_0x3f16('0x6c')],'as':_0x3f16('0x6c'),'raw':!![]});}var _0x3d2597=[{'model':db[_0x3f16('0x93')],'as':'Messages','attributes':['id','body',_0x3f16('0xb1'),_0x3f16('0xb2'),_0x3f16('0x8a'),'read'],'include':_0x3861a5}];_0x3d2597[_0x3f16('0xa3')]({'model':db[_0x3f16('0x4b')],'as':'Account','attributes':['id',_0x3f16('0x2b')]});_0x3d2597[_0x3f16('0xa3')]({'model':db[_0x3f16('0x7a')],'as':_0x3f16('0xb3'),'attributes':['id',_0x3f16('0x88')]});return db[_0x3f16('0x34')][_0x3f16('0x46')]({'where':{'id':_0x490b16[_0x3f16('0x3c')]['id']},'include':_0x3d2597})[_0x3f16('0x3b')](handleEntityNotFound(_0x556ff6,null))['then'](function(_0x3e93bb){if(_0x3e93bb){var _0x3862d3=_0x3e93bb[_0x3f16('0xb4')]({'plain':!![]});fs[_0x3f16('0xb5')](_0x3f6a12);var _0x59e64b={'channel':_0x3f16('0xb6'),'account':_0x3862d3['Account']['name'],'agent':_0x3862d3[_0x3f16('0xb3')]?_0x3862d3[_0x3f16('0xb3')][_0x3f16('0x88')]:_0x3f16('0xb7'),'createdAt':moment(_0x3862d3[_0x3f16('0xb1')])[_0x3f16('0x77')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x3862d3[_0x3f16('0x63')]?moment(_0x3862d3['closedAt'])[_0x3f16('0x77')](_0x3f16('0x9d'))[_0x3f16('0xab')]():'','disposition':_0x3862d3['disposition'],'chatInfo':{'browser':_0x3862d3[_0x3f16('0xb8')],'os':_0x3862d3['osName'],'referer':_0x3862d3[_0x3f16('0xb9')],'customerIp':_0x3862d3[_0x3f16('0xba')],'customerPort':_0x3862d3[_0x3f16('0xbb')]?_0x3862d3[_0x3f16('0xbb')]:_0x3f16('0xb7')},'messages':_(_0x3862d3[_0x3f16('0x7c')])['tail']()[_0x3f16('0x9a')]({'secret':![]})[_0x3f16('0x33')](function(_0x325dce){if(_0x325dce[_0x3f16('0x6c')]){var _0x39906c=path['join'](_0x2d6d6c,_0x325dce[_0x3f16('0x6c')][_0x3f16('0x72')]);if(fs['existsSync'](_0x39906c)){fs[_0x3f16('0xbc')](_0x39906c)['pipe'](fs['createWriteStream'](path[_0x3f16('0x6e')](_0x3f6a12,_0x325dce['Attachment'][_0x3f16('0x72')])));}}return{'date':moment(_0x325dce['createdAt'])[_0x3f16('0x77')](_0x3f16('0x9d'))[_0x3f16('0xab')](),'sender':_0x325dce[_0x3f16('0xb2')]===_0x3f16('0xbd')?_0x325dce[_0x3f16('0x7a')]?_0x325dce[_0x3f16('0x7a')][_0x3f16('0x88')]:_0x3f16('0x84'):_0x325dce[_0x3f16('0x5f')]['firstName']+(_0x325dce[_0x3f16('0x5f')]['lastName']?'\x20'+_0x325dce[_0x3f16('0x5f')][_0x3f16('0xbe')]:''),'body':_0x325dce[_0x3f16('0x6c')]?_0x325dce[_0x3f16('0x6c')][_0x3f16('0x72')]:_0x325dce[_0x3f16('0x48')],'direction':_0x325dce[_0x3f16('0xb2')]===_0x3f16('0xbd')?'A':'C','secret':_0x325dce[_0x3f16('0x8a')],'read':_0x325dce[_0x3f16('0xbf')],'attachment':_0x325dce[_0x3f16('0x6c')]};})['value']()};return ejs[_0x3f16('0xc0')](path[_0x3f16('0x6e')](config[_0x3f16('0x6f')],_0x3f16('0xac'),_0x3f16('0xc1'),_0x3f16('0xc2')),{'interaction':_0x59e64b})[_0x3f16('0x3b')](function(_0x1e2765){var _0x43e508=path['join'](_0x3f6a12,'transcript-'+_0x3862d3['id']+'-'+_0x124d7a+'.pdf');var _0xa17db3={'path':_0x43e508,'channel':'Chat','interactionId':_0x3862d3['id']};return pdf[_0x3f16('0xc3')](_0x1e2765,_0xa17db3);})[_0x3f16('0x3b')](function(){return new Promise(function(_0x55f6a7,_0x468917){zipdir(_0x3f6a12,{'saveTo':_0x3ddb46},function(_0x3365bb,_0x57878e){if(_0x3365bb)return _0x468917(_0x3365bb);return _0x55f6a7(_0x57878e);});})[_0x3f16('0x3b')](function(){return new BPromise(function(_0x4f8376,_0x51dc9c){rimraf(_0x3f6a12,function(_0x3ac378){if(_0x3ac378)_0x51dc9c(_0x3ac378);return _0x4f8376();});});})[_0x3f16('0x3b')](function(){return _0x556ff6[_0x3f16('0x73')](_0x3ddb46,_0x25aa11,function(_0xa0a84a){if(_0xa0a84a){logger['error'](_0x3f16('0xc4'),_0xa0a84a);}else{fs[_0x3f16('0xc5')](_0x3ddb46);}});});});}else{return _0x556ff6[_0x3f16('0x1e')](0xc8);}})[_0x3f16('0x1d')](handleError(_0x556ff6,null));};
\ No newline at end of file
+var _0x2754=['attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','root','join','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','options','includeAgent','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','Contact','value','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','ejs','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','end','stack','name','send','render','body','contact','agent','account','map','ChatInteraction','fieldName','type','key','getOptions','chat','query','user','catch','show','params','model','keys','rawAttributes','intersection','attributes','length','includeAll','include','find','create','destroy','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment'];(function(_0x71035a,_0x2086dc){var _0x45334c=function(_0x488d4d){while(--_0x488d4d){_0x71035a['push'](_0x71035a['shift']());}};_0x45334c(++_0x2086dc);}(_0x2754,0x67));var _0x4275=function(_0x207f67,_0x172ffa){_0x207f67=_0x207f67-0x0;var _0x4d6724=_0x2754[_0x207f67];return _0x4d6724;};'use strict';var rimraf=require(_0x4275('0x0'));var zipdir=require(_0x4275('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4275('0x2'));var Mustache=require(_0x4275('0x3'));var util=require(_0x4275('0x4'));var path=require('path');var ejs=require(_0x4275('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x4275('0x6'));var interaction=require(_0x4275('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4275('0x8'));var logger=require(_0x4275('0x9'))('api');var config=require(_0x4275('0xa'));var db=require(_0x4275('0xb'))['db'];config[_0x4275('0xc')]=_['defaults'](config[_0x4275('0xc')],{'host':_0x4275('0xd'),'port':0x18eb});var socket=require(_0x4275('0xe'))(new Redis(config[_0x4275('0xc')]));require(_0x4275('0xf'))[_0x4275('0x10')](socket);var jayson=require(_0x4275('0x11'));var client=jayson['client'][_0x4275('0x12')]({'port':0x232b});var client9004=jayson[_0x4275('0x13')][_0x4275('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x217002,_0x406cb4,_0x3f0135,_0x1f31f9){return new BPromise(function(_0x58e206,_0x91712c){var _0x6a30de=_0x1f31f9||client;return _0x6a30de[_0x4275('0x14')](_0x217002,_0x3f0135)[_0x4275('0x15')](function(_0x2c4b99){logger[_0x4275('0x16')](_0x4275('0x17'),_0x406cb4,_0x4275('0x18'));logger[_0x4275('0x19')](_0x4275('0x1a'),_0x406cb4,'request\x20sent',JSON['stringify'](_0x2c4b99));if(_0x2c4b99['error']){if(_0x2c4b99[_0x4275('0x1b')][_0x4275('0x1c')]===0x1f4){logger[_0x4275('0x1b')](_0x4275('0x17'),_0x406cb4,_0x2c4b99['error'][_0x4275('0x1d')]);return _0x91712c(_0x2c4b99[_0x4275('0x1b')][_0x4275('0x1d')]);}logger[_0x4275('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x406cb4,_0x2c4b99[_0x4275('0x1b')][_0x4275('0x1d')]);return _0x58e206(_0x2c4b99['error'][_0x4275('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x406cb4,_0x4275('0x18'));_0x58e206(_0x2c4b99[_0x4275('0x1e')][_0x4275('0x1d')]);}})['catch'](function(_0xe5384d){logger[_0x4275('0x1b')](_0x4275('0x17'),_0x406cb4,_0xe5384d);_0x91712c(_0xe5384d);});});}function respondWithStatusCode(_0x284f04,_0x233a7a){_0x233a7a=_0x233a7a||0xcc;return function(_0x225015){if(_0x225015){return _0x284f04[_0x4275('0x1f')](_0x233a7a);}return _0x284f04[_0x4275('0x20')](_0x233a7a)['end']();};}function respondWithResult(_0x66a044,_0x1e477d){_0x1e477d=_0x1e477d||0xc8;return function(_0x3c491e){if(_0x3c491e){return _0x66a044['status'](_0x1e477d)[_0x4275('0x21')](_0x3c491e);}};}function respondWithFilteredResult(_0x12aae4,_0x190248){return function(_0x3a3646){if(_0x3a3646){var _0x47cb86=typeof _0x190248[_0x4275('0x22')]==='undefined'&&typeof _0x190248[_0x4275('0x23')]===_0x4275('0x24');var _0x47dd0b=_0x3a3646['count'];var _0x2bb24e=_0x47cb86?0x0:_0x190248[_0x4275('0x22')];var _0x4aa1e7=_0x47cb86?_0x3a3646[_0x4275('0x25')]:_0x190248[_0x4275('0x22')]+_0x190248[_0x4275('0x23')];var _0x4afbc2;if(_0x4aa1e7>=_0x47dd0b){_0x4aa1e7=_0x47dd0b;_0x4afbc2=0xc8;}else{_0x4afbc2=0xce;}_0x12aae4[_0x4275('0x20')](_0x4afbc2);return _0x12aae4[_0x4275('0x26')](_0x4275('0x27'),_0x2bb24e+'-'+_0x4aa1e7+'/'+_0x47dd0b)[_0x4275('0x21')](_0x3a3646);}return null;};}function saveUpdates(_0x2a2df3){return function(_0x3164c5){if(_0x3164c5){return _0x3164c5[_0x4275('0x28')](_0x2a2df3)[_0x4275('0x15')](function(_0x3c8821){return _0x3c8821;});}return null;};}function removeEntity(_0x1a738a){return function(_0x1c9e69){if(_0x1c9e69){return _0x1c9e69['destroy']()['then'](function(){_0x1a738a[_0x4275('0x20')](0xcc)[_0x4275('0x29')]();});}};}function handleEntityNotFound(_0x188ae0){return function(_0xa38061){if(!_0xa38061){_0x188ae0['sendStatus'](0x194);}return _0xa38061;};}function handleError(_0x443d95,_0x1a8ce0){_0x1a8ce0=_0x1a8ce0||0x1f4;return function(_0x575f10){logger[_0x4275('0x1b')](_0x575f10[_0x4275('0x2a')]);if(_0x575f10[_0x4275('0x2b')]){delete _0x575f10['name'];}_0x443d95[_0x4275('0x20')](_0x1a8ce0)[_0x4275('0x2c')](_0x575f10);};}function getMustacheRender(_0xbd10b8,_0xb5ca1e){return Mustache[_0x4275('0x2d')](_0xbd10b8,_['merge'](_0xb5ca1e[_0x4275('0x2e')],{'contact':_0xb5ca1e[_0x4275('0x2f')],'message':_0xb5ca1e[_0x4275('0x1d')],'agent':_0xb5ca1e[_0x4275('0x30')],'interaction':_0xb5ca1e['interaction'],'account':_0xb5ca1e[_0x4275('0x31')]}))||'';}exports['index']=function(_0x5bbb65,_0x69da99){var _0x5e2478={};var _0x178522=_[_0x4275('0x32')](db[_0x4275('0x33')]['rawAttributes'],function(_0xb253d){return{'name':_0xb253d[_0x4275('0x34')],'type':_0xb253d[_0x4275('0x35')][_0x4275('0x36')]};});_0x5e2478=qs[_0x4275('0x37')](_0x178522,_0x5bbb65);return interaction['findAll'](_0x4275('0x38'),_0x5bbb65[_0x4275('0x39')],_0x5bbb65[_0x4275('0x3a')],_0x5e2478,_0x178522)['then'](respondWithFilteredResult(_0x69da99,_0x5e2478))[_0x4275('0x3b')](handleError(_0x69da99,null));};exports[_0x4275('0x3c')]=function(_0x39f579,_0x44e326){var _0x1c7c7d={'raw':![],'where':{'id':_0x39f579[_0x4275('0x3d')]['id']}},_0x14c515={};_0x14c515[_0x4275('0x3e')]=_[_0x4275('0x3f')](db[_0x4275('0x33')][_0x4275('0x40')]);_0x14c515['query']=_[_0x4275('0x3f')](_0x39f579[_0x4275('0x39')]);_0x14c515['filters']=_[_0x4275('0x41')](_0x14c515['model'],_0x14c515[_0x4275('0x39')]);_0x1c7c7d[_0x4275('0x42')]=_[_0x4275('0x41')](_0x14c515[_0x4275('0x3e')],qs['fields'](_0x39f579[_0x4275('0x39')]['fields']));_0x1c7c7d['attributes']=_0x1c7c7d[_0x4275('0x42')][_0x4275('0x43')]?_0x1c7c7d[_0x4275('0x42')]:_0x14c515['model'];if(_0x39f579[_0x4275('0x39')][_0x4275('0x44')]){_0x1c7c7d[_0x4275('0x45')]=[{'all':!![]}];}_0x1c7c7d=_['merge']({},_0x1c7c7d,_0x39f579['options']);return db[_0x4275('0x33')][_0x4275('0x46')](_0x1c7c7d)[_0x4275('0x15')](handleEntityNotFound(_0x44e326,null))['then'](respondWithResult(_0x44e326,null))['catch'](handleError(_0x44e326,null));};exports[_0x4275('0x47')]=function(_0x4bb9ab,_0x3458e6){return db[_0x4275('0x33')]['create'](_0x4bb9ab[_0x4275('0x2e')],{})[_0x4275('0x15')](respondWithResult(_0x3458e6,0xc9))[_0x4275('0x3b')](handleError(_0x3458e6,null));};exports[_0x4275('0x28')]=function(_0x27f0a8,_0x590768){if(_0x27f0a8['body']['id']){delete _0x27f0a8[_0x4275('0x2e')]['id'];}return db[_0x4275('0x33')][_0x4275('0x46')]({'where':{'id':_0x27f0a8[_0x4275('0x3d')]['id']}})[_0x4275('0x15')](handleEntityNotFound(_0x590768,null))[_0x4275('0x15')](saveUpdates(_0x27f0a8[_0x4275('0x2e')],null))['then'](respondWithResult(_0x590768,null))[_0x4275('0x3b')](handleError(_0x590768,null));};exports[_0x4275('0x48')]=function(_0x3fa49e,_0x2b156c){return db[_0x4275('0x33')][_0x4275('0x46')]({'where':{'id':_0x3fa49e[_0x4275('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2b156c,null))[_0x4275('0x15')](removeEntity(_0x2b156c,null))['catch'](handleError(_0x2b156c,null));};exports[_0x4275('0x49')]=function(_0x506a88,_0x49fe1d){return db[_0x4275('0x33')]['describe']()[_0x4275('0x15')](respondWithResult(_0x49fe1d,null))['catch'](handleError(_0x49fe1d,null));};exports['createVidaooSession']=function(_0x3c6d80,_0x521b39){var _0xf4a6dc=_0x3c6d80[_0x4275('0x3d')]['id'];var _0x2fd177;var _0x1641a2;var _0x2e4aaa;return db[_0x4275('0x33')][_0x4275('0x4a')]({'where':{'id':_0xf4a6dc}})[_0x4275('0x15')](function(_0x1ed927){_0x2fd177=_0x1ed927;return db[_0x4275('0x4b')]['findOne']({'where':{'id':_0x1ed927[_0x4275('0x4c')]},'attributes':['id',_0x4275('0x4d'),'vidaooEscalation',_0x4275('0x4e'),_0x4275('0x4f'),_0x4275('0x50')],'raw':!![]});})[_0x4275('0x15')](function(_0x4a5790){if(_0x4a5790&&_0x4a5790[_0x4275('0x4d')]&&_0x4a5790['vidaooEscalation']){_0x1641a2=_0x4a5790;var _0x3900f3={'interaction':{'id':_0xf4a6dc},'agent':{'id':_0x3c6d80['user']['id'],'name':_0x3c6d80[_0x4275('0x3a')][_0x4275('0x2b')],'fullname':_0x3c6d80['user'][_0x4275('0x51')],'email':_0x3c6d80[_0x4275('0x3a')][_0x4275('0x52')]},'contact':_0x3c6d80['body'][_0x4275('0x2f')],'account':_0x3c6d80['body'][_0x4275('0x31')]};var _0x2ea286={'rejectUnauthorized':![],'method':_0x4275('0x53'),'url':_0x4275('0x54'),'headers':{'X-APIKEY':_0x4a5790[_0x4275('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c6d80[_0x4275('0x3a')][_0x4275('0x52')]],'buttons':null,'topic':_0x1641a2[_0x4275('0x4e')],'note':_[_0x4275('0x55')](_0x1641a2[_0x4275('0x4f')])?null:getMustacheRender(_0x1641a2['vidaooNote'],_0x3900f3),'metadata':null},'redirect':_0x4275('0x56'),'json':!![]};try{if(!_[_0x4275('0x55')](_0x1641a2[_0x4275('0x50')])){var _0x1b4bc1=getMustacheRender(_0x1641a2['vidaooMetadata'],_0x3900f3);var _0x4c1f52=JSON[_0x4275('0x57')](_0x1b4bc1);_0x2ea286[_0x4275('0x2e')][_0x4275('0x58')]=_0x4c1f52;}}catch(_0x12554c){throw new db[(_0x4275('0x59'))]['ValidationError'](_0x4275('0x5a'));}return rp(_0x2ea286);}else{throw new db[(_0x4275('0x59'))][(_0x4275('0x5b'))](_0x4275('0x5c'));}})[_0x4275('0x15')](function(_0x345c7d){_0x2e4aaa=_0x345c7d;if(_0x2e4aaa['id']){var _0x5b7929={'body':_0x2e4aaa[_0x4275('0x5d')],'ChatWebsiteId':_0x1641a2['id'],'ChatInteractionId':_0x2fd177['id'],'direction':'out','UserId':_0x3c6d80['user']['id']};return db[_0x4275('0x5e')][_0x4275('0x47')](_0x5b7929,{});}else{throw new db['Sequelize'][(_0x4275('0x5b'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x2fd177[_0x4275('0x5f')]({'vidaooSessionId':_0x2e4aaa['id']});})[_0x4275('0x15')](respondWithResult(_0x521b39,null))[_0x4275('0x3b')](handleError(_0x521b39,null));};exports[_0x4275('0x60')]=function(_0xab5945,_0x1c1a5d){if(_0xab5945['body']['id']){delete _0xab5945['body']['id'];}return db[_0x4275('0x33')][_0x4275('0x46')]({'where':{'id':_0xab5945['params']['id']},'include':[{'model':db[_0x4275('0x61')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x1c1a5d,null))[_0x4275('0x15')](saveUpdates(_0xab5945[_0x4275('0x2e')],null))[_0x4275('0x15')](respondWithResult(_0x1c1a5d,null))[_0x4275('0x3b')](handleError(_0x1c1a5d,null));};exports[_0x4275('0x62')]=function(_0x41235a,_0x82cb9a){if(_0x41235a[_0x4275('0x2e')]['id']){delete _0x41235a[_0x4275('0x2e')]['id'];}return db[_0x4275('0x33')][_0x4275('0x46')]({'where':{'id':_0x41235a[_0x4275('0x3d')]['id']}})[_0x4275('0x15')](function(_0x4b1667){if(!_0x4b1667){logger['error'](_0x4275('0x63'),_0x4275('0x62'),0x194,_0x4275('0x64'));_0x82cb9a['sendStatus'](0x194);}else{if(_0x4b1667[_0x4275('0x65')]){throw new db[(_0x4275('0x59'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x4b1667;})['then'](function(_0x4b4dde){if(_0x4b4dde){return _0x4b4dde[_0x4275('0x28')]({'closed':_0x41235a['body']['closed'],'disposition':_0x41235a['body'][_0x4275('0x66')]})[_0x4275('0x15')](function(_0x2ee661){return _0x2ee661;});}})[_0x4275('0x15')](function(){return respondWithRpcPromise(_0x4275('0x67'),_0x4275('0x62'),_0x41235a[_0x4275('0x2e')],client9004);})[_0x4275('0x15')](respondWithResult(_0x82cb9a,null))[_0x4275('0x3b')](handleError(_0x82cb9a,null));};exports['attachmentUpload']=function(_0x3f7812,_0x5d0e96){_0x3f7812[_0x4275('0x2e')]['name']=_0x3f7812[_0x4275('0x68')][_0x4275('0x69')];_0x3f7812[_0x4275('0x2e')][_0x4275('0x6a')]=_0x3f7812[_0x4275('0x68')]['filename'];_0x3f7812[_0x4275('0x2e')]['type']=_0x3f7812['file'][_0x4275('0x6b')];return db[_0x4275('0x6c')]['create'](_0x3f7812[_0x4275('0x2e')])[_0x4275('0x15')](respondWithResult(_0x5d0e96,0xc9))[_0x4275('0x3b')](handleError(_0x5d0e96,null));};exports[_0x4275('0x6d')]=function(_0x116a4e,_0x26f907){return db[_0x4275('0x33')][_0x4275('0x4a')]({'where':{'id':_0x116a4e[_0x4275('0x3d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x26f907,null))[_0x4275('0x15')](function(_0x1260f8){if(_0x1260f8){if(_0x1260f8[_0x4275('0x6e')]){return _0x26f907['status'](0x193)[_0x4275('0x21')]({'status':0x193,'message':_0x4275('0x6f')});}return db[_0x4275('0x6c')][_0x4275('0x4a')]({'where':{'id':_0x116a4e[_0x4275('0x39')][_0x4275('0x70')]},'raw':!![]})[_0x4275('0x15')](handleEntityNotFound(_0x26f907,null));}})[_0x4275('0x15')](function(_0x913217){if(_0x913217){var _0x1ebb79=_0x913217[_0x4275('0x71')]!==null;var _0x8f681e=path['join'](config[_0x4275('0x72')],'server/files/attachments/');if(_0x1ebb79){_0x8f681e=path[_0x4275('0x73')](_0x8f681e,_0x4275('0x74'));}var _0x1295be=path[_0x4275('0x73')](_0x8f681e,_0x913217[_0x4275('0x6a')]);return _0x26f907[_0x4275('0x75')](_0x1295be);}})[_0x4275('0x3b')](handleError(_0x26f907,null));};exports[_0x4275('0x76')]=function(_0x3b37c2,_0x39a70f){var _0x22cd4c=null;var _0xfdffa9=null;var _0x243391=null;if(_0x3b37c2[_0x4275('0x2e')]['id']){delete _0x3b37c2[_0x4275('0x2e')]['id'];}if(_0x3b37c2[_0x4275('0x2e')]['mailTranscript']){_0x243391=path[_0x4275('0x73')](config[_0x4275('0x72')],_0x4275('0x77'),util[_0x4275('0x78')](_0x4275('0x79'),Date[_0x4275('0x7a')]()));_0x3b37c2[_0x4275('0x2e')][_0x4275('0x7b')]=_0x243391;}return db[_0x4275('0x33')][_0x4275('0x46')]({'where':{'id':_0x3b37c2[_0x4275('0x3d')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x4275('0x7c'),'include':[{'model':db[_0x4275('0x7d')],'as':'User'}]}]})[_0x4275('0x15')](handleEntityNotFound(_0x39a70f,null))['then'](saveUpdates(_0x3b37c2[_0x4275('0x2e')],null))[_0x4275('0x15')](function(_0x4b869c){if(_0x4b869c){_0x22cd4c=_0x4b869c;return db[_0x4275('0x4b')][_0x4275('0x46')]({'where':{'id':_0x22cd4c[_0x4275('0x4c')]}});}})[_0x4275('0x15')](function(_0x130884){if(_0x130884){_0xfdffa9=_0x130884;return db['CmContact'][_0x4275('0x46')]({'where':{'id':_0x22cd4c[_0x4275('0x7e')]}});}})[_0x4275('0x15')](function(_0x93ee2b){if(_0x93ee2b){if(_0x243391){var _0x250657=null;for(var _0xed18bd=0x1;_0xed18bd<_0x22cd4c[_0x4275('0x7c')][_0x4275('0x43')];++_0xed18bd){_0x250657=_0x22cd4c['Messages'][_0xed18bd];var _0x1b677c=_0x250657[_0x4275('0x65')]?util[_0x4275('0x78')](_0x4275('0x7f'),_0xfdffa9['agentAlias'],_0x250657[_0x4275('0x65')]):_0x4275('0x80');var _0x1f624b=_0x3b37c2[_0x4275('0x2e')][_0x4275('0x81')]||util[_0x4275('0x78')](_0x4275('0x7f'),_0x4275('0x82'),_0x250657['ContactId']);switch(_0xfdffa9[_0x4275('0x83')]){case _0x4275('0x84'):_0x1b677c=_0x250657[_0x4275('0x65')]?util[_0x4275('0x78')](_0x4275('0x7f'),_0xfdffa9[_0x4275('0x85')],_0x250657[_0x4275('0x65')]):'System';break;case _0x4275('0x86'):_0x1b677c=_0x250657[_0x4275('0x65')]?_0x250657[_0x4275('0x7d')][_0x4275('0x87')]||_0x250657['User'][_0x4275('0x51')]:_0x4275('0x80');break;case _0x4275('0x88'):_0x1b677c=_0x250657[_0x4275('0x65')]?_0x250657['User'][_0x4275('0x51')]:_0x4275('0x80');break;default:_0x1b677c=_0x250657[_0x4275('0x65')]?util[_0x4275('0x78')]('%s%d',_0xfdffa9['agentAlias'],_0x250657[_0x4275('0x65')]):_0x4275('0x80');}var _0x975da0=util[_0x4275('0x78')](_0x4275('0x89'),moment(_0x250657[_0x4275('0x8a')])[_0x4275('0x78')]('MM/DD/YYYY\x20HH:mm:ss'),_0x250657[_0x4275('0x8b')]==='in'?_0x1f624b:_0x1b677c,_0x250657[_0x4275('0x2e')]);if(!_0x250657[_0x4275('0x8c')]){fs[_0x4275('0x8d')](_0x243391,_0x975da0);}}return db['MailAccount'][_0x4275('0x4a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4275('0x8e'),'raw':!![],'include':[{'model':db[_0x4275('0x8f')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x4275('0x15')](function(_0x291a84){if(!_0x291a84||!_0x291a84[_0x4275('0x8e')]||!_0x3b37c2[_0x4275('0x2e')])return _0x22cd4c;var _0x2dc7d0=_0x291a84['getSmtpOptions']();return respondWithRpcPromise(_0x4275('0x90'),_0x4275('0x91'),{'account':_0x2dc7d0,'message':{'from':util[_0x4275('0x78')](_0x4275('0x92'),_0x291a84[_0x4275('0x2b')],_0x291a84[_0x4275('0x52')]||_0x291a84[_0x4275('0x8e')][_0x4275('0x3a')]),'to':_0x3b37c2[_0x4275('0x2e')][_0x4275('0x93')],'subject':'Mail\x20Transcript','text':util[_0x4275('0x78')](_0x4275('0x94'),_0x3b37c2[_0x4275('0x2e')][_0x4275('0x93')]),'attachments':[{'path':_0x243391}]}})[_0x4275('0x15')](function(){return _0x22cd4c;})[_0x4275('0x3b')](function(_0x3bbce4){logger[_0x4275('0x1b')](_0x3bbce4);});})['then'](respondWithStatusCode(_0x39a70f,0xc8))[_0x4275('0x3b')](handleError(_0x39a70f,null));};exports[_0x4275('0x95')]=function(_0x1aa61e,_0x41a89d){return db[_0x4275('0x5e')][_0x4275('0x46')]({'where':{'id':_0x1aa61e['params']['id']}})[_0x4275('0x15')](handleEntityNotFound(_0x41a89d,null))['then'](function(_0x2c4a20){if(_0x2c4a20){return _0x2c4a20['addMessage'](_0x1aa61e['body'][_0x4275('0x96')],_[_0x4275('0x97')](_0x1aa61e['body'],[_0x4275('0x96'),'id'])||{});}})[_0x4275('0x15')](respondWithResult(_0x41a89d,null))[_0x4275('0x3b')](handleError(_0x41a89d,null));};exports[_0x4275('0x98')]=function(_0x17b032,_0x22895a){var _0x158cd4={'raw':![],'where':{}};var _0x9ab3af={};var _0x3efcd6={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x17b032[_0x4275('0x3d')]['id']}})[_0x4275('0x15')](handleEntityNotFound(_0x22895a,null))[_0x4275('0x15')](function(_0x24ad51){if(_0x24ad51){_0x9ab3af[_0x4275('0x3e')]=_[_0x4275('0x3f')](db[_0x4275('0x5e')][_0x4275('0x40')]);_0x9ab3af['query']=_[_0x4275('0x3f')](_0x17b032[_0x4275('0x39')]);_0x9ab3af[_0x4275('0x99')]=_[_0x4275('0x41')](_0x9ab3af[_0x4275('0x3e')],_0x9ab3af[_0x4275('0x39')]);_0x158cd4[_0x4275('0x42')]=_['intersection'](_0x9ab3af[_0x4275('0x3e')],qs[_0x4275('0x9a')](_0x17b032[_0x4275('0x39')][_0x4275('0x9a')]));_0x158cd4[_0x4275('0x42')]=_0x158cd4['attributes'][_0x4275('0x43')]?_0x158cd4['attributes']:_0x9ab3af[_0x4275('0x3e')];if(!_0x17b032[_0x4275('0x39')][_0x4275('0x9b')](_0x4275('0x9c'))){_0x158cd4[_0x4275('0x23')]=qs[_0x4275('0x23')](_0x17b032['query'][_0x4275('0x23')]);_0x158cd4[_0x4275('0x22')]=qs[_0x4275('0x22')](_0x17b032['query'][_0x4275('0x22')]);}_0x158cd4[_0x4275('0x9d')]=qs[_0x4275('0x9e')](_0x17b032['query']['sort']);_0x158cd4[_0x4275('0x9f')]=qs[_0x4275('0x99')](_[_0x4275('0xa0')](_0x17b032[_0x4275('0x39')],_0x9ab3af[_0x4275('0x99')]));_0x158cd4[_0x4275('0x9f')]['ChatInteractionId']=_0x24ad51['id'];if(_0x17b032[_0x4275('0x39')][_0x4275('0xa1')]){_0x158cd4['where']=_[_0x4275('0xa2')](_0x158cd4[_0x4275('0x9f')],{'$or':_['map'](_0x158cd4[_0x4275('0x42')],function(_0x51664b){var _0x1cac42={};_0x1cac42[_0x51664b]={'$like':'%'+_0x17b032[_0x4275('0x39')][_0x4275('0xa1')]+'%'};return _0x1cac42;})});}if(_0x17b032[_0x4275('0x39')][_0x4275('0xa3')]){var _0x4793c3=_0x17b032[_0x4275('0x39')][_0x4275('0xa3')]['split'](',');var _0x16d63a={};_0x16d63a[_0x4793c3[0x0]]={'$gte':moment(_0x4793c3[0x1])[_0x4275('0x78')](_0x4275('0xa4'))};_0x158cd4[_0x4275('0x9f')]=_[_0x4275('0xa2')](_0x158cd4['where'],_0x16d63a);}_0x158cd4=_[_0x4275('0xa2')]({},_0x158cd4,_0x17b032['options']);return db[_0x4275('0x5e')][_0x4275('0x25')]({'where':_0x158cd4['where']})[_0x4275('0x15')](function(_0x128315){_0x3efcd6[_0x4275('0x25')]=_0x128315;if(_0x17b032['query'][_0x4275('0x44')]){_0x158cd4['include']=[{'all':!![]}];}return db[_0x4275('0x5e')][_0x4275('0xa5')](_0x158cd4);})[_0x4275('0x15')](function(_0x156638){_0x3efcd6[_0x4275('0xa6')]=_0x156638;return _0x3efcd6;});}})[_0x4275('0x15')](respondWithFilteredResult(_0x22895a,_0x158cd4))[_0x4275('0x3b')](handleError(_0x22895a,null));};exports[_0x4275('0xa7')]=function(_0x3506d6,_0x5a6b5a){var _0x13e326={'where':{}},_0x134252={},_0x20797b={'count':0x0,'rows':[]};return db[_0x4275('0x33')][_0x4275('0x4a')]({'where':{'id':_0x3506d6['params']['id']}})[_0x4275('0x15')](handleEntityNotFound(_0x5a6b5a,null))['then'](function(_0x5d4695){if(_0x5d4695){_0x134252[_0x4275('0x3e')]=_[_0x4275('0x3f')](db[_0x4275('0x5e')][_0x4275('0x40')]);_0x134252[_0x4275('0x39')]=_[_0x4275('0x3f')](_0x3506d6[_0x4275('0x39')]);_0x134252['filters']=_[_0x4275('0x41')](_0x134252[_0x4275('0x3e')],_0x134252[_0x4275('0x39')]);_0x13e326[_0x4275('0x42')]=_[_0x4275('0x41')](_0x134252[_0x4275('0x3e')],qs[_0x4275('0x9a')](_0x3506d6[_0x4275('0x39')][_0x4275('0x9a')]));_0x13e326[_0x4275('0x42')]=_0x13e326[_0x4275('0x42')][_0x4275('0x43')]?_0x13e326['attributes']:_0x134252[_0x4275('0x3e')];if(!_0x3506d6[_0x4275('0x39')][_0x4275('0x9b')](_0x4275('0x9c'))){_0x13e326['limit']=qs[_0x4275('0x23')](_0x3506d6['query'][_0x4275('0x23')]);_0x13e326[_0x4275('0x22')]=qs[_0x4275('0x22')](_0x3506d6[_0x4275('0x39')]['offset']);}_0x13e326[_0x4275('0x9d')]=qs[_0x4275('0x9e')](_0x3506d6['query'][_0x4275('0x9e')]);_0x13e326[_0x4275('0x9f')]=qs['filters'](_[_0x4275('0xa0')](_0x3506d6['query'],_0x134252[_0x4275('0x99')]));_0x13e326['where']['ChatInteractionId']=_0x5d4695['id'];if(_0x3506d6[_0x4275('0x39')][_0x4275('0xa1')]){_0x13e326[_0x4275('0x9f')]=_['merge'](_0x13e326['where'],{'$or':_[_0x4275('0x32')](_0x13e326[_0x4275('0x42')],function(_0x78eec7){var _0x6d56c4={};_0x6d56c4[_0x78eec7]={'$like':'%'+_0x3506d6[_0x4275('0x39')][_0x4275('0xa1')]+'%'};return _0x6d56c4;})});}_0x13e326['where'][_0x4275('0x8c')]=![];if(_0x3506d6['query']['id']){_0x13e326[_0x4275('0x9f')]['id']={'$gt':_0x3506d6['query']['id']};}_0x13e326=_[_0x4275('0xa2')]({},_0x13e326,_0x3506d6[_0x4275('0xa8')]);return db[_0x4275('0x5e')][_0x4275('0x25')]({'where':_0x13e326[_0x4275('0x9f')]})[_0x4275('0x15')](function(_0x19615e){_0x20797b['count']=_0x19615e;_0x13e326['include']=[];if(_0x3506d6[_0x4275('0x39')][_0x4275('0xa9')]){_0x13e326[_0x4275('0x45')]['push']({'model':db[_0x4275('0x7d')],'as':'User','attributes':['id',_0x4275('0x51'),_0x4275('0x87')]});}if(_0x3506d6[_0x4275('0x39')][_0x4275('0x44')]){_0x13e326[_0x4275('0x45')]=[{'all':!![]}];}return db[_0x4275('0x5e')]['findAll'](_0x13e326);})['then'](function(_0x34fc3e){_0x20797b[_0x4275('0xa6')]=_0x34fc3e;return _0x20797b;});}})[_0x4275('0x15')](respondWithFilteredResult(_0x5a6b5a,_0x13e326))[_0x4275('0x3b')](handleError(_0x5a6b5a,null));};exports[_0x4275('0xaa')]=function(_0x5717c7,_0x12a1ad){return db[_0x4275('0x33')][_0x4275('0x46')]({'where':{'id':_0x5717c7[_0x4275('0x3d')]['id']}})[_0x4275('0x15')](handleEntityNotFound(_0x12a1ad,null))['then'](function(_0x8a9797){if(_0x8a9797){return _0x8a9797[_0x4275('0xab')](_0x5717c7[_0x4275('0x2e')][_0x4275('0x96')],_[_0x4275('0x97')](_0x5717c7['body'],[_0x4275('0x96'),'id'])||{})[_0x4275('0xac')](function(){return db[_0x4275('0xad')][_0x4275('0xa5')]({'attributes':['id','name',_0x4275('0xae')],'where':{'id':_0x5717c7[_0x4275('0x2e')][_0x4275('0x96')]}});})[_0x4275('0x15')](function(_0x24bfbc){socket[_0x4275('0xaf')](_0x4275('0xb0'),{'id':Number(_0x5717c7[_0x4275('0x3d')]['id']),'tags':_0x24bfbc||[]});return{'id':Number(_0x5717c7[_0x4275('0x3d')]['id']),'tags':_0x24bfbc||[]};});}})['then'](respondWithResult(_0x12a1ad,null))[_0x4275('0x3b')](handleError(_0x12a1ad,null));};exports[_0x4275('0xb1')]=function(_0x3f4c48,_0x5a8272){return db['ChatInteraction'][_0x4275('0x46')]({'where':{'id':_0x3f4c48[_0x4275('0x3d')]['id']}})[_0x4275('0x15')](handleEntityNotFound(_0x5a8272,null))[_0x4275('0x15')](function(_0x356ef4){if(_0x356ef4){return _0x356ef4[_0x4275('0xb1')](_0x3f4c48[_0x4275('0x39')][_0x4275('0x96')]);}})[_0x4275('0x15')](respondWithStatusCode(_0x5a8272,null))[_0x4275('0x3b')](handleError(_0x5a8272,null));};exports['download']=function(_0x2bbfa2,_0x19f3ed){var _0x3f5d86=moment()[_0x4275('0xb2')]()[_0x4275('0xb3')]();var _0x3e9e72=path[_0x4275('0x73')](config[_0x4275('0x72')],_0x4275('0xb4'),_0x4275('0xb5'),'tmp');var _0x3db431=path[_0x4275('0x73')](config[_0x4275('0x72')],_0x4275('0xb4'),_0x4275('0xb5'),_0x4275('0xb6'));var _0x1fc2ed=path[_0x4275('0x73')](_0x3e9e72,_0x3f5d86);var _0x24b0f6=util[_0x4275('0x78')](_0x4275('0xb7'),_0x2bbfa2[_0x4275('0x3d')]['id'],_0x3f5d86);var _0xee6fca=path[_0x4275('0x73')](_0x3e9e72,_0x24b0f6);var _0x1265f4=[];_0x1265f4[_0x4275('0xb8')]({'model':db[_0x4275('0x7d')],'as':'User','attributes':['id',_0x4275('0x51')],'raw':!![]});_0x1265f4[_0x4275('0xb8')]({'model':db[_0x4275('0x61')],'as':'Contact','attributes':['id',_0x4275('0xb9'),_0x4275('0xba')],'raw':!![]});if(_0x2bbfa2[_0x4275('0x39')][_0x4275('0xb6')]){_0x1265f4[_0x4275('0xb8')]({'model':db[_0x4275('0x6c')],'as':_0x4275('0x6c'),'raw':!![]});}var _0x5935f9=[{'model':db[_0x4275('0x5e')],'as':_0x4275('0x7c'),'attributes':['id',_0x4275('0x2e'),_0x4275('0x8a'),_0x4275('0x8b'),_0x4275('0x8c'),_0x4275('0xbb')],'include':_0x1265f4}];_0x5935f9[_0x4275('0xb8')]({'model':db['ChatWebsite'],'as':_0x4275('0xbc'),'attributes':['id',_0x4275('0x2b')]});_0x5935f9[_0x4275('0xb8')]({'model':db[_0x4275('0x7d')],'as':_0x4275('0xbd'),'attributes':['id',_0x4275('0x51')]});return db[_0x4275('0x33')][_0x4275('0x46')]({'where':{'id':_0x2bbfa2['params']['id']},'include':_0x5935f9})[_0x4275('0x15')](handleEntityNotFound(_0x19f3ed,null))[_0x4275('0x15')](function(_0x4c6be8){if(_0x4c6be8){var _0x584cb0=_0x4c6be8[_0x4275('0xbe')]({'plain':!![]});fs[_0x4275('0xbf')](_0x1fc2ed);var _0x5933f3={'channel':_0x4275('0xc0'),'account':_0x584cb0[_0x4275('0xbc')][_0x4275('0x2b')],'agent':_0x584cb0['Owner']?_0x584cb0[_0x4275('0xbd')][_0x4275('0x51')]:'N.A.','createdAt':moment(_0x584cb0[_0x4275('0x8a')])[_0x4275('0x78')](_0x4275('0xa4'))[_0x4275('0xb3')](),'closedAt':_0x584cb0['closed']?moment(_0x584cb0[_0x4275('0xc1')])[_0x4275('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4275('0xb3')]():'','disposition':_0x584cb0[_0x4275('0x66')],'chatInfo':{'browser':_0x584cb0[_0x4275('0xc2')],'os':_0x584cb0[_0x4275('0xc3')],'referer':_0x584cb0[_0x4275('0xc4')],'customerIp':_0x584cb0['customerIp'],'customerPort':_0x584cb0[_0x4275('0xc5')]?_0x584cb0[_0x4275('0xc5')]:'N.A.'},'messages':_(_0x584cb0[_0x4275('0x7c')])[_0x4275('0xc6')]()[_0x4275('0xa1')]({'secret':![]})['map'](function(_0x466737){if(_0x466737[_0x4275('0x6c')]){var _0x4dc5de=path[_0x4275('0x73')](_0x3db431,_0x466737[_0x4275('0x6c')][_0x4275('0x6a')]);if(fs[_0x4275('0xc7')](_0x4dc5de)){fs[_0x4275('0xc8')](_0x4dc5de)[_0x4275('0xc9')](fs[_0x4275('0xca')](path['join'](_0x1fc2ed,_0x466737[_0x4275('0x6c')][_0x4275('0x6a')])));}}return{'date':moment(_0x466737[_0x4275('0x8a')])['format'](_0x4275('0xa4'))[_0x4275('0xb3')](),'sender':_0x466737[_0x4275('0x8b')]===_0x4275('0xcb')?_0x466737['User']?_0x466737[_0x4275('0x7d')]['fullname']:_0x4275('0x80'):_0x466737[_0x4275('0xcc')][_0x4275('0xb9')]+(_0x466737[_0x4275('0xcc')][_0x4275('0xba')]?'\x20'+_0x466737[_0x4275('0xcc')][_0x4275('0xba')]:''),'body':_0x466737[_0x4275('0x6c')]?_0x466737[_0x4275('0x6c')]['basename']:_0x466737[_0x4275('0x2e')],'direction':_0x466737['direction']==='out'?'A':'C','secret':_0x466737[_0x4275('0x8c')],'read':_0x466737[_0x4275('0xbb')],'attachment':_0x466737[_0x4275('0x6c')]};})[_0x4275('0xcd')]()};return ejs['renderFile'](path[_0x4275('0x73')](config['root'],_0x4275('0xb4'),_0x4275('0xce'),_0x4275('0xcf')),{'interaction':_0x5933f3})[_0x4275('0x15')](function(_0x223d6e){var _0x5a82ef=path[_0x4275('0x73')](_0x1fc2ed,'transcript-'+_0x584cb0['id']+'-'+_0x3f5d86+_0x4275('0xd0'));var _0x588298={'path':_0x5a82ef,'channel':_0x4275('0xc0'),'interactionId':_0x584cb0['id']};return pdf[_0x4275('0xd1')](_0x223d6e,_0x588298);})[_0x4275('0x15')](function(){return new Promise(function(_0x3138b0,_0x1dca65){zipdir(_0x1fc2ed,{'saveTo':_0xee6fca},function(_0xa75109,_0x1b4f36){if(_0xa75109)return _0x1dca65(_0xa75109);return _0x3138b0(_0x1b4f36);});})[_0x4275('0x15')](function(){return new BPromise(function(_0x458f84,_0xbcb844){rimraf(_0x1fc2ed,function(_0x21c688){if(_0x21c688)_0xbcb844(_0x21c688);return _0x458f84();});});})[_0x4275('0x15')](function(){return _0x19f3ed[_0x4275('0x75')](_0xee6fca,_0x24b0f6,function(_0x3fe977){if(_0x3fe977){logger[_0x4275('0x1b')](_0x4275('0xd2'),_0x3fe977);}else{fs[_0x4275('0xd3')](_0xee6fca);}});});});}else{return _0x19f3ed['sendStatus'](0xc8);}})[_0x4275('0x3b')](handleError(_0x19f3ed,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d586d3a..7609123 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 _0xb686=['then','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll'];(function(_0x597f7b,_0x511d3c){var _0x41ef72=function(_0x5657cf){while(--_0x5657cf){_0x597f7b['push'](_0x597f7b['shift']());}};_0x41ef72(++_0x511d3c);}(_0xb686,0xa8));var _0x6b68=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xb686[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0x6b68('0x0'));var ChatInteraction=require(_0x6b68('0x1'))['db'][_0x6b68('0x2')];var ChatMessage=require(_0x6b68('0x1'))['db'][_0x6b68('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6b68('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6b68('0x5'),'afterDestroy':_0x6b68('0x6')};function emitEvent(_0x48ceda){return function(_0x213410,_0x37c231,_0x32282f){_0x213410[_0x6b68('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x36bf7f){_0x213410[_0x6b68('0x8')](_0x6b68('0x9'),_0x36bf7f[_0x6b68('0xa')](function(_0x295df5){return{'id':_0x295df5['id']};}));return ChatMessage[_0x6b68('0xb')]({'where':{'ChatInteractionId':_0x213410['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6b68('0xc')](function(_0xa2336e){_0x213410[_0x6b68('0x8')](_0x6b68('0xd'),_0xa2336e['length']);ChatInteractionEvents[_0x6b68('0xe')](_0x48ceda+':'+_0x213410['id'],_0x213410);ChatInteractionEvents[_0x6b68('0xe')](_0x48ceda,_0x213410);_0x32282f(null);})[_0x6b68('0xf')](_0x32282f(null));};}for(var e in events){if(events[_0x6b68('0x10')](e)){var event=events[e];ChatInteraction[_0x6b68('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x6795=['ChatMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x50d3c3,_0x4b2a29){var _0x47ac6e=function(_0x3df07a){while(--_0x3df07a){_0x50d3c3['push'](_0x50d3c3['shift']());}};_0x47ac6e(++_0x4b2a29);}(_0x6795,0x9f));var _0x5679=function(_0x513abe,_0x880145){_0x513abe=_0x513abe-0x0;var _0x595005=_0x6795[_0x513abe];return _0x595005;};'use strict';var EventEmitter=require(_0x5679('0x0'));var ChatInteraction=require(_0x5679('0x1'))['db'][_0x5679('0x2')];var ChatMessage=require(_0x5679('0x1'))['db'][_0x5679('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5679('0x4')](0x0);var events={'afterCreate':_0x5679('0x5'),'afterUpdate':_0x5679('0x6'),'afterDestroy':'remove'};function emitEvent(_0x29ab93){return function(_0x2fc03b,_0x30494f,_0x235897){_0x2fc03b[_0x5679('0x7')]({'attributes':['id'],'raw':!![]})[_0x5679('0x8')](function(_0x4c8dd2){_0x2fc03b[_0x5679('0x9')](_0x5679('0xa'),_0x4c8dd2['map'](function(_0x348184){return{'id':_0x348184['id']};}));return ChatMessage[_0x5679('0xb')]({'where':{'ChatInteractionId':_0x2fc03b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x42a076){_0x2fc03b['setDataValue'](_0x5679('0xc'),_0x42a076['length']);ChatInteractionEvents[_0x5679('0xd')](_0x29ab93+':'+_0x2fc03b['id'],_0x2fc03b);ChatInteractionEvents[_0x5679('0xd')](_0x29ab93,_0x2fc03b);_0x235897(null);})[_0x5679('0xe')](_0x235897(null));};}for(var e in events){if(events[_0x5679('0xf')](e)){var event=events[e];ChatInteraction[_0x5679('0x10')](e,emitEvent(event));}}module[_0x5679('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 0d2a977..c553e1a 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 _0x15c9=['../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf'];(function(_0x43ddfc,_0x4c02bb){var _0x2f0b82=function(_0x1eb5ef){while(--_0x1eb5ef){_0x43ddfc['push'](_0x43ddfc['shift']());}};_0x2f0b82(++_0x4c02bb);}(_0x15c9,0xd2));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x915c('0x0'));var util=require(_0x915c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x915c('0x2'));var BPromise=require('bluebird');var rp=require(_0x915c('0x3'));var fs=require('fs');var path=require(_0x915c('0x4'));var rimraf=require(_0x915c('0x5'));var config=require(_0x915c('0x6'));var attributes=require(_0x915c('0x7'));module[_0x915c('0x8')]=function(_0x58658e,_0xdcf7d7){return _0x58658e['define'](_0x915c('0x9'),attributes,{'tableName':_0x915c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ff29a,_0x490ee9,_0x4d8ded){if(_0x2ff29a[_0x915c('0xb')](_0x915c('0xc'))){_0x2ff29a[_0x915c('0xd')]=moment()[_0x915c('0xe')](_0x915c('0xf'));}_0x4d8ded(null,_0x2ff29a);}},'charset':_0x915c('0x10'),'collate':_0x915c('0x11')});};
\ No newline at end of file
+var _0x6596=['exports','ChatInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x3415a1,_0x5e5717){var _0x224228=function(_0x4134b2){while(--_0x4134b2){_0x3415a1['push'](_0x3415a1['shift']());}};_0x224228(++_0x5e5717);}(_0x6596,0x1ca));var _0x6659=function(_0x11d5f7,_0x41d281){_0x11d5f7=_0x11d5f7-0x0;var _0x47ab7c=_0x6596[_0x11d5f7];return _0x47ab7c;};'use strict';var _=require(_0x6659('0x0'));var util=require('util');var logger=require(_0x6659('0x1'))('api');var moment=require(_0x6659('0x2'));var BPromise=require('bluebird');var rp=require(_0x6659('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6659('0x4'));var config=require(_0x6659('0x5'));var attributes=require(_0x6659('0x6'));module[_0x6659('0x7')]=function(_0x39b238,_0x4e414e){return _0x39b238['define'](_0x6659('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56f064,_0x42cbb4,_0x5d1791){if(_0x56f064[_0x6659('0x9')]('closed')){_0x56f064[_0x6659('0xa')]=moment()[_0x6659('0xb')](_0x6659('0xc'));}_0x5d1791(null,_0x56f064);}},'charset':_0x6659('0xd'),'collate':_0x6659('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e164532..4e1b18e 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 _0xdb07=['request\x20sent','catch','UpdateChatInteraction','update','options','raw','where','attributes','debug','AddTagsToChatInteraction','find','addTags','body','omit','ids','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','stringify','error','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x36531f,_0x4ba624){var _0x2ee6b0=function(_0x45bad0){while(--_0x45bad0){_0x36531f['push'](_0x36531f['shift']());}};_0x2ee6b0(++_0x4ba624);}(_0xdb07,0x85));var _0x7db0=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0xdb07[_0x35ebae];return _0x1924cf;};'use strict';var _=require('lodash');var util=require(_0x7db0('0x0'));var moment=require(_0x7db0('0x1'));var BPromise=require(_0x7db0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7db0('0x3'));var db=require(_0x7db0('0x4'))['db'];var utils=require(_0x7db0('0x5'));var logger=require(_0x7db0('0x6'))(_0x7db0('0x7'));var config=require('../../config/environment');var jayson=require(_0x7db0('0x8'));var client=jayson[_0x7db0('0x9')][_0x7db0('0xa')]({'port':0x232a});config['redis']=_[_0x7db0('0xb')](config[_0x7db0('0xc')],{'host':_0x7db0('0xd'),'port':0x18eb});var socket=require(_0x7db0('0xe'))(new Redis(config[_0x7db0('0xc')]));require('./chatInteraction.socket')[_0x7db0('0xf')](socket);function respondWithRpcPromise(_0x40af10,_0x23fb5a,_0x7b2323){return new BPromise(function(_0x4f57ee,_0x2ff6d8){return client[_0x7db0('0x10')](_0x40af10,_0x7b2323)[_0x7db0('0x11')](function(_0x35a886){logger[_0x7db0('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x23fb5a,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x23fb5a,'request\x20sent',JSON[_0x7db0('0x13')](_0x35a886));if(_0x35a886[_0x7db0('0x14')]){if(_0x35a886[_0x7db0('0x14')]['code']===0x1f4){logger[_0x7db0('0x14')](_0x7db0('0x15'),_0x23fb5a,_0x35a886['error'][_0x7db0('0x16')]);return _0x2ff6d8(_0x35a886[_0x7db0('0x14')]['message']);}logger[_0x7db0('0x14')](_0x7db0('0x15'),_0x23fb5a,_0x35a886[_0x7db0('0x14')][_0x7db0('0x16')]);return _0x4f57ee(_0x35a886[_0x7db0('0x14')][_0x7db0('0x16')]);}else{logger[_0x7db0('0x12')](_0x7db0('0x15'),_0x23fb5a,_0x7db0('0x17'));_0x4f57ee(_0x35a886['result'][_0x7db0('0x16')]);}})[_0x7db0('0x18')](function(_0x4f0a38){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x23fb5a,_0x4f0a38);_0x2ff6d8(_0x4f0a38);});});}exports[_0x7db0('0x19')]=function(_0x443706){var _0x3dc3aa=this;return new Promise(function(_0x50be04,_0x1b4af1){return db['ChatInteraction'][_0x7db0('0x1a')](_0x443706['body'],{'raw':_0x443706[_0x7db0('0x1b')]?_0x443706[_0x7db0('0x1b')][_0x7db0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x443706[_0x7db0('0x1b')]?_0x443706[_0x7db0('0x1b')][_0x7db0('0x1d')]||null:null,'attributes':_0x443706[_0x7db0('0x1b')]?_0x443706[_0x7db0('0x1b')][_0x7db0('0x1e')]||null:null,'limit':_0x443706['options']?_0x443706[_0x7db0('0x1b')]['limit']||null:null})[_0x7db0('0x11')](function(_0x527a68){logger['info'](_0x7db0('0x19'),_0x443706);logger[_0x7db0('0x1f')](_0x7db0('0x19'),_0x443706,JSON[_0x7db0('0x13')](_0x527a68));_0x50be04(_0x527a68);})['catch'](function(_0x228ef7){logger['error'](_0x7db0('0x19'),_0x228ef7[_0x7db0('0x16')],_0x443706);_0x1b4af1(_0x3dc3aa[_0x7db0('0x14')](0x1f4,_0x228ef7[_0x7db0('0x16')]));});});};exports[_0x7db0('0x20')]=function(_0x43bc94){return new Promise(function(_0x5a7e20,_0x15aa40){return db['ChatInteraction'][_0x7db0('0x21')]({'where':_0x43bc94[_0x7db0('0x1b')]?_0x43bc94['options'][_0x7db0('0x1d')]||null:null})[_0x7db0('0x11')](function(_0x1b8e9e){if(_0x1b8e9e){return _0x1b8e9e[_0x7db0('0x22')](_0x43bc94[_0x7db0('0x23')]['ids'],_[_0x7db0('0x24')](_0x43bc94[_0x7db0('0x23')],[_0x7db0('0x25'),'id'])||{});}})['spread'](function(_0x42c70a){logger['info']('AddTags',_0x43bc94);logger[_0x7db0('0x1f')](_0x7db0('0x26'),_0x43bc94,JSON['stringify'](_0x42c70a));_0x5a7e20(_0x42c70a);})['catch'](function(_0x3f0237){logger['error'](_0x7db0('0x26'),_0x3f0237[_0x7db0('0x16')],_0x43bc94);_0x15aa40(_this[_0x7db0('0x14')](0x1f4,_0x3f0237['message']));});});};
\ No newline at end of file
+var _0x4546=['options','raw','where','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','UpdateChatInteraction','update','body'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0x4546,0xab));var _0x6454=function(_0x50b6cc,_0x4dfee5){_0x50b6cc=_0x50b6cc-0x0;var _0x93119c=_0x4546[_0x50b6cc];return _0x93119c;};'use strict';var _=require(_0x6454('0x0'));var util=require(_0x6454('0x1'));var moment=require(_0x6454('0x2'));var BPromise=require(_0x6454('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6454('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6454('0x5'))(_0x6454('0x6'));var config=require(_0x6454('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6454('0x8')]['http']({'port':0x232a});config[_0x6454('0x9')]=_[_0x6454('0xa')](config[_0x6454('0x9')],{'host':_0x6454('0xb'),'port':0x18eb});var socket=require(_0x6454('0xc'))(new Redis(config[_0x6454('0x9')]));require(_0x6454('0xd'))[_0x6454('0xe')](socket);function respondWithRpcPromise(_0x4d8e6d,_0x48278f,_0x3630cb){return new BPromise(function(_0x13ef93,_0x566d2f){return client[_0x6454('0xf')](_0x4d8e6d,_0x3630cb)[_0x6454('0x10')](function(_0x1e7230){logger[_0x6454('0x11')](_0x6454('0x12'),_0x48278f,'request\x20sent');logger['debug'](_0x6454('0x13'),_0x48278f,'request\x20sent',JSON[_0x6454('0x14')](_0x1e7230));if(_0x1e7230['error']){if(_0x1e7230['error'][_0x6454('0x15')]===0x1f4){logger[_0x6454('0x16')](_0x6454('0x12'),_0x48278f,_0x1e7230[_0x6454('0x16')][_0x6454('0x17')]);return _0x566d2f(_0x1e7230[_0x6454('0x16')]['message']);}logger[_0x6454('0x16')](_0x6454('0x12'),_0x48278f,_0x1e7230[_0x6454('0x16')][_0x6454('0x17')]);return _0x13ef93(_0x1e7230[_0x6454('0x16')][_0x6454('0x17')]);}else{logger['info'](_0x6454('0x12'),_0x48278f,_0x6454('0x18'));_0x13ef93(_0x1e7230['result'][_0x6454('0x17')]);}})[_0x6454('0x19')](function(_0x48972b){logger[_0x6454('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x48278f,_0x48972b);_0x566d2f(_0x48972b);});});}exports[_0x6454('0x1a')]=function(_0x587636){var _0x3bc737=this;return new Promise(function(_0x5b1574,_0x29b7ee){return db['ChatInteraction'][_0x6454('0x1b')](_0x587636[_0x6454('0x1c')],{'raw':_0x587636['options']?_0x587636[_0x6454('0x1d')][_0x6454('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x587636['options']?_0x587636[_0x6454('0x1d')][_0x6454('0x1f')]||null:null,'attributes':_0x587636[_0x6454('0x1d')]?_0x587636[_0x6454('0x1d')]['attributes']||null:null,'limit':_0x587636[_0x6454('0x1d')]?_0x587636[_0x6454('0x1d')]['limit']||null:null})[_0x6454('0x10')](function(_0xeda3aa){logger[_0x6454('0x11')]('UpdateChatInteraction',_0x587636);logger[_0x6454('0x20')](_0x6454('0x1a'),_0x587636,JSON['stringify'](_0xeda3aa));_0x5b1574(_0xeda3aa);})['catch'](function(_0x36fc74){logger[_0x6454('0x16')](_0x6454('0x1a'),_0x36fc74['message'],_0x587636);_0x29b7ee(_0x3bc737[_0x6454('0x16')](0x1f4,_0x36fc74[_0x6454('0x17')]));});});};exports[_0x6454('0x21')]=function(_0x26518f){return new Promise(function(_0x30341a,_0x62047a){return db['ChatInteraction'][_0x6454('0x22')]({'where':_0x26518f[_0x6454('0x1d')]?_0x26518f[_0x6454('0x1d')][_0x6454('0x1f')]||null:null})['then'](function(_0x57b197){if(_0x57b197){return _0x57b197[_0x6454('0x23')](_0x26518f[_0x6454('0x1c')][_0x6454('0x24')],_[_0x6454('0x25')](_0x26518f[_0x6454('0x1c')],[_0x6454('0x24'),'id'])||{});}})[_0x6454('0x26')](function(_0x3764e0){logger[_0x6454('0x11')](_0x6454('0x27'),_0x26518f);logger['debug'](_0x6454('0x27'),_0x26518f,JSON['stringify'](_0x3764e0));_0x30341a(_0x3764e0);})[_0x6454('0x19')](function(_0x3be06c){logger['error'](_0x6454('0x27'),_0x3be06c[_0x6454('0x17')],_0x26518f);_0x62047a(_this[_0x6454('0x16')](0x1f4,_0x3be06c[_0x6454('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 2f5216f..53c9d18 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 _0xb079=['register','save','remove','update','emit','removeListener'];(function(_0x1a0404,_0x364e3d){var _0x243c1b=function(_0x102e16){while(--_0x102e16){_0x1a0404['push'](_0x1a0404['shift']());}};_0x243c1b(++_0x364e3d);}(_0xb079,0x1c9));var _0x9b07=function(_0x26f5e8,_0x41e832){_0x26f5e8=_0x26f5e8-0x0;var _0x3acdfd=_0xb079[_0x26f5e8];return _0x3acdfd;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x9b07('0x0'),_0x9b07('0x1'),_0x9b07('0x2')];function createListener(_0x158a14,_0x22f945){return function(_0x3c199c){_0x22f945[_0x9b07('0x3')](_0x158a14,_0x3c199c);};}function removeListener(_0x14a884,_0x3bf703){return function(){ChatInteractionEvents[_0x9b07('0x4')](_0x14a884,_0x3bf703);};}exports[_0x9b07('0x5')]=function(_0x4a6f57){for(var _0x1ebf90=0x0,_0x2be1ef=events['length'];_0x1ebf90<_0x2be1ef;_0x1ebf90++){var _0x17a4bc=events[_0x1ebf90];var _0x5a0395=createListener('chatInteraction:'+_0x17a4bc,_0x4a6f57);ChatInteractionEvents['on'](_0x17a4bc,_0x5a0395);}};
\ No newline at end of file
+var _0x0fc2=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x85e1ae,_0xd1bfba){var _0x3be149=function(_0x16b94d){while(--_0x16b94d){_0x85e1ae['push'](_0x85e1ae['shift']());}};_0x3be149(++_0xd1bfba);}(_0x0fc2,0x6e));var _0x20fc=function(_0x43d690,_0x232548){_0x43d690=_0x43d690-0x0;var _0x10d5a6=_0x0fc2[_0x43d690];return _0x10d5a6;};'use strict';var ChatInteractionEvents=require(_0x20fc('0x0'));var events=[_0x20fc('0x1'),_0x20fc('0x2'),_0x20fc('0x3')];function createListener(_0x51d2ab,_0x46b3ae){return function(_0xba56f5){_0x46b3ae[_0x20fc('0x4')](_0x51d2ab,_0xba56f5);};}function removeListener(_0x2b95b8,_0x14a9af){return function(){ChatInteractionEvents[_0x20fc('0x5')](_0x2b95b8,_0x14a9af);};}exports[_0x20fc('0x6')]=function(_0x13f2d5){for(var _0x10f6ad=0x0,_0xc556e8=events[_0x20fc('0x7')];_0x10f6ad<_0xc556e8;_0x10f6ad++){var _0x470d1a=events[_0x10f6ad];var _0x24b617=createListener(_0x20fc('0x8')+_0x470d1a,_0x13f2d5);ChatInteractionEvents['on'](_0x470d1a,_0x24b617);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 801e632..bd53830 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 _0xf839=['root','server/files/attachments/','format','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','join'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf839,0x1da));var _0x9f83=function(_0x331152,_0x25c1a8){_0x331152=_0x331152-0x0;var _0x2da184=_0xf839[_0x331152];return _0x2da184;};'use strict';var multer=require(_0x9f83('0x0'));var util=require('util');var path=require(_0x9f83('0x1'));var timeout=require(_0x9f83('0x2'));var express=require(_0x9f83('0x3'));var router=express[_0x9f83('0x4')]();var fs_extra=require(_0x9f83('0x5'));var auth=require(_0x9f83('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9f83('0x7'));var controller=require(_0x9f83('0x8'));router[_0x9f83('0x9')]('/',auth[_0x9f83('0xa')](),controller[_0x9f83('0xb')]);router[_0x9f83('0x9')](_0x9f83('0xc'),auth['isAuthenticated'](),controller[_0x9f83('0xd')]);router[_0x9f83('0x9')](_0x9f83('0xe'),auth[_0x9f83('0xf')](),controller['show']);router['get'](_0x9f83('0x10'),auth[_0x9f83('0xf')](),controller[_0x9f83('0x11')]);router[_0x9f83('0x9')](_0x9f83('0x12'),auth['isAuthenticated'](),controller[_0x9f83('0x13')]);router['get'](_0x9f83('0x14'),auth[_0x9f83('0xf')](),controller[_0x9f83('0x15')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x9f83('0x16')]);router[_0x9f83('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9f83('0x17')](_0x9f83('0x18'),auth[_0x9f83('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53a4b5,_0x488b11,_0x4ac108){_0x4ac108(null,path[_0x9f83('0x19')](config[_0x9f83('0x1a')],_0x9f83('0x1b')));},'filename':function(_0x22cb30,_0x134adb,_0xb4f4cc){_0xb4f4cc(null,util[_0x9f83('0x1c')]('%s-%s',Date['now'](),_0x134adb['originalname'][_0x9f83('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9f83('0x17')](_0x9f83('0x1e'),upload[_0x9f83('0x1f')](_0x9f83('0x20')),controller['attachmentUpload']);router[_0x9f83('0x17')](_0x9f83('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x9f83('0x21')]);router['post'](_0x9f83('0x22'),auth['isAuthenticated'](),interaction[_0x9f83('0x23')](_0x9f83('0x24'),_0x9f83('0x25')),controller[_0x9f83('0x26')]);router[_0x9f83('0x27')](_0x9f83('0xe'),auth[_0x9f83('0xa')](),interaction[_0x9f83('0x23')](_0x9f83('0x24'),_0x9f83('0x28')),controller[_0x9f83('0x29')]);router[_0x9f83('0x27')](_0x9f83('0x2a'),controller[_0x9f83('0x2b')]);router[_0x9f83('0x27')]('/:id/abandon',auth[_0x9f83('0xf')](),controller[_0x9f83('0x2c')]);router[_0x9f83('0x27')](_0x9f83('0x2d'),controller[_0x9f83('0x2e')]);router[_0x9f83('0x2f')](_0x9f83('0xe'),auth[_0x9f83('0xa')](),interaction['tracked'](_0x9f83('0x24'),_0x9f83('0x30')),controller['destroy']);router[_0x9f83('0x2f')](_0x9f83('0x22'),auth[_0x9f83('0xa')](),controller[_0x9f83('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0x303b=['tracked','chatinteraction:destroy','destroy','removeTags','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload','/:id/tags','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','put','/:id/close','close','delete'];(function(_0x5e5c64,_0x19b9fb){var _0x1bf287=function(_0x19fb98){while(--_0x19fb98){_0x5e5c64['push'](_0x5e5c64['shift']());}};_0x1bf287(++_0x19b9fb);}(_0x303b,0xd5));var _0xb303=function(_0x5da87f,_0x3e0249){_0x5da87f=_0x5da87f-0x0;var _0x1be0cf=_0x303b[_0x5da87f];return _0x1be0cf;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb303('0x0'));var express=require(_0xb303('0x1'));var router=express[_0xb303('0x2')]();var fs_extra=require(_0xb303('0x3'));var auth=require(_0xb303('0x4'));var interaction=require(_0xb303('0x5'));var config=require(_0xb303('0x6'));var controller=require(_0xb303('0x7'));router['get']('/',auth[_0xb303('0x8')](),controller[_0xb303('0x9')]);router['get'](_0xb303('0xa'),auth[_0xb303('0x8')](),controller[_0xb303('0xb')]);router[_0xb303('0xc')](_0xb303('0xd'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0xb303('0xc')](_0xb303('0xe'),auth[_0xb303('0xf')](),controller[_0xb303('0x10')]);router[_0xb303('0xc')](_0xb303('0x11'),auth[_0xb303('0x8')](),controller[_0xb303('0x12')]);router[_0xb303('0xc')]('/:id/my_messages',auth[_0xb303('0xf')](),controller[_0xb303('0x13')]);router[_0xb303('0xc')](_0xb303('0x14'),auth['isAuthenticated'](),controller['download']);router[_0xb303('0x15')]('/',auth[_0xb303('0x8')](),controller[_0xb303('0x16')]);router[_0xb303('0x15')](_0xb303('0x17'),auth[_0xb303('0x8')](),controller[_0xb303('0x18')]);var upload=multer({'storage':multer[_0xb303('0x19')]({'destination':function(_0x1910eb,_0x30bfe4,_0x2859aa){_0x2859aa(null,path['join'](config[_0xb303('0x1a')],_0xb303('0x1b')));},'filename':function(_0x277f70,_0xf11a6f,_0x19f7d2){_0x19f7d2(null,util[_0xb303('0x1c')](_0xb303('0x1d'),Date[_0xb303('0x1e')](),_0xf11a6f['originalname'][_0xb303('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xb303('0x20'),upload['single'](_0xb303('0x21')),controller[_0xb303('0x22')]);router[_0xb303('0x15')](_0xb303('0x11'),auth[_0xb303('0xf')](),controller['addMessage']);router[_0xb303('0x15')](_0xb303('0x23'),auth['isAuthenticated'](),interaction['tracked'](_0xb303('0x24'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0xb303('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xb303('0x24'),_0xb303('0x25')),controller[_0xb303('0x26')]);router['put'](_0xb303('0x27'),controller[_0xb303('0x28')]);router['put'](_0xb303('0x29'),auth['isChatInteractionAuthorized'](),controller[_0xb303('0x2a')]);router[_0xb303('0x2b')](_0xb303('0x2c'),controller[_0xb303('0x2d')]);router[_0xb303('0x2e')](_0xb303('0xd'),auth[_0xb303('0x8')](),interaction[_0xb303('0x2f')](_0xb303('0x24'),_0xb303('0x30')),controller[_0xb303('0x31')]);router[_0xb303('0x2e')](_0xb303('0x23'),auth['isAuthenticated'](),controller[_0xb303('0x32')]);module[_0xb303('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index a8d45d5..57f4346 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 _0x67d3=['sequelize','exports','TEXT','medium','INTEGER'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x67d3,0x1a9));var _0x367d=function(_0x18d479,_0x5ee508){_0x18d479=_0x18d479-0x0;var _0x2cf821=_0x67d3[_0x18d479];return _0x2cf821;};'use strict';var Sequelize=require(_0x367d('0x0'));module[_0x367d('0x1')]={'body':{'type':Sequelize[_0x367d('0x2')](_0x367d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x367d('0x4')]}};
\ No newline at end of file
+var _0xd904=['medium','INTEGER','sequelize'];(function(_0x345524,_0x28de07){var _0x476dba=function(_0x149408){while(--_0x149408){_0x345524['push'](_0x345524['shift']());}};_0x476dba(++_0x28de07);}(_0xd904,0x1bb));var _0x4d90=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xd904[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0x4d90('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4d90('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4d90('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index c393ded..f70f5d2 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 _0x8698=['map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','admin','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','user','get','role','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','ToId','read','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','end','error','name','status','send'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x8698,0xa9));var _0x8869=function(_0x220fd2,_0x3acd91){_0x220fd2=_0x220fd2-0x0;var _0x1e4faf=_0x8698[_0x220fd2];return _0x1e4faf;};'use strict';var emlformat=require(_0x8869('0x0'));var rimraf=require(_0x8869('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8869('0x2'));var rp=require(_0x8869('0x3'));var moment=require('moment');var BPromise=require(_0x8869('0x4'));var Mustache=require(_0x8869('0x5'));var util=require(_0x8869('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8869('0x7'));var ejs=require(_0x8869('0x8'));var fs=require('fs');var fs_extra=require(_0x8869('0x9'));var _=require(_0x8869('0xa'));var squel=require(_0x8869('0xb'));var crypto=require(_0x8869('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8869('0xd'));var toCsv=require(_0x8869('0x7'));var querystring=require(_0x8869('0xe'));var Papa=require(_0x8869('0xf'));var Redis=require('ioredis');var authService=require(_0x8869('0x10'));var qs=require(_0x8869('0x11'));var as=require(_0x8869('0x12'));var hardwareService=require(_0x8869('0x13'));var logger=require(_0x8869('0x14'))('api');var utils=require(_0x8869('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8869('0x16'));var db=require('../../mysqldb')['db'];config[_0x8869('0x17')]=_[_0x8869('0x18')](config[_0x8869('0x17')],{'host':_0x8869('0x19'),'port':0x18eb});var socket=require(_0x8869('0x1a'))(new Redis(config[_0x8869('0x17')]));require(_0x8869('0x1b'))[_0x8869('0x1c')](socket);function respondWithStatusCode(_0x1ecc54,_0x45414a){_0x45414a=_0x45414a||0xcc;return function(_0x32cfcc){if(_0x32cfcc){return _0x1ecc54[_0x8869('0x1d')](_0x45414a);}return _0x1ecc54['status'](_0x45414a)['end']();};}function respondWithResult(_0x514e27,_0x161c24){_0x161c24=_0x161c24||0xc8;return function(_0x5a74fd){if(_0x5a74fd){return _0x514e27['status'](_0x161c24)['json'](_0x5a74fd);}};}function respondWithFilteredResult(_0x6393f5,_0x483af8){return function(_0x580a6b){if(_0x580a6b){var _0x3eb117=typeof _0x483af8['offset']===_0x8869('0x1e')&&typeof _0x483af8[_0x8869('0x1f')]===_0x8869('0x1e');var _0x4d1079=_0x580a6b[_0x8869('0x20')];var _0x233c15=_0x3eb117?0x0:_0x483af8[_0x8869('0x21')];var _0x343f22=_0x3eb117?_0x580a6b[_0x8869('0x20')]:_0x483af8[_0x8869('0x21')]+_0x483af8['limit'];var _0x519c47;if(_0x343f22>=_0x4d1079){_0x343f22=_0x4d1079;_0x519c47=0xc8;}else{_0x519c47=0xce;}_0x6393f5['status'](_0x519c47);return _0x6393f5[_0x8869('0x22')](_0x8869('0x23'),_0x233c15+'-'+_0x343f22+'/'+_0x4d1079)[_0x8869('0x24')](_0x580a6b);}return null;};}function patchUpdates(_0x582e2e){return function(_0x3f53a3){try{jsonpatch['apply'](_0x3f53a3,_0x582e2e,!![]);}catch(_0x3b009f){return BPromise[_0x8869('0x25')](_0x3b009f);}return _0x3f53a3['save']();};}function saveUpdates(_0x3aa6a8,_0x51c422){return function(_0x47d32a){if(_0x47d32a){return _0x47d32a[_0x8869('0x26')](_0x3aa6a8)[_0x8869('0x27')](function(_0x526094){return _0x526094;});}return null;};}function removeEntity(_0x15d577,_0x3382d1){return function(_0xe640b9){if(_0xe640b9){return _0xe640b9['destroy']()[_0x8869('0x27')](function(){_0x15d577['status'](0xcc)[_0x8869('0x28')]();});}};}function handleEntityNotFound(_0x3d63ef,_0xe5cbc4){return function(_0x1d8d9a){if(!_0x1d8d9a){_0x3d63ef[_0x8869('0x1d')](0x194);}return _0x1d8d9a;};}function handleError(_0x5b62b0,_0x1dec1b){_0x1dec1b=_0x1dec1b||0x1f4;return function(_0x4d6488){logger[_0x8869('0x29')](_0x4d6488['stack']);if(_0x4d6488[_0x8869('0x2a')]){delete _0x4d6488[_0x8869('0x2a')];}_0x5b62b0[_0x8869('0x2b')](_0x1dec1b)[_0x8869('0x2c')](_0x4d6488);};}exports['index']=function(_0x13df95,_0x5efa97){var _0x36ca21={},_0x53d2e4={},_0x2596b6={'count':0x0,'rows':[]};var _0x51ea45=_[_0x8869('0x2d')](db[_0x8869('0x2e')][_0x8869('0x2f')],function(_0x247912){return{'name':_0x247912['fieldName'],'type':_0x247912[_0x8869('0x30')][_0x8869('0x31')]};});_0x53d2e4[_0x8869('0x32')]=_[_0x8869('0x2d')](_0x51ea45,'name');_0x53d2e4[_0x8869('0x33')]=_[_0x8869('0x34')](_0x13df95[_0x8869('0x33')]);_0x53d2e4[_0x8869('0x35')]=_[_0x8869('0x36')](_0x53d2e4['model'],_0x53d2e4[_0x8869('0x33')]);_0x36ca21[_0x8869('0x37')]=_[_0x8869('0x36')](_0x53d2e4[_0x8869('0x32')],qs[_0x8869('0x38')](_0x13df95['query'][_0x8869('0x38')]));_0x36ca21['attributes']=_0x36ca21[_0x8869('0x37')][_0x8869('0x39')]?_0x36ca21['attributes']:_0x53d2e4[_0x8869('0x32')];if(!_0x13df95[_0x8869('0x33')][_0x8869('0x3a')](_0x8869('0x3b'))){_0x36ca21[_0x8869('0x1f')]=qs[_0x8869('0x1f')](_0x13df95['query'][_0x8869('0x1f')]);_0x36ca21[_0x8869('0x21')]=qs[_0x8869('0x21')](_0x13df95[_0x8869('0x33')][_0x8869('0x21')]);}_0x36ca21[_0x8869('0x3c')]=qs['sort'](_0x13df95[_0x8869('0x33')][_0x8869('0x3d')]);_0x36ca21[_0x8869('0x3e')]=qs['filters'](_[_0x8869('0x3f')](_0x13df95[_0x8869('0x33')],_0x53d2e4[_0x8869('0x35')]),_0x51ea45);if(_0x13df95[_0x8869('0x33')][_0x8869('0x40')]){_0x36ca21[_0x8869('0x3e')]=_[_0x8869('0x41')](_0x36ca21[_0x8869('0x3e')],{'$or':_[_0x8869('0x2d')](_0x51ea45,function(_0x29c118){if(_0x29c118[_0x8869('0x30')]!=='VIRTUAL'){var _0x30dc8f={};_0x30dc8f[_0x29c118[_0x8869('0x2a')]]={'$like':'%'+_0x13df95[_0x8869('0x33')][_0x8869('0x40')]+'%'};return _0x30dc8f;}})});}_0x36ca21=_[_0x8869('0x41')]({},_0x36ca21,_0x13df95[_0x8869('0x42')]);var _0x40b824={'where':_0x36ca21[_0x8869('0x3e')]};return db['ChatInternalMessage'][_0x8869('0x20')](_0x40b824)[_0x8869('0x27')](function(_0x39367d){_0x2596b6[_0x8869('0x20')]=_0x39367d;if(_0x13df95[_0x8869('0x33')][_0x8869('0x43')]){_0x36ca21[_0x8869('0x44')]=[{'all':!![]}];}return db[_0x8869('0x2e')][_0x8869('0x45')](_0x36ca21);})['then'](function(_0x33a6f8){_0x2596b6[_0x8869('0x46')]=_0x33a6f8;return _0x2596b6;})[_0x8869('0x27')](respondWithFilteredResult(_0x5efa97,_0x36ca21))[_0x8869('0x47')](handleError(_0x5efa97,null));};exports[_0x8869('0x48')]=function(_0x4708cf,_0x111541){var _0x14a87d={'raw':!![],'where':{'id':_0x4708cf[_0x8869('0x49')]['id']}},_0x153d30={};_0x153d30[_0x8869('0x32')]=_['keys'](db[_0x8869('0x2e')][_0x8869('0x2f')]);_0x153d30[_0x8869('0x33')]=_[_0x8869('0x34')](_0x4708cf[_0x8869('0x33')]);_0x153d30['filters']=_[_0x8869('0x36')](_0x153d30[_0x8869('0x32')],_0x153d30[_0x8869('0x33')]);_0x14a87d[_0x8869('0x37')]=_[_0x8869('0x36')](_0x153d30['model'],qs[_0x8869('0x38')](_0x4708cf[_0x8869('0x33')][_0x8869('0x38')]));_0x14a87d[_0x8869('0x37')]=_0x14a87d['attributes'][_0x8869('0x39')]?_0x14a87d[_0x8869('0x37')]:_0x153d30['model'];if(_0x4708cf[_0x8869('0x33')][_0x8869('0x43')]){_0x14a87d[_0x8869('0x44')]=[{'all':!![]}];}_0x14a87d=_['merge']({},_0x14a87d,_0x4708cf[_0x8869('0x42')]);return db[_0x8869('0x2e')][_0x8869('0x4a')](_0x14a87d)[_0x8869('0x27')](handleEntityNotFound(_0x111541,null))[_0x8869('0x27')](respondWithResult(_0x111541,null))['catch'](handleError(_0x111541,null));};exports[_0x8869('0x4b')]=function(_0x54d3ba,_0xeb3b8c){return db[_0x8869('0x2e')][_0x8869('0x4b')](_0x54d3ba[_0x8869('0x4c')],{})['then'](respondWithResult(_0xeb3b8c,0xc9))[_0x8869('0x47')](handleError(_0xeb3b8c,null));};exports[_0x8869('0x26')]=function(_0x5d1788,_0x749edb){if(_0x5d1788[_0x8869('0x4c')]['id']){delete _0x5d1788[_0x8869('0x4c')]['id'];}return db[_0x8869('0x2e')][_0x8869('0x4a')]({'where':{'id':_0x5d1788[_0x8869('0x49')]['id']}})[_0x8869('0x27')](handleEntityNotFound(_0x749edb,null))[_0x8869('0x27')](saveUpdates(_0x5d1788['body'],null))[_0x8869('0x27')](respondWithResult(_0x749edb,null))[_0x8869('0x47')](handleError(_0x749edb,null));};exports[_0x8869('0x4d')]=function(_0xfe070a,_0x414e5b){return db[_0x8869('0x2e')][_0x8869('0x4a')]({'where':{'id':_0xfe070a[_0x8869('0x49')]['id']}})[_0x8869('0x27')](handleEntityNotFound(_0x414e5b,null))[_0x8869('0x27')](removeEntity(_0x414e5b,null))[_0x8869('0x47')](handleError(_0x414e5b,null));};exports[_0x8869('0x4e')]=function(_0x140526,_0x53f3e4){return db[_0x8869('0x2e')][_0x8869('0x4e')]()['then'](respondWithResult(_0x53f3e4,null))['catch'](handleError(_0x53f3e4,null));};function wrapUser(_0x237f8f){return function(_0x45b065){var _0x2316b0=_0x237f8f['get']({'plain':!![]});_0x2316b0[_0x8869('0x4f')]=[];if(_0x45b065){_0x2316b0[_0x8869('0x50')]=_0x45b065[_0x8869('0x51')];_0x2316b0[_0x8869('0x52')]=_0x45b065;}else{_0x2316b0[_0x8869('0x50')]=moment(0x0)[_0x8869('0x53')](_0x8869('0x54'));_0x2316b0['lastMessage']={};}return _0x2316b0;};}exports['getUsers']=function(_0x3934c7,_0x15b48d,_0x47da51){var _0x1335ce=[];return db['User'][_0x8869('0x45')]({'where':{'role':['agent',_0x8869('0x55'),'user']},'attributes':['id','fullname',_0x8869('0x2a'),'role',_0x8869('0x56'),_0x8869('0x57'),_0x8869('0x58'),_0x8869('0x59'),_0x8869('0x5a'),_0x8869('0x5b')],'order':qs[_0x8869('0x3d')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x8869('0x5c'),'attributes':['id',_0x8869('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x8869('0x27')](function(_0x2e6947){if(_0x2e6947){var _0x261117=_0x3934c7[_0x8869('0x5d')][_0x8869('0x5e')]({'plain':!![]});if(!_0x261117)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x261117[_0x8869('0x5f')]===_0x8869('0x5d')){return db[_0x8869('0x60')][_0x8869('0x4a')]({'where':{'name':_0x8869('0x61'),'userProfileId':_0x261117['userProfileId']},'raw':!![]})['then'](function(_0x35ba9f){if(_0x35ba9f){if(_0x35ba9f[_0x8869('0x62')]===0x0){return db[_0x8869('0x63')][_0x8869('0x45')]({'where':{'sectionId':_0x35ba9f['id']},'raw':!![]})[_0x8869('0x27')](function(_0x3e7b50){var _0xcde4a7=[];if(_[_0x8869('0x64')](_0x3e7b50)){_0xcde4a7=_[_0x8869('0x40')](_0x2e6947,function(_0x3d4884){if(_0x3d4884['role']!==_0x8869('0x65')){return _0x3d4884;}});return _0xcde4a7;}else{for(var _0x151c73=0x0;_0x151c73<_0x2e6947[_0x8869('0x39')];_0x151c73++){var _0x3fb6df=_0x2e6947[_0x151c73];if(_0x3fb6df[_0x8869('0x5f')]===_0x8869('0x65')){var _0xf57140=_[_0x8869('0x4a')](_0x3e7b50,function(_0x350815){return _0x350815[_0x8869('0x66')]===_0x3fb6df['id'];});if(_0xf57140)_0xcde4a7[_0x8869('0x67')](_0x3fb6df);}else{_0xcde4a7[_0x8869('0x67')](_0x3fb6df);}}return _0xcde4a7;}});}else{return _0x2e6947;}}else{var _0x4ddeb7=_[_0x8869('0x40')](_0x2e6947,function(_0x3a6842){if(_0x3a6842[_0x8869('0x5f')]!==_0x8869('0x65')){return _0x3a6842;}});return _0x4ddeb7;}});}else{return _0x2e6947;}}})[_0x8869('0x27')](function(_0x4425b7){var _0xac1b46=[];if(_0x4425b7){_0x1335ce=_0x4425b7;for(var _0x31e65c=0x0;_0x31e65c<_0x4425b7[_0x8869('0x39')];_0x31e65c+=0x1){_0x1335ce[_0x31e65c][_0x8869('0x4f')]=[];_0xac1b46[_0x8869('0x67')](db['ChatInternalMessage'][_0x8869('0x4a')]({'where':{'FromId':[_0x3934c7[_0x8869('0x5d')]['id'],_0x4425b7[_0x31e65c]['id']],'ToId':[_0x3934c7['user']['id'],_0x4425b7[_0x31e65c]['id']],'ChatGroupId':null},'attributes':['id',_0x8869('0x51'),'FromId',_0x8869('0x68'),_0x8869('0x69'),'body'],'order':qs[_0x8869('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8869('0x27')](wrapUser(_0x4425b7[_0x31e65c])));}return BPromise[_0x8869('0x6a')](_0xac1b46);}return[];})['then'](function(_0x25cbf3){return{'rows':_0x25cbf3,'count':_0x25cbf3[_0x8869('0x39')]};})[_0x8869('0x27')](respondWithResult(_0x15b48d,null))['catch'](handleError(_0x15b48d,null));};
\ No newline at end of file
+var _0x89cf=['userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','agent','resourceId','push','messages','createdAt','FromId','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','ChatInternalMessage','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','params','includeAll','find','catch','create','body','describe','lastMessage','lastMessageAt','admin','user','fullname','role'];(function(_0x25abbe,_0x53b462){var _0x55c770=function(_0x164dbf){while(--_0x164dbf){_0x25abbe['push'](_0x25abbe['shift']());}};_0x55c770(++_0x53b462);}(_0x89cf,0x7b));var _0xf89c=function(_0x1f6b53,_0xfff811){_0x1f6b53=_0x1f6b53-0x0;var _0x248627=_0x89cf[_0x1f6b53];return _0x248627;};'use strict';var emlformat=require(_0xf89c('0x0'));var rimraf=require(_0xf89c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf89c('0x2'));var rp=require('request-promise');var moment=require(_0xf89c('0x3'));var BPromise=require(_0xf89c('0x4'));var Mustache=require('mustache');var util=require(_0xf89c('0x5'));var path=require(_0xf89c('0x6'));var sox=require('sox');var csv=require(_0xf89c('0x7'));var ejs=require(_0xf89c('0x8'));var fs=require('fs');var fs_extra=require(_0xf89c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf89c('0xa'));var deskjs=require(_0xf89c('0xb'));var toCsv=require(_0xf89c('0x7'));var querystring=require(_0xf89c('0xc'));var Papa=require(_0xf89c('0xd'));var Redis=require(_0xf89c('0xe'));var authService=require(_0xf89c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf89c('0x10'));var logger=require(_0xf89c('0x11'))(_0xf89c('0x12'));var utils=require(_0xf89c('0x13'));var config=require(_0xf89c('0x14'));var licenseUtil=require(_0xf89c('0x15'));var db=require(_0xf89c('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xf89c('0x17'),'port':0x18eb});var socket=require(_0xf89c('0x18'))(new Redis(config[_0xf89c('0x19')]));require(_0xf89c('0x1a'))[_0xf89c('0x1b')](socket);function respondWithStatusCode(_0x34f8bf,_0x2446c5){_0x2446c5=_0x2446c5||0xcc;return function(_0x2240e1){if(_0x2240e1){return _0x34f8bf[_0xf89c('0x1c')](_0x2446c5);}return _0x34f8bf[_0xf89c('0x1d')](_0x2446c5)[_0xf89c('0x1e')]();};}function respondWithResult(_0x128cb0,_0x133848){_0x133848=_0x133848||0xc8;return function(_0xf15450){if(_0xf15450){return _0x128cb0[_0xf89c('0x1d')](_0x133848)[_0xf89c('0x1f')](_0xf15450);}};}function respondWithFilteredResult(_0x4d1412,_0x5ec42f){return function(_0x5501ed){if(_0x5501ed){var _0x436213=typeof _0x5ec42f[_0xf89c('0x20')]===_0xf89c('0x21')&&typeof _0x5ec42f[_0xf89c('0x22')]===_0xf89c('0x21');var _0x38137f=_0x5501ed[_0xf89c('0x23')];var _0x1976a1=_0x436213?0x0:_0x5ec42f[_0xf89c('0x20')];var _0x214e35=_0x436213?_0x5501ed[_0xf89c('0x23')]:_0x5ec42f[_0xf89c('0x20')]+_0x5ec42f[_0xf89c('0x22')];var _0x3f62ad;if(_0x214e35>=_0x38137f){_0x214e35=_0x38137f;_0x3f62ad=0xc8;}else{_0x3f62ad=0xce;}_0x4d1412[_0xf89c('0x1d')](_0x3f62ad);return _0x4d1412[_0xf89c('0x24')](_0xf89c('0x25'),_0x1976a1+'-'+_0x214e35+'/'+_0x38137f)[_0xf89c('0x1f')](_0x5501ed);}return null;};}function patchUpdates(_0x5d83b5){return function(_0x6861e8){try{jsonpatch[_0xf89c('0x26')](_0x6861e8,_0x5d83b5,!![]);}catch(_0x312bd4){return BPromise[_0xf89c('0x27')](_0x312bd4);}return _0x6861e8[_0xf89c('0x28')]();};}function saveUpdates(_0x3d8390,_0x36378f){return function(_0x30a4c8){if(_0x30a4c8){return _0x30a4c8[_0xf89c('0x29')](_0x3d8390)[_0xf89c('0x2a')](function(_0x176ec4){return _0x176ec4;});}return null;};}function removeEntity(_0x4c158d,_0x2bb797){return function(_0xdff54c){if(_0xdff54c){return _0xdff54c[_0xf89c('0x2b')]()[_0xf89c('0x2a')](function(){_0x4c158d[_0xf89c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380b72,_0x228999){return function(_0x53f4ac){if(!_0x53f4ac){_0x380b72[_0xf89c('0x1c')](0x194);}return _0x53f4ac;};}function handleError(_0x601f93,_0x63762c){_0x63762c=_0x63762c||0x1f4;return function(_0xb832cf){logger['error'](_0xb832cf['stack']);if(_0xb832cf[_0xf89c('0x2c')]){delete _0xb832cf[_0xf89c('0x2c')];}_0x601f93[_0xf89c('0x1d')](_0x63762c)[_0xf89c('0x2d')](_0xb832cf);};}exports['index']=function(_0x4a4382,_0x5ecf66){var _0x333a64={},_0x301b17={},_0x124df9={'count':0x0,'rows':[]};var _0x2224ff=_['map'](db[_0xf89c('0x2e')][_0xf89c('0x2f')],function(_0x35937b){return{'name':_0x35937b['fieldName'],'type':_0x35937b[_0xf89c('0x30')][_0xf89c('0x31')]};});_0x301b17[_0xf89c('0x32')]=_['map'](_0x2224ff,_0xf89c('0x2c'));_0x301b17[_0xf89c('0x33')]=_[_0xf89c('0x34')](_0x4a4382[_0xf89c('0x33')]);_0x301b17['filters']=_['intersection'](_0x301b17['model'],_0x301b17[_0xf89c('0x33')]);_0x333a64[_0xf89c('0x35')]=_[_0xf89c('0x36')](_0x301b17[_0xf89c('0x32')],qs[_0xf89c('0x37')](_0x4a4382[_0xf89c('0x33')][_0xf89c('0x37')]));_0x333a64[_0xf89c('0x35')]=_0x333a64[_0xf89c('0x35')][_0xf89c('0x38')]?_0x333a64[_0xf89c('0x35')]:_0x301b17['model'];if(!_0x4a4382['query'][_0xf89c('0x39')](_0xf89c('0x3a'))){_0x333a64[_0xf89c('0x22')]=qs['limit'](_0x4a4382[_0xf89c('0x33')][_0xf89c('0x22')]);_0x333a64[_0xf89c('0x20')]=qs['offset'](_0x4a4382['query']['offset']);}_0x333a64[_0xf89c('0x3b')]=qs[_0xf89c('0x3c')](_0x4a4382[_0xf89c('0x33')][_0xf89c('0x3c')]);_0x333a64['where']=qs[_0xf89c('0x3d')](_[_0xf89c('0x3e')](_0x4a4382[_0xf89c('0x33')],_0x301b17[_0xf89c('0x3d')]),_0x2224ff);if(_0x4a4382[_0xf89c('0x33')][_0xf89c('0x3f')]){_0x333a64[_0xf89c('0x40')]=_[_0xf89c('0x41')](_0x333a64[_0xf89c('0x40')],{'$or':_[_0xf89c('0x42')](_0x2224ff,function(_0x27a1b3){if(_0x27a1b3[_0xf89c('0x30')]!==_0xf89c('0x43')){var _0x1b510f={};_0x1b510f[_0x27a1b3[_0xf89c('0x2c')]]={'$like':'%'+_0x4a4382[_0xf89c('0x33')][_0xf89c('0x3f')]+'%'};return _0x1b510f;}})});}_0x333a64=_[_0xf89c('0x41')]({},_0x333a64,_0x4a4382[_0xf89c('0x44')]);var _0x1a0582={'where':_0x333a64[_0xf89c('0x40')]};return db['ChatInternalMessage']['count'](_0x1a0582)['then'](function(_0x4c6060){_0x124df9[_0xf89c('0x23')]=_0x4c6060;if(_0x4a4382['query']['includeAll']){_0x333a64[_0xf89c('0x45')]=[{'all':!![]}];}return db[_0xf89c('0x2e')][_0xf89c('0x46')](_0x333a64);})[_0xf89c('0x2a')](function(_0x4e9829){_0x124df9[_0xf89c('0x47')]=_0x4e9829;return _0x124df9;})[_0xf89c('0x2a')](respondWithFilteredResult(_0x5ecf66,_0x333a64))['catch'](handleError(_0x5ecf66,null));};exports['show']=function(_0x377dd2,_0x2d01e1){var _0x463f20={'raw':!![],'where':{'id':_0x377dd2[_0xf89c('0x48')]['id']}},_0x12ec73={};_0x12ec73[_0xf89c('0x32')]=_['keys'](db['ChatInternalMessage'][_0xf89c('0x2f')]);_0x12ec73['query']=_[_0xf89c('0x34')](_0x377dd2[_0xf89c('0x33')]);_0x12ec73[_0xf89c('0x3d')]=_['intersection'](_0x12ec73[_0xf89c('0x32')],_0x12ec73['query']);_0x463f20[_0xf89c('0x35')]=_[_0xf89c('0x36')](_0x12ec73[_0xf89c('0x32')],qs[_0xf89c('0x37')](_0x377dd2[_0xf89c('0x33')]['fields']));_0x463f20[_0xf89c('0x35')]=_0x463f20[_0xf89c('0x35')]['length']?_0x463f20[_0xf89c('0x35')]:_0x12ec73['model'];if(_0x377dd2[_0xf89c('0x33')][_0xf89c('0x49')]){_0x463f20['include']=[{'all':!![]}];}_0x463f20=_[_0xf89c('0x41')]({},_0x463f20,_0x377dd2['options']);return db[_0xf89c('0x2e')][_0xf89c('0x4a')](_0x463f20)['then'](handleEntityNotFound(_0x2d01e1,null))[_0xf89c('0x2a')](respondWithResult(_0x2d01e1,null))[_0xf89c('0x4b')](handleError(_0x2d01e1,null));};exports['create']=function(_0x2295a9,_0x550966){return db[_0xf89c('0x2e')][_0xf89c('0x4c')](_0x2295a9[_0xf89c('0x4d')],{})[_0xf89c('0x2a')](respondWithResult(_0x550966,0xc9))[_0xf89c('0x4b')](handleError(_0x550966,null));};exports[_0xf89c('0x29')]=function(_0x3091ba,_0xe166a0){if(_0x3091ba[_0xf89c('0x4d')]['id']){delete _0x3091ba[_0xf89c('0x4d')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x3091ba[_0xf89c('0x48')]['id']}})['then'](handleEntityNotFound(_0xe166a0,null))['then'](saveUpdates(_0x3091ba[_0xf89c('0x4d')],null))[_0xf89c('0x2a')](respondWithResult(_0xe166a0,null))[_0xf89c('0x4b')](handleError(_0xe166a0,null));};exports[_0xf89c('0x2b')]=function(_0xe144bd,_0x1db3f9){return db[_0xf89c('0x2e')][_0xf89c('0x4a')]({'where':{'id':_0xe144bd['params']['id']}})['then'](handleEntityNotFound(_0x1db3f9,null))[_0xf89c('0x2a')](removeEntity(_0x1db3f9,null))[_0xf89c('0x4b')](handleError(_0x1db3f9,null));};exports[_0xf89c('0x4e')]=function(_0x2ca16d,_0x429dfe){return db['ChatInternalMessage'][_0xf89c('0x4e')]()['then'](respondWithResult(_0x429dfe,null))['catch'](handleError(_0x429dfe,null));};function wrapUser(_0x5677b2){return function(_0x2da42a){var _0x3aaa4f=_0x5677b2['get']({'plain':!![]});_0x3aaa4f['messages']=[];if(_0x2da42a){_0x3aaa4f['lastMessageAt']=_0x2da42a['createdAt'];_0x3aaa4f[_0xf89c('0x4f')]=_0x2da42a;}else{_0x3aaa4f[_0xf89c('0x50')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3aaa4f[_0xf89c('0x4f')]={};}return _0x3aaa4f;};}exports['getUsers']=function(_0x39720e,_0x3e06be,_0x545932){var _0x4a8a3d=[];return db['User'][_0xf89c('0x46')]({'where':{'role':['agent',_0xf89c('0x51'),_0xf89c('0x52')]},'attributes':['id',_0xf89c('0x53'),_0xf89c('0x2c'),_0xf89c('0x54'),_0xf89c('0x55'),_0xf89c('0x56'),_0xf89c('0x57'),'lastLoginAt','allowmessenger',_0xf89c('0x58')],'order':qs[_0xf89c('0x3c')](_0xf89c('0x59')),'include':[{'model':db[_0xf89c('0x5a')],'as':_0xf89c('0x5b'),'attributes':['id',_0xf89c('0x2c'),_0xf89c('0x30')],'through':{'attributes':[]}}]})[_0xf89c('0x2a')](function(_0xbdccec){if(_0xbdccec){var _0x47c6b0=_0x39720e['user']['get']({'plain':!![]});if(!_0x47c6b0)throw new Error(_0xf89c('0x5c'));if(_0x47c6b0[_0xf89c('0x54')]===_0xf89c('0x52')){return db[_0xf89c('0x5d')][_0xf89c('0x4a')]({'where':{'name':'Agents','userProfileId':_0x47c6b0[_0xf89c('0x5e')]},'raw':!![]})[_0xf89c('0x2a')](function(_0x4b978e){if(_0x4b978e){if(_0x4b978e['autoAssociation']===0x0){return db[_0xf89c('0x5f')]['findAll']({'where':{'sectionId':_0x4b978e['id']},'raw':!![]})[_0xf89c('0x2a')](function(_0x415c2e){var _0x5b368d=[];if(_['isEmpty'](_0x415c2e)){_0x5b368d=_[_0xf89c('0x3f')](_0xbdccec,function(_0x15a758){if(_0x15a758['role']!==_0xf89c('0x60')){return _0x15a758;}});return _0x5b368d;}else{for(var _0x351b87=0x0;_0x351b87<_0xbdccec[_0xf89c('0x38')];_0x351b87++){var _0x20f038=_0xbdccec[_0x351b87];if(_0x20f038[_0xf89c('0x54')]==='agent'){var _0x48c4f7=_[_0xf89c('0x4a')](_0x415c2e,function(_0x2017a5){return _0x2017a5[_0xf89c('0x61')]===_0x20f038['id'];});if(_0x48c4f7)_0x5b368d[_0xf89c('0x62')](_0x20f038);}else{_0x5b368d[_0xf89c('0x62')](_0x20f038);}}return _0x5b368d;}});}else{return _0xbdccec;}}else{var _0x30ca4b=_[_0xf89c('0x3f')](_0xbdccec,function(_0x84f090){if(_0x84f090[_0xf89c('0x54')]!==_0xf89c('0x60')){return _0x84f090;}});return _0x30ca4b;}});}else{return _0xbdccec;}}})[_0xf89c('0x2a')](function(_0x35c493){var _0x23c377=[];if(_0x35c493){_0x4a8a3d=_0x35c493;for(var _0x3dcee1=0x0;_0x3dcee1<_0x35c493['length'];_0x3dcee1+=0x1){_0x4a8a3d[_0x3dcee1][_0xf89c('0x63')]=[];_0x23c377[_0xf89c('0x62')](db[_0xf89c('0x2e')][_0xf89c('0x4a')]({'where':{'FromId':[_0x39720e[_0xf89c('0x52')]['id'],_0x35c493[_0x3dcee1]['id']],'ToId':[_0x39720e[_0xf89c('0x52')]['id'],_0x35c493[_0x3dcee1]['id']],'ChatGroupId':null},'attributes':['id',_0xf89c('0x64'),_0xf89c('0x65'),'ToId','read',_0xf89c('0x4d')],'order':qs[_0xf89c('0x3c')](_0xf89c('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x35c493[_0x3dcee1])));}return BPromise[_0xf89c('0x67')](_0x23c377);}return[];})[_0xf89c('0x2a')](function(_0x351e08){return{'rows':_0x351e08,'count':_0x351e08['length']};})['then'](respondWithResult(_0x3e06be,null))[_0xf89c('0x4b')](handleError(_0x3e06be,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 036a256..aa95e8e 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 _0xf873=['events','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x456ce1,_0x5bef34){var _0x5b3a7f=function(_0x118465){while(--_0x118465){_0x456ce1['push'](_0x456ce1['shift']());}};_0x5b3a7f(++_0x5bef34);}(_0xf873,0x178));var _0x3f87=function(_0x592b9e,_0x2d882a){_0x592b9e=_0x592b9e-0x0;var _0x3ec6ac=_0xf873[_0x592b9e];return _0x3ec6ac;};'use strict';var EventEmitter=require(_0x3f87('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x3f87('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3f87('0x2')](0x0);var events={'afterCreate':_0x3f87('0x3'),'afterUpdate':'update','afterDestroy':_0x3f87('0x4')};function emitEvent(_0x1324a7){return function(_0x44b3c3,_0x32e82d,_0x394849){ChatInternalMessageEvents[_0x3f87('0x5')](_0x1324a7+':'+_0x44b3c3['id'],_0x44b3c3);ChatInternalMessageEvents['emit'](_0x1324a7,_0x44b3c3);_0x394849(null);};}for(var e in events){if(events[_0x3f87('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3f87('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe7e1=['setMaxListeners','save','remove','emit','events','../../mysqldb','ChatInternalMessage'];(function(_0x9035a,_0x1c1624){var _0x193d40=function(_0x660e1e){while(--_0x660e1e){_0x9035a['push'](_0x9035a['shift']());}};_0x193d40(++_0x1c1624);}(_0xe7e1,0x185));var _0x1e7e=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xe7e1[_0x45b034];return _0x509cb0;};'use strict';var EventEmitter=require(_0x1e7e('0x0'));var ChatInternalMessage=require(_0x1e7e('0x1'))['db'][_0x1e7e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1e7e('0x3')](0x0);var events={'afterCreate':_0x1e7e('0x4'),'afterUpdate':'update','afterDestroy':_0x1e7e('0x5')};function emitEvent(_0x59a86d){return function(_0x122f22,_0x3caffb,_0x2bc43a){ChatInternalMessageEvents[_0x1e7e('0x6')](_0x59a86d+':'+_0x122f22['id'],_0x122f22);ChatInternalMessageEvents[_0x1e7e('0x6')](_0x59a86d,_0x122f22);_0x2bc43a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index fb97c8e..30ee538 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 _0x7dab=['../../config/logger','api','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7dab,0x102));var _0xb7da=function(_0x2c9eea,_0x5abda0){_0x2c9eea=_0x2c9eea-0x0;var _0x309090=_0x7dab[_0x2c9eea];return _0x309090;};'use strict';var _=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var logger=require(_0xb7da('0x2'))(_0xb7da('0x3'));var moment=require('moment');var BPromise=require(_0xb7da('0x4'));var rp=require(_0xb7da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7da('0x6'));var attributes=require(_0xb7da('0x7'));module[_0xb7da('0x8')]=function(_0x36f359,_0x5e8cc5){return _0x36f359[_0xb7da('0x9')](_0xb7da('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb7da('0xb'),'collate':_0xb7da('0xc')});};
\ No newline at end of file
+var _0xfd91=['ChatInternalMessage','chat_internal_messages','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes','define'];(function(_0x5111bf,_0x5a1f92){var _0xeabd97=function(_0x55e865){while(--_0x55e865){_0x5111bf['push'](_0x5111bf['shift']());}};_0xeabd97(++_0x5a1f92);}(_0xfd91,0x1db));var _0x1fd9=function(_0x57bb28,_0x3d6d4a){_0x57bb28=_0x57bb28-0x0;var _0x4d26a4=_0xfd91[_0x57bb28];return _0x4d26a4;};'use strict';var _=require('lodash');var util=require(_0x1fd9('0x0'));var logger=require(_0x1fd9('0x1'))(_0x1fd9('0x2'));var moment=require(_0x1fd9('0x3'));var BPromise=require(_0x1fd9('0x4'));var rp=require(_0x1fd9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fd9('0x6'));var config=require('../../config/environment');var attributes=require(_0x1fd9('0x7'));module['exports']=function(_0x461d8c,_0x4f19da){return _0x461d8c[_0x1fd9('0x8')](_0x1fd9('0x9'),attributes,{'tableName':_0x1fd9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 3e775f2..ebad29d 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 _0x2aef=['../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2c8b50,_0x23a0d2){var _0x342eb2=function(_0x27df6e){while(--_0x27df6e){_0x2c8b50['push'](_0x2c8b50['shift']());}};_0x342eb2(++_0x23a0d2);}(_0x2aef,0x122));var _0xf2ae=function(_0x227dd3,_0x3f3428){_0x227dd3=_0x227dd3-0x0;var _0x4a595e=_0x2aef[_0x227dd3];return _0x4a595e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf2ae('0x0'));var rs=require(_0xf2ae('0x1'));var fs=require('fs');var Redis=require(_0xf2ae('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2ae('0x3'));var logger=require(_0xf2ae('0x4'))('rpc');var config=require(_0xf2ae('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf2ae('0x6')][_0xf2ae('0x7')]({'port':0x232a});config['redis']=_[_0xf2ae('0x8')](config[_0xf2ae('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2ae('0xa'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x257c86,_0x143a8c,_0x401f26){return new BPromise(function(_0x50f544,_0xdcaf7a){return client['request'](_0x257c86,_0x401f26)['then'](function(_0x79e05e){logger[_0xf2ae('0xb')]('ChatInternalMessage,\x20%s,\x20%s',_0x143a8c,_0xf2ae('0xc'));logger[_0xf2ae('0xd')](_0xf2ae('0xe'),_0x143a8c,_0xf2ae('0xc'),JSON[_0xf2ae('0xf')](_0x79e05e));if(_0x79e05e['error']){if(_0x79e05e['error']['code']===0x1f4){logger[_0xf2ae('0x10')](_0xf2ae('0x11'),_0x143a8c,_0x79e05e[_0xf2ae('0x10')][_0xf2ae('0x12')]);return _0xdcaf7a(_0x79e05e[_0xf2ae('0x10')][_0xf2ae('0x12')]);}logger[_0xf2ae('0x10')](_0xf2ae('0x11'),_0x143a8c,_0x79e05e['error'][_0xf2ae('0x12')]);return _0x50f544(_0x79e05e[_0xf2ae('0x10')][_0xf2ae('0x12')]);}else{logger['info'](_0xf2ae('0x11'),_0x143a8c,'request\x20sent');_0x50f544(_0x79e05e[_0xf2ae('0x13')]['message']);}})[_0xf2ae('0x14')](function(_0x39d561){logger[_0xf2ae('0x10')](_0xf2ae('0x11'),_0x143a8c,_0x39d561);_0xdcaf7a(_0x39d561);});});}
\ No newline at end of file
+var _0xca41=['register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x3f5f3d,_0x2e38c5){var _0x455ffb=function(_0x28f837){while(--_0x28f837){_0x3f5f3d['push'](_0x3f5f3d['shift']());}};_0x455ffb(++_0x2e38c5);}(_0xca41,0xb5));var _0x1ca4=function(_0x5af0a2,_0x2b4a26){_0x5af0a2=_0x5af0a2-0x0;var _0x1419f6=_0xca41[_0x5af0a2];return _0x1419f6;};'use strict';var _=require(_0x1ca4('0x0'));var util=require(_0x1ca4('0x1'));var moment=require(_0x1ca4('0x2'));var BPromise=require(_0x1ca4('0x3'));var rs=require(_0x1ca4('0x4'));var fs=require('fs');var Redis=require(_0x1ca4('0x5'));var db=require(_0x1ca4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ca4('0x7'))(_0x1ca4('0x8'));var config=require(_0x1ca4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1ca4('0xa')]['http']({'port':0x232a});config[_0x1ca4('0xb')]=_[_0x1ca4('0xc')](config[_0x1ca4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ca4('0xd'))(new Redis(config[_0x1ca4('0xb')]));require(_0x1ca4('0xe'))[_0x1ca4('0xf')](socket);function respondWithRpcPromise(_0x31aa6c,_0x5aa247,_0x33c7b8){return new BPromise(function(_0x4e9dc7,_0x8e8bd8){return client[_0x1ca4('0x10')](_0x31aa6c,_0x33c7b8)[_0x1ca4('0x11')](function(_0x262344){logger[_0x1ca4('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x5aa247,_0x1ca4('0x13'));logger[_0x1ca4('0x14')](_0x1ca4('0x15'),_0x5aa247,_0x1ca4('0x13'),JSON['stringify'](_0x262344));if(_0x262344['error']){if(_0x262344[_0x1ca4('0x16')][_0x1ca4('0x17')]===0x1f4){logger[_0x1ca4('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x5aa247,_0x262344[_0x1ca4('0x16')]['message']);return _0x8e8bd8(_0x262344[_0x1ca4('0x16')][_0x1ca4('0x18')]);}logger[_0x1ca4('0x16')](_0x1ca4('0x19'),_0x5aa247,_0x262344[_0x1ca4('0x16')][_0x1ca4('0x18')]);return _0x4e9dc7(_0x262344[_0x1ca4('0x16')][_0x1ca4('0x18')]);}else{logger[_0x1ca4('0x12')](_0x1ca4('0x19'),_0x5aa247,_0x1ca4('0x13'));_0x4e9dc7(_0x262344[_0x1ca4('0x1a')][_0x1ca4('0x18')]);}})[_0x1ca4('0x1b')](function(_0x37d91a){logger[_0x1ca4('0x16')](_0x1ca4('0x19'),_0x5aa247,_0x37d91a);_0x8e8bd8(_0x37d91a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 8593606..49e9535 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 _0xfa50=['register','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener'];(function(_0x4cbc20,_0x115dc6){var _0x3f83f7=function(_0x133b98){while(--_0x133b98){_0x4cbc20['push'](_0x4cbc20['shift']());}};_0x3f83f7(++_0x115dc6);}(_0xfa50,0x1d7));var _0x0fa5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfa50[_0x321bb2];return _0x9c12ed;};'use strict';var ChatInternalMessageEvents=require(_0x0fa5('0x0'));var events=['save',_0x0fa5('0x1'),_0x0fa5('0x2')];function createListener(_0xcdfb05,_0x5a117e){return function(_0xb5ff0b){_0x5a117e[_0x0fa5('0x3')](_0xcdfb05,_0xb5ff0b);};}function removeListener(_0x4c4d4f,_0x364b1e){return function(){ChatInternalMessageEvents[_0x0fa5('0x4')](_0x4c4d4f,_0x364b1e);};}exports[_0x0fa5('0x5')]=function(_0x194313){for(var _0x3e4bbe=0x0,_0x44cf6a=events['length'];_0x3e4bbe<_0x44cf6a;_0x3e4bbe++){var _0x2e8e26=events[_0x3e4bbe];var _0x56b6ea=createListener(_0x0fa5('0x6')+_0x2e8e26,_0x194313);ChatInternalMessageEvents['on'](_0x2e8e26,_0x56b6ea);}};
\ No newline at end of file
+var _0x6df3=['update','emit','removeListener','length','save','remove'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x6df3,0xb2));var _0x36df=function(_0x32912e,_0x35b6ea){_0x32912e=_0x32912e-0x0;var _0x39500d=_0x6df3[_0x32912e];return _0x39500d;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x36df('0x0'),_0x36df('0x1'),_0x36df('0x2')];function createListener(_0x4885b9,_0x20e39f){return function(_0x5ab52b){_0x20e39f[_0x36df('0x3')](_0x4885b9,_0x5ab52b);};}function removeListener(_0x221289,_0x4322e8){return function(){ChatInternalMessageEvents[_0x36df('0x4')](_0x221289,_0x4322e8);};}exports['register']=function(_0x49d1eb){for(var _0x4af8bd=0x0,_0x3869b5=events[_0x36df('0x5')];_0x4af8bd<_0x3869b5;_0x4af8bd++){var _0x3702b6=events[_0x4af8bd];var _0x3f6d87=createListener('chatInternalMessage:'+_0x3702b6,_0x49d1eb);ChatInternalMessageEvents['on'](_0x3702b6,_0x3f6d87);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index c9d9963..22d189f 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 _0xec57=['getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users'];(function(_0x150355,_0x1ef719){var _0x42887b=function(_0xfd9450){while(--_0xfd9450){_0x150355['push'](_0x150355['shift']());}};_0x42887b(++_0x1ef719);}(_0xec57,0x87));var _0x7ec5=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0xec57[_0x340380];return _0x49ce1c;};'use strict';var multer=require(_0x7ec5('0x0'));var util=require(_0x7ec5('0x1'));var path=require(_0x7ec5('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ec5('0x3'));var router=express[_0x7ec5('0x4')]();var fs_extra=require(_0x7ec5('0x5'));var auth=require(_0x7ec5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ec5('0x7'));var controller=require(_0x7ec5('0x8'));router[_0x7ec5('0x9')]('/',auth[_0x7ec5('0xa')](),controller[_0x7ec5('0xb')]);router['get'](_0x7ec5('0xc'),auth[_0x7ec5('0xa')](),controller[_0x7ec5('0xd')]);router[_0x7ec5('0x9')](_0x7ec5('0xe'),auth[_0x7ec5('0xa')](),controller[_0x7ec5('0xf')]);router[_0x7ec5('0x9')](_0x7ec5('0x10'),auth[_0x7ec5('0xa')](),controller[_0x7ec5('0x11')]);router[_0x7ec5('0x12')]('/',auth['isAuthenticated'](),controller[_0x7ec5('0x13')]);router[_0x7ec5('0x14')]('/:id',controller[_0x7ec5('0x15')]);router[_0x7ec5('0x16')](_0x7ec5('0x10'),auth[_0x7ec5('0xa')](),controller[_0x7ec5('0x17')]);module[_0x7ec5('0x18')]=router;
\ No newline at end of file
+var _0xf1c9=['/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','getUsers'];(function(_0x2f568c,_0x298e5b){var _0x3135f7=function(_0x46df10){while(--_0x46df10){_0x2f568c['push'](_0x2f568c['shift']());}};_0x3135f7(++_0x298e5b);}(_0xf1c9,0xb1));var _0x9f1c=function(_0x2351d7,_0x3b1861){_0x2351d7=_0x2351d7-0x0;var _0x106340=_0xf1c9[_0x2351d7];return _0x106340;};'use strict';var multer=require(_0x9f1c('0x0'));var util=require(_0x9f1c('0x1'));var path=require(_0x9f1c('0x2'));var timeout=require(_0x9f1c('0x3'));var express=require(_0x9f1c('0x4'));var router=express[_0x9f1c('0x5')]();var fs_extra=require(_0x9f1c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9f1c('0x7'));var config=require('../../config/environment');var controller=require(_0x9f1c('0x8'));router[_0x9f1c('0x9')]('/',auth[_0x9f1c('0xa')](),controller['index']);router[_0x9f1c('0x9')](_0x9f1c('0xb'),auth[_0x9f1c('0xa')](),controller['describe']);router[_0x9f1c('0x9')]('/users',auth[_0x9f1c('0xa')](),controller[_0x9f1c('0xc')]);router[_0x9f1c('0x9')](_0x9f1c('0xd'),auth[_0x9f1c('0xa')](),controller[_0x9f1c('0xe')]);router['post']('/',auth[_0x9f1c('0xa')](),controller[_0x9f1c('0xf')]);router[_0x9f1c('0x10')](_0x9f1c('0xd'),controller['update']);router[_0x9f1c('0x11')](_0x9f1c('0xd'),auth['isAuthenticated'](),controller[_0x9f1c('0x12')]);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 70a2664..485ee29 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 _0x117c=['ENUM','out','DATE','STRING','TEXT','medium'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x117c,0x71));var _0xc117=function(_0x33481a,_0x5d4316){_0x33481a=_0x33481a-0x0;var _0x408ab9=_0x117c[_0x33481a];return _0x408ab9;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xc117('0x0')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc117('0x1')]('in',_0xc117('0x2')),'defaultValue':_0xc117('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc117('0x3')]},'providerName':{'type':Sequelize[_0xc117('0x4')]},'providerResponse':{'type':Sequelize[_0xc117('0x5')]}};
\ No newline at end of file
+var _0xdef9=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0xdef9,0x1ed));var _0x9def=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0xdef9[_0x37b3e5];return _0x207f20;};'use strict';var Sequelize=require(_0x9def('0x0'));module[_0x9def('0x1')]={'body':{'type':Sequelize[_0x9def('0x2')](_0x9def('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9def('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9def('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9def('0x5')]('in',_0x9def('0x6')),'defaultValue':_0x9def('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9def('0x7')]},'providerName':{'type':Sequelize[_0x9def('0x8')]},'providerResponse':{'type':Sequelize[_0x9def('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index c1e144d..c4ce79b 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 _0x862b=['intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','include','rows','show','length','body','find','params','describe','accept','acceptMessage','chat','user','UserId','get','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','fullname','email','interface','format','channel','motionChannel','event','EventManager','rejectmessage','parse','formData','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','set','Content-Range','update','then','destroy','end','sendStatus','send','index','ChatMessage','rawAttributes','key','model','name','query','keys'];(function(_0x2ccc71,_0x6b0352){var _0xb9fff2=function(_0xf6f69c){while(--_0xf6f69c){_0x2ccc71['push'](_0x2ccc71['shift']());}};_0xb9fff2(++_0x6b0352);}(_0x862b,0x9a));var _0xb862=function(_0xbe22c,_0x486191){_0xbe22c=_0xbe22c-0x0;var _0x31b9ee=_0x862b[_0xbe22c];return _0x31b9ee;};'use strict';var util=require(_0xb862('0x0'));var _=require(_0xb862('0x1'));var Redis=require(_0xb862('0x2'));var interactionService=require(_0xb862('0x3'));var qs=require(_0xb862('0x4'));var logger=require(_0xb862('0x5'))(_0xb862('0x6'));var config=require(_0xb862('0x7'));var db=require(_0xb862('0x8'))['db'];config[_0xb862('0x9')]=_['defaults'](config[_0xb862('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb862('0xa'))(new Redis(config[_0xb862('0x9')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xb862('0xb'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xb862('0xc')][_0xb862('0xd')]({'port':0x232a});var interaction_log=require(_0xb862('0x5'))('chat-interactions');function respondWithRpcPromise(_0x4d97dd,_0x5c31dd,_0x4a0785,_0x2366cb){return new Promise(function(_0x36c3dd,_0x10e950){var _0x534d5a=_0x2366cb||client;return _0x534d5a[_0xb862('0xe')](_0x4d97dd,_0x4a0785)['then'](function(_0x1809af){logger[_0xb862('0xf')]('ChatMessage,\x20%s,\x20%s',_0x5c31dd,_0xb862('0x10'));logger[_0xb862('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5c31dd,_0xb862('0x10'),JSON[_0xb862('0x12')](_0x1809af));if(_0x1809af['error']){if(_0x1809af[_0xb862('0x13')][_0xb862('0x14')]===0x1f4){logger[_0xb862('0x13')](_0xb862('0x15'),_0x5c31dd,_0x1809af[_0xb862('0x13')]['message']);return _0x10e950(_0x1809af[_0xb862('0x13')][_0xb862('0x16')]);}logger['error'](_0xb862('0x15'),_0x5c31dd,_0x1809af['error'][_0xb862('0x16')]);return _0x36c3dd(_0x1809af['error'][_0xb862('0x16')]);}else{logger[_0xb862('0xf')](_0xb862('0x15'),_0x5c31dd,_0xb862('0x10'));_0x36c3dd(_0x1809af[_0xb862('0x17')][_0xb862('0x16')]);}})[_0xb862('0x18')](function(_0x1c921c){logger[_0xb862('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5c31dd,_0x1c921c);_0x10e950(_0x1c921c);});});}function respondWithResult(_0x433cd3,_0x418da5){_0x418da5=_0x418da5||0xc8;return function(_0x224035){if(_0x224035){return _0x433cd3[_0xb862('0x19')](_0x418da5)[_0xb862('0x1a')](_0x224035);}};}function respondWithFilteredResult(_0x384ff5,_0x506356){return function(_0xe07bc3){if(_0xe07bc3){var _0x5e1400=typeof _0x506356[_0xb862('0x1b')]===_0xb862('0x1c')&&typeof _0x506356['limit']===_0xb862('0x1c');var _0x52643c=_0xe07bc3[_0xb862('0x1d')];var _0x2b5401=_0x5e1400?0x0:_0x506356['offset'];var _0x451050=_0x5e1400?_0xe07bc3['count']:_0x506356[_0xb862('0x1b')]+_0x506356['limit'];var _0x3dbac7;if(_0x451050>=_0x52643c){_0x451050=_0x52643c;_0x3dbac7=0xc8;}else{_0x3dbac7=0xce;}_0x384ff5['status'](_0x3dbac7);return _0x384ff5[_0xb862('0x1e')](_0xb862('0x1f'),_0x2b5401+'-'+_0x451050+'/'+_0x52643c)[_0xb862('0x1a')](_0xe07bc3);}return null;};}function saveUpdates(_0x2bd1c6){return function(_0x51de20){if(_0x51de20){return _0x51de20[_0xb862('0x20')](_0x2bd1c6)[_0xb862('0x21')](function(_0x26bdfb){return _0x26bdfb;});}return null;};}function removeEntity(_0x564eae){return function(_0x29c354){if(_0x29c354){return _0x29c354[_0xb862('0x22')]()[_0xb862('0x21')](function(){_0x564eae['status'](0xcc)[_0xb862('0x23')]();});}};}function handleEntityNotFound(_0x1224a5){return function(_0x433e6e){if(!_0x433e6e){_0x1224a5[_0xb862('0x24')](0x194);}return _0x433e6e;};}function handleError(_0x444c24,_0x551c7b){_0x551c7b=_0x551c7b||0x1f4;return function(_0x5c4401){logger[_0xb862('0x13')](_0x5c4401['stack']);if(_0x5c4401['name']){delete _0x5c4401['name'];}_0x444c24[_0xb862('0x19')](_0x551c7b)[_0xb862('0x25')](_0x5c4401);};}exports[_0xb862('0x26')]=function(_0x188973,_0x1cb98d){var _0x1eef3d={},_0x2699ef={},_0x36a2e1={'count':0x0,'rows':[]};var _0x5a2644=_['map'](db[_0xb862('0x27')][_0xb862('0x28')],function(_0x1ddf2c){return{'name':_0x1ddf2c['fieldName'],'type':_0x1ddf2c['type'][_0xb862('0x29')]};});_0x2699ef[_0xb862('0x2a')]=_['map'](_0x5a2644,_0xb862('0x2b'));_0x2699ef[_0xb862('0x2c')]=_[_0xb862('0x2d')](_0x188973[_0xb862('0x2c')]);_0x2699ef['filters']=_[_0xb862('0x2e')](_0x2699ef[_0xb862('0x2a')],_0x2699ef[_0xb862('0x2c')]);_0x1eef3d[_0xb862('0x2f')]=_['intersection'](_0x2699ef['model'],qs[_0xb862('0x30')](_0x188973[_0xb862('0x2c')][_0xb862('0x30')]));_0x1eef3d[_0xb862('0x2f')]=_0x1eef3d[_0xb862('0x2f')]['length']?_0x1eef3d[_0xb862('0x2f')]:_0x2699ef[_0xb862('0x2a')];if(!_0x188973[_0xb862('0x2c')][_0xb862('0x31')]('nolimit')){_0x1eef3d[_0xb862('0x32')]=qs[_0xb862('0x32')](_0x188973['query'][_0xb862('0x32')]);_0x1eef3d[_0xb862('0x1b')]=qs[_0xb862('0x1b')](_0x188973[_0xb862('0x2c')]['offset']);}_0x1eef3d[_0xb862('0x33')]=qs[_0xb862('0x34')](_0x188973['query']['sort']);_0x1eef3d[_0xb862('0x35')]=qs[_0xb862('0x36')](_[_0xb862('0x37')](_0x188973[_0xb862('0x2c')],_0x2699ef[_0xb862('0x36')]),_0x5a2644);if(_0x188973[_0xb862('0x2c')][_0xb862('0x38')]){_0x1eef3d[_0xb862('0x35')]=_['merge'](_0x1eef3d['where'],{'$or':_[_0xb862('0x39')](_0x5a2644,function(_0x18f3e0){if(_0x18f3e0['type']!==_0xb862('0x3a')){var _0x41f6a5={};_0x41f6a5[_0x18f3e0[_0xb862('0x2b')]]={'$like':'%'+_0x188973[_0xb862('0x2c')][_0xb862('0x38')]+'%'};return _0x41f6a5;}})});}_0x1eef3d=_[_0xb862('0x3b')]({},_0x1eef3d,_0x188973[_0xb862('0x3c')]);var _0x2724b1={'where':_0x1eef3d[_0xb862('0x35')]};return db[_0xb862('0x27')]['count'](_0x2724b1)[_0xb862('0x21')](function(_0x2e0a30){_0x36a2e1[_0xb862('0x1d')]=_0x2e0a30;if(_0x188973[_0xb862('0x2c')]['includeAll']){_0x1eef3d[_0xb862('0x3d')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1eef3d);})['then'](function(_0x8954f9){_0x36a2e1[_0xb862('0x3e')]=_0x8954f9;return _0x36a2e1;})[_0xb862('0x21')](respondWithFilteredResult(_0x1cb98d,_0x1eef3d))[_0xb862('0x18')](handleError(_0x1cb98d,null));};exports[_0xb862('0x3f')]=function(_0x505f42,_0x57e6bd){var _0x202339={'raw':!![],'where':{'id':_0x505f42['params']['id']}},_0x2b966f={};_0x2b966f['model']=_[_0xb862('0x2d')](db[_0xb862('0x27')][_0xb862('0x28')]);_0x2b966f[_0xb862('0x2c')]=_[_0xb862('0x2d')](_0x505f42[_0xb862('0x2c')]);_0x2b966f[_0xb862('0x36')]=_[_0xb862('0x2e')](_0x2b966f[_0xb862('0x2a')],_0x2b966f[_0xb862('0x2c')]);_0x202339[_0xb862('0x2f')]=_[_0xb862('0x2e')](_0x2b966f[_0xb862('0x2a')],qs[_0xb862('0x30')](_0x505f42['query'][_0xb862('0x30')]));_0x202339['attributes']=_0x202339[_0xb862('0x2f')][_0xb862('0x40')]?_0x202339[_0xb862('0x2f')]:_0x2b966f[_0xb862('0x2a')];if(_0x505f42['query']['includeAll']){_0x202339[_0xb862('0x3d')]=[{'all':!![]}];}_0x202339=_['merge']({},_0x202339,_0x505f42[_0xb862('0x3c')]);return db[_0xb862('0x27')]['find'](_0x202339)['then'](handleEntityNotFound(_0x57e6bd,null))[_0xb862('0x21')](respondWithResult(_0x57e6bd,null))[_0xb862('0x18')](handleError(_0x57e6bd,null));};exports['create']=function(_0x49acce,_0x1cad79){return db[_0xb862('0x27')]['create'](_0x49acce[_0xb862('0x41')],{})[_0xb862('0x21')](respondWithResult(_0x1cad79,0xc9))[_0xb862('0x18')](handleError(_0x1cad79,null));};exports[_0xb862('0x20')]=function(_0x19e199,_0x147c79){if(_0x19e199[_0xb862('0x41')]['id']){delete _0x19e199['body']['id'];}return db['ChatMessage'][_0xb862('0x42')]({'where':{'id':_0x19e199['params']['id']}})['then'](handleEntityNotFound(_0x147c79,null))[_0xb862('0x21')](saveUpdates(_0x19e199[_0xb862('0x41')],null))['then'](respondWithResult(_0x147c79,null))[_0xb862('0x18')](handleError(_0x147c79,null));};exports[_0xb862('0x22')]=function(_0x53e67a,_0x5af744){return db['ChatMessage'][_0xb862('0x42')]({'where':{'id':_0x53e67a[_0xb862('0x43')]['id']}})[_0xb862('0x21')](handleEntityNotFound(_0x5af744,null))[_0xb862('0x21')](removeEntity(_0x5af744,null))[_0xb862('0x18')](handleError(_0x5af744,null));};exports['describe']=function(_0x4e2160,_0x59da84){return db['ChatMessage'][_0xb862('0x44')]()['then'](respondWithResult(_0x59da84,null))[_0xb862('0x18')](handleError(_0x59da84,null));};exports[_0xb862('0x45')]=function(_0x2c17ef,_0x2327b0){var _0x1d0a8c='chat';return interactionService[_0xb862('0x46')](_0x2c17ef,_0x1d0a8c)[_0xb862('0x21')](respondWithResult(_0x2327b0,null))[_0xb862('0x18')](handleError(_0x2327b0,null));};exports['reject']=function(_0x53b0a7,_0x554736){var _0x17c5e9={'agent':{},'channel':_0xb862('0x47')};if(_0x53b0a7[_0xb862('0x41')]['id']){delete _0x53b0a7[_0xb862('0x41')]['id'];}_0x53b0a7['body']['UserId']=_0x53b0a7[_0xb862('0x41')]['UserId']||_0x53b0a7[_0xb862('0x48')]['id'];_0x17c5e9['agent']['id']=_0x53b0a7[_0xb862('0x41')][_0xb862('0x49')];return db['ChatMessage']['find']({'where':{'id':_0x53b0a7['params']['id'],'UserId':null}})[_0xb862('0x21')](handleEntityNotFound(_0x554736,null))['then'](function(_0x3831c3){if(_0x3831c3){_0x17c5e9[_0xb862('0x16')]=_0x3831c3[_0xb862('0x4a')]({'plain':!![]});return db[_0xb862('0x4b')]['find']({'where':{'id':_0x3831c3[_0xb862('0x4c')]}});}return null;})['then'](handleEntityNotFound(_0x554736,null))[_0xb862('0x21')](function(_0x26713f){if(_0x26713f){_0x17c5e9['interaction']=_0x26713f[_0xb862('0x4a')]({'plain':!![]});interaction_log['info'](_0xb862('0x4d'),_0x53b0a7[_0xb862('0x48')]['id'],_0x53b0a7[_0xb862('0x48')][_0xb862('0x2b')],_0x53b0a7[_0xb862('0x48')]['role'],_0x17c5e9[_0xb862('0x4e')]['id'],_0x53b0a7['body']?JSON[_0xb862('0x12')](_0x53b0a7[_0xb862('0x41')]):_0xb862('0x4f'));return respondWithRpcPromise(_0xb862('0x50'),_0xb862('0x51'),_0x17c5e9);}return null;})[_0xb862('0x21')](function(_0x140811){var _0x3d400b=_0xb862('0x52')+_0x140811[_0xb862('0x16')][_0xb862('0x53')];return db['sequelize'][_0xb862('0x2c')](_0x3d400b,{'type':db[_0xb862('0x54')]['QueryTypes'][_0xb862('0x55')],'raw':!![]})[_0xb862('0x21')](function(_0x1bd2a2){return _0x1bd2a2;});})['then'](function(_0xf00d37){if(_0xf00d37){_0x17c5e9[_0xb862('0x16')][_0xb862('0x56')]=_0xf00d37[0x0];if(!_0x53b0a7[_0xb862('0x41')][_0xb862('0x49')])return;return db[_0xb862('0x57')][_0xb862('0x42')]({'where':{'id':_0x53b0a7['body'][_0xb862('0x49')],'role':_0xb862('0x58')},'attributes':['id','name',_0xb862('0x59'),_0xb862('0x5a'),'internal'],'raw':!![]});}return null;})[_0xb862('0x21')](function(_0x524d50){if(!_0x524d50)return null;_0x17c5e9[_0xb862('0x16')][_0xb862('0x58')]=_0x524d50;return _0x17c5e9;})[_0xb862('0x21')](function(_0x547859){if(_0x547859){_0x547859['message'][_0xb862('0x5b')]=util[_0xb862('0x5c')]('SIP/%s',_0x53b0a7[_0xb862('0x48')][_0xb862('0x2b')]);_0x547859['message'][_0xb862('0x5d')]=_0x17c5e9['channel'];_0x547859[_0xb862('0x16')][_0xb862('0x5e')]=_0x17c5e9[_0xb862('0x5d')];_0x547859[_0xb862('0x16')][_0xb862('0x5f')]='reject';respondWithRpcPromise('EventManager',_0xb862('0x60'),{'event':_0xb862('0x61'),'message':_['merge'](_0x17c5e9[_0xb862('0x16')],JSON[_0xb862('0x62')](_0x17c5e9[_0xb862('0x4e')][_0xb862('0x63')]))},client9002);return _0x17c5e9;}return null;})['then'](respondWithResult(_0x554736,null))[_0xb862('0x18')](handleError(_0x554736,null));};
\ No newline at end of file
+var _0x3a68=['describe','reject','chat','UserId','user','agent','ChatInteraction','ChatInteractionId','interaction','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','interface','format','SIP/%s','channel','motionChannel','EventManager','rejectmessage','parse','formData','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','status','json','offset','undefined','limit','count','Content-Range','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','ChatMessage','includeAll','findAll','rows','show','params','keys','options','create','body','update','find'];(function(_0x34df56,_0x52a58f){var _0x520f88=function(_0x2f0a82){while(--_0x2f0a82){_0x34df56['push'](_0x34df56['shift']());}};_0x520f88(++_0x52a58f);}(_0x3a68,0xe6));var _0x83a6=function(_0x2a7837,_0x57caa0){_0x2a7837=_0x2a7837-0x0;var _0x4f10bf=_0x3a68[_0x2a7837];return _0x4f10bf;};'use strict';var util=require(_0x83a6('0x0'));var _=require('lodash');var Redis=require(_0x83a6('0x1'));var interactionService=require(_0x83a6('0x2'));var qs=require(_0x83a6('0x3'));var logger=require(_0x83a6('0x4'))(_0x83a6('0x5'));var config=require('../../config/environment');var db=require(_0x83a6('0x6'))['db'];config[_0x83a6('0x7')]=_[_0x83a6('0x8')](config[_0x83a6('0x7')],{'host':_0x83a6('0x9'),'port':0x18eb});var socket=require(_0x83a6('0xa'))(new Redis(config['redis']));require(_0x83a6('0xb'))[_0x83a6('0xc')](socket);var jayson=require('jayson/promise');var client=jayson[_0x83a6('0xd')][_0x83a6('0xe')]({'port':0x232c});var client9002=jayson['client'][_0x83a6('0xe')]({'port':0x232a});var interaction_log=require(_0x83a6('0x4'))('chat-interactions');function respondWithRpcPromise(_0x2f201d,_0x817230,_0x192f77,_0x26182e){return new Promise(function(_0x56c570,_0x2df6d4){var _0x27b462=_0x26182e||client;return _0x27b462[_0x83a6('0xf')](_0x2f201d,_0x192f77)['then'](function(_0x46ce92){logger['info'](_0x83a6('0x10'),_0x817230,'request\x20sent');logger[_0x83a6('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x817230,_0x83a6('0x12'),JSON[_0x83a6('0x13')](_0x46ce92));if(_0x46ce92['error']){if(_0x46ce92[_0x83a6('0x14')]['code']===0x1f4){logger[_0x83a6('0x14')](_0x83a6('0x10'),_0x817230,_0x46ce92['error'][_0x83a6('0x15')]);return _0x2df6d4(_0x46ce92[_0x83a6('0x14')][_0x83a6('0x15')]);}logger['error'](_0x83a6('0x10'),_0x817230,_0x46ce92[_0x83a6('0x14')]['message']);return _0x56c570(_0x46ce92['error'][_0x83a6('0x15')]);}else{logger[_0x83a6('0x16')](_0x83a6('0x10'),_0x817230,'request\x20sent');_0x56c570(_0x46ce92[_0x83a6('0x17')][_0x83a6('0x15')]);}})[_0x83a6('0x18')](function(_0x1128b0){logger[_0x83a6('0x14')](_0x83a6('0x10'),_0x817230,_0x1128b0);_0x2df6d4(_0x1128b0);});});}function respondWithResult(_0x4ff2b2,_0x22fc1d){_0x22fc1d=_0x22fc1d||0xc8;return function(_0x5bf3a4){if(_0x5bf3a4){return _0x4ff2b2[_0x83a6('0x19')](_0x22fc1d)[_0x83a6('0x1a')](_0x5bf3a4);}};}function respondWithFilteredResult(_0x102976,_0x5b38a5){return function(_0x598141){if(_0x598141){var _0x2f7ef2=typeof _0x5b38a5[_0x83a6('0x1b')]===_0x83a6('0x1c')&&typeof _0x5b38a5[_0x83a6('0x1d')]==='undefined';var _0xc40d99=_0x598141[_0x83a6('0x1e')];var _0x2f0aeb=_0x2f7ef2?0x0:_0x5b38a5[_0x83a6('0x1b')];var _0x637be1=_0x2f7ef2?_0x598141['count']:_0x5b38a5[_0x83a6('0x1b')]+_0x5b38a5['limit'];var _0x8eee70;if(_0x637be1>=_0xc40d99){_0x637be1=_0xc40d99;_0x8eee70=0xc8;}else{_0x8eee70=0xce;}_0x102976[_0x83a6('0x19')](_0x8eee70);return _0x102976['set'](_0x83a6('0x1f'),_0x2f0aeb+'-'+_0x637be1+'/'+_0xc40d99)[_0x83a6('0x1a')](_0x598141);}return null;};}function saveUpdates(_0x157193){return function(_0x57d30b){if(_0x57d30b){return _0x57d30b['update'](_0x157193)['then'](function(_0x509f7a){return _0x509f7a;});}return null;};}function removeEntity(_0x1d648a){return function(_0x20516e){if(_0x20516e){return _0x20516e['destroy']()[_0x83a6('0x20')](function(){_0x1d648a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8e3495){return function(_0x4bf316){if(!_0x4bf316){_0x8e3495['sendStatus'](0x194);}return _0x4bf316;};}function handleError(_0x21e2e2,_0x393a7f){_0x393a7f=_0x393a7f||0x1f4;return function(_0x1ffbfa){logger[_0x83a6('0x14')](_0x1ffbfa[_0x83a6('0x21')]);if(_0x1ffbfa[_0x83a6('0x22')]){delete _0x1ffbfa[_0x83a6('0x22')];}_0x21e2e2[_0x83a6('0x19')](_0x393a7f)[_0x83a6('0x23')](_0x1ffbfa);};}exports[_0x83a6('0x24')]=function(_0x3d0073,_0x1eae99){var _0x50ccc0={},_0x4e94ca={},_0x3d22bc={'count':0x0,'rows':[]};var _0x569fda=_[_0x83a6('0x25')](db['ChatMessage'][_0x83a6('0x26')],function(_0x1c7312){return{'name':_0x1c7312[_0x83a6('0x27')],'type':_0x1c7312['type'][_0x83a6('0x28')]};});_0x4e94ca[_0x83a6('0x29')]=_[_0x83a6('0x25')](_0x569fda,_0x83a6('0x22'));_0x4e94ca[_0x83a6('0x2a')]=_['keys'](_0x3d0073[_0x83a6('0x2a')]);_0x4e94ca[_0x83a6('0x2b')]=_[_0x83a6('0x2c')](_0x4e94ca[_0x83a6('0x29')],_0x4e94ca[_0x83a6('0x2a')]);_0x50ccc0['attributes']=_[_0x83a6('0x2c')](_0x4e94ca[_0x83a6('0x29')],qs['fields'](_0x3d0073[_0x83a6('0x2a')][_0x83a6('0x2d')]));_0x50ccc0[_0x83a6('0x2e')]=_0x50ccc0[_0x83a6('0x2e')][_0x83a6('0x2f')]?_0x50ccc0[_0x83a6('0x2e')]:_0x4e94ca[_0x83a6('0x29')];if(!_0x3d0073['query'][_0x83a6('0x30')](_0x83a6('0x31'))){_0x50ccc0[_0x83a6('0x1d')]=qs[_0x83a6('0x1d')](_0x3d0073[_0x83a6('0x2a')]['limit']);_0x50ccc0[_0x83a6('0x1b')]=qs[_0x83a6('0x1b')](_0x3d0073[_0x83a6('0x2a')][_0x83a6('0x1b')]);}_0x50ccc0[_0x83a6('0x32')]=qs['sort'](_0x3d0073['query'][_0x83a6('0x33')]);_0x50ccc0[_0x83a6('0x34')]=qs['filters'](_[_0x83a6('0x35')](_0x3d0073[_0x83a6('0x2a')],_0x4e94ca[_0x83a6('0x2b')]),_0x569fda);if(_0x3d0073[_0x83a6('0x2a')][_0x83a6('0x36')]){_0x50ccc0[_0x83a6('0x34')]=_[_0x83a6('0x37')](_0x50ccc0[_0x83a6('0x34')],{'$or':_[_0x83a6('0x25')](_0x569fda,function(_0x4ae5bf){if(_0x4ae5bf[_0x83a6('0x38')]!==_0x83a6('0x39')){var _0x151b12={};_0x151b12[_0x4ae5bf[_0x83a6('0x22')]]={'$like':'%'+_0x3d0073[_0x83a6('0x2a')][_0x83a6('0x36')]+'%'};return _0x151b12;}})});}_0x50ccc0=_[_0x83a6('0x37')]({},_0x50ccc0,_0x3d0073['options']);var _0x459e74={'where':_0x50ccc0[_0x83a6('0x34')]};return db[_0x83a6('0x3a')][_0x83a6('0x1e')](_0x459e74)[_0x83a6('0x20')](function(_0x342e4d){_0x3d22bc[_0x83a6('0x1e')]=_0x342e4d;if(_0x3d0073['query'][_0x83a6('0x3b')]){_0x50ccc0['include']=[{'all':!![]}];}return db['ChatMessage'][_0x83a6('0x3c')](_0x50ccc0);})[_0x83a6('0x20')](function(_0x75e073){_0x3d22bc[_0x83a6('0x3d')]=_0x75e073;return _0x3d22bc;})[_0x83a6('0x20')](respondWithFilteredResult(_0x1eae99,_0x50ccc0))[_0x83a6('0x18')](handleError(_0x1eae99,null));};exports[_0x83a6('0x3e')]=function(_0x1baf74,_0x561887){var _0x2ed145={'raw':!![],'where':{'id':_0x1baf74[_0x83a6('0x3f')]['id']}},_0x47f168={};_0x47f168[_0x83a6('0x29')]=_[_0x83a6('0x40')](db['ChatMessage'][_0x83a6('0x26')]);_0x47f168[_0x83a6('0x2a')]=_[_0x83a6('0x40')](_0x1baf74['query']);_0x47f168[_0x83a6('0x2b')]=_[_0x83a6('0x2c')](_0x47f168[_0x83a6('0x29')],_0x47f168[_0x83a6('0x2a')]);_0x2ed145[_0x83a6('0x2e')]=_[_0x83a6('0x2c')](_0x47f168[_0x83a6('0x29')],qs['fields'](_0x1baf74['query'][_0x83a6('0x2d')]));_0x2ed145[_0x83a6('0x2e')]=_0x2ed145[_0x83a6('0x2e')][_0x83a6('0x2f')]?_0x2ed145[_0x83a6('0x2e')]:_0x47f168[_0x83a6('0x29')];if(_0x1baf74[_0x83a6('0x2a')][_0x83a6('0x3b')]){_0x2ed145['include']=[{'all':!![]}];}_0x2ed145=_['merge']({},_0x2ed145,_0x1baf74[_0x83a6('0x41')]);return db[_0x83a6('0x3a')]['find'](_0x2ed145)[_0x83a6('0x20')](handleEntityNotFound(_0x561887,null))[_0x83a6('0x20')](respondWithResult(_0x561887,null))[_0x83a6('0x18')](handleError(_0x561887,null));};exports[_0x83a6('0x42')]=function(_0x44442f,_0x4f5b7a){return db['ChatMessage'][_0x83a6('0x42')](_0x44442f[_0x83a6('0x43')],{})[_0x83a6('0x20')](respondWithResult(_0x4f5b7a,0xc9))[_0x83a6('0x18')](handleError(_0x4f5b7a,null));};exports[_0x83a6('0x44')]=function(_0x225874,_0x6f7acc){if(_0x225874[_0x83a6('0x43')]['id']){delete _0x225874[_0x83a6('0x43')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x225874[_0x83a6('0x3f')]['id']}})[_0x83a6('0x20')](handleEntityNotFound(_0x6f7acc,null))[_0x83a6('0x20')](saveUpdates(_0x225874['body'],null))[_0x83a6('0x20')](respondWithResult(_0x6f7acc,null))[_0x83a6('0x18')](handleError(_0x6f7acc,null));};exports['destroy']=function(_0x393a7a,_0x1f08fe){return db[_0x83a6('0x3a')][_0x83a6('0x45')]({'where':{'id':_0x393a7a['params']['id']}})[_0x83a6('0x20')](handleEntityNotFound(_0x1f08fe,null))['then'](removeEntity(_0x1f08fe,null))[_0x83a6('0x18')](handleError(_0x1f08fe,null));};exports[_0x83a6('0x46')]=function(_0x3605fe,_0x318a47){return db[_0x83a6('0x3a')][_0x83a6('0x46')]()[_0x83a6('0x20')](respondWithResult(_0x318a47,null))[_0x83a6('0x18')](handleError(_0x318a47,null));};exports['accept']=function(_0x2701a2,_0x39eace){var _0x2ca612='chat';return interactionService['acceptMessage'](_0x2701a2,_0x2ca612)['then'](respondWithResult(_0x39eace,null))[_0x83a6('0x18')](handleError(_0x39eace,null));};exports[_0x83a6('0x47')]=function(_0x57b203,_0x1c74db){var _0x12f818={'agent':{},'channel':_0x83a6('0x48')};if(_0x57b203[_0x83a6('0x43')]['id']){delete _0x57b203['body']['id'];}_0x57b203[_0x83a6('0x43')][_0x83a6('0x49')]=_0x57b203[_0x83a6('0x43')][_0x83a6('0x49')]||_0x57b203[_0x83a6('0x4a')]['id'];_0x12f818[_0x83a6('0x4b')]['id']=_0x57b203[_0x83a6('0x43')][_0x83a6('0x49')];return db[_0x83a6('0x3a')]['find']({'where':{'id':_0x57b203[_0x83a6('0x3f')]['id'],'UserId':null}})[_0x83a6('0x20')](handleEntityNotFound(_0x1c74db,null))[_0x83a6('0x20')](function(_0x3d4840){if(_0x3d4840){_0x12f818[_0x83a6('0x15')]=_0x3d4840['get']({'plain':!![]});return db[_0x83a6('0x4c')][_0x83a6('0x45')]({'where':{'id':_0x3d4840[_0x83a6('0x4d')]}});}return null;})['then'](handleEntityNotFound(_0x1c74db,null))['then'](function(_0x1b002b){if(_0x1b002b){_0x12f818[_0x83a6('0x4e')]=_0x1b002b[_0x83a6('0x4f')]({'plain':!![]});interaction_log[_0x83a6('0x16')](_0x83a6('0x50'),_0x57b203['user']['id'],_0x57b203['user'][_0x83a6('0x22')],_0x57b203[_0x83a6('0x4a')]['role'],_0x12f818[_0x83a6('0x4e')]['id'],_0x57b203['body']?JSON[_0x83a6('0x13')](_0x57b203[_0x83a6('0x43')]):_0x83a6('0x51'));return respondWithRpcPromise(_0x83a6('0x52'),'rejectMessage',_0x12f818);}return null;})[_0x83a6('0x20')](function(_0x54f4d5){var _0x514c2b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54f4d5[_0x83a6('0x15')][_0x83a6('0x53')];return db[_0x83a6('0x54')][_0x83a6('0x2a')](_0x514c2b,{'type':db[_0x83a6('0x55')]['QueryTypes'][_0x83a6('0x56')],'raw':!![]})[_0x83a6('0x20')](function(_0x17678b){return _0x17678b;});})[_0x83a6('0x20')](function(_0x5c6225){if(_0x5c6225){_0x12f818['message'][_0x83a6('0x57')]=_0x5c6225[0x0];if(!_0x57b203[_0x83a6('0x43')][_0x83a6('0x49')])return;return db[_0x83a6('0x58')][_0x83a6('0x45')]({'where':{'id':_0x57b203[_0x83a6('0x43')]['UserId'],'role':'agent'},'attributes':['id','name',_0x83a6('0x59'),_0x83a6('0x5a'),'internal'],'raw':!![]});}return null;})[_0x83a6('0x20')](function(_0x14dbd1){if(!_0x14dbd1)return null;_0x12f818['message'][_0x83a6('0x4b')]=_0x14dbd1;return _0x12f818;})[_0x83a6('0x20')](function(_0x3cb0b8){if(_0x3cb0b8){_0x3cb0b8[_0x83a6('0x15')][_0x83a6('0x5b')]=util[_0x83a6('0x5c')](_0x83a6('0x5d'),_0x57b203[_0x83a6('0x4a')][_0x83a6('0x22')]);_0x3cb0b8['message'][_0x83a6('0x5e')]=_0x12f818[_0x83a6('0x5e')];_0x3cb0b8[_0x83a6('0x15')][_0x83a6('0x5f')]=_0x12f818[_0x83a6('0x5e')];_0x3cb0b8[_0x83a6('0x15')]['event']=_0x83a6('0x47');respondWithRpcPromise(_0x83a6('0x60'),_0x83a6('0x60'),{'event':_0x83a6('0x61'),'message':_[_0x83a6('0x37')](_0x12f818[_0x83a6('0x15')],JSON[_0x83a6('0x62')](_0x12f818['interaction'][_0x83a6('0x63')]))},client9002);return _0x12f818;}return null;})[_0x83a6('0x20')](respondWithResult(_0x1c74db,null))[_0x83a6('0x18')](handleError(_0x1c74db,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 738e15b..4cabc87 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 _0x6bab=['events','../../mysqldb','save','remove','emit','hasOwnProperty','exports'];(function(_0x597f0d,_0x49508b){var _0x4b66ef=function(_0xbc756c){while(--_0xbc756c){_0x597f0d['push'](_0x597f0d['shift']());}};_0x4b66ef(++_0x49508b);}(_0x6bab,0x1e3));var _0xb6ba=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0x6bab[_0x2390bd];return _0x3a969d;};'use strict';var EventEmitter=require(_0xb6ba('0x0'));var ChatMessage=require(_0xb6ba('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb6ba('0x2'),'afterUpdate':'update','afterDestroy':_0xb6ba('0x3')};function emitEvent(_0x37e2c9){return function(_0x3db3eb,_0x43c284,_0x15c200){ChatMessageEvents[_0xb6ba('0x4')](_0x37e2c9+':'+_0x3db3eb['id'],_0x3db3eb);ChatMessageEvents[_0xb6ba('0x4')](_0x37e2c9,_0x3db3eb);_0x15c200(null);};}for(var e in events){if(events[_0xb6ba('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xb6ba('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x4564=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4564,0xfc));var _0x4456=function(_0x7fb487,_0x32182b){_0x7fb487=_0x7fb487-0x0;var _0x39fb59=_0x4564[_0x7fb487];return _0x39fb59;};'use strict';var EventEmitter=require(_0x4456('0x0'));var ChatMessage=require(_0x4456('0x1'))['db'][_0x4456('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x4456('0x3')](0x0);var events={'afterCreate':_0x4456('0x4'),'afterUpdate':_0x4456('0x5'),'afterDestroy':_0x4456('0x6')};function emitEvent(_0x3f3785){return function(_0x2ab069,_0x2299b3,_0x4a33bd){ChatMessageEvents[_0x4456('0x7')](_0x3f3785+':'+_0x2ab069['id'],_0x2ab069);ChatMessageEvents[_0x4456('0x7')](_0x3f3785,_0x2ab069);_0x4a33bd(null);};}for(var e in events){if(events[_0x4456('0x8')](e)){var event=events[e];ChatMessage[_0x4456('0x9')](e,emitEvent(event));}}module[_0x4456('0xa')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index b152bb9..37ebd33 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 _0xc0bc=['moment','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x3764b3,_0x23d114){var _0x48f40c=function(_0xdecee1){while(--_0xdecee1){_0x3764b3['push'](_0x3764b3['shift']());}};_0x48f40c(++_0x23d114);}(_0xc0bc,0x176));var _0xcc0b=function(_0x35b0ec,_0x28ff81){_0x35b0ec=_0x35b0ec-0x0;var _0x2dd601=_0xc0bc[_0x35b0ec];return _0x2dd601;};'use strict';var _=require('lodash');var util=require(_0xcc0b('0x0'));var logger=require(_0xcc0b('0x1'))(_0xcc0b('0x2'));var moment=require(_0xcc0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc0b('0x4'));var fs=require('fs');var path=require(_0xcc0b('0x5'));var rimraf=require(_0xcc0b('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc0b('0x7'));module[_0xcc0b('0x8')]=function(_0x526a0d,_0x5b427c){return _0x526a0d[_0xcc0b('0x9')](_0xcc0b('0xa'),attributes,{'tableName':_0xcc0b('0xb'),'paranoid':![],'indexes':[{'name':_0xcc0b('0xc'),'fields':[_0xcc0b('0xd')],'type':_0xcc0b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53c0e7,_0x235b6c,_0x58c6a7){var _0x44c706=_0x526a0d['models'];var _0x822723=_0x53c0e7[_0xcc0b('0xf')]({'plain':!![]});if(_0x822723[_0xcc0b('0x10')][_0xcc0b('0x11')]()==='in'||_0x822723['direction'][_0xcc0b('0x11')]()==='out'&&!_0x822723[_0xcc0b('0x12')]&&!_[_0xcc0b('0x13')](_0x822723[_0xcc0b('0x14')])){_0x44c706['ChatInteraction'][_0xcc0b('0x15')]({'where':{'id':_0x822723[_0xcc0b('0x16')]}})[_0xcc0b('0x17')](function(_0xd77f39){if(_0xd77f39){_0xd77f39['update']({'lastMsgAt':_0x822723[_0xcc0b('0x18')],'lastMsgDirection':_0x822723[_0xcc0b('0x10')][_0xcc0b('0x11')]()});}})[_0xcc0b('0x19')](function(_0x43835a){console[_0xcc0b('0x1a')](_0x43835a);});}_0x58c6a7();}},'charset':_0xcc0b('0x1b'),'collate':_0xcc0b('0x1c')});};
\ No newline at end of file
+var _0xdcd5=['then','update','createdAt','error','utf8mb4','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x9d1556,_0x22622f){var _0x2d2cea=function(_0x266ee1){while(--_0x266ee1){_0x9d1556['push'](_0x9d1556['shift']());}};_0x2d2cea(++_0x22622f);}(_0xdcd5,0x1a9));var _0x5dcd=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0xdcd5[_0x2f3d29];return _0x53d69d;};'use strict';var _=require(_0x5dcd('0x0'));var util=require('util');var logger=require(_0x5dcd('0x1'))(_0x5dcd('0x2'));var moment=require(_0x5dcd('0x3'));var BPromise=require('bluebird');var rp=require(_0x5dcd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5dcd('0x5'));var config=require(_0x5dcd('0x6'));var attributes=require('./chatMessage.attributes');module[_0x5dcd('0x7')]=function(_0x938bdf,_0x995967){return _0x938bdf[_0x5dcd('0x8')](_0x5dcd('0x9'),attributes,{'tableName':_0x5dcd('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x5dcd('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b8e85,_0x40c557,_0x24fba5){var _0x41ec14=_0x938bdf[_0x5dcd('0xc')];var _0x5b07ed=_0x4b8e85[_0x5dcd('0xd')]({'plain':!![]});if(_0x5b07ed[_0x5dcd('0xe')][_0x5dcd('0xf')]()==='in'||_0x5b07ed['direction'][_0x5dcd('0xf')]()===_0x5dcd('0x10')&&!_0x5b07ed[_0x5dcd('0x11')]&&!_[_0x5dcd('0x12')](_0x5b07ed[_0x5dcd('0x13')])){_0x41ec14[_0x5dcd('0x14')][_0x5dcd('0x15')]({'where':{'id':_0x5b07ed[_0x5dcd('0x16')]}})[_0x5dcd('0x17')](function(_0x4a13c0){if(_0x4a13c0){_0x4a13c0[_0x5dcd('0x18')]({'lastMsgAt':_0x5b07ed[_0x5dcd('0x19')],'lastMsgDirection':_0x5b07ed[_0x5dcd('0xe')][_0x5dcd('0xf')]()});}})['catch'](function(_0x1468c9){console[_0x5dcd('0x1a')](_0x1468c9);});}_0x24fba5();}},'charset':_0x5dcd('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 22fd5c9..249383d 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 _0xbf3e=['ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','./chatMessage.socket','register','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','create','body','options','lodash','util','bluebird','randomstring'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xbf3e,0x1e9));var _0xebf3=function(_0x469afd,_0x3b6353){_0x469afd=_0x469afd-0x0;var _0x10b8e5=_0xbf3e[_0x469afd];return _0x10b8e5;};'use strict';var _=require(_0xebf3('0x0'));var util=require(_0xebf3('0x1'));var moment=require('moment');var BPromise=require(_0xebf3('0x2'));var rs=require(_0xebf3('0x3'));var fs=require('fs');var Redis=require(_0xebf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xebf3('0x5'))(_0xebf3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xebf3('0x7')][_0xebf3('0x8')]({'port':0x232a});config[_0xebf3('0x9')]=_[_0xebf3('0xa')](config['redis'],{'host':_0xebf3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebf3('0x9')]));require(_0xebf3('0xc'))[_0xebf3('0xd')](socket);function respondWithRpcPromise(_0x2ad341,_0x51b31e,_0x587f34){return new BPromise(function(_0x449e96,_0x525315){return client['request'](_0x2ad341,_0x587f34)[_0xebf3('0xe')](function(_0x2ecdce){logger[_0xebf3('0xf')]('ChatMessage,\x20%s,\x20%s',_0x51b31e,_0xebf3('0x10'));logger[_0xebf3('0x11')](_0xebf3('0x12'),_0x51b31e,'request\x20sent',JSON['stringify'](_0x2ecdce));if(_0x2ecdce[_0xebf3('0x13')]){if(_0x2ecdce['error'][_0xebf3('0x14')]===0x1f4){logger[_0xebf3('0x13')](_0xebf3('0x15'),_0x51b31e,_0x2ecdce['error'][_0xebf3('0x16')]);return _0x525315(_0x2ecdce[_0xebf3('0x13')][_0xebf3('0x16')]);}logger[_0xebf3('0x13')](_0xebf3('0x15'),_0x51b31e,_0x2ecdce['error']['message']);return _0x449e96(_0x2ecdce[_0xebf3('0x13')][_0xebf3('0x16')]);}else{logger[_0xebf3('0xf')](_0xebf3('0x15'),_0x51b31e,_0xebf3('0x10'));_0x449e96(_0x2ecdce[_0xebf3('0x17')][_0xebf3('0x16')]);}})[_0xebf3('0x18')](function(_0x44f18e){logger[_0xebf3('0x13')](_0xebf3('0x15'),_0x51b31e,_0x44f18e);_0x525315(_0x44f18e);});});}exports[_0xebf3('0x19')]=function(_0x3cc01a){var _0x147aaf=this;return new Promise(function(_0x17a26c,_0x1a30cc){return db['ChatMessage'][_0xebf3('0x1a')](_0x3cc01a[_0xebf3('0x1b')],{'raw':_0x3cc01a[_0xebf3('0x1c')]?_0x3cc01a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2efe43){logger[_0xebf3('0xf')](_0xebf3('0x19'),_0x3cc01a);logger['debug'](_0xebf3('0x19'),_0x3cc01a,JSON['stringify'](_0x2efe43));_0x17a26c(_0x2efe43);})[_0xebf3('0x18')](function(_0x5ef606){logger[_0xebf3('0x13')](_0xebf3('0x19'),_0x5ef606[_0xebf3('0x16')],_0x3cc01a);_0x1a30cc(_0x147aaf[_0xebf3('0x13')](0x1f4,_0x5ef606[_0xebf3('0x16')]));});});};
\ No newline at end of file
+var _0x1b6e=['error','message','result','catch','CreateChatMessage','create','body','options','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x52d4ee,_0x64e207){var _0x51d053=function(_0x32b659){while(--_0x32b659){_0x52d4ee['push'](_0x52d4ee['shift']());}};_0x51d053(++_0x64e207);}(_0x1b6e,0x1d8));var _0xe1b6=function(_0x5a12a5,_0x20c182){_0x5a12a5=_0x5a12a5-0x0;var _0x5d384c=_0x1b6e[_0x5a12a5];return _0x5d384c;};'use strict';var _=require(_0xe1b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe1b6('0x1'));var fs=require('fs');var Redis=require(_0xe1b6('0x2'));var db=require(_0xe1b6('0x3'))['db'];var utils=require(_0xe1b6('0x4'));var logger=require(_0xe1b6('0x5'))(_0xe1b6('0x6'));var config=require(_0xe1b6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe1b6('0x8')][_0xe1b6('0x9')]({'port':0x232a});config[_0xe1b6('0xa')]=_['defaults'](config[_0xe1b6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe1b6('0xb'))(new Redis(config['redis']));require(_0xe1b6('0xc'))['register'](socket);function respondWithRpcPromise(_0x313181,_0x107b90,_0x2cc31c){return new BPromise(function(_0x162d11,_0xe3673){return client[_0xe1b6('0xd')](_0x313181,_0x2cc31c)[_0xe1b6('0xe')](function(_0x5ee723){logger[_0xe1b6('0xf')](_0xe1b6('0x10'),_0x107b90,'request\x20sent');logger[_0xe1b6('0x11')](_0xe1b6('0x12'),_0x107b90,_0xe1b6('0x13'),JSON[_0xe1b6('0x14')](_0x5ee723));if(_0x5ee723[_0xe1b6('0x15')]){if(_0x5ee723[_0xe1b6('0x15')]['code']===0x1f4){logger[_0xe1b6('0x15')]('ChatMessage,\x20%s,\x20%s',_0x107b90,_0x5ee723[_0xe1b6('0x15')]['message']);return _0xe3673(_0x5ee723[_0xe1b6('0x15')][_0xe1b6('0x16')]);}logger[_0xe1b6('0x15')](_0xe1b6('0x10'),_0x107b90,_0x5ee723[_0xe1b6('0x15')][_0xe1b6('0x16')]);return _0x162d11(_0x5ee723[_0xe1b6('0x15')][_0xe1b6('0x16')]);}else{logger[_0xe1b6('0xf')](_0xe1b6('0x10'),_0x107b90,_0xe1b6('0x13'));_0x162d11(_0x5ee723[_0xe1b6('0x17')][_0xe1b6('0x16')]);}})[_0xe1b6('0x18')](function(_0x4c1aca){logger[_0xe1b6('0x15')](_0xe1b6('0x10'),_0x107b90,_0x4c1aca);_0xe3673(_0x4c1aca);});});}exports[_0xe1b6('0x19')]=function(_0x108728){var _0x4e517a=this;return new Promise(function(_0xe8de21,_0x129e66){return db['ChatMessage'][_0xe1b6('0x1a')](_0x108728[_0xe1b6('0x1b')],{'raw':_0x108728['options']?_0x108728[_0xe1b6('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x24d69e){logger[_0xe1b6('0xf')](_0xe1b6('0x19'),_0x108728);logger[_0xe1b6('0x11')](_0xe1b6('0x19'),_0x108728,JSON[_0xe1b6('0x14')](_0x24d69e));_0xe8de21(_0x24d69e);})[_0xe1b6('0x18')](function(_0x38a3db){logger[_0xe1b6('0x15')](_0xe1b6('0x19'),_0x38a3db[_0xe1b6('0x16')],_0x108728);_0x129e66(_0x4e517a['error'](0x1f4,_0x38a3db[_0xe1b6('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 16d5df2..9830c9c 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 _0x46fc=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x2777ef,_0x1f7721){var _0xd4b76a=function(_0x48518b){while(--_0x48518b){_0x2777ef['push'](_0x2777ef['shift']());}};_0xd4b76a(++_0x1f7721);}(_0x46fc,0x103));var _0xc46f=function(_0x1a50e5,_0x14accb){_0x1a50e5=_0x1a50e5-0x0;var _0x53b463=_0x46fc[_0x1a50e5];return _0x53b463;};'use strict';var ChatMessageEvents=require(_0xc46f('0x0'));var events=[_0xc46f('0x1'),_0xc46f('0x2'),_0xc46f('0x3')];function createListener(_0x865c60,_0x9460ea){return function(_0x2bf9ee){_0x9460ea[_0xc46f('0x4')](_0x865c60,_0x2bf9ee);};}function removeListener(_0x3a56db,_0x5b0483){return function(){ChatMessageEvents['removeListener'](_0x3a56db,_0x5b0483);};}exports[_0xc46f('0x5')]=function(_0x176c6f){for(var _0x30ca8d=0x0,_0x15904c=events[_0xc46f('0x6')];_0x30ca8d<_0x15904c;_0x30ca8d++){var _0x312101=events[_0x30ca8d];var _0x155a10=createListener(_0xc46f('0x7')+_0x312101,_0x176c6f);ChatMessageEvents['on'](_0x312101,_0x155a10);}};
\ No newline at end of file
+var _0x85d0=['emit','register','length','chatMessage:'];(function(_0x185925,_0x3cf438){var _0x5a34dc=function(_0x269f37){while(--_0x269f37){_0x185925['push'](_0x185925['shift']());}};_0x5a34dc(++_0x3cf438);}(_0x85d0,0x164));var _0x085d=function(_0x33233f,_0x510bc2){_0x33233f=_0x33233f-0x0;var _0xe8ba55=_0x85d0[_0x33233f];return _0xe8ba55;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove','update'];function createListener(_0x297001,_0x1716e5){return function(_0xfd8773){_0x1716e5[_0x085d('0x0')](_0x297001,_0xfd8773);};}function removeListener(_0x231765,_0x19ae4c){return function(){ChatMessageEvents['removeListener'](_0x231765,_0x19ae4c);};}exports[_0x085d('0x1')]=function(_0x5c917f){for(var _0x364f09=0x0,_0x9acc97=events[_0x085d('0x2')];_0x364f09<_0x9acc97;_0x364f09++){var _0x4a12b7=events[_0x364f09];var _0xf65d01=createListener(_0x085d('0x3')+_0x4a12b7,_0x5c917f);ChatMessageEvents['on'](_0x4a12b7,_0xf65d01);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 4167120..2b89d4f 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 _0x2ba8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','chat','chatmessage:create','create','put','accept','/:id/reject','reject','delete','destroy'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x2ba8,0x6e));var _0x82ba=function(_0x158241,_0x236288){_0x158241=_0x158241-0x0;var _0x1dd068=_0x2ba8[_0x158241];return _0x1dd068;};'use strict';var multer=require(_0x82ba('0x0'));var util=require('util');var path=require(_0x82ba('0x1'));var timeout=require(_0x82ba('0x2'));var express=require(_0x82ba('0x3'));var router=express[_0x82ba('0x4')]();var fs_extra=require(_0x82ba('0x5'));var auth=require(_0x82ba('0x6'));var interaction=require(_0x82ba('0x7'));var config=require(_0x82ba('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x82ba('0x9')](),controller['index']);router[_0x82ba('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x82ba('0xa')](_0x82ba('0xb'),auth[_0x82ba('0x9')](),controller[_0x82ba('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x82ba('0xd'),_0x82ba('0xe')),controller[_0x82ba('0xf')]);router[_0x82ba('0x10')](_0x82ba('0xb'),controller['update']);router['put']('/:id/accept',auth[_0x82ba('0x9')](),controller[_0x82ba('0x11')]);router[_0x82ba('0x10')](_0x82ba('0x12'),auth[_0x82ba('0x9')](),controller[_0x82ba('0x13')]);router[_0x82ba('0x14')](_0x82ba('0xb'),auth['isAuthenticated'](),controller[_0x82ba('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x8fad=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5e4740,_0x2e4ed7){var _0x314894=function(_0x35d383){while(--_0x35d383){_0x5e4740['push'](_0x5e4740['shift']());}};_0x314894(++_0x2e4ed7);}(_0x8fad,0x65));var _0xd8fa=function(_0x4e7f11,_0x56d30c){_0x4e7f11=_0x4e7f11-0x0;var _0x30633a=_0x8fad[_0x4e7f11];return _0x30633a;};'use strict';var multer=require(_0xd8fa('0x0'));var util=require(_0xd8fa('0x1'));var path=require(_0xd8fa('0x2'));var timeout=require(_0xd8fa('0x3'));var express=require(_0xd8fa('0x4'));var router=express[_0xd8fa('0x5')]();var fs_extra=require(_0xd8fa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd8fa('0x7'));var config=require(_0xd8fa('0x8'));var controller=require(_0xd8fa('0x9'));router[_0xd8fa('0xa')]('/',auth[_0xd8fa('0xb')](),controller[_0xd8fa('0xc')]);router['get']('/describe',auth[_0xd8fa('0xb')](),controller['describe']);router[_0xd8fa('0xa')](_0xd8fa('0xd'),auth[_0xd8fa('0xb')](),controller[_0xd8fa('0xe')]);router[_0xd8fa('0xf')]('/',auth[_0xd8fa('0xb')](),interaction['tracked'](_0xd8fa('0x10'),_0xd8fa('0x11')),controller[_0xd8fa('0x12')]);router[_0xd8fa('0x13')](_0xd8fa('0xd'),controller[_0xd8fa('0x14')]);router[_0xd8fa('0x13')](_0xd8fa('0x15'),auth[_0xd8fa('0xb')](),controller[_0xd8fa('0x16')]);router[_0xd8fa('0x13')](_0xd8fa('0x17'),auth[_0xd8fa('0xb')](),controller['reject']);router[_0xd8fa('0x18')]('/:id',auth[_0xd8fa('0xb')](),controller[_0xd8fa('0x19')]);module[_0xd8fa('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index e39475c..f9a0b1e 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 _0x757a=['exports','TEXT'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x757a,0xde));var _0xa757=function(_0xd51ae0,_0x197b10){_0xd51ae0=_0xd51ae0-0x0;var _0x204c3a=_0x757a[_0xd51ae0];return _0x204c3a;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x267a32,_0x20480f){var _0x33e7e9=function(_0x3ac9bb){while(--_0x3ac9bb){_0x267a32['push'](_0x267a32['shift']());}};_0x33e7e9(++_0x20480f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('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 cf307f1..81cfbba 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(_0x4aa3b4,_0x53970e){var _0x5447e1=function(_0x54df7d){while(--_0x54df7d){_0x4aa3b4['push'](_0x4aa3b4['shift']());}};_0x5447e1(++_0x53970e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x101ce3,_0x5c6db1){var _0x63b658=function(_0x22ff8d){while(--_0x22ff8d){_0x101ce3['push'](_0x101ce3['shift']());}};_0x63b658(++_0x5c6db1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 09b136b..7db4b36 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbc9b=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3193f1,_0x3503b9){var _0x3c7c76=function(_0x386007){while(--_0x386007){_0x3193f1['push'](_0x3193f1['shift']());}};_0x3c7c76(++_0x3503b9);}(_0xbc9b,0x9e));var _0xbbc9=function(_0x2b8ff6,_0x54639b){_0x2b8ff6=_0x2b8ff6-0x0;var _0xe6d789=_0xbc9b[_0x2b8ff6];return _0xe6d789;};'use strict';var EventEmitter=require(_0xbbc9('0x0'));var ChatOfflineMessage=require(_0xbbc9('0x1'))['db'][_0xbbc9('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xbbc9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbbc9('0x4'),'afterDestroy':_0xbbc9('0x5')};function emitEvent(_0x2dd792){return function(_0x8d64d8,_0x3ffa65,_0x5ed1a4){ChatOfflineMessageEvents[_0xbbc9('0x6')](_0x2dd792+':'+_0x8d64d8['id'],_0x8d64d8);ChatOfflineMessageEvents['emit'](_0x2dd792,_0x8d64d8);_0x5ed1a4(null);};}for(var e in events){if(events[_0xbbc9('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xbbc9('0x8')](e,emitEvent(event));}}module[_0xbbc9('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x57e8=['exports','../../mysqldb','update','emit','hasOwnProperty'];(function(_0x3f724a,_0x50581c){var _0x41bbf2=function(_0x177952){while(--_0x177952){_0x3f724a['push'](_0x3f724a['shift']());}};_0x41bbf2(++_0x50581c);}(_0x57e8,0x10a));var _0x857e=function(_0xe5b0fd,_0x502084){_0xe5b0fd=_0xe5b0fd-0x0;var _0x56cb02=_0x57e8[_0xe5b0fd];return _0x56cb02;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x857e('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x857e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x333dc6){return function(_0x8df9a0,_0x440ec1,_0x4d789c){ChatOfflineMessageEvents[_0x857e('0x2')](_0x333dc6+':'+_0x8df9a0['id'],_0x8df9a0);ChatOfflineMessageEvents[_0x857e('0x2')](_0x333dc6,_0x8df9a0);_0x4d789c(null);};}for(var e in events){if(events[_0x857e('0x3')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x857e('0x4')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index bea86bb..b2ce403 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 _0xc29b=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define'];(function(_0x240096,_0x4a8c21){var _0x59a87b=function(_0x2f68c3){while(--_0x2f68c3){_0x240096['push'](_0x240096['shift']());}};_0x59a87b(++_0x4a8c21);}(_0xc29b,0x1d9));var _0xbc29=function(_0x3b55e1,_0x3da326){_0x3b55e1=_0x3b55e1-0x0;var _0x2f1a16=_0xc29b[_0x3b55e1];return _0x2f1a16;};'use strict';var attributes=require(_0xbc29('0x0'));module['exports']=function(_0x3074a4){return _0x3074a4[_0xbc29('0x1')](_0xbc29('0x2'),attributes,{'tableName':_0xbc29('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbc29('0x4')});};
\ No newline at end of file
+var _0xc6e8=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports'];(function(_0x1ee30f,_0xd6880a){var _0x5774b9=function(_0x4f98a5){while(--_0x4f98a5){_0x1ee30f['push'](_0x1ee30f['shift']());}};_0x5774b9(++_0xd6880a);}(_0xc6e8,0xb6));var _0x8c6e=function(_0x48a766,_0x2b095a){_0x48a766=_0x48a766-0x0;var _0x4a2207=_0xc6e8[_0x48a766];return _0x4a2207;};'use strict';var attributes=require(_0x8c6e('0x0'));module[_0x8c6e('0x1')]=function(_0x136208){return _0x136208['define']('ChatOfflineMessage',attributes,{'tableName':_0x8c6e('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c6e('0x3'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index efadef4..9c5d4ba 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 _0xc1b6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x2e2616,_0x15afe2){var _0x572c57=function(_0x1243b8){while(--_0x1243b8){_0x2e2616['push'](_0x2e2616['shift']());}};_0x572c57(++_0x15afe2);}(_0xc1b6,0xfb));var _0x6c1b=function(_0x820d7b,_0xa5564c){_0x820d7b=_0x820d7b-0x0;var _0x249af0=_0xc1b6[_0x820d7b];return _0x249af0;};'use strict';var _=require(_0x6c1b('0x0'));var util=require(_0x6c1b('0x1'));var moment=require(_0x6c1b('0x2'));var BPromise=require(_0x6c1b('0x3'));var rs=require(_0x6c1b('0x4'));var fs=require('fs');var Redis=require(_0x6c1b('0x5'));var db=require(_0x6c1b('0x6'))['db'];var utils=require(_0x6c1b('0x7'));var logger=require(_0x6c1b('0x8'))(_0x6c1b('0x9'));var config=require('../../config/environment');var jayson=require(_0x6c1b('0xa'));var client=jayson[_0x6c1b('0xb')][_0x6c1b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c82c0,_0x14aedf,_0xccd626){return new BPromise(function(_0x1edcc2,_0x3cac92){return client['request'](_0x3c82c0,_0xccd626)['then'](function(_0x1614c2){logger[_0x6c1b('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x14aedf,_0x6c1b('0xe'));logger[_0x6c1b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x14aedf,'request\x20sent',JSON[_0x6c1b('0x10')](_0x1614c2));if(_0x1614c2[_0x6c1b('0x11')]){if(_0x1614c2[_0x6c1b('0x11')][_0x6c1b('0x12')]===0x1f4){logger[_0x6c1b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x14aedf,_0x1614c2[_0x6c1b('0x11')]['message']);return _0x3cac92(_0x1614c2[_0x6c1b('0x11')]['message']);}logger[_0x6c1b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x14aedf,_0x1614c2[_0x6c1b('0x11')][_0x6c1b('0x13')]);return _0x1edcc2(_0x1614c2['error'][_0x6c1b('0x13')]);}else{logger[_0x6c1b('0xd')](_0x6c1b('0x14'),_0x14aedf,_0x6c1b('0xe'));_0x1edcc2(_0x1614c2[_0x6c1b('0x15')][_0x6c1b('0x13')]);}})[_0x6c1b('0x16')](function(_0x68258b){logger[_0x6c1b('0x11')](_0x6c1b('0x14'),_0x14aedf,_0x68258b);_0x3cac92(_0x68258b);});});}
\ No newline at end of file
+var _0xc0c2=['message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc0c2,0x1b7));var _0x2c0c=function(_0x7b717,_0x311539){_0x7b717=_0x7b717-0x0;var _0x50d254=_0xc0c2[_0x7b717];return _0x50d254;};'use strict';var _=require('lodash');var util=require(_0x2c0c('0x0'));var moment=require(_0x2c0c('0x1'));var BPromise=require(_0x2c0c('0x2'));var rs=require(_0x2c0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c0c('0x4'))['db'];var utils=require(_0x2c0c('0x5'));var logger=require(_0x2c0c('0x6'))(_0x2c0c('0x7'));var config=require(_0x2c0c('0x8'));var jayson=require(_0x2c0c('0x9'));var client=jayson[_0x2c0c('0xa')][_0x2c0c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5472d9,_0x5730f6,_0x3d6ee6){return new BPromise(function(_0x20d58d,_0x7fe1a9){return client['request'](_0x5472d9,_0x3d6ee6)[_0x2c0c('0xc')](function(_0x5a4c71){logger[_0x2c0c('0xd')](_0x2c0c('0xe'),_0x5730f6,'request\x20sent');logger[_0x2c0c('0xf')](_0x2c0c('0x10'),_0x5730f6,_0x2c0c('0x11'),JSON[_0x2c0c('0x12')](_0x5a4c71));if(_0x5a4c71[_0x2c0c('0x13')]){if(_0x5a4c71[_0x2c0c('0x13')][_0x2c0c('0x14')]===0x1f4){logger[_0x2c0c('0x13')](_0x2c0c('0xe'),_0x5730f6,_0x5a4c71[_0x2c0c('0x13')][_0x2c0c('0x15')]);return _0x7fe1a9(_0x5a4c71[_0x2c0c('0x13')]['message']);}logger[_0x2c0c('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5730f6,_0x5a4c71[_0x2c0c('0x13')][_0x2c0c('0x15')]);return _0x20d58d(_0x5a4c71[_0x2c0c('0x13')][_0x2c0c('0x15')]);}else{logger[_0x2c0c('0xd')](_0x2c0c('0xe'),_0x5730f6,_0x2c0c('0x11'));_0x20d58d(_0x5a4c71['result'][_0x2c0c('0x15')]);}})[_0x2c0c('0x16')](function(_0x4e3703){logger['error'](_0x2c0c('0xe'),_0x5730f6,_0x4e3703);_0x7fe1a9(_0x4e3703);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 54ecc0d..587d047 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 _0xb1ef=['post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','describe','/:id','show'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xb1ef,0x168));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var path=require(_0xfb1e('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb1e('0x3'));var router=express[_0xfb1e('0x4')]();var fs_extra=require(_0xfb1e('0x5'));var auth=require(_0xfb1e('0x6'));var interaction=require(_0xfb1e('0x7'));var config=require(_0xfb1e('0x8'));var controller=require(_0xfb1e('0x9'));router[_0xfb1e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfb1e('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xfb1e('0xb')]);router[_0xfb1e('0xa')](_0xfb1e('0xc'),auth['isAuthenticated'](),controller[_0xfb1e('0xd')]);router[_0xfb1e('0xe')]('/',auth[_0xfb1e('0xf')](),controller[_0xfb1e('0x10')]);router[_0xfb1e('0x11')](_0xfb1e('0xc'),auth[_0xfb1e('0xf')](),controller[_0xfb1e('0x12')]);router[_0xfb1e('0x13')](_0xfb1e('0xc'),auth[_0xfb1e('0xf')](),controller[_0xfb1e('0x14')]);module[_0xfb1e('0x15')]=router;
\ No newline at end of file
+var _0xb407=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x3c9363,_0x48021b){var _0x1ea31d=function(_0x4edaf8){while(--_0x4edaf8){_0x3c9363['push'](_0x3c9363['shift']());}};_0x1ea31d(++_0x48021b);}(_0xb407,0x13f));var _0x7b40=function(_0x27fc10,_0x1a8782){_0x27fc10=_0x27fc10-0x0;var _0x141ae3=_0xb407[_0x27fc10];return _0x141ae3;};'use strict';var multer=require(_0x7b40('0x0'));var util=require('util');var path=require(_0x7b40('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b40('0x2'));var router=express[_0x7b40('0x3')]();var fs_extra=require(_0x7b40('0x4'));var auth=require(_0x7b40('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b40('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x7b40('0x7')]('/',auth[_0x7b40('0x8')](),controller[_0x7b40('0x9')]);router[_0x7b40('0x7')](_0x7b40('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7b40('0x7')](_0x7b40('0xb'),auth[_0x7b40('0x8')](),controller[_0x7b40('0xc')]);router[_0x7b40('0xd')]('/',auth[_0x7b40('0x8')](),controller['create']);router[_0x7b40('0xe')](_0x7b40('0xb'),auth[_0x7b40('0x8')](),controller[_0x7b40('0xf')]);router[_0x7b40('0x10')](_0x7b40('0xb'),auth[_0x7b40('0x8')](),controller[_0x7b40('0x11')]);module[_0x7b40('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 69899be..76ee5c4 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 _0xe892=['ENUM','mouseOver','timeout','STRING'];(function(_0x26e2b6,_0x46e581){var _0x5976ab=function(_0x2cace3){while(--_0x2cace3){_0x26e2b6['push'](_0x26e2b6['shift']());}};_0x5976ab(++_0x46e581);}(_0xe892,0x73));var _0x2e89=function(_0x1210e6,_0x4329d3){_0x1210e6=_0x1210e6-0x0;var _0x245b77=_0xe892[_0x1210e6];return _0x245b77;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2e89('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x2e89('0x1')](_0x2e89('0x2'),_0x2e89('0x3')),'defaultValue':_0x2e89('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4b64=['mouseOver','sequelize','exports','STRING','ENUM'];(function(_0x358aa7,_0x73c983){var _0x57a925=function(_0x4bf7cc){while(--_0x4bf7cc){_0x358aa7['push'](_0x358aa7['shift']());}};_0x57a925(++_0x73c983);}(_0x4b64,0x100));var _0x44b6=function(_0x556b28,_0x46061b){_0x556b28=_0x556b28-0x0;var _0x23bfc1=_0x4b64[_0x556b28];return _0x23bfc1;};'use strict';var Sequelize=require(_0x44b6('0x0'));module[_0x44b6('0x1')]={'name':{'type':Sequelize[_0x44b6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x44b6('0x3')](_0x44b6('0x4'),'timeout'),'defaultValue':_0x44b6('0x4')},'selector':{'type':Sequelize[_0x44b6('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index c15b567..f20cd66 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 _0x32ff=['attributes','intersection','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x32ff,0xc7));var _0xf32f=function(_0x2f0c73,_0x59f591){_0x2f0c73=_0x2f0c73-0x0;var _0xd82041=_0x32ff[_0x2f0c73];return _0xd82041;};'use strict';var emlformat=require(_0xf32f('0x0'));var rimraf=require(_0xf32f('0x1'));var zipdir=require(_0xf32f('0x2'));var jsonpatch=require(_0xf32f('0x3'));var rp=require(_0xf32f('0x4'));var moment=require(_0xf32f('0x5'));var BPromise=require(_0xf32f('0x6'));var Mustache=require(_0xf32f('0x7'));var util=require(_0xf32f('0x8'));var path=require(_0xf32f('0x9'));var sox=require(_0xf32f('0xa'));var csv=require(_0xf32f('0xb'));var ejs=require(_0xf32f('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf32f('0xd'));var squel=require('squel');var crypto=require(_0xf32f('0xe'));var jsforce=require(_0xf32f('0xf'));var deskjs=require(_0xf32f('0x10'));var toCsv=require(_0xf32f('0xb'));var querystring=require(_0xf32f('0x11'));var Papa=require(_0xf32f('0x12'));var Redis=require(_0xf32f('0x13'));var authService=require(_0xf32f('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf32f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf32f('0x16'));var config=require(_0xf32f('0x17'));var licenseUtil=require(_0xf32f('0x18'));var db=require(_0xf32f('0x19'))['db'];function respondWithStatusCode(_0xe12aea,_0x159f72){_0x159f72=_0x159f72||0xcc;return function(_0x257380){if(_0x257380){return _0xe12aea[_0xf32f('0x1a')](_0x159f72);}return _0xe12aea[_0xf32f('0x1b')](_0x159f72)['end']();};}function respondWithResult(_0x83c7d9,_0x120885){_0x120885=_0x120885||0xc8;return function(_0x174efc){if(_0x174efc){return _0x83c7d9['status'](_0x120885)[_0xf32f('0x1c')](_0x174efc);}};}function respondWithFilteredResult(_0x1750fa,_0xeec5c){return function(_0x160ba1){if(_0x160ba1){var _0x1b7dc3=typeof _0xeec5c[_0xf32f('0x1d')]==='undefined'&&typeof _0xeec5c[_0xf32f('0x1e')]==='undefined';var _0x140126=_0x160ba1['count'];var _0x19ffa2=_0x1b7dc3?0x0:_0xeec5c[_0xf32f('0x1d')];var _0x8cf34d=_0x1b7dc3?_0x160ba1[_0xf32f('0x1f')]:_0xeec5c['offset']+_0xeec5c[_0xf32f('0x1e')];var _0x181d12;if(_0x8cf34d>=_0x140126){_0x8cf34d=_0x140126;_0x181d12=0xc8;}else{_0x181d12=0xce;}_0x1750fa['status'](_0x181d12);return _0x1750fa[_0xf32f('0x20')](_0xf32f('0x21'),_0x19ffa2+'-'+_0x8cf34d+'/'+_0x140126)['json'](_0x160ba1);}return null;};}function patchUpdates(_0x25cb11){return function(_0x40dbdb){try{jsonpatch[_0xf32f('0x22')](_0x40dbdb,_0x25cb11,!![]);}catch(_0xf2fa68){return BPromise[_0xf32f('0x23')](_0xf2fa68);}return _0x40dbdb[_0xf32f('0x24')]();};}function saveUpdates(_0x465f80,_0xe0b16d){return function(_0x48a316){if(_0x48a316){return _0x48a316[_0xf32f('0x25')](_0x465f80)[_0xf32f('0x26')](function(_0xcad45b){return _0xcad45b;});}return null;};}function removeEntity(_0x27007d,_0x360a68){return function(_0x5d0c5a){if(_0x5d0c5a){return _0x5d0c5a[_0xf32f('0x27')]()['then'](function(){_0x27007d[_0xf32f('0x1b')](0xcc)[_0xf32f('0x28')]();});}};}function handleEntityNotFound(_0x52eac7,_0x517924){return function(_0x48c9b7){if(!_0x48c9b7){_0x52eac7[_0xf32f('0x1a')](0x194);}return _0x48c9b7;};}function handleError(_0x450056,_0x2edf3a){_0x2edf3a=_0x2edf3a||0x1f4;return function(_0x3ac4d3){logger[_0xf32f('0x29')](_0x3ac4d3[_0xf32f('0x2a')]);if(_0x3ac4d3[_0xf32f('0x2b')]){delete _0x3ac4d3[_0xf32f('0x2b')];}_0x450056[_0xf32f('0x1b')](_0x2edf3a)[_0xf32f('0x2c')](_0x3ac4d3);};}exports[_0xf32f('0x2d')]=function(_0xe631d0,_0x4f9feb){var _0x9ff745={'raw':!![],'where':{'id':_0xe631d0[_0xf32f('0x2e')]['id']}},_0x285eb9={};_0x285eb9['model']=_[_0xf32f('0x2f')](db[_0xf32f('0x30')][_0xf32f('0x31')]);_0x285eb9[_0xf32f('0x32')]=_[_0xf32f('0x2f')](_0xe631d0[_0xf32f('0x32')]);_0x285eb9[_0xf32f('0x33')]=_['intersection'](_0x285eb9[_0xf32f('0x34')],_0x285eb9[_0xf32f('0x32')]);_0x9ff745[_0xf32f('0x35')]=_[_0xf32f('0x36')](_0x285eb9[_0xf32f('0x34')],qs['fields'](_0xe631d0[_0xf32f('0x32')]['fields']));_0x9ff745['attributes']=_0x9ff745[_0xf32f('0x35')][_0xf32f('0x37')]?_0x9ff745[_0xf32f('0x35')]:_0x285eb9[_0xf32f('0x34')];if(_0xe631d0[_0xf32f('0x32')][_0xf32f('0x38')]){_0x9ff745['include']=[{'all':!![]}];}_0x9ff745=_[_0xf32f('0x39')]({},_0x9ff745,_0xe631d0[_0xf32f('0x3a')]);return db[_0xf32f('0x30')][_0xf32f('0x3b')](_0x9ff745)[_0xf32f('0x26')](handleEntityNotFound(_0x4f9feb,null))[_0xf32f('0x26')](respondWithResult(_0x4f9feb,null))[_0xf32f('0x3c')](handleError(_0x4f9feb,null));};exports[_0xf32f('0x3d')]=function(_0x5e79b2,_0x3f6769){return db[_0xf32f('0x30')]['create'](_0x5e79b2[_0xf32f('0x3e')],{})[_0xf32f('0x26')](respondWithResult(_0x3f6769,0xc9))[_0xf32f('0x3c')](handleError(_0x3f6769,null));};exports['update']=function(_0x1c618c,_0x14418a){if(_0x1c618c[_0xf32f('0x3e')]['id']){delete _0x1c618c[_0xf32f('0x3e')]['id'];}return db[_0xf32f('0x30')][_0xf32f('0x3b')]({'where':{'id':_0x1c618c[_0xf32f('0x2e')]['id']}})[_0xf32f('0x26')](handleEntityNotFound(_0x14418a,null))[_0xf32f('0x26')](saveUpdates(_0x1c618c[_0xf32f('0x3e')],null))[_0xf32f('0x26')](respondWithResult(_0x14418a,null))[_0xf32f('0x3c')](handleError(_0x14418a,null));};exports[_0xf32f('0x27')]=function(_0x68efde,_0x3c79d0){return db['ChatProactiveAction'][_0xf32f('0x3b')]({'where':{'id':_0x68efde[_0xf32f('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3c79d0,null))[_0xf32f('0x26')](removeEntity(_0x3c79d0,null))[_0xf32f('0x3c')](handleError(_0x3c79d0,null));};
\ No newline at end of file
+var _0x0faf=['options','find','create','body','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','name','send','show','model','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge'];(function(_0x2fa167,_0x5a76e9){var _0x759825=function(_0x5432ad){while(--_0x5432ad){_0x2fa167['push'](_0x2fa167['shift']());}};_0x759825(++_0x5a76e9);}(_0x0faf,0x132));var _0xf0fa=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x0faf[_0x4456a2];return _0xf36b56;};'use strict';var emlformat=require(_0xf0fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0fa('0x1'));var jsonpatch=require(_0xf0fa('0x2'));var rp=require(_0xf0fa('0x3'));var moment=require(_0xf0fa('0x4'));var BPromise=require(_0xf0fa('0x5'));var Mustache=require(_0xf0fa('0x6'));var util=require(_0xf0fa('0x7'));var path=require(_0xf0fa('0x8'));var sox=require(_0xf0fa('0x9'));var csv=require('to-csv');var ejs=require(_0xf0fa('0xa'));var fs=require('fs');var fs_extra=require(_0xf0fa('0xb'));var _=require(_0xf0fa('0xc'));var squel=require(_0xf0fa('0xd'));var crypto=require(_0xf0fa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf0fa('0xf'));var toCsv=require(_0xf0fa('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0fa('0x11'));var authService=require(_0xf0fa('0x12'));var qs=require(_0xf0fa('0x13'));var as=require(_0xf0fa('0x14'));var hardwareService=require(_0xf0fa('0x15'));var logger=require(_0xf0fa('0x16'))(_0xf0fa('0x17'));var utils=require(_0xf0fa('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf0fa('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f46ff,_0x521034){_0x521034=_0x521034||0xcc;return function(_0x39ae2b){if(_0x39ae2b){return _0x2f46ff[_0xf0fa('0x1a')](_0x521034);}return _0x2f46ff[_0xf0fa('0x1b')](_0x521034)['end']();};}function respondWithResult(_0x5821ae,_0x42591b){_0x42591b=_0x42591b||0xc8;return function(_0x540a04){if(_0x540a04){return _0x5821ae[_0xf0fa('0x1b')](_0x42591b)[_0xf0fa('0x1c')](_0x540a04);}};}function respondWithFilteredResult(_0x10ce43,_0x3203ce){return function(_0x467d5f){if(_0x467d5f){var _0x33df80=typeof _0x3203ce[_0xf0fa('0x1d')]===_0xf0fa('0x1e')&&typeof _0x3203ce['limit']===_0xf0fa('0x1e');var _0x477914=_0x467d5f[_0xf0fa('0x1f')];var _0x1d3c22=_0x33df80?0x0:_0x3203ce[_0xf0fa('0x1d')];var _0x386e5f=_0x33df80?_0x467d5f['count']:_0x3203ce['offset']+_0x3203ce[_0xf0fa('0x20')];var _0x2751cc;if(_0x386e5f>=_0x477914){_0x386e5f=_0x477914;_0x2751cc=0xc8;}else{_0x2751cc=0xce;}_0x10ce43[_0xf0fa('0x1b')](_0x2751cc);return _0x10ce43[_0xf0fa('0x21')](_0xf0fa('0x22'),_0x1d3c22+'-'+_0x386e5f+'/'+_0x477914)[_0xf0fa('0x1c')](_0x467d5f);}return null;};}function patchUpdates(_0x32c9bc){return function(_0x3de639){try{jsonpatch[_0xf0fa('0x23')](_0x3de639,_0x32c9bc,!![]);}catch(_0x15942b){return BPromise[_0xf0fa('0x24')](_0x15942b);}return _0x3de639['save']();};}function saveUpdates(_0x10c93e,_0x306f3e){return function(_0x39e82d){if(_0x39e82d){return _0x39e82d[_0xf0fa('0x25')](_0x10c93e)[_0xf0fa('0x26')](function(_0x2b22c5){return _0x2b22c5;});}return null;};}function removeEntity(_0x3901aa,_0x1f0eaf){return function(_0x3feb0c){if(_0x3feb0c){return _0x3feb0c['destroy']()[_0xf0fa('0x26')](function(){_0x3901aa[_0xf0fa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b5d7d,_0x3703b5){return function(_0x2efe88){if(!_0x2efe88){_0x3b5d7d['sendStatus'](0x194);}return _0x2efe88;};}function handleError(_0xded80d,_0x284499){_0x284499=_0x284499||0x1f4;return function(_0x3d10fb){logger[_0xf0fa('0x27')](_0x3d10fb['stack']);if(_0x3d10fb['name']){delete _0x3d10fb[_0xf0fa('0x28')];}_0xded80d[_0xf0fa('0x1b')](_0x284499)[_0xf0fa('0x29')](_0x3d10fb);};}exports[_0xf0fa('0x2a')]=function(_0x57b8e9,_0x4058d6){var _0x409a8c={'raw':!![],'where':{'id':_0x57b8e9['params']['id']}},_0x1279cf={};_0x1279cf[_0xf0fa('0x2b')]=_['keys'](db[_0xf0fa('0x2c')][_0xf0fa('0x2d')]);_0x1279cf[_0xf0fa('0x2e')]=_['keys'](_0x57b8e9[_0xf0fa('0x2e')]);_0x1279cf[_0xf0fa('0x2f')]=_[_0xf0fa('0x30')](_0x1279cf[_0xf0fa('0x2b')],_0x1279cf[_0xf0fa('0x2e')]);_0x409a8c[_0xf0fa('0x31')]=_['intersection'](_0x1279cf['model'],qs[_0xf0fa('0x32')](_0x57b8e9[_0xf0fa('0x2e')]['fields']));_0x409a8c[_0xf0fa('0x31')]=_0x409a8c['attributes']['length']?_0x409a8c['attributes']:_0x1279cf[_0xf0fa('0x2b')];if(_0x57b8e9['query'][_0xf0fa('0x33')]){_0x409a8c[_0xf0fa('0x34')]=[{'all':!![]}];}_0x409a8c=_[_0xf0fa('0x35')]({},_0x409a8c,_0x57b8e9[_0xf0fa('0x36')]);return db[_0xf0fa('0x2c')][_0xf0fa('0x37')](_0x409a8c)[_0xf0fa('0x26')](handleEntityNotFound(_0x4058d6,null))[_0xf0fa('0x26')](respondWithResult(_0x4058d6,null))['catch'](handleError(_0x4058d6,null));};exports[_0xf0fa('0x38')]=function(_0x307aa8,_0x36dd2b){return db['ChatProactiveAction'][_0xf0fa('0x38')](_0x307aa8[_0xf0fa('0x39')],{})[_0xf0fa('0x26')](respondWithResult(_0x36dd2b,0xc9))[_0xf0fa('0x3a')](handleError(_0x36dd2b,null));};exports['update']=function(_0x5c474e,_0x2a9f4b){if(_0x5c474e[_0xf0fa('0x39')]['id']){delete _0x5c474e[_0xf0fa('0x39')]['id'];}return db[_0xf0fa('0x2c')][_0xf0fa('0x37')]({'where':{'id':_0x5c474e['params']['id']}})['then'](handleEntityNotFound(_0x2a9f4b,null))['then'](saveUpdates(_0x5c474e['body'],null))[_0xf0fa('0x26')](respondWithResult(_0x2a9f4b,null))[_0xf0fa('0x3a')](handleError(_0x2a9f4b,null));};exports['destroy']=function(_0x4ff1a5,_0xdada45){return db[_0xf0fa('0x2c')][_0xf0fa('0x37')]({'where':{'id':_0x4ff1a5[_0xf0fa('0x3b')]['id']}})[_0xf0fa('0x26')](handleEntityNotFound(_0xdada45,null))[_0xf0fa('0x26')](removeEntity(_0xdada45,null))[_0xf0fa('0x3a')](handleError(_0xdada45,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b958ec8..24e8991 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 _0x883d=['chat_proactive_actions','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatProactiveAction'];(function(_0x355141,_0x4ce3bd){var _0x328382=function(_0x44e03c){while(--_0x44e03c){_0x355141['push'](_0x355141['shift']());}};_0x328382(++_0x4ce3bd);}(_0x883d,0x90));var _0xd883=function(_0x3cb8ea,_0x30f75d){_0x3cb8ea=_0x3cb8ea-0x0;var _0x430985=_0x883d[_0x3cb8ea];return _0x430985;};'use strict';var _=require(_0xd883('0x0'));var util=require('util');var logger=require(_0xd883('0x1'))('api');var moment=require(_0xd883('0x2'));var BPromise=require(_0xd883('0x3'));var rp=require(_0xd883('0x4'));var fs=require('fs');var path=require(_0xd883('0x5'));var rimraf=require(_0xd883('0x6'));var config=require(_0xd883('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x14da31,_0xd62e7f){return _0x14da31[_0xd883('0x8')](_0xd883('0x9'),attributes,{'tableName':_0xd883('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e52=['../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xc15fc,_0x5a2e1f){var _0x2a8c36=function(_0x5029a1){while(--_0x5029a1){_0xc15fc['push'](_0xc15fc['shift']());}};_0x2a8c36(++_0x5a2e1f);}(_0x7e52,0x17e));var _0x27e5=function(_0x15fe30,_0x38f044){_0x15fe30=_0x15fe30-0x0;var _0x12ebe7=_0x7e52[_0x15fe30];return _0x12ebe7;};'use strict';var _=require(_0x27e5('0x0'));var util=require('util');var logger=require(_0x27e5('0x1'))(_0x27e5('0x2'));var moment=require(_0x27e5('0x3'));var BPromise=require(_0x27e5('0x4'));var rp=require(_0x27e5('0x5'));var fs=require('fs');var path=require(_0x27e5('0x6'));var rimraf=require(_0x27e5('0x7'));var config=require(_0x27e5('0x8'));var attributes=require(_0x27e5('0x9'));module['exports']=function(_0x1804e2,_0x348e0f){return _0x1804e2[_0x27e5('0xa')](_0x27e5('0xb'),attributes,{'tableName':_0x27e5('0xc'),'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 57a7c08..7959d12 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 _0xece2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x5b8704,_0x40b036){var _0x5bdc53=function(_0x354b24){while(--_0x354b24){_0x5b8704['push'](_0x5b8704['shift']());}};_0x5bdc53(++_0x40b036);}(_0xece2,0xd9));var _0x2ece=function(_0x449f06,_0x56a32c){_0x449f06=_0x449f06-0x0;var _0x179378=_0xece2[_0x449f06];return _0x179378;};'use strict';var _=require(_0x2ece('0x0'));var util=require(_0x2ece('0x1'));var moment=require(_0x2ece('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ece('0x3'));var db=require(_0x2ece('0x4'))['db'];var utils=require(_0x2ece('0x5'));var logger=require(_0x2ece('0x6'))('rpc');var config=require(_0x2ece('0x7'));var jayson=require(_0x2ece('0x8'));var client=jayson['client'][_0x2ece('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46917a,_0x14a892,_0x469b73){return new BPromise(function(_0x452c3b,_0x1aa0fe){return client['request'](_0x46917a,_0x469b73)[_0x2ece('0xa')](function(_0x37346b){logger[_0x2ece('0xb')](_0x2ece('0xc'),_0x14a892,'request\x20sent');logger[_0x2ece('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x14a892,'request\x20sent',JSON[_0x2ece('0xe')](_0x37346b));if(_0x37346b['error']){if(_0x37346b[_0x2ece('0xf')]['code']===0x1f4){logger[_0x2ece('0xf')](_0x2ece('0xc'),_0x14a892,_0x37346b['error'][_0x2ece('0x10')]);return _0x1aa0fe(_0x37346b[_0x2ece('0xf')][_0x2ece('0x10')]);}logger[_0x2ece('0xf')](_0x2ece('0xc'),_0x14a892,_0x37346b[_0x2ece('0xf')][_0x2ece('0x10')]);return _0x452c3b(_0x37346b[_0x2ece('0xf')][_0x2ece('0x10')]);}else{logger['info'](_0x2ece('0xc'),_0x14a892,_0x2ece('0x11'));_0x452c3b(_0x37346b[_0x2ece('0x12')][_0x2ece('0x10')]);}})[_0x2ece('0x13')](function(_0x757b0){logger[_0x2ece('0xf')](_0x2ece('0xc'),_0x14a892,_0x757b0);_0x1aa0fe(_0x757b0);});});}
\ No newline at end of file
+var _0x4c3b=['code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','http','info','request\x20sent','debug','stringify','error'];(function(_0x49fb23,_0x5340d4){var _0x4ef27b=function(_0xe79ef4){while(--_0xe79ef4){_0x49fb23['push'](_0x49fb23['shift']());}};_0x4ef27b(++_0x5340d4);}(_0x4c3b,0x16d));var _0xb4c3=function(_0x571726,_0x4c5bd1){_0x571726=_0x571726-0x0;var _0x53a3d8=_0x4c3b[_0x571726];return _0x53a3d8;};'use strict';var _=require(_0xb4c3('0x0'));var util=require(_0xb4c3('0x1'));var moment=require(_0xb4c3('0x2'));var BPromise=require(_0xb4c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4c3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4c3('0x5'))(_0xb4c3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb4c3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a9417,_0x2d67d3,_0x3191f2){return new BPromise(function(_0x3cfd9a,_0x4ae5e5){return client['request'](_0x1a9417,_0x3191f2)['then'](function(_0x147203){logger[_0xb4c3('0x8')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d67d3,_0xb4c3('0x9'));logger[_0xb4c3('0xa')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2d67d3,'request\x20sent',JSON[_0xb4c3('0xb')](_0x147203));if(_0x147203[_0xb4c3('0xc')]){if(_0x147203['error'][_0xb4c3('0xd')]===0x1f4){logger[_0xb4c3('0xc')](_0xb4c3('0xe'),_0x2d67d3,_0x147203[_0xb4c3('0xc')]['message']);return _0x4ae5e5(_0x147203[_0xb4c3('0xc')]['message']);}logger['error'](_0xb4c3('0xe'),_0x2d67d3,_0x147203[_0xb4c3('0xc')][_0xb4c3('0xf')]);return _0x3cfd9a(_0x147203[_0xb4c3('0xc')][_0xb4c3('0xf')]);}else{logger[_0xb4c3('0x8')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d67d3,_0xb4c3('0x9'));_0x3cfd9a(_0x147203[_0xb4c3('0x10')][_0xb4c3('0xf')]);}})[_0xb4c3('0x11')](function(_0x4ebf9){logger[_0xb4c3('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x2d67d3,_0x4ebf9);_0x4ae5e5(_0x4ebf9);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 582ca10..d005459 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 _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0xbec2cd,_0xcf1938){var _0x38142e=function(_0x2abf51){while(--_0x2abf51){_0xbec2cd['push'](_0xbec2cd['shift']());}};_0x38142e(++_0xcf1938);}(_0x31f0,0xb7));var _0x031f=function(_0xb30c72,_0x38c379){_0xb30c72=_0xb30c72-0x0;var _0x5c2b2e=_0x31f0[_0xb30c72];return _0x5c2b2e;};'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
+var _0x8958=['show','post','put','update','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x3cc418,_0xe8585d){var _0x307a5b=function(_0x347f56){while(--_0x347f56){_0x3cc418['push'](_0x3cc418['shift']());}};_0x307a5b(++_0xe8585d);}(_0x8958,0x93));var _0x8895=function(_0x18f3a6,_0x4561f7){_0x18f3a6=_0x18f3a6-0x0;var _0x37b39c=_0x8958[_0x18f3a6];return _0x37b39c;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get'](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0x7')]);router[_0x8895('0x8')]('/',auth[_0x8895('0x6')](),controller['create']);router[_0x8895('0x9')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xc')]);module[_0x8895('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 73c75e3..108b33d 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 _0x9319=['sequelize','exports','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x2eae90,_0x3b09f2){var _0x27fce6=function(_0x30c5c7){while(--_0x30c5c7){_0x2eae90['push'](_0x2eae90['shift']());}};_0x27fce6(++_0x3b09f2);}(_0x9319,0xe0));var _0x9931=function(_0x45d5bf,_0x338e8e){_0x45d5bf=_0x45d5bf-0x0;var _0x5197d3=_0x9319[_0x45d5bf];return _0x5197d3;};'use strict';var Sequelize=require(_0x9931('0x0'));module[_0x9931('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9931('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9931('0x3')](_0x9931('0x4'),_0x9931('0x5'),_0x9931('0x6'))}};
\ No newline at end of file
+var _0x5f07=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x5aea3e,_0x20d237){var _0x558b7b=function(_0x46b629){while(--_0x46b629){_0x5aea3e['push'](_0x5aea3e['shift']());}};_0x558b7b(++_0x20d237);}(_0x5f07,0x121));var _0x75f0=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f07[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x75f0('0x0'));module[_0x75f0('0x1')]={'name':{'type':Sequelize[_0x75f0('0x2')],'unique':_0x75f0('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x75f0('0x2')]},'timeout':{'type':Sequelize[_0x75f0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x75f0('0x5'),_0x75f0('0x6'),_0x75f0('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index d47c292..37f8735 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 _0x6450=['include','query','findAll','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','UserChatQueue','nolimit','order','sort','pick','ChatQueueId','filter','map','User','findAndCountAll','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','hasOwnProperty','addTeams','ids','online','interface','flatMap','sequelize','transaction','each','forEach','userChatQueue:save','removeTeams','Agents','select','field','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','destroy','get','ChatQueues','error','name','send','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where'];(function(_0x1ee73f,_0x3b0729){var _0x5954f9=function(_0x2cf6b5){while(--_0x2cf6b5){_0x1ee73f['push'](_0x1ee73f['shift']());}};_0x5954f9(++_0x3b0729);}(_0x6450,0x1b4));var _0x0645=function(_0x33b9d8,_0x3b087c){_0x33b9d8=_0x33b9d8-0x0;var _0x1cffc7=_0x6450[_0x33b9d8];return _0x1cffc7;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x0645('0x0'));var squel=require('squel');var Redis=require(_0x0645('0x1'));var qs=require(_0x0645('0x2'));var logger=require(_0x0645('0x3'))(_0x0645('0x4'));var config=require(_0x0645('0x5'));var db=require(_0x0645('0x6'))['db'];config['redis']=_[_0x0645('0x7')](config[_0x0645('0x8')],{'host':_0x0645('0x9'),'port':0x18eb});var socket=require(_0x0645('0xa'))(new Redis(config['redis']));require(_0x0645('0xb'))['register'](socket);function respondWithStatusCode(_0x3946d9,_0xda538b){_0xda538b=_0xda538b||0xcc;return function(_0xb3febe){if(_0xb3febe){return _0x3946d9[_0x0645('0xc')](_0xda538b);}return _0x3946d9[_0x0645('0xd')](_0xda538b)[_0x0645('0xe')]();};}function respondWithResult(_0x40bf96,_0xab72b4){_0xab72b4=_0xab72b4||0xc8;return function(_0x32f9d4){if(_0x32f9d4){return _0x40bf96[_0x0645('0xd')](_0xab72b4)[_0x0645('0xf')](_0x32f9d4);}};}function respondWithFilteredResult(_0x328d0d,_0x3e15b8){return function(_0x3b7da4){if(_0x3b7da4){var _0x48f428=typeof _0x3e15b8['offset']===_0x0645('0x10')&&typeof _0x3e15b8[_0x0645('0x11')]===_0x0645('0x10');var _0x330773=_0x3b7da4[_0x0645('0x12')];var _0x5d32af=_0x48f428?0x0:_0x3e15b8[_0x0645('0x13')];var _0x3858fb=_0x48f428?_0x3b7da4['count']:_0x3e15b8[_0x0645('0x13')]+_0x3e15b8['limit'];var _0x51bdab;if(_0x3858fb>=_0x330773){_0x3858fb=_0x330773;_0x51bdab=0xc8;}else{_0x51bdab=0xce;}_0x328d0d[_0x0645('0xd')](_0x51bdab);return _0x328d0d['set'](_0x0645('0x14'),_0x5d32af+'-'+_0x3858fb+'/'+_0x330773)['json'](_0x3b7da4);}return null;};}function saveUpdates(_0x3273c1){return function(_0x173109){if(_0x173109){return _0x173109[_0x0645('0x15')](_0x3273c1)[_0x0645('0x16')](function(_0x451a79){return _0x451a79;});}return null;};}function removeEntity(_0x2b54b4){return function(_0x50a3cb){if(_0x50a3cb){return _0x50a3cb[_0x0645('0x17')]()['then'](function(){var _0x1da23b=_0x50a3cb[_0x0645('0x18')]({'plain':!![]});var _0x542f42=_0x0645('0x19');return db['UserProfileResource']['destroy']({'where':{'type':_0x542f42,'resourceId':_0x1da23b['id']}})[_0x0645('0x16')](function(){return _0x50a3cb;});})[_0x0645('0x16')](function(){_0x2b54b4[_0x0645('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37d765){return function(_0x54dbd4){if(!_0x54dbd4){_0x37d765[_0x0645('0xc')](0x194);}return _0x54dbd4;};}function handleError(_0x54ee29,_0xe6e56d){_0xe6e56d=_0xe6e56d||0x1f4;return function(_0x497ff7){logger[_0x0645('0x1a')](_0x497ff7['stack']);if(_0x497ff7['name']){delete _0x497ff7[_0x0645('0x1b')];}_0x54ee29['status'](_0xe6e56d)[_0x0645('0x1c')](_0x497ff7);};}exports['index']=function(_0x52e6e2,_0x329e07){var _0x5098ec={};var _0x217666={'count':0x0,'rows':[]};var _0x586e09=_['map'](db[_0x0645('0x1d')][_0x0645('0x1e')],function(_0x1c89ae){return{'name':_0x1c89ae[_0x0645('0x1f')],'type':_0x1c89ae[_0x0645('0x20')][_0x0645('0x21')]};});_0x5098ec=qs[_0x0645('0x22')](_0x586e09,_0x52e6e2);var _0x16ce72={'where':_0x5098ec[_0x0645('0x23')]};return db[_0x0645('0x1d')][_0x0645('0x12')](_0x16ce72)[_0x0645('0x16')](function(_0x562909){_0x217666[_0x0645('0x12')]=_0x562909;_0x5098ec['include']=qs[_0x0645('0x24')](_0x52e6e2[_0x0645('0x25')]);return db[_0x0645('0x1d')][_0x0645('0x26')](_0x5098ec);})[_0x0645('0x16')](function(_0x1563d6){_0x217666['rows']=_0x1563d6;return _0x217666;})['then'](respondWithFilteredResult(_0x329e07,_0x5098ec))[_0x0645('0x27')](handleError(_0x329e07,null));};exports[_0x0645('0x28')]=function(_0xf2f38d,_0x27da7d){var _0x4b5d38={'raw':!![],'where':{'id':_0xf2f38d[_0x0645('0x29')]['id']}},_0x572d63={};_0x572d63[_0x0645('0x2a')]=_[_0x0645('0x2b')](db[_0x0645('0x1d')][_0x0645('0x1e')]);_0x572d63['query']=_[_0x0645('0x2b')](_0xf2f38d['query']);_0x572d63[_0x0645('0x2c')]=_[_0x0645('0x2d')](_0x572d63[_0x0645('0x2a')],_0x572d63[_0x0645('0x25')]);_0x4b5d38[_0x0645('0x2e')]=_['intersection'](_0x572d63[_0x0645('0x2a')],qs[_0x0645('0x2f')](_0xf2f38d[_0x0645('0x25')]['fields']));_0x4b5d38[_0x0645('0x2e')]=_0x4b5d38['attributes'][_0x0645('0x30')]?_0x4b5d38[_0x0645('0x2e')]:_0x572d63[_0x0645('0x2a')];if(_0xf2f38d[_0x0645('0x25')][_0x0645('0x31')]){_0x4b5d38[_0x0645('0x24')]=[{'all':!![]}];}_0x4b5d38=_[_0x0645('0x32')]({},_0x4b5d38,_0xf2f38d[_0x0645('0x33')]);return db[_0x0645('0x1d')][_0x0645('0x34')](_0x4b5d38)[_0x0645('0x16')](handleEntityNotFound(_0x27da7d,null))[_0x0645('0x16')](respondWithResult(_0x27da7d,null))[_0x0645('0x27')](handleError(_0x27da7d,null));};exports['create']=function(_0x22a0e1,_0x48e7dc){return db[_0x0645('0x1d')][_0x0645('0x35')](_0x22a0e1[_0x0645('0x36')],{})[_0x0645('0x16')](function(_0x749940){var _0x919ccb=_0x22a0e1[_0x0645('0x37')][_0x0645('0x18')]({'plain':!![]});if(!_0x919ccb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x919ccb[_0x0645('0x38')]===_0x0645('0x37')){var _0x5000fb=_0x749940[_0x0645('0x18')]({'plain':!![]});var _0x233060='ChatQueues';return db[_0x0645('0x39')][_0x0645('0x34')]({'where':{'name':_0x233060,'userProfileId':_0x919ccb[_0x0645('0x3a')]},'raw':!![]})[_0x0645('0x16')](function(_0x1dc0b1){if(_0x1dc0b1&&_0x1dc0b1['autoAssociation']===0x0){return db[_0x0645('0x3b')]['create']({'name':_0x5000fb[_0x0645('0x1b')],'resourceId':_0x5000fb['id'],'type':_0x1dc0b1[_0x0645('0x1b')],'sectionId':_0x1dc0b1['id']},{})[_0x0645('0x16')](function(){return _0x749940;});}else{return _0x749940;}})[_0x0645('0x27')](function(_0x271176){logger[_0x0645('0x1a')](_0x0645('0x3c'),_0x271176);throw _0x271176;});}return _0x749940;})[_0x0645('0x16')](respondWithResult(_0x48e7dc,0xc9))['catch'](handleError(_0x48e7dc,null));};exports['update']=function(_0x5b793b,_0x50ff6a){if(_0x5b793b['body']['id']){delete _0x5b793b[_0x0645('0x36')]['id'];}return db[_0x0645('0x1d')][_0x0645('0x34')]({'where':{'id':_0x5b793b['params']['id']}})['then'](handleEntityNotFound(_0x50ff6a,null))[_0x0645('0x16')](saveUpdates(_0x5b793b[_0x0645('0x36')],null))[_0x0645('0x16')](respondWithResult(_0x50ff6a,null))[_0x0645('0x27')](handleError(_0x50ff6a,null));};exports['destroy']=function(_0x502284,_0xa135e8){return db['ChatQueue']['find']({'where':{'id':_0x502284[_0x0645('0x29')]['id']}})[_0x0645('0x16')](handleEntityNotFound(_0xa135e8,null))[_0x0645('0x16')](removeEntity(_0xa135e8,null))[_0x0645('0x27')](handleError(_0xa135e8,null));};exports['describe']=function(_0x1cd039,_0x2ebbb6){return db[_0x0645('0x1d')]['describe']()['then'](respondWithResult(_0x2ebbb6,null))[_0x0645('0x27')](handleError(_0x2ebbb6,null));};exports['getMembers']=function(_0x19f805,_0x5ddb73){var _0x5a7aa3={'raw':!![],'where':{}},_0x3d54a0={},_0x439adf;return db[_0x0645('0x1d')][_0x0645('0x3d')]({'where':{'id':_0x19f805[_0x0645('0x29')]['id']}})[_0x0645('0x16')](handleEntityNotFound(_0x5ddb73,null))[_0x0645('0x16')](function(_0x487961){if(_0x487961){_0x439adf=_0x487961[_0x0645('0x18')]({'plain':!![]});_0x3d54a0[_0x0645('0x2a')]=_['keys'](db[_0x0645('0x3e')]['rawAttributes']);_0x3d54a0[_0x0645('0x25')]=_['keys'](_0x19f805[_0x0645('0x25')]);_0x3d54a0['filters']=_[_0x0645('0x2d')](_0x3d54a0[_0x0645('0x2a')],_0x3d54a0[_0x0645('0x25')]);_0x5a7aa3[_0x0645('0x2e')]=_[_0x0645('0x2d')](_0x3d54a0['model'],qs[_0x0645('0x2f')](_0x19f805[_0x0645('0x25')]['fields']));_0x5a7aa3[_0x0645('0x2e')]=_0x5a7aa3['attributes']['length']?_0x5a7aa3[_0x0645('0x2e')]:_0x3d54a0[_0x0645('0x2a')];if(!_0x19f805[_0x0645('0x25')]['hasOwnProperty'](_0x0645('0x3f'))){_0x5a7aa3[_0x0645('0x11')]=qs[_0x0645('0x11')](_0x19f805[_0x0645('0x25')][_0x0645('0x11')]);_0x5a7aa3[_0x0645('0x13')]=qs[_0x0645('0x13')](_0x19f805[_0x0645('0x25')]['offset']);}_0x5a7aa3[_0x0645('0x40')]=qs[_0x0645('0x41')](_0x19f805[_0x0645('0x25')]['sort']);_0x5a7aa3['where']=qs[_0x0645('0x2c')](_[_0x0645('0x42')](_0x19f805[_0x0645('0x25')],_0x3d54a0[_0x0645('0x2c')]));_0x5a7aa3['where'][_0x0645('0x43')]=_0x487961['id'];if(_0x19f805[_0x0645('0x25')][_0x0645('0x44')]){_0x5a7aa3['where']=_[_0x0645('0x32')](_0x5a7aa3[_0x0645('0x23')],{'$or':_[_0x0645('0x45')](_0x5a7aa3[_0x0645('0x2e')],function(_0x15b6e2){var _0xf79eaa={};_0xf79eaa[_0x15b6e2]={'$like':'%'+_0x19f805[_0x0645('0x25')][_0x0645('0x44')]+'%'};return _0xf79eaa;})});}_0x5a7aa3=_[_0x0645('0x32')]({},_0x5a7aa3,_0x19f805[_0x0645('0x33')]);return db['UserChatQueue']['findAll'](_0x5a7aa3);}})[_0x0645('0x16')](function(_0x4b9763){if(_0x4b9763){return db[_0x0645('0x46')][_0x0645('0x47')]({'where':{'id':_['map'](_0x4b9763,'UserId'),'role':_0x0645('0x48')},'attributes':['id','name',_0x0645('0x49'),_0x0645('0x4a'),'createdAt']});}})[_0x0645('0x16')](function(_0x12ea49){if(_0x12ea49){return{'count':_0x12ea49['count'],'rows':_[_0x0645('0x45')](_0x12ea49['rows'],function(_0x6590fe){return{'membername':_0x6590fe[_0x0645('0x1b')],'UserId':_0x6590fe['id'],'queue_name':_0x439adf[_0x0645('0x1b')],'ChatQueueId':_0x439adf['id'],'interface':util[_0x0645('0x4b')](_0x0645('0x4c'),_0x0645('0x4d'),_0x6590fe[_0x0645('0x1b')]),'penalty':0x0,'paused':_0x6590fe[_0x0645('0x49')],'createdAt':_0x6590fe[_0x0645('0x4e')],'updatedAt':_0x6590fe[_0x0645('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0645('0x16')](respondWithFilteredResult(_0x5ddb73,_0x5a7aa3))[_0x0645('0x27')](handleError(_0x5ddb73,null));};exports[_0x0645('0x4f')]=function(_0x1f1bc8,_0x1125b8){var _0x58b607={};var _0x2138ac={};var _0x5bfbcb;var _0x1b7774;return db['ChatQueue']['findOne']({'where':{'id':_0x1f1bc8[_0x0645('0x29')]['id']}})[_0x0645('0x16')](handleEntityNotFound(_0x1125b8,null))[_0x0645('0x16')](function(_0x22af0a){if(_0x22af0a){_0x5bfbcb=_0x22af0a;_0x2138ac['model']=_[_0x0645('0x2b')](db[_0x0645('0x50')][_0x0645('0x1e')]);_0x2138ac[_0x0645('0x25')]=_[_0x0645('0x2b')](_0x1f1bc8[_0x0645('0x25')]);_0x2138ac['filters']=_['intersection'](_0x2138ac['model'],_0x2138ac[_0x0645('0x25')]);_0x58b607['attributes']=_[_0x0645('0x2d')](_0x2138ac['model'],qs[_0x0645('0x2f')](_0x1f1bc8[_0x0645('0x25')][_0x0645('0x2f')]));_0x58b607[_0x0645('0x2e')]=_0x58b607[_0x0645('0x2e')][_0x0645('0x30')]?_0x58b607[_0x0645('0x2e')]:_0x2138ac[_0x0645('0x2a')];_0x58b607[_0x0645('0x40')]=qs[_0x0645('0x41')](_0x1f1bc8[_0x0645('0x25')][_0x0645('0x41')]);_0x58b607[_0x0645('0x23')]=qs['filters'](_[_0x0645('0x42')](_0x1f1bc8[_0x0645('0x25')],_0x2138ac[_0x0645('0x2c')]));if(_0x1f1bc8[_0x0645('0x25')][_0x0645('0x44')]){_0x58b607[_0x0645('0x23')]=_['merge'](_0x58b607[_0x0645('0x23')],{'$or':_[_0x0645('0x45')](_0x58b607[_0x0645('0x2e')],function(_0x24ed2b){var _0x323529={};_0x323529[_0x24ed2b]={'$like':'%'+_0x1f1bc8['query'][_0x0645('0x44')]+'%'};return _0x323529;})});}_0x58b607=_[_0x0645('0x32')]({},_0x58b607,_0x1f1bc8[_0x0645('0x33')]);return _0x5bfbcb['getTeams'](_0x58b607);}})[_0x0645('0x16')](function(_0x23a3b8){if(_0x23a3b8){_0x1b7774=_0x23a3b8[_0x0645('0x30')];if(!_0x1f1bc8[_0x0645('0x25')][_0x0645('0x51')](_0x0645('0x3f'))){_0x58b607[_0x0645('0x11')]=qs['limit'](_0x1f1bc8[_0x0645('0x25')]['limit']);_0x58b607[_0x0645('0x13')]=qs['offset'](_0x1f1bc8['query'][_0x0645('0x13')]);}return _0x5bfbcb[_0x0645('0x4f')](_0x58b607);}})[_0x0645('0x16')](function(_0x32162a){if(_0x32162a){return _0x32162a?{'count':_0x1b7774,'rows':_0x32162a}:null;}})[_0x0645('0x16')](respondWithResult(_0x1125b8,null))[_0x0645('0x27')](handleError(_0x1125b8,null));};exports[_0x0645('0x52')]=function(_0x270592,_0x3816ed){var _0x83e7ad=_0x270592[_0x0645('0x36')][_0x0645('0x53')];return db[_0x0645('0x50')][_0x0645('0x26')]({'where':{'id':_0x83e7ad},'attributes':['id'],'include':[{'model':db[_0x0645('0x46')],'as':'Agents','attributes':['id',_0x0645('0x1b'),_0x0645('0x54'),'voicePause',_0x0645('0x55')],'raw':!![]}]})[_0x0645('0x16')](function(_0x107168){if(_0x107168){var _0x2ed370=_[_0x0645('0x56')](_0x107168,function(_0x45c28f){var _0x5709f9=_0x45c28f[_0x0645('0x18')]({'plain':!![]});return _0x5709f9['Agents'];});return db[_0x0645('0x1d')][_0x0645('0x34')]({'where':{'id':_0x270592[_0x0645('0x29')]['id']}})['then'](function(_0x244d3f){return db[_0x0645('0x57')][_0x0645('0x58')](function(_0x45a8ba){return _0x244d3f[_0x0645('0x52')](_0x83e7ad,{'transaction':_0x45a8ba})['then'](function(){return BPromise[_0x0645('0x59')](_0x2ed370,function(_0x5984b5){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x5984b5['id'],'ChatQueueId':_0x270592[_0x0645('0x29')]['id']},'transaction':_0x45a8ba});});})[_0x0645('0x16')](function(){_0x2ed370[_0x0645('0x5a')](function(_0x1bf736){socket['emit'](_0x0645('0x5b'),{'UserId':_0x1bf736['id'],'ChatQueueId':_0x244d3f['id']});});});});});}})[_0x0645('0x16')](respondWithStatusCode(_0x3816ed,null))[_0x0645('0x27')](handleError(_0x3816ed,null));};exports[_0x0645('0x5c')]=function(_0x5e3438,_0x1e7a45){return db['Team']['findAll']({'where':{'id':_0x5e3438[_0x0645('0x25')][_0x0645('0x53')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0645('0x5d'),'attributes':['id'],'raw':!![]}]})[_0x0645('0x16')](handleEntityNotFound(_0x1e7a45,null))[_0x0645('0x16')](function(_0x52de67){var _0x274287=_[_0x0645('0x45')](_0x52de67,'id');var _0x4d7ab7=[];var _0xe75ff9=[];var _0x3d97fb=squel[_0x0645('0x5e')]();_0x3d97fb[_0x0645('0x5f')]('tq.TeamId')['from'](_0x0645('0x60'),'tq')[_0x0645('0x61')](_0x0645('0x62'),'ut',_0x0645('0x63'))[_0x0645('0x23')](_0x0645('0x64'),_0x5e3438[_0x0645('0x29')]['id']);for(var _0x16e187=0x0;_0x16e187<_0x52de67[_0x0645('0x30')];_0x16e187+=0x1){let _0x25579d=_0x52de67[_0x16e187];for(var _0x48ab9d=0x0;_0x48ab9d<_0x25579d[_0x0645('0x5d')]['length'];_0x48ab9d+=0x1){let _0x10bcfc=_0x25579d[_0x0645('0x5d')][_0x48ab9d];var _0x87dfe2=_0x3d97fb['clone']();_0x87dfe2[_0x0645('0x23')](_0x0645('0x65'),_0x10bcfc['id']);_0xe75ff9['push'](db[_0x0645('0x57')][_0x0645('0x25')](_0x87dfe2['toString'](),{'type':db['sequelize'][_0x0645('0x66')][_0x0645('0x67')]})[_0x0645('0x16')](function(_0x3670ea){if(_0x3670ea[_0x0645('0x30')]===0x1){return _0x10bcfc['id'];}else{var _0x371ad0=_[_0x0645('0x68')](_[_0x0645('0x45')](_0x3670ea,'TeamId'),function(_0x257850){return _[_0x0645('0x69')](_0x274287,_0x257850);});if(_0x371ad0){return _0x10bcfc['id'];}}}));}}return BPromise[_0x0645('0x6a')](_0xe75ff9)['then'](function(_0x21138b){_0x4d7ab7=_(_0x4d7ab7)[_0x0645('0x6b')](_0x21138b)[_0x0645('0x6c')]()['value']();return db[_0x0645('0x1d')]['find']({'where':{'id':_0x5e3438['params']['id']}})['then'](function(_0x468d28){return db[_0x0645('0x57')][_0x0645('0x58')](function(_0x3a5210){return _0x468d28[_0x0645('0x5c')](_0x5e3438['query'][_0x0645('0x53')],{'transaction':_0x3a5210})[_0x0645('0x16')](function(){if(!_[_0x0645('0x6d')](_0x4d7ab7)){return _0x468d28[_0x0645('0x6e')](_0x4d7ab7,{'transaction':_0x3a5210});}})[_0x0645('0x16')](function(){_0x4d7ab7[_0x0645('0x5a')](function(_0x3dbb41){socket[_0x0645('0x6f')](_0x0645('0x70'),{'UserId':_0x3dbb41,'ChatQueueId':_0x468d28['id']});});});});});});})['then'](respondWithStatusCode(_0x1e7a45,null))[_0x0645('0x27')](handleError(_0x1e7a45,null));};exports[_0x0645('0x71')]=function(_0x37f929,_0xccc21a){return db[_0x0645('0x1d')][_0x0645('0x34')]({'where':{'id':_0x37f929[_0x0645('0x29')]['id']}})[_0x0645('0x16')](handleEntityNotFound(_0xccc21a,null))[_0x0645('0x16')](function(_0x4cea7d){if(_0x4cea7d){return _0x4cea7d[_0x0645('0x71')](_0x37f929[_0x0645('0x36')]['ids'],_[_0x0645('0x72')](_0x37f929[_0x0645('0x36')],[_0x0645('0x53'),'id'])||{})[_0x0645('0x73')](function(_0x145c9c){for(var _0x5cb51d=0x0;_0x5cb51d<_0x37f929[_0x0645('0x36')][_0x0645('0x53')]['length'];_0x5cb51d+=0x1){socket[_0x0645('0x6f')]('userChatQueue:save',{'UserId':Number(_0x37f929[_0x0645('0x36')]['ids'][_0x5cb51d]),'ChatQueueId':Number(_0x37f929[_0x0645('0x29')]['id'])});}return _0x145c9c;});}})[_0x0645('0x16')](respondWithResult(_0xccc21a,null))[_0x0645('0x27')](handleError(_0xccc21a,null));};exports['removeAgents']=function(_0x211d62,_0x4f5c6c){return db[_0x0645('0x1d')]['find']({'where':{'id':_0x211d62[_0x0645('0x29')]['id']}})[_0x0645('0x16')](handleEntityNotFound(_0x4f5c6c,null))[_0x0645('0x16')](function(_0x2117f6){if(_0x2117f6){return _0x2117f6[_0x0645('0x6e')](_0x211d62[_0x0645('0x25')][_0x0645('0x53')])[_0x0645('0x16')](function(){if(_[_0x0645('0x74')](_0x211d62[_0x0645('0x25')][_0x0645('0x53')])){for(var _0x2ae2a0=0x0;_0x2ae2a0<_0x211d62[_0x0645('0x25')][_0x0645('0x53')]['length'];_0x2ae2a0+=0x1){socket[_0x0645('0x6f')](_0x0645('0x70'),{'UserId':Number(_0x211d62['query'][_0x0645('0x53')][_0x2ae2a0]),'ChatQueueId':Number(_0x211d62[_0x0645('0x29')]['id'])});}}else{socket['emit'](_0x0645('0x70'),{'UserId':Number(_0x211d62[_0x0645('0x25')]['ids']),'ChatQueueId':Number(_0x211d62[_0x0645('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f5c6c,null))[_0x0645('0x27')](handleError(_0x4f5c6c,null));};exports['getAgents']=function(_0x4435ba,_0x3f2e14){var _0x4cc9ab={};var _0x1aa631={};var _0x398f77;var _0x256dde;return db[_0x0645('0x1d')]['findOne']({'where':{'id':_0x4435ba[_0x0645('0x29')]['id']}})[_0x0645('0x16')](handleEntityNotFound(_0x3f2e14,null))[_0x0645('0x16')](function(_0x5e2d61){if(_0x5e2d61){_0x398f77=_0x5e2d61;_0x1aa631['model']=_['keys'](db[_0x0645('0x46')][_0x0645('0x1e')]);_0x1aa631[_0x0645('0x25')]=_[_0x0645('0x2b')](_0x4435ba[_0x0645('0x25')]);_0x1aa631[_0x0645('0x2c')]=_[_0x0645('0x2d')](_0x1aa631[_0x0645('0x2a')],_0x1aa631[_0x0645('0x25')]);_0x4cc9ab[_0x0645('0x2e')]=_['intersection'](_0x1aa631[_0x0645('0x2a')],qs[_0x0645('0x2f')](_0x4435ba[_0x0645('0x25')]['fields']));_0x4cc9ab[_0x0645('0x2e')]=_0x4cc9ab[_0x0645('0x2e')][_0x0645('0x30')]?_0x4cc9ab[_0x0645('0x2e')]:_0x1aa631[_0x0645('0x2a')];_0x4cc9ab[_0x0645('0x40')]=qs[_0x0645('0x41')](_0x4435ba['query'][_0x0645('0x41')]);_0x4cc9ab[_0x0645('0x23')]=qs[_0x0645('0x2c')](_[_0x0645('0x42')](_0x4435ba[_0x0645('0x25')],_0x1aa631[_0x0645('0x2c')]));if(_0x4435ba[_0x0645('0x25')][_0x0645('0x44')]){_0x4cc9ab[_0x0645('0x23')]=_[_0x0645('0x32')](_0x4cc9ab[_0x0645('0x23')],{'$or':_[_0x0645('0x45')](_0x4cc9ab[_0x0645('0x2e')],function(_0x15e4e7){var _0x31724b={};_0x31724b[_0x15e4e7]={'$like':'%'+_0x4435ba[_0x0645('0x25')][_0x0645('0x44')]+'%'};return _0x31724b;})});}_0x4cc9ab=_[_0x0645('0x32')]({},_0x4cc9ab,_0x4435ba[_0x0645('0x33')]);return _0x398f77[_0x0645('0x75')](_0x4cc9ab);}})[_0x0645('0x16')](function(_0x6920f8){if(_0x6920f8){_0x256dde=_0x6920f8[_0x0645('0x30')];if(!_0x4435ba['query'][_0x0645('0x51')]('nolimit')){_0x4cc9ab[_0x0645('0x11')]=qs[_0x0645('0x11')](_0x4435ba[_0x0645('0x25')][_0x0645('0x11')]);_0x4cc9ab[_0x0645('0x13')]=qs['offset'](_0x4435ba[_0x0645('0x25')][_0x0645('0x13')]);}return _0x398f77['getAgents'](_0x4cc9ab);}})[_0x0645('0x16')](function(_0x1abb9f){if(_0x1abb9f){return _0x1abb9f?{'count':_0x256dde,'rows':_0x1abb9f}:null;}})['then'](respondWithResult(_0x3f2e14,null))[_0x0645('0x27')](handleError(_0x3f2e14,null));};
\ No newline at end of file
+var _0x1096=['%s/%s','updatedAt','getTeams','addTeams','ids','findAll','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','removeTeams','Team','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','util','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','ChatQueues','UserProfileResource','name','send','index','rawAttributes','fieldName','type','getOptions','where','ChatQueue','include','rows','catch','params','keys','query','filters','model','attributes','intersection','fields','length','includeAll','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','limit','order','sort','pick','filter','map','options','User','findAndCountAll','UserId','agent','chatPause','createdAt','format'];(function(_0x1612bb,_0x53b05c){var _0x365f9d=function(_0x4b1d56){while(--_0x4b1d56){_0x1612bb['push'](_0x1612bb['shift']());}};_0x365f9d(++_0x53b05c);}(_0x1096,0x11b));var _0x6109=function(_0x475a6f,_0x10769f){_0x475a6f=_0x475a6f-0x0;var _0x356d19=_0x1096[_0x475a6f];return _0x356d19;};'use strict';var BPromise=require('bluebird');var util=require(_0x6109('0x0'));var _=require('lodash');var squel=require('squel');var Redis=require(_0x6109('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x6109('0x2'))(_0x6109('0x3'));var config=require(_0x6109('0x4'));var db=require(_0x6109('0x5'))['db'];config[_0x6109('0x6')]=_[_0x6109('0x7')](config[_0x6109('0x6')],{'host':_0x6109('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6109('0x9'))[_0x6109('0xa')](socket);function respondWithStatusCode(_0xafef8e,_0x5cc6b1){_0x5cc6b1=_0x5cc6b1||0xcc;return function(_0x3f2e66){if(_0x3f2e66){return _0xafef8e[_0x6109('0xb')](_0x5cc6b1);}return _0xafef8e[_0x6109('0xc')](_0x5cc6b1)[_0x6109('0xd')]();};}function respondWithResult(_0x98914a,_0x18d5d0){_0x18d5d0=_0x18d5d0||0xc8;return function(_0x38a79c){if(_0x38a79c){return _0x98914a[_0x6109('0xc')](_0x18d5d0)[_0x6109('0xe')](_0x38a79c);}};}function respondWithFilteredResult(_0x3a41b3,_0x2c9eeb){return function(_0x440d1b){if(_0x440d1b){var _0x29f450=typeof _0x2c9eeb[_0x6109('0xf')]===_0x6109('0x10')&&typeof _0x2c9eeb['limit']===_0x6109('0x10');var _0x20a7f4=_0x440d1b[_0x6109('0x11')];var _0x350bc9=_0x29f450?0x0:_0x2c9eeb['offset'];var _0x2f25b0=_0x29f450?_0x440d1b[_0x6109('0x11')]:_0x2c9eeb[_0x6109('0xf')]+_0x2c9eeb['limit'];var _0x468a14;if(_0x2f25b0>=_0x20a7f4){_0x2f25b0=_0x20a7f4;_0x468a14=0xc8;}else{_0x468a14=0xce;}_0x3a41b3[_0x6109('0xc')](_0x468a14);return _0x3a41b3[_0x6109('0x12')](_0x6109('0x13'),_0x350bc9+'-'+_0x2f25b0+'/'+_0x20a7f4)[_0x6109('0xe')](_0x440d1b);}return null;};}function saveUpdates(_0x36438c){return function(_0x1f502e){if(_0x1f502e){return _0x1f502e[_0x6109('0x14')](_0x36438c)['then'](function(_0x202032){return _0x202032;});}return null;};}function removeEntity(_0x597b53){return function(_0x43fb1e){if(_0x43fb1e){return _0x43fb1e[_0x6109('0x15')]()[_0x6109('0x16')](function(){var _0x182df7=_0x43fb1e['get']({'plain':!![]});var _0x47ae63=_0x6109('0x17');return db[_0x6109('0x18')][_0x6109('0x15')]({'where':{'type':_0x47ae63,'resourceId':_0x182df7['id']}})[_0x6109('0x16')](function(){return _0x43fb1e;});})[_0x6109('0x16')](function(){_0x597b53[_0x6109('0xc')](0xcc)[_0x6109('0xd')]();});}};}function handleEntityNotFound(_0x508de9){return function(_0x1e5587){if(!_0x1e5587){_0x508de9[_0x6109('0xb')](0x194);}return _0x1e5587;};}function handleError(_0x4ccf14,_0x3799ad){_0x3799ad=_0x3799ad||0x1f4;return function(_0x119770){logger['error'](_0x119770['stack']);if(_0x119770[_0x6109('0x19')]){delete _0x119770[_0x6109('0x19')];}_0x4ccf14['status'](_0x3799ad)[_0x6109('0x1a')](_0x119770);};}exports[_0x6109('0x1b')]=function(_0x3e9b61,_0x1cde64){var _0x4da4e9={};var _0x3d23ea={'count':0x0,'rows':[]};var _0x150291=_['map'](db['ChatQueue'][_0x6109('0x1c')],function(_0x41e053){return{'name':_0x41e053[_0x6109('0x1d')],'type':_0x41e053[_0x6109('0x1e')]['key']};});_0x4da4e9=qs[_0x6109('0x1f')](_0x150291,_0x3e9b61);var _0x77a9ba={'where':_0x4da4e9[_0x6109('0x20')]};return db[_0x6109('0x21')]['count'](_0x77a9ba)[_0x6109('0x16')](function(_0x29cbae){_0x3d23ea[_0x6109('0x11')]=_0x29cbae;_0x4da4e9[_0x6109('0x22')]=qs[_0x6109('0x22')](_0x3e9b61['query']);return db[_0x6109('0x21')]['findAll'](_0x4da4e9);})[_0x6109('0x16')](function(_0x4b73fa){_0x3d23ea[_0x6109('0x23')]=_0x4b73fa;return _0x3d23ea;})[_0x6109('0x16')](respondWithFilteredResult(_0x1cde64,_0x4da4e9))[_0x6109('0x24')](handleError(_0x1cde64,null));};exports['show']=function(_0x33407a,_0x7c3f3e){var _0x13580c={'raw':!![],'where':{'id':_0x33407a[_0x6109('0x25')]['id']}},_0x3adac3={};_0x3adac3['model']=_[_0x6109('0x26')](db['ChatQueue']['rawAttributes']);_0x3adac3[_0x6109('0x27')]=_[_0x6109('0x26')](_0x33407a['query']);_0x3adac3[_0x6109('0x28')]=_['intersection'](_0x3adac3[_0x6109('0x29')],_0x3adac3[_0x6109('0x27')]);_0x13580c[_0x6109('0x2a')]=_[_0x6109('0x2b')](_0x3adac3['model'],qs[_0x6109('0x2c')](_0x33407a['query'][_0x6109('0x2c')]));_0x13580c[_0x6109('0x2a')]=_0x13580c[_0x6109('0x2a')][_0x6109('0x2d')]?_0x13580c[_0x6109('0x2a')]:_0x3adac3['model'];if(_0x33407a[_0x6109('0x27')][_0x6109('0x2e')]){_0x13580c['include']=[{'all':!![]}];}_0x13580c=_[_0x6109('0x2f')]({},_0x13580c,_0x33407a['options']);return db['ChatQueue'][_0x6109('0x30')](_0x13580c)['then'](handleEntityNotFound(_0x7c3f3e,null))['then'](respondWithResult(_0x7c3f3e,null))['catch'](handleError(_0x7c3f3e,null));};exports['create']=function(_0x406a14,_0x4e6d4a){return db[_0x6109('0x21')][_0x6109('0x31')](_0x406a14[_0x6109('0x32')],{})[_0x6109('0x16')](function(_0x39f6ab){var _0x45a108=_0x406a14[_0x6109('0x33')][_0x6109('0x34')]({'plain':!![]});if(!_0x45a108)throw new Error(_0x6109('0x35'));if(_0x45a108['role']==='user'){var _0x51e27c=_0x39f6ab[_0x6109('0x34')]({'plain':!![]});var _0x50e066='ChatQueues';return db[_0x6109('0x36')][_0x6109('0x30')]({'where':{'name':_0x50e066,'userProfileId':_0x45a108[_0x6109('0x37')]},'raw':!![]})['then'](function(_0x21a371){if(_0x21a371&&_0x21a371['autoAssociation']===0x0){return db[_0x6109('0x18')]['create']({'name':_0x51e27c[_0x6109('0x19')],'resourceId':_0x51e27c['id'],'type':_0x21a371[_0x6109('0x19')],'sectionId':_0x21a371['id']},{})[_0x6109('0x16')](function(){return _0x39f6ab;});}else{return _0x39f6ab;}})[_0x6109('0x24')](function(_0xa22b3f){logger['error'](_0x6109('0x38'),_0xa22b3f);throw _0xa22b3f;});}return _0x39f6ab;})[_0x6109('0x16')](respondWithResult(_0x4e6d4a,0xc9))[_0x6109('0x24')](handleError(_0x4e6d4a,null));};exports[_0x6109('0x14')]=function(_0x285915,_0xfa6380){if(_0x285915['body']['id']){delete _0x285915['body']['id'];}return db[_0x6109('0x21')][_0x6109('0x30')]({'where':{'id':_0x285915[_0x6109('0x25')]['id']}})[_0x6109('0x16')](handleEntityNotFound(_0xfa6380,null))[_0x6109('0x16')](saveUpdates(_0x285915[_0x6109('0x32')],null))[_0x6109('0x16')](respondWithResult(_0xfa6380,null))[_0x6109('0x24')](handleError(_0xfa6380,null));};exports[_0x6109('0x15')]=function(_0x4ef9a9,_0xe0224d){return db[_0x6109('0x21')][_0x6109('0x30')]({'where':{'id':_0x4ef9a9[_0x6109('0x25')]['id']}})[_0x6109('0x16')](handleEntityNotFound(_0xe0224d,null))[_0x6109('0x16')](removeEntity(_0xe0224d,null))['catch'](handleError(_0xe0224d,null));};exports[_0x6109('0x39')]=function(_0x485364,_0x2492dc){return db['ChatQueue'][_0x6109('0x39')]()['then'](respondWithResult(_0x2492dc,null))[_0x6109('0x24')](handleError(_0x2492dc,null));};exports[_0x6109('0x3a')]=function(_0x21f66f,_0x318be6){var _0x40444a={'raw':!![],'where':{}},_0x4243f1={},_0x3fe73a;return db[_0x6109('0x21')][_0x6109('0x3b')]({'where':{'id':_0x21f66f[_0x6109('0x25')]['id']}})[_0x6109('0x16')](handleEntityNotFound(_0x318be6,null))[_0x6109('0x16')](function(_0x578523){if(_0x578523){_0x3fe73a=_0x578523[_0x6109('0x34')]({'plain':!![]});_0x4243f1[_0x6109('0x29')]=_['keys'](db[_0x6109('0x3c')]['rawAttributes']);_0x4243f1[_0x6109('0x27')]=_['keys'](_0x21f66f[_0x6109('0x27')]);_0x4243f1[_0x6109('0x28')]=_[_0x6109('0x2b')](_0x4243f1[_0x6109('0x29')],_0x4243f1[_0x6109('0x27')]);_0x40444a[_0x6109('0x2a')]=_[_0x6109('0x2b')](_0x4243f1['model'],qs['fields'](_0x21f66f[_0x6109('0x27')][_0x6109('0x2c')]));_0x40444a[_0x6109('0x2a')]=_0x40444a[_0x6109('0x2a')][_0x6109('0x2d')]?_0x40444a['attributes']:_0x4243f1[_0x6109('0x29')];if(!_0x21f66f[_0x6109('0x27')][_0x6109('0x3d')](_0x6109('0x3e'))){_0x40444a[_0x6109('0x3f')]=qs[_0x6109('0x3f')](_0x21f66f[_0x6109('0x27')][_0x6109('0x3f')]);_0x40444a[_0x6109('0xf')]=qs[_0x6109('0xf')](_0x21f66f[_0x6109('0x27')][_0x6109('0xf')]);}_0x40444a[_0x6109('0x40')]=qs[_0x6109('0x41')](_0x21f66f[_0x6109('0x27')][_0x6109('0x41')]);_0x40444a[_0x6109('0x20')]=qs['filters'](_[_0x6109('0x42')](_0x21f66f['query'],_0x4243f1[_0x6109('0x28')]));_0x40444a[_0x6109('0x20')]['ChatQueueId']=_0x578523['id'];if(_0x21f66f[_0x6109('0x27')][_0x6109('0x43')]){_0x40444a[_0x6109('0x20')]=_[_0x6109('0x2f')](_0x40444a['where'],{'$or':_[_0x6109('0x44')](_0x40444a[_0x6109('0x2a')],function(_0x34ff29){var _0x589c7e={};_0x589c7e[_0x34ff29]={'$like':'%'+_0x21f66f[_0x6109('0x27')][_0x6109('0x43')]+'%'};return _0x589c7e;})});}_0x40444a=_[_0x6109('0x2f')]({},_0x40444a,_0x21f66f[_0x6109('0x45')]);return db['UserChatQueue']['findAll'](_0x40444a);}})[_0x6109('0x16')](function(_0x3a27c7){if(_0x3a27c7){return db[_0x6109('0x46')][_0x6109('0x47')]({'where':{'id':_['map'](_0x3a27c7,_0x6109('0x48')),'role':_0x6109('0x49')},'attributes':['id','name',_0x6109('0x4a'),'updatedAt',_0x6109('0x4b')]});}})['then'](function(_0x1352b6){if(_0x1352b6){return{'count':_0x1352b6['count'],'rows':_[_0x6109('0x44')](_0x1352b6['rows'],function(_0x3e63c8){return{'membername':_0x3e63c8['name'],'UserId':_0x3e63c8['id'],'queue_name':_0x3fe73a['name'],'ChatQueueId':_0x3fe73a['id'],'interface':util[_0x6109('0x4c')](_0x6109('0x4d'),'SIP',_0x3e63c8[_0x6109('0x19')]),'penalty':0x0,'paused':_0x3e63c8[_0x6109('0x4a')],'createdAt':_0x3e63c8['createdAt'],'updatedAt':_0x3e63c8[_0x6109('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x318be6,_0x40444a))[_0x6109('0x24')](handleError(_0x318be6,null));};exports[_0x6109('0x4f')]=function(_0x396ad4,_0xae7afd){var _0xdc4e28={};var _0x1f17c9={};var _0x41a959;var _0x3a68f6;return db[_0x6109('0x21')]['findOne']({'where':{'id':_0x396ad4[_0x6109('0x25')]['id']}})['then'](handleEntityNotFound(_0xae7afd,null))[_0x6109('0x16')](function(_0x417682){if(_0x417682){_0x41a959=_0x417682;_0x1f17c9['model']=_[_0x6109('0x26')](db['Team'][_0x6109('0x1c')]);_0x1f17c9['query']=_[_0x6109('0x26')](_0x396ad4['query']);_0x1f17c9['filters']=_[_0x6109('0x2b')](_0x1f17c9[_0x6109('0x29')],_0x1f17c9[_0x6109('0x27')]);_0xdc4e28[_0x6109('0x2a')]=_[_0x6109('0x2b')](_0x1f17c9['model'],qs[_0x6109('0x2c')](_0x396ad4['query']['fields']));_0xdc4e28['attributes']=_0xdc4e28[_0x6109('0x2a')][_0x6109('0x2d')]?_0xdc4e28['attributes']:_0x1f17c9[_0x6109('0x29')];_0xdc4e28[_0x6109('0x40')]=qs[_0x6109('0x41')](_0x396ad4[_0x6109('0x27')]['sort']);_0xdc4e28[_0x6109('0x20')]=qs[_0x6109('0x28')](_['pick'](_0x396ad4['query'],_0x1f17c9[_0x6109('0x28')]));if(_0x396ad4[_0x6109('0x27')][_0x6109('0x43')]){_0xdc4e28[_0x6109('0x20')]=_['merge'](_0xdc4e28[_0x6109('0x20')],{'$or':_[_0x6109('0x44')](_0xdc4e28[_0x6109('0x2a')],function(_0x2414be){var _0x59d25={};_0x59d25[_0x2414be]={'$like':'%'+_0x396ad4[_0x6109('0x27')][_0x6109('0x43')]+'%'};return _0x59d25;})});}_0xdc4e28=_[_0x6109('0x2f')]({},_0xdc4e28,_0x396ad4[_0x6109('0x45')]);return _0x41a959['getTeams'](_0xdc4e28);}})[_0x6109('0x16')](function(_0xc586ca){if(_0xc586ca){_0x3a68f6=_0xc586ca['length'];if(!_0x396ad4['query'][_0x6109('0x3d')]('nolimit')){_0xdc4e28[_0x6109('0x3f')]=qs[_0x6109('0x3f')](_0x396ad4[_0x6109('0x27')][_0x6109('0x3f')]);_0xdc4e28['offset']=qs[_0x6109('0xf')](_0x396ad4[_0x6109('0x27')][_0x6109('0xf')]);}return _0x41a959['getTeams'](_0xdc4e28);}})[_0x6109('0x16')](function(_0x2e8699){if(_0x2e8699){return _0x2e8699?{'count':_0x3a68f6,'rows':_0x2e8699}:null;}})[_0x6109('0x16')](respondWithResult(_0xae7afd,null))[_0x6109('0x24')](handleError(_0xae7afd,null));};exports[_0x6109('0x50')]=function(_0x3eb24a,_0x405026){var _0x3a9697=_0x3eb24a[_0x6109('0x32')][_0x6109('0x51')];return db['Team'][_0x6109('0x52')]({'where':{'id':_0x3a9697},'attributes':['id'],'include':[{'model':db[_0x6109('0x46')],'as':_0x6109('0x53'),'attributes':['id','name',_0x6109('0x54'),'voicePause',_0x6109('0x55')],'raw':!![]}]})[_0x6109('0x16')](function(_0x2b8018){if(_0x2b8018){var _0x1c992e=_[_0x6109('0x56')](_0x2b8018,function(_0x47e4f3){var _0x9e58ee=_0x47e4f3['get']({'plain':!![]});return _0x9e58ee['Agents'];});return db[_0x6109('0x21')][_0x6109('0x30')]({'where':{'id':_0x3eb24a[_0x6109('0x25')]['id']}})[_0x6109('0x16')](function(_0xed031){return db[_0x6109('0x57')][_0x6109('0x58')](function(_0x4980bc){return _0xed031['addTeams'](_0x3a9697,{'transaction':_0x4980bc})[_0x6109('0x16')](function(){return BPromise[_0x6109('0x59')](_0x1c992e,function(_0x2634ba){return db[_0x6109('0x3c')][_0x6109('0x5a')]({'where':{'UserId':_0x2634ba['id'],'ChatQueueId':_0x3eb24a[_0x6109('0x25')]['id']},'transaction':_0x4980bc});});})[_0x6109('0x16')](function(){_0x1c992e['forEach'](function(_0x52b1d1){socket['emit']('userChatQueue:save',{'UserId':_0x52b1d1['id'],'ChatQueueId':_0xed031['id']});});});});});}})[_0x6109('0x16')](respondWithStatusCode(_0x405026,null))[_0x6109('0x24')](handleError(_0x405026,null));};exports[_0x6109('0x5b')]=function(_0x5d7ab5,_0x4b7e00){return db[_0x6109('0x5c')][_0x6109('0x52')]({'where':{'id':_0x5d7ab5[_0x6109('0x27')][_0x6109('0x51')]},'attributes':['id'],'include':[{'model':db[_0x6109('0x46')],'as':_0x6109('0x53'),'attributes':['id'],'raw':!![]}]})[_0x6109('0x16')](handleEntityNotFound(_0x4b7e00,null))[_0x6109('0x16')](function(_0x10a7d7){var _0x427e10=_[_0x6109('0x44')](_0x10a7d7,'id');var _0x2f23f3=[];var _0x1a56e2=[];var _0x1782e9=squel['select']();_0x1782e9['field'](_0x6109('0x5d'))[_0x6109('0x5e')](_0x6109('0x5f'),'tq')[_0x6109('0x60')](_0x6109('0x61'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6109('0x20')]('ChatQueueId\x20=\x20?',_0x5d7ab5[_0x6109('0x25')]['id']);for(var _0xc9ad90=0x0;_0xc9ad90<_0x10a7d7['length'];_0xc9ad90+=0x1){let _0x3016c7=_0x10a7d7[_0xc9ad90];for(var _0x1a608d=0x0;_0x1a608d<_0x3016c7[_0x6109('0x53')]['length'];_0x1a608d+=0x1){let _0x58042b=_0x3016c7[_0x6109('0x53')][_0x1a608d];var _0x30e94e=_0x1782e9[_0x6109('0x62')]();_0x30e94e['where']('ut.UserId\x20=\x20?',_0x58042b['id']);_0x1a56e2['push'](db[_0x6109('0x57')][_0x6109('0x27')](_0x30e94e[_0x6109('0x63')](),{'type':db[_0x6109('0x57')][_0x6109('0x64')][_0x6109('0x65')]})[_0x6109('0x16')](function(_0x2246f6){if(_0x2246f6['length']===0x1){return _0x58042b['id'];}else{var _0x412f4c=_[_0x6109('0x66')](_['map'](_0x2246f6,_0x6109('0x67')),function(_0x5e5e5a){return _[_0x6109('0x68')](_0x427e10,_0x5e5e5a);});if(_0x412f4c){return _0x58042b['id'];}}}));}}return BPromise[_0x6109('0x69')](_0x1a56e2)[_0x6109('0x16')](function(_0x3d964d){_0x2f23f3=_(_0x2f23f3)[_0x6109('0x6a')](_0x3d964d)[_0x6109('0x6b')]()[_0x6109('0x6c')]();return db['ChatQueue'][_0x6109('0x30')]({'where':{'id':_0x5d7ab5[_0x6109('0x25')]['id']}})[_0x6109('0x16')](function(_0x36b222){return db[_0x6109('0x57')][_0x6109('0x58')](function(_0x564d2d){return _0x36b222[_0x6109('0x5b')](_0x5d7ab5['query'][_0x6109('0x51')],{'transaction':_0x564d2d})[_0x6109('0x16')](function(){if(!_[_0x6109('0x6d')](_0x2f23f3)){return _0x36b222['removeAgents'](_0x2f23f3,{'transaction':_0x564d2d});}})[_0x6109('0x16')](function(){_0x2f23f3[_0x6109('0x6e')](function(_0x2600f5){socket[_0x6109('0x6f')](_0x6109('0x70'),{'UserId':_0x2600f5,'ChatQueueId':_0x36b222['id']});});});});});});})[_0x6109('0x16')](respondWithStatusCode(_0x4b7e00,null))[_0x6109('0x24')](handleError(_0x4b7e00,null));};exports[_0x6109('0x71')]=function(_0x1ffd76,_0x434d3a){return db['ChatQueue'][_0x6109('0x30')]({'where':{'id':_0x1ffd76[_0x6109('0x25')]['id']}})[_0x6109('0x16')](handleEntityNotFound(_0x434d3a,null))['then'](function(_0x464977){if(_0x464977){return _0x464977[_0x6109('0x71')](_0x1ffd76['body'][_0x6109('0x51')],_[_0x6109('0x72')](_0x1ffd76['body'],[_0x6109('0x51'),'id'])||{})[_0x6109('0x73')](function(_0x3b4639){for(var _0x393ada=0x0;_0x393ada<_0x1ffd76[_0x6109('0x32')][_0x6109('0x51')][_0x6109('0x2d')];_0x393ada+=0x1){socket[_0x6109('0x6f')](_0x6109('0x74'),{'UserId':Number(_0x1ffd76[_0x6109('0x32')][_0x6109('0x51')][_0x393ada]),'ChatQueueId':Number(_0x1ffd76[_0x6109('0x25')]['id'])});}return _0x3b4639;});}})[_0x6109('0x16')](respondWithResult(_0x434d3a,null))[_0x6109('0x24')](handleError(_0x434d3a,null));};exports[_0x6109('0x75')]=function(_0x154eb9,_0x42d6f6){return db['ChatQueue'][_0x6109('0x30')]({'where':{'id':_0x154eb9[_0x6109('0x25')]['id']}})[_0x6109('0x16')](handleEntityNotFound(_0x42d6f6,null))[_0x6109('0x16')](function(_0x1d957a){if(_0x1d957a){return _0x1d957a[_0x6109('0x75')](_0x154eb9[_0x6109('0x27')][_0x6109('0x51')])[_0x6109('0x16')](function(){if(_[_0x6109('0x76')](_0x154eb9['query']['ids'])){for(var _0x7d335b=0x0;_0x7d335b<_0x154eb9[_0x6109('0x27')][_0x6109('0x51')]['length'];_0x7d335b+=0x1){socket[_0x6109('0x6f')]('userChatQueue:remove',{'UserId':Number(_0x154eb9['query']['ids'][_0x7d335b]),'ChatQueueId':Number(_0x154eb9[_0x6109('0x25')]['id'])});}}else{socket['emit'](_0x6109('0x70'),{'UserId':Number(_0x154eb9['query'][_0x6109('0x51')]),'ChatQueueId':Number(_0x154eb9['params']['id'])});}});}})[_0x6109('0x16')](respondWithStatusCode(_0x42d6f6,null))[_0x6109('0x24')](handleError(_0x42d6f6,null));};exports[_0x6109('0x77')]=function(_0x1a2788,_0x467a60){var _0x262255={};var _0x1a88bd={};var _0x27671c;var _0x546eda;return db['ChatQueue'][_0x6109('0x3b')]({'where':{'id':_0x1a2788['params']['id']}})[_0x6109('0x16')](handleEntityNotFound(_0x467a60,null))[_0x6109('0x16')](function(_0x296523){if(_0x296523){_0x27671c=_0x296523;_0x1a88bd[_0x6109('0x29')]=_[_0x6109('0x26')](db[_0x6109('0x46')][_0x6109('0x1c')]);_0x1a88bd[_0x6109('0x27')]=_['keys'](_0x1a2788['query']);_0x1a88bd[_0x6109('0x28')]=_['intersection'](_0x1a88bd[_0x6109('0x29')],_0x1a88bd['query']);_0x262255[_0x6109('0x2a')]=_['intersection'](_0x1a88bd['model'],qs[_0x6109('0x2c')](_0x1a2788[_0x6109('0x27')][_0x6109('0x2c')]));_0x262255[_0x6109('0x2a')]=_0x262255[_0x6109('0x2a')][_0x6109('0x2d')]?_0x262255[_0x6109('0x2a')]:_0x1a88bd[_0x6109('0x29')];_0x262255[_0x6109('0x40')]=qs[_0x6109('0x41')](_0x1a2788['query'][_0x6109('0x41')]);_0x262255[_0x6109('0x20')]=qs[_0x6109('0x28')](_[_0x6109('0x42')](_0x1a2788[_0x6109('0x27')],_0x1a88bd[_0x6109('0x28')]));if(_0x1a2788[_0x6109('0x27')][_0x6109('0x43')]){_0x262255[_0x6109('0x20')]=_[_0x6109('0x2f')](_0x262255[_0x6109('0x20')],{'$or':_[_0x6109('0x44')](_0x262255[_0x6109('0x2a')],function(_0x3f789d){var _0x3717d8={};_0x3717d8[_0x3f789d]={'$like':'%'+_0x1a2788[_0x6109('0x27')][_0x6109('0x43')]+'%'};return _0x3717d8;})});}_0x262255=_[_0x6109('0x2f')]({},_0x262255,_0x1a2788[_0x6109('0x45')]);return _0x27671c[_0x6109('0x77')](_0x262255);}})[_0x6109('0x16')](function(_0x4645cb){if(_0x4645cb){_0x546eda=_0x4645cb[_0x6109('0x2d')];if(!_0x1a2788[_0x6109('0x27')][_0x6109('0x3d')](_0x6109('0x3e'))){_0x262255[_0x6109('0x3f')]=qs[_0x6109('0x3f')](_0x1a2788[_0x6109('0x27')][_0x6109('0x3f')]);_0x262255['offset']=qs[_0x6109('0xf')](_0x1a2788['query'][_0x6109('0xf')]);}return _0x27671c[_0x6109('0x77')](_0x262255);}})[_0x6109('0x16')](function(_0x4752ec){if(_0x4752ec){return _0x4752ec?{'count':_0x546eda,'rows':_0x4752ec}:null;}})['then'](respondWithResult(_0x467a60,null))[_0x6109('0x24')](handleError(_0x467a60,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 10f71a7..a616b08 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 _0x8954=['hook','exports','events','ChatQueue','setMaxListeners','emit','hasOwnProperty'];(function(_0x117260,_0x14e08f){var _0x4d32f7=function(_0x1c5446){while(--_0x1c5446){_0x117260['push'](_0x117260['shift']());}};_0x4d32f7(++_0x14e08f);}(_0x8954,0x136));var _0x4895=function(_0x2e3dcd,_0x1d883d){_0x2e3dcd=_0x2e3dcd-0x0;var _0x3cb872=_0x8954[_0x2e3dcd];return _0x3cb872;};'use strict';var EventEmitter=require(_0x4895('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4895('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4895('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x39e68b){return function(_0x469496,_0x175e0c,_0x23b837){ChatQueueEvents[_0x4895('0x3')](_0x39e68b+':'+_0x469496['id'],_0x469496);ChatQueueEvents['emit'](_0x39e68b,_0x469496);_0x23b837(null);};}for(var e in events){if(events[_0x4895('0x4')](e)){var event=events[e];ChatQueue[_0x4895('0x5')](e,emitEvent(event));}}module[_0x4895('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x6fff=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3407be,_0x3ad78b){var _0x1743e2=function(_0x564703){while(--_0x564703){_0x3407be['push'](_0x3407be['shift']());}};_0x1743e2(++_0x3ad78b);}(_0x6fff,0x160));var _0xf6ff=function(_0x2a27cc,_0x76891){_0x2a27cc=_0x2a27cc-0x0;var _0x32326a=_0x6fff[_0x2a27cc];return _0x32326a;};'use strict';var EventEmitter=require(_0xf6ff('0x0'));var ChatQueue=require(_0xf6ff('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf6ff('0x2'),'afterUpdate':'update','afterDestroy':_0xf6ff('0x3')};function emitEvent(_0x2bd8df){return function(_0x401f76,_0x1f9573,_0x3f3319){ChatQueueEvents[_0xf6ff('0x4')](_0x2bd8df+':'+_0x401f76['id'],_0x401f76);ChatQueueEvents[_0xf6ff('0x4')](_0x2bd8df,_0x401f76);_0x3f3319(null);};}for(var e in events){if(events[_0xf6ff('0x5')](e)){var event=events[e];ChatQueue[_0xf6ff('0x6')](e,emitEvent(event));}}module[_0xf6ff('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index de7cc01..39aa7a1 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 _0xd9c8=['define','ChatQueue','chat_queues','lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x1ec1b8,_0x4e3651){var _0x4d0f2c=function(_0x502766){while(--_0x502766){_0x1ec1b8['push'](_0x1ec1b8['shift']());}};_0x4d0f2c(++_0x4e3651);}(_0xd9c8,0x66));var _0x8d9c=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd9c8[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8d9c('0x2'));var BPromise=require(_0x8d9c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d9c('0x4'));var rimraf=require(_0x8d9c('0x5'));var config=require(_0x8d9c('0x6'));var attributes=require('./chatQueue.attributes');module[_0x8d9c('0x7')]=function(_0x368ea6,_0x203291){return _0x368ea6[_0x8d9c('0x8')](_0x8d9c('0x9'),attributes,{'tableName':_0x8d9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15a9=['define','ChatQueue','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatQueue.attributes','exports'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0x15a9,0xa7));var _0x915a=function(_0x4abd5b,_0x10e5d4){_0x4abd5b=_0x4abd5b-0x0;var _0x14d848=_0x15a9[_0x4abd5b];return _0x14d848;};'use strict';var _=require(_0x915a('0x0'));var util=require('util');var logger=require(_0x915a('0x1'))(_0x915a('0x2'));var moment=require(_0x915a('0x3'));var BPromise=require('bluebird');var rp=require(_0x915a('0x4'));var fs=require('fs');var path=require(_0x915a('0x5'));var rimraf=require('rimraf');var config=require(_0x915a('0x6'));var attributes=require(_0x915a('0x7'));module[_0x915a('0x8')]=function(_0x1b5876,_0xd3f27d){return _0x1b5876[_0x915a('0x9')](_0x915a('0xa'),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 708b6ff..aec0224 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 _0x7582=['map','include','model','GetChatQueue','debug','ShowChatQueue','ChatQueue','find','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7582,0x167));var _0x2758=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0x7582[_0xdeac17];return _0x33aabd;};'use strict';var _=require('lodash');var util=require(_0x2758('0x0'));var moment=require(_0x2758('0x1'));var BPromise=require(_0x2758('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2758('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2758('0x4'));var logger=require(_0x2758('0x5'))(_0x2758('0x6'));var config=require(_0x2758('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2758('0x8')][_0x2758('0x9')]({'port':0x232a});config['redis']=_[_0x2758('0xa')](config[_0x2758('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2758('0xc'))(new Redis(config[_0x2758('0xb')]));require(_0x2758('0xd'))['register'](socket);function respondWithRpcPromise(_0x39afde,_0x1bb787,_0x5816fe){return new BPromise(function(_0x51fd3c,_0x32cf1a){return client[_0x2758('0xe')](_0x39afde,_0x5816fe)[_0x2758('0xf')](function(_0x27df52){logger[_0x2758('0x10')](_0x2758('0x11'),_0x1bb787,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1bb787,_0x2758('0x12'),JSON[_0x2758('0x13')](_0x27df52));if(_0x27df52[_0x2758('0x14')]){if(_0x27df52[_0x2758('0x14')][_0x2758('0x15')]===0x1f4){logger[_0x2758('0x14')](_0x2758('0x11'),_0x1bb787,_0x27df52[_0x2758('0x14')][_0x2758('0x16')]);return _0x32cf1a(_0x27df52[_0x2758('0x14')][_0x2758('0x16')]);}logger[_0x2758('0x14')](_0x2758('0x11'),_0x1bb787,_0x27df52[_0x2758('0x14')]['message']);return _0x51fd3c(_0x27df52['error']['message']);}else{logger[_0x2758('0x10')](_0x2758('0x11'),_0x1bb787,_0x2758('0x12'));_0x51fd3c(_0x27df52[_0x2758('0x17')][_0x2758('0x16')]);}})[_0x2758('0x18')](function(_0x594575){logger[_0x2758('0x14')](_0x2758('0x11'),_0x1bb787,_0x594575);_0x32cf1a(_0x594575);});});}exports['GetChatQueue']=function(_0x30b3d9){var _0x1cdc63=this;return new Promise(function(_0x8cfe47,_0x4100a0){return db['ChatQueue'][_0x2758('0x19')]({'raw':_0x30b3d9['options']?_0x30b3d9[_0x2758('0x1a')][_0x2758('0x1b')]===undefined?!![]:![]:!![],'where':_0x30b3d9[_0x2758('0x1a')]?_0x30b3d9[_0x2758('0x1a')][_0x2758('0x1c')]||null:null,'attributes':_0x30b3d9[_0x2758('0x1a')]?_0x30b3d9[_0x2758('0x1a')][_0x2758('0x1d')]||null:null,'limit':_0x30b3d9[_0x2758('0x1a')]?_0x30b3d9[_0x2758('0x1a')][_0x2758('0x1e')]||null:null,'include':_0x30b3d9[_0x2758('0x1a')]?_0x30b3d9['options']['include']?_[_0x2758('0x1f')](_0x30b3d9[_0x2758('0x1a')][_0x2758('0x20')],function(_0x2209fc){return{'model':db[_0x2209fc[_0x2758('0x21')]],'as':_0x2209fc['as'],'attributes':_0x2209fc[_0x2758('0x1d')],'include':_0x2209fc['include']?_['map'](_0x2209fc[_0x2758('0x20')],function(_0x28c1f2){return{'model':db[_0x28c1f2[_0x2758('0x21')]],'as':_0x28c1f2['as'],'attributes':_0x28c1f2[_0x2758('0x1d')],'include':_0x28c1f2['include']?_['map'](_0x28c1f2[_0x2758('0x20')],function(_0x230f28){return{'model':db[_0x230f28[_0x2758('0x21')]],'as':_0x230f28['as'],'attributes':_0x230f28['attributes']};}):[]};}):[]};}):[]:[]})[_0x2758('0xf')](function(_0x4b20ee){logger[_0x2758('0x10')](_0x2758('0x22'),_0x30b3d9);logger[_0x2758('0x23')](_0x2758('0x22'),_0x30b3d9,JSON[_0x2758('0x13')](_0x4b20ee));_0x8cfe47(_0x4b20ee);})[_0x2758('0x18')](function(_0x2d44e4){logger[_0x2758('0x14')](_0x2758('0x22'),_0x2d44e4[_0x2758('0x16')],_0x30b3d9);_0x4100a0(_0x1cdc63['error'](0x1f4,_0x2d44e4[_0x2758('0x16')]));});});};exports[_0x2758('0x24')]=function(_0x819909){var _0x2f7f7b=this;return new Promise(function(_0x51b7db,_0x5f105f){return db[_0x2758('0x25')][_0x2758('0x26')]({'raw':_0x819909['options']?_0x819909[_0x2758('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x819909[_0x2758('0x1a')]?_0x819909['options'][_0x2758('0x1c')]||null:null,'attributes':_0x819909[_0x2758('0x1a')]?_0x819909['options'][_0x2758('0x1d')]||null:null,'include':_0x819909[_0x2758('0x1a')]?_0x819909[_0x2758('0x1a')][_0x2758('0x20')]?_[_0x2758('0x1f')](_0x819909[_0x2758('0x1a')][_0x2758('0x20')],function(_0x4453a8){return{'model':db[_0x4453a8['model']],'as':_0x4453a8['as'],'attributes':_0x4453a8[_0x2758('0x1d')],'include':_0x4453a8[_0x2758('0x20')]?_[_0x2758('0x1f')](_0x4453a8[_0x2758('0x20')],function(_0x4030c5){return{'model':db[_0x4030c5[_0x2758('0x21')]],'as':_0x4030c5['as'],'attributes':_0x4030c5[_0x2758('0x1d')],'include':_0x4030c5[_0x2758('0x20')]?_[_0x2758('0x1f')](_0x4030c5['include'],function(_0x4ba64a){return{'model':db[_0x4ba64a[_0x2758('0x21')]],'as':_0x4ba64a['as'],'attributes':_0x4ba64a[_0x2758('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2758('0xf')](function(_0x2c3aab){logger[_0x2758('0x10')](_0x2758('0x24'),_0x819909);logger['debug'](_0x2758('0x24'),_0x819909,JSON[_0x2758('0x13')](_0x2c3aab));_0x51b7db(_0x2c3aab);})['catch'](function(_0x57908c){logger['error'](_0x2758('0x24'),_0x57908c[_0x2758('0x16')],_0x819909);_0x5f105f(_0x2f7f7b[_0x2758('0x14')](0x1f4,_0x57908c[_0x2758('0x16')]));});});};
\ No newline at end of file
+var _0x5fbb=['./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetChatQueue','ChatQueue','options','raw','where','include','map','model','attributes','stringify','ShowChatQueue','find','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x25ce5a,_0x2f621e){var _0xe19595=function(_0x167964){while(--_0x167964){_0x25ce5a['push'](_0x25ce5a['shift']());}};_0xe19595(++_0x2f621e);}(_0x5fbb,0x1ba));var _0xb5fb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5fbb[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb5fb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb5fb('0x1'));var fs=require('fs');var Redis=require(_0xb5fb('0x2'));var db=require(_0xb5fb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb5fb('0x4'))(_0xb5fb('0x5'));var config=require(_0xb5fb('0x6'));var jayson=require(_0xb5fb('0x7'));var client=jayson[_0xb5fb('0x8')][_0xb5fb('0x9')]({'port':0x232a});config[_0xb5fb('0xa')]=_[_0xb5fb('0xb')](config[_0xb5fb('0xa')],{'host':_0xb5fb('0xc'),'port':0x18eb});var socket=require(_0xb5fb('0xd'))(new Redis(config[_0xb5fb('0xa')]));require(_0xb5fb('0xe'))['register'](socket);function respondWithRpcPromise(_0x462832,_0x84f5a8,_0x38f18a){return new BPromise(function(_0x58eb20,_0x5e3694){return client['request'](_0x462832,_0x38f18a)[_0xb5fb('0xf')](function(_0xf7cb72){logger['info'](_0xb5fb('0x10'),_0x84f5a8,_0xb5fb('0x11'));logger[_0xb5fb('0x12')](_0xb5fb('0x13'),_0x84f5a8,_0xb5fb('0x11'),JSON['stringify'](_0xf7cb72));if(_0xf7cb72[_0xb5fb('0x14')]){if(_0xf7cb72[_0xb5fb('0x14')][_0xb5fb('0x15')]===0x1f4){logger[_0xb5fb('0x14')](_0xb5fb('0x10'),_0x84f5a8,_0xf7cb72['error'][_0xb5fb('0x16')]);return _0x5e3694(_0xf7cb72[_0xb5fb('0x14')]['message']);}logger[_0xb5fb('0x14')](_0xb5fb('0x10'),_0x84f5a8,_0xf7cb72['error'][_0xb5fb('0x16')]);return _0x58eb20(_0xf7cb72['error'][_0xb5fb('0x16')]);}else{logger[_0xb5fb('0x17')](_0xb5fb('0x10'),_0x84f5a8,_0xb5fb('0x11'));_0x58eb20(_0xf7cb72[_0xb5fb('0x18')][_0xb5fb('0x16')]);}})[_0xb5fb('0x19')](function(_0x15d462){logger[_0xb5fb('0x14')](_0xb5fb('0x10'),_0x84f5a8,_0x15d462);_0x5e3694(_0x15d462);});});}exports[_0xb5fb('0x1a')]=function(_0x3a87fe){var _0x1daacb=this;return new Promise(function(_0x28ad5b,_0x15a8f4){return db[_0xb5fb('0x1b')]['findAll']({'raw':_0x3a87fe['options']?_0x3a87fe[_0xb5fb('0x1c')][_0xb5fb('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a87fe[_0xb5fb('0x1c')]?_0x3a87fe[_0xb5fb('0x1c')][_0xb5fb('0x1e')]||null:null,'attributes':_0x3a87fe[_0xb5fb('0x1c')]?_0x3a87fe[_0xb5fb('0x1c')]['attributes']||null:null,'limit':_0x3a87fe[_0xb5fb('0x1c')]?_0x3a87fe[_0xb5fb('0x1c')]['limit']||null:null,'include':_0x3a87fe[_0xb5fb('0x1c')]?_0x3a87fe[_0xb5fb('0x1c')][_0xb5fb('0x1f')]?_[_0xb5fb('0x20')](_0x3a87fe[_0xb5fb('0x1c')][_0xb5fb('0x1f')],function(_0x17e59f){return{'model':db[_0x17e59f[_0xb5fb('0x21')]],'as':_0x17e59f['as'],'attributes':_0x17e59f[_0xb5fb('0x22')],'include':_0x17e59f[_0xb5fb('0x1f')]?_[_0xb5fb('0x20')](_0x17e59f['include'],function(_0x3820dc){return{'model':db[_0x3820dc[_0xb5fb('0x21')]],'as':_0x3820dc['as'],'attributes':_0x3820dc[_0xb5fb('0x22')],'include':_0x3820dc[_0xb5fb('0x1f')]?_[_0xb5fb('0x20')](_0x3820dc[_0xb5fb('0x1f')],function(_0x4d9cc6){return{'model':db[_0x4d9cc6[_0xb5fb('0x21')]],'as':_0x4d9cc6['as'],'attributes':_0x4d9cc6[_0xb5fb('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb5fb('0xf')](function(_0x2aa7bf){logger[_0xb5fb('0x17')]('GetChatQueue',_0x3a87fe);logger['debug']('GetChatQueue',_0x3a87fe,JSON[_0xb5fb('0x23')](_0x2aa7bf));_0x28ad5b(_0x2aa7bf);})[_0xb5fb('0x19')](function(_0x58c9a8){logger[_0xb5fb('0x14')](_0xb5fb('0x1a'),_0x58c9a8[_0xb5fb('0x16')],_0x3a87fe);_0x15a8f4(_0x1daacb['error'](0x1f4,_0x58c9a8[_0xb5fb('0x16')]));});});};exports[_0xb5fb('0x24')]=function(_0x5a60fb){var _0x54c2aa=this;return new Promise(function(_0x2ca3a6,_0x8d71da){return db[_0xb5fb('0x1b')][_0xb5fb('0x25')]({'raw':_0x5a60fb[_0xb5fb('0x1c')]?_0x5a60fb[_0xb5fb('0x1c')][_0xb5fb('0x1d')]===undefined?!![]:![]:!![],'where':_0x5a60fb[_0xb5fb('0x1c')]?_0x5a60fb[_0xb5fb('0x1c')]['where']||null:null,'attributes':_0x5a60fb[_0xb5fb('0x1c')]?_0x5a60fb[_0xb5fb('0x1c')][_0xb5fb('0x22')]||null:null,'include':_0x5a60fb[_0xb5fb('0x1c')]?_0x5a60fb[_0xb5fb('0x1c')][_0xb5fb('0x1f')]?_[_0xb5fb('0x20')](_0x5a60fb[_0xb5fb('0x1c')][_0xb5fb('0x1f')],function(_0x6b3e2e){return{'model':db[_0x6b3e2e['model']],'as':_0x6b3e2e['as'],'attributes':_0x6b3e2e['attributes'],'include':_0x6b3e2e['include']?_['map'](_0x6b3e2e[_0xb5fb('0x1f')],function(_0x4fe549){return{'model':db[_0x4fe549[_0xb5fb('0x21')]],'as':_0x4fe549['as'],'attributes':_0x4fe549['attributes'],'include':_0x4fe549['include']?_[_0xb5fb('0x20')](_0x4fe549[_0xb5fb('0x1f')],function(_0x2629f9){return{'model':db[_0x2629f9[_0xb5fb('0x21')]],'as':_0x2629f9['as'],'attributes':_0x2629f9[_0xb5fb('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40f732){logger[_0xb5fb('0x17')](_0xb5fb('0x24'),_0x5a60fb);logger[_0xb5fb('0x12')](_0xb5fb('0x24'),_0x5a60fb,JSON[_0xb5fb('0x23')](_0x40f732));_0x2ca3a6(_0x40f732);})[_0xb5fb('0x19')](function(_0x1a0dfa){logger[_0xb5fb('0x14')](_0xb5fb('0x24'),_0x1a0dfa[_0xb5fb('0x16')],_0x5a60fb);_0x8d71da(_0x54c2aa[_0xb5fb('0x14')](0x1f4,_0x1a0dfa[_0xb5fb('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index e9b0bbe..56dbe3b 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 _0x6aa7=['update','emit','length','chatQueue:','./chatQueue.events','remove'];(function(_0x4d216c,_0x363a80){var _0x36fe74=function(_0x460e09){while(--_0x460e09){_0x4d216c['push'](_0x4d216c['shift']());}};_0x36fe74(++_0x363a80);}(_0x6aa7,0x178));var _0x76aa=function(_0x3ad2a0,_0x222027){_0x3ad2a0=_0x3ad2a0-0x0;var _0x5729d8=_0x6aa7[_0x3ad2a0];return _0x5729d8;};'use strict';var ChatQueueEvents=require(_0x76aa('0x0'));var events=['save',_0x76aa('0x1'),_0x76aa('0x2')];function createListener(_0x25c818,_0x2db4fe){return function(_0x4f007e){_0x2db4fe[_0x76aa('0x3')](_0x25c818,_0x4f007e);};}function removeListener(_0xef15ef,_0x1d6e04){return function(){ChatQueueEvents['removeListener'](_0xef15ef,_0x1d6e04);};}exports['register']=function(_0x1aceaa){for(var _0x4d53f6=0x0,_0x32dee5=events[_0x76aa('0x4')];_0x4d53f6<_0x32dee5;_0x4d53f6++){var _0xa9b695=events[_0x4d53f6];var _0x56d6bc=createListener(_0x76aa('0x5')+_0xa9b695,_0x1aceaa);ChatQueueEvents['on'](_0xa9b695,_0x56d6bc);}};
\ No newline at end of file
+var _0x0c02=['save','remove','emit','removeListener','register','chatQueue:'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x20c0('0x0'),_0x20c0('0x1'),'update'];function createListener(_0x1338cf,_0x5c8750){return function(_0x454922){_0x5c8750[_0x20c0('0x2')](_0x1338cf,_0x454922);};}function removeListener(_0x38022e,_0x2e9d65){return function(){ChatQueueEvents[_0x20c0('0x3')](_0x38022e,_0x2e9d65);};}exports[_0x20c0('0x4')]=function(_0x13312d){for(var _0xd25ee8=0x0,_0x5d6408=events['length'];_0xd25ee8<_0x5d6408;_0xd25ee8++){var _0x5da127=events[_0xd25ee8];var _0x4db532=createListener(_0x20c0('0x5')+_0x5da127,_0x13312d);ChatQueueEvents['on'](_0x5da127,_0x4db532);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 24e47dd..5fed92a 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e74,0x175));var _0x43e7=function(_0x7cc618,_0x3da493){_0x7cc618=_0x7cc618-0x0;var _0x5b62b2=_0x3e74[_0x7cc618];return _0x5b62b2;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x5efc6d,_0x26f293){var _0x31d65f=function(_0x58b2ba){while(--_0x58b2ba){_0x5efc6d['push'](_0x5efc6d['shift']());}};_0x31d65f(++_0x26f293);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b4eb8ac..aa28c87 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 _0xb7a5=['sequelize','exports','STRING','DATE'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0xb7a5,0x13c));var _0x5b7a=function(_0x4792f8,_0x5dad13){_0x4792f8=_0x4792f8-0x0;var _0x50efe9=_0xb7a5[_0x4792f8];return _0x50efe9;};'use strict';var moment=require('moment');var Sequelize=require(_0x5b7a('0x0'));module[_0x5b7a('0x1')]={'uniqueid':{'type':Sequelize[_0x5b7a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5b7a('0x2')]},'joinAt':{'type':Sequelize[_0x5b7a('0x3')]},'leaveAt':{'type':Sequelize[_0x5b7a('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5b7a('0x3')]},'reason':{'type':Sequelize[_0x5b7a('0x2')]}};
\ No newline at end of file
+var _0x97f6=['STRING','DATE','moment','sequelize','exports'];(function(_0x562d85,_0x60bd0b){var _0x1a5780=function(_0x44e426){while(--_0x44e426){_0x562d85['push'](_0x562d85['shift']());}};_0x1a5780(++_0x60bd0b);}(_0x97f6,0x1bf));var _0x697f=function(_0x192b02,_0x9af40d){_0x192b02=_0x192b02-0x0;var _0x2effa3=_0x97f6[_0x192b02];return _0x2effa3;};'use strict';var moment=require(_0x697f('0x0'));var Sequelize=require(_0x697f('0x1'));module[_0x697f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x697f('0x3')]},'joinAt':{'type':Sequelize[_0x697f('0x4')]},'leaveAt':{'type':Sequelize[_0x697f('0x4')]},'acceptAt':{'type':Sequelize[_0x697f('0x4')]},'exitAt':{'type':Sequelize[_0x697f('0x4')]},'reason':{'type':Sequelize[_0x697f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index ee7d012..2728f4d 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 _0x0958=['../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','json','save','update','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3220a2,_0x16f7b2){var _0x2307ce=function(_0x1e087d){while(--_0x1e087d){_0x3220a2['push'](_0x3220a2['shift']());}};_0x2307ce(++_0x16f7b2);}(_0x0958,0x7c));var _0x8095=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0958[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x8095('0x0'));var rimraf=require(_0x8095('0x1'));var zipdir=require(_0x8095('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8095('0x3'));var moment=require(_0x8095('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8095('0x5'));var path=require(_0x8095('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8095('0x7'));var fs=require('fs');var fs_extra=require(_0x8095('0x8'));var _=require(_0x8095('0x9'));var squel=require(_0x8095('0xa'));var crypto=require(_0x8095('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8095('0xc'));var querystring=require(_0x8095('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8095('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8095('0xf'));var hardwareService=require(_0x8095('0x10'));var logger=require(_0x8095('0x11'))(_0x8095('0x12'));var utils=require(_0x8095('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8095('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2acacf,_0x4cf53f){_0x4cf53f=_0x4cf53f||0xcc;return function(_0x31803a){if(_0x31803a){return _0x2acacf[_0x8095('0x15')](_0x4cf53f);}return _0x2acacf[_0x8095('0x16')](_0x4cf53f)[_0x8095('0x17')]();};}function respondWithResult(_0x5cfc5f,_0x8f6b26){_0x8f6b26=_0x8f6b26||0xc8;return function(_0x2f75a4){if(_0x2f75a4){return _0x5cfc5f[_0x8095('0x16')](_0x8f6b26)['json'](_0x2f75a4);}};}function respondWithFilteredResult(_0x5c1299,_0x3f446f){return function(_0x42a59a){if(_0x42a59a){var _0xb7c487=typeof _0x3f446f[_0x8095('0x18')]==='undefined'&&typeof _0x3f446f[_0x8095('0x19')]===_0x8095('0x1a');var _0x4a1d27=_0x42a59a['count'];var _0x13ff41=_0xb7c487?0x0:_0x3f446f['offset'];var _0x3e4fde=_0xb7c487?_0x42a59a[_0x8095('0x1b')]:_0x3f446f[_0x8095('0x18')]+_0x3f446f['limit'];var _0x2e5b38;if(_0x3e4fde>=_0x4a1d27){_0x3e4fde=_0x4a1d27;_0x2e5b38=0xc8;}else{_0x2e5b38=0xce;}_0x5c1299[_0x8095('0x16')](_0x2e5b38);return _0x5c1299[_0x8095('0x1c')]('Content-Range',_0x13ff41+'-'+_0x3e4fde+'/'+_0x4a1d27)[_0x8095('0x1d')](_0x42a59a);}return null;};}function patchUpdates(_0x104cc4){return function(_0xb0a513){try{jsonpatch['apply'](_0xb0a513,_0x104cc4,!![]);}catch(_0x176ba9){return BPromise['reject'](_0x176ba9);}return _0xb0a513[_0x8095('0x1e')]();};}function saveUpdates(_0x3f4b29,_0x421792){return function(_0x1c97c4){if(_0x1c97c4){return _0x1c97c4[_0x8095('0x1f')](_0x3f4b29)[_0x8095('0x20')](function(_0x2a7bb6){return _0x2a7bb6;});}return null;};}function removeEntity(_0x138b65,_0x23ece3){return function(_0x441fbf){if(_0x441fbf){return _0x441fbf[_0x8095('0x21')]()[_0x8095('0x20')](function(){_0x138b65[_0x8095('0x16')](0xcc)[_0x8095('0x17')]();});}};}function handleEntityNotFound(_0x5896f4,_0x499138){return function(_0x1b2939){if(!_0x1b2939){_0x5896f4[_0x8095('0x15')](0x194);}return _0x1b2939;};}function handleError(_0x2552b9,_0x39cde9){_0x39cde9=_0x39cde9||0x1f4;return function(_0x3bf5ce){logger[_0x8095('0x22')](_0x3bf5ce[_0x8095('0x23')]);if(_0x3bf5ce[_0x8095('0x24')]){delete _0x3bf5ce[_0x8095('0x24')];}_0x2552b9[_0x8095('0x16')](_0x39cde9)[_0x8095('0x25')](_0x3bf5ce);};}exports[_0x8095('0x26')]=function(_0x223ade,_0x38d932){var _0xd4ff7d={},_0x22fc6c={},_0x38d69e={'count':0x0,'rows':[]};var _0x575801=_['map'](db[_0x8095('0x27')][_0x8095('0x28')],function(_0x45843c){return{'name':_0x45843c[_0x8095('0x29')],'type':_0x45843c[_0x8095('0x2a')][_0x8095('0x2b')]};});_0x22fc6c[_0x8095('0x2c')]=_['map'](_0x575801,'name');_0x22fc6c['query']=_[_0x8095('0x2d')](_0x223ade['query']);_0x22fc6c[_0x8095('0x2e')]=_[_0x8095('0x2f')](_0x22fc6c[_0x8095('0x2c')],_0x22fc6c[_0x8095('0x30')]);_0xd4ff7d[_0x8095('0x31')]=_['intersection'](_0x22fc6c['model'],qs['fields'](_0x223ade[_0x8095('0x30')][_0x8095('0x32')]));_0xd4ff7d[_0x8095('0x31')]=_0xd4ff7d[_0x8095('0x31')][_0x8095('0x33')]?_0xd4ff7d['attributes']:_0x22fc6c[_0x8095('0x2c')];if(!_0x223ade[_0x8095('0x30')]['hasOwnProperty'](_0x8095('0x34'))){_0xd4ff7d[_0x8095('0x19')]=qs['limit'](_0x223ade[_0x8095('0x30')][_0x8095('0x19')]);_0xd4ff7d[_0x8095('0x18')]=qs[_0x8095('0x18')](_0x223ade['query'][_0x8095('0x18')]);}_0xd4ff7d[_0x8095('0x35')]=qs[_0x8095('0x36')](_0x223ade[_0x8095('0x30')][_0x8095('0x36')]);_0xd4ff7d[_0x8095('0x37')]=qs[_0x8095('0x2e')](_['pick'](_0x223ade[_0x8095('0x30')],_0x22fc6c[_0x8095('0x2e')]),_0x575801);if(_0x223ade['query'][_0x8095('0x38')]){_0xd4ff7d[_0x8095('0x37')]=_[_0x8095('0x39')](_0xd4ff7d['where'],{'$or':_[_0x8095('0x3a')](_0x575801,function(_0x44ef7d){if(_0x44ef7d['type']!==_0x8095('0x3b')){var _0x1b12fe={};_0x1b12fe[_0x44ef7d[_0x8095('0x24')]]={'$like':'%'+_0x223ade[_0x8095('0x30')]['filter']+'%'};return _0x1b12fe;}})});}_0xd4ff7d=_[_0x8095('0x39')]({},_0xd4ff7d,_0x223ade[_0x8095('0x3c')]);var _0x42827b={'where':_0xd4ff7d[_0x8095('0x37')]};return db[_0x8095('0x27')][_0x8095('0x1b')](_0x42827b)[_0x8095('0x20')](function(_0x482427){_0x38d69e[_0x8095('0x1b')]=_0x482427;if(_0x223ade[_0x8095('0x30')][_0x8095('0x3d')]){_0xd4ff7d[_0x8095('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x8095('0x3f')](_0xd4ff7d);})[_0x8095('0x20')](function(_0x5484d5){_0x38d69e[_0x8095('0x40')]=_0x5484d5;return _0x38d69e;})['then'](respondWithFilteredResult(_0x38d932,_0xd4ff7d))[_0x8095('0x41')](handleError(_0x38d932,null));};exports[_0x8095('0x42')]=function(_0x306fb4,_0x594309){var _0x15bcde={'raw':!![],'where':{'id':_0x306fb4['params']['id']}},_0x488e2e={};_0x488e2e['model']=_[_0x8095('0x2d')](db[_0x8095('0x27')][_0x8095('0x28')]);_0x488e2e[_0x8095('0x30')]=_[_0x8095('0x2d')](_0x306fb4[_0x8095('0x30')]);_0x488e2e[_0x8095('0x2e')]=_[_0x8095('0x2f')](_0x488e2e[_0x8095('0x2c')],_0x488e2e[_0x8095('0x30')]);_0x15bcde[_0x8095('0x31')]=_[_0x8095('0x2f')](_0x488e2e[_0x8095('0x2c')],qs['fields'](_0x306fb4[_0x8095('0x30')][_0x8095('0x32')]));_0x15bcde['attributes']=_0x15bcde[_0x8095('0x31')]['length']?_0x15bcde[_0x8095('0x31')]:_0x488e2e[_0x8095('0x2c')];if(_0x306fb4[_0x8095('0x30')][_0x8095('0x3d')]){_0x15bcde[_0x8095('0x3e')]=[{'all':!![]}];}_0x15bcde=_[_0x8095('0x39')]({},_0x15bcde,_0x306fb4[_0x8095('0x3c')]);return db[_0x8095('0x27')]['find'](_0x15bcde)[_0x8095('0x20')](handleEntityNotFound(_0x594309,null))[_0x8095('0x20')](respondWithResult(_0x594309,null))[_0x8095('0x41')](handleError(_0x594309,null));};exports[_0x8095('0x43')]=function(_0xa78ed7,_0x14fd11){return db[_0x8095('0x27')][_0x8095('0x43')](_0xa78ed7[_0x8095('0x44')],{})[_0x8095('0x20')](respondWithResult(_0x14fd11,0xc9))[_0x8095('0x41')](handleError(_0x14fd11,null));};exports[_0x8095('0x1f')]=function(_0x5961c8,_0x2209b6){if(_0x5961c8['body']['id']){delete _0x5961c8['body']['id'];}return db[_0x8095('0x27')][_0x8095('0x45')]({'where':{'id':_0x5961c8['params']['id']}})['then'](handleEntityNotFound(_0x2209b6,null))[_0x8095('0x20')](saveUpdates(_0x5961c8[_0x8095('0x44')],null))['then'](respondWithResult(_0x2209b6,null))[_0x8095('0x41')](handleError(_0x2209b6,null));};exports[_0x8095('0x21')]=function(_0x1bef5e,_0x1aa669){return db[_0x8095('0x27')][_0x8095('0x45')]({'where':{'id':_0x1bef5e[_0x8095('0x46')]['id']}})['then'](handleEntityNotFound(_0x1aa669,null))['then'](removeEntity(_0x1aa669,null))[_0x8095('0x41')](handleError(_0x1aa669,null));};exports['describe']=function(_0x4782d8,_0x49246c){return db[_0x8095('0x27')][_0x8095('0x47')]()['then'](respondWithResult(_0x49246c,null))[_0x8095('0x41')](handleError(_0x49246c,null));};
\ No newline at end of file
+var _0x3024=['type','key','model','name','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','stack','send','map','ChatQueueReport','rawAttributes','fieldName'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0x3024,0x64));var _0x4302=function(_0x32a308,_0x3399c8){_0x32a308=_0x32a308-0x0;var _0x5eb939=_0x3024[_0x32a308];return _0x5eb939;};'use strict';var emlformat=require(_0x4302('0x0'));var rimraf=require(_0x4302('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4302('0x2'));var rp=require(_0x4302('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4302('0x4'));var util=require('util');var path=require(_0x4302('0x5'));var sox=require(_0x4302('0x6'));var csv=require('to-csv');var ejs=require(_0x4302('0x7'));var fs=require('fs');var fs_extra=require(_0x4302('0x8'));var _=require('lodash');var squel=require(_0x4302('0x9'));var crypto=require(_0x4302('0xa'));var jsforce=require(_0x4302('0xb'));var deskjs=require(_0x4302('0xc'));var toCsv=require(_0x4302('0xd'));var querystring=require(_0x4302('0xe'));var Papa=require(_0x4302('0xf'));var Redis=require('ioredis');var authService=require(_0x4302('0x10'));var qs=require(_0x4302('0x11'));var as=require(_0x4302('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4302('0x13'))(_0x4302('0x14'));var utils=require('../../config/utils');var config=require(_0x4302('0x15'));var licenseUtil=require(_0x4302('0x16'));var db=require(_0x4302('0x17'))['db'];function respondWithStatusCode(_0x5a0241,_0x3ce552){_0x3ce552=_0x3ce552||0xcc;return function(_0x177706){if(_0x177706){return _0x5a0241['sendStatus'](_0x3ce552);}return _0x5a0241[_0x4302('0x18')](_0x3ce552)[_0x4302('0x19')]();};}function respondWithResult(_0x2b9821,_0x5b19ca){_0x5b19ca=_0x5b19ca||0xc8;return function(_0x1b254c){if(_0x1b254c){return _0x2b9821[_0x4302('0x18')](_0x5b19ca)['json'](_0x1b254c);}};}function respondWithFilteredResult(_0x36599d,_0x27a6a8){return function(_0x53c593){if(_0x53c593){var _0x1cc113=typeof _0x27a6a8[_0x4302('0x1a')]===_0x4302('0x1b')&&typeof _0x27a6a8[_0x4302('0x1c')]===_0x4302('0x1b');var _0x3ce7c2=_0x53c593[_0x4302('0x1d')];var _0x23aa0e=_0x1cc113?0x0:_0x27a6a8[_0x4302('0x1a')];var _0x41de23=_0x1cc113?_0x53c593[_0x4302('0x1d')]:_0x27a6a8[_0x4302('0x1a')]+_0x27a6a8[_0x4302('0x1c')];var _0xa736ce;if(_0x41de23>=_0x3ce7c2){_0x41de23=_0x3ce7c2;_0xa736ce=0xc8;}else{_0xa736ce=0xce;}_0x36599d['status'](_0xa736ce);return _0x36599d[_0x4302('0x1e')]('Content-Range',_0x23aa0e+'-'+_0x41de23+'/'+_0x3ce7c2)[_0x4302('0x1f')](_0x53c593);}return null;};}function patchUpdates(_0x50d168){return function(_0x4ad2a3){try{jsonpatch[_0x4302('0x20')](_0x4ad2a3,_0x50d168,!![]);}catch(_0x102eee){return BPromise[_0x4302('0x21')](_0x102eee);}return _0x4ad2a3[_0x4302('0x22')]();};}function saveUpdates(_0x525520,_0x5e2404){return function(_0x1d99fe){if(_0x1d99fe){return _0x1d99fe[_0x4302('0x23')](_0x525520)[_0x4302('0x24')](function(_0x4b259d){return _0x4b259d;});}return null;};}function removeEntity(_0x19ab4c,_0x156072){return function(_0x72ed32){if(_0x72ed32){return _0x72ed32[_0x4302('0x25')]()['then'](function(){_0x19ab4c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2952,_0x1021b1){return function(_0x3ffa91){if(!_0x3ffa91){_0x5a2952['sendStatus'](0x194);}return _0x3ffa91;};}function handleError(_0x1e0486,_0x33a916){_0x33a916=_0x33a916||0x1f4;return function(_0x20fe19){logger['error'](_0x20fe19[_0x4302('0x26')]);if(_0x20fe19['name']){delete _0x20fe19['name'];}_0x1e0486['status'](_0x33a916)[_0x4302('0x27')](_0x20fe19);};}exports['index']=function(_0x2e1633,_0x1aca12){var _0x5cb819={},_0x1b057f={},_0x5bc965={'count':0x0,'rows':[]};var _0x1ce315=_[_0x4302('0x28')](db[_0x4302('0x29')][_0x4302('0x2a')],function(_0x2dd48c){return{'name':_0x2dd48c[_0x4302('0x2b')],'type':_0x2dd48c[_0x4302('0x2c')][_0x4302('0x2d')]};});_0x1b057f[_0x4302('0x2e')]=_['map'](_0x1ce315,_0x4302('0x2f'));_0x1b057f[_0x4302('0x30')]=_[_0x4302('0x31')](_0x2e1633[_0x4302('0x30')]);_0x1b057f['filters']=_[_0x4302('0x32')](_0x1b057f[_0x4302('0x2e')],_0x1b057f[_0x4302('0x30')]);_0x5cb819[_0x4302('0x33')]=_[_0x4302('0x32')](_0x1b057f['model'],qs[_0x4302('0x34')](_0x2e1633[_0x4302('0x30')][_0x4302('0x34')]));_0x5cb819[_0x4302('0x33')]=_0x5cb819[_0x4302('0x33')][_0x4302('0x35')]?_0x5cb819[_0x4302('0x33')]:_0x1b057f[_0x4302('0x2e')];if(!_0x2e1633[_0x4302('0x30')]['hasOwnProperty'](_0x4302('0x36'))){_0x5cb819['limit']=qs[_0x4302('0x1c')](_0x2e1633['query']['limit']);_0x5cb819[_0x4302('0x1a')]=qs[_0x4302('0x1a')](_0x2e1633[_0x4302('0x30')]['offset']);}_0x5cb819[_0x4302('0x37')]=qs[_0x4302('0x38')](_0x2e1633[_0x4302('0x30')][_0x4302('0x38')]);_0x5cb819['where']=qs[_0x4302('0x39')](_['pick'](_0x2e1633[_0x4302('0x30')],_0x1b057f[_0x4302('0x39')]),_0x1ce315);if(_0x2e1633[_0x4302('0x30')][_0x4302('0x3a')]){_0x5cb819[_0x4302('0x3b')]=_['merge'](_0x5cb819[_0x4302('0x3b')],{'$or':_['map'](_0x1ce315,function(_0x4e4780){if(_0x4e4780['type']!==_0x4302('0x3c')){var _0x39bedf={};_0x39bedf[_0x4e4780[_0x4302('0x2f')]]={'$like':'%'+_0x2e1633[_0x4302('0x30')][_0x4302('0x3a')]+'%'};return _0x39bedf;}})});}_0x5cb819=_[_0x4302('0x3d')]({},_0x5cb819,_0x2e1633[_0x4302('0x3e')]);var _0x263950={'where':_0x5cb819[_0x4302('0x3b')]};return db[_0x4302('0x29')]['count'](_0x263950)['then'](function(_0x155361){_0x5bc965[_0x4302('0x1d')]=_0x155361;if(_0x2e1633[_0x4302('0x30')][_0x4302('0x3f')]){_0x5cb819['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x4302('0x40')](_0x5cb819);})[_0x4302('0x24')](function(_0x203c1f){_0x5bc965[_0x4302('0x41')]=_0x203c1f;return _0x5bc965;})[_0x4302('0x24')](respondWithFilteredResult(_0x1aca12,_0x5cb819))[_0x4302('0x42')](handleError(_0x1aca12,null));};exports['show']=function(_0x109c63,_0x52e975){var _0x372bb4={'raw':!![],'where':{'id':_0x109c63[_0x4302('0x43')]['id']}},_0x2a557b={};_0x2a557b[_0x4302('0x2e')]=_['keys'](db[_0x4302('0x29')][_0x4302('0x2a')]);_0x2a557b[_0x4302('0x30')]=_[_0x4302('0x31')](_0x109c63[_0x4302('0x30')]);_0x2a557b['filters']=_[_0x4302('0x32')](_0x2a557b[_0x4302('0x2e')],_0x2a557b['query']);_0x372bb4['attributes']=_[_0x4302('0x32')](_0x2a557b[_0x4302('0x2e')],qs['fields'](_0x109c63[_0x4302('0x30')][_0x4302('0x34')]));_0x372bb4[_0x4302('0x33')]=_0x372bb4[_0x4302('0x33')][_0x4302('0x35')]?_0x372bb4[_0x4302('0x33')]:_0x2a557b[_0x4302('0x2e')];if(_0x109c63[_0x4302('0x30')][_0x4302('0x3f')]){_0x372bb4[_0x4302('0x44')]=[{'all':!![]}];}_0x372bb4=_['merge']({},_0x372bb4,_0x109c63[_0x4302('0x3e')]);return db['ChatQueueReport'][_0x4302('0x45')](_0x372bb4)['then'](handleEntityNotFound(_0x52e975,null))[_0x4302('0x24')](respondWithResult(_0x52e975,null))[_0x4302('0x42')](handleError(_0x52e975,null));};exports['create']=function(_0x34bc72,_0x558af4){return db[_0x4302('0x29')]['create'](_0x34bc72[_0x4302('0x46')],{})[_0x4302('0x24')](respondWithResult(_0x558af4,0xc9))[_0x4302('0x42')](handleError(_0x558af4,null));};exports[_0x4302('0x23')]=function(_0x25b46b,_0x2b073b){if(_0x25b46b['body']['id']){delete _0x25b46b[_0x4302('0x46')]['id'];}return db[_0x4302('0x29')][_0x4302('0x45')]({'where':{'id':_0x25b46b[_0x4302('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b073b,null))[_0x4302('0x24')](saveUpdates(_0x25b46b[_0x4302('0x46')],null))[_0x4302('0x24')](respondWithResult(_0x2b073b,null))[_0x4302('0x42')](handleError(_0x2b073b,null));};exports[_0x4302('0x25')]=function(_0x1dbe2f,_0x359f87){return db[_0x4302('0x29')][_0x4302('0x45')]({'where':{'id':_0x1dbe2f[_0x4302('0x43')]['id']}})[_0x4302('0x24')](handleEntityNotFound(_0x359f87,null))[_0x4302('0x24')](removeEntity(_0x359f87,null))[_0x4302('0x42')](handleError(_0x359f87,null));};exports[_0x4302('0x47')]=function(_0x59845a,_0x994c1f){return db['ChatQueueReport'][_0x4302('0x47')]()[_0x4302('0x24')](respondWithResult(_0x994c1f,null))['catch'](handleError(_0x994c1f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 0b85c85..793f0d2 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x14df1a,_0x5b627d){var _0x5a7379=function(_0x30ba7b){while(--_0x30ba7b){_0x14df1a['push'](_0x14df1a['shift']());}};_0x5a7379(++_0x5b627d);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x28b463,_0x19caf5){var _0x273400=function(_0x35d0b6){while(--_0x35d0b6){_0x28b463['push'](_0x28b463['shift']());}};_0x273400(++_0x19caf5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb7e7[_0x1b7368];return _0x25d54c;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 8edb67d..d89d46b 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 _0x017c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','debug','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x150d8a,_0x3123cc){var _0xf67128=function(_0x242fb9){while(--_0x242fb9){_0x150d8a['push'](_0x150d8a['shift']());}};_0xf67128(++_0x3123cc);}(_0x017c,0xb6));var _0xc017=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x017c[_0x43a1b8];return _0x324ecc;};'use strict';var _=require(_0xc017('0x0'));var util=require(_0xc017('0x1'));var moment=require(_0xc017('0x2'));var BPromise=require(_0xc017('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc017('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc017('0x5'));var logger=require(_0xc017('0x6'))(_0xc017('0x7'));var config=require(_0xc017('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc017('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17930e,_0x205f9f,_0x57d0d9){return new BPromise(function(_0x141177,_0x71792){return client[_0xc017('0xa')](_0x17930e,_0x57d0d9)[_0xc017('0xb')](function(_0x2feedf){logger['info'](_0xc017('0xc'),_0x205f9f,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x205f9f,_0xc017('0xd'),JSON[_0xc017('0xe')](_0x2feedf));if(_0x2feedf[_0xc017('0xf')]){if(_0x2feedf[_0xc017('0xf')][_0xc017('0x10')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x205f9f,_0x2feedf[_0xc017('0xf')][_0xc017('0x11')]);return _0x71792(_0x2feedf[_0xc017('0xf')][_0xc017('0x11')]);}logger['error'](_0xc017('0xc'),_0x205f9f,_0x2feedf[_0xc017('0xf')][_0xc017('0x11')]);return _0x141177(_0x2feedf['error']['message']);}else{logger[_0xc017('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x205f9f,_0xc017('0xd'));_0x141177(_0x2feedf[_0xc017('0x13')][_0xc017('0x11')]);}})[_0xc017('0x14')](function(_0x1e10c3){logger[_0xc017('0xf')](_0xc017('0xc'),_0x205f9f,_0x1e10c3);_0x71792(_0x1e10c3);});});}exports[_0xc017('0x15')]=function(_0x48bf8e){var _0x2febe1=this;return new Promise(function(_0x1c622a,_0x4943d5){return db[_0xc017('0x16')][_0xc017('0x17')](_0x48bf8e[_0xc017('0x18')],{'raw':_0x48bf8e[_0xc017('0x19')]?_0x48bf8e['options']['raw']===undefined?!![]:![]:!![]})[_0xc017('0xb')](function(_0xfdc7d3){logger[_0xc017('0x12')](_0xc017('0x15'),_0x48bf8e);logger[_0xc017('0x1a')](_0xc017('0x15'),_0x48bf8e,JSON['stringify'](_0xfdc7d3));_0x1c622a(_0xfdc7d3);})['catch'](function(_0x3dbe06){logger[_0xc017('0xf')](_0xc017('0x15'),_0x3dbe06[_0xc017('0x11')],_0x48bf8e);_0x4943d5(_0x2febe1[_0xc017('0xf')](0x1f4,_0x3dbe06['message']));});});};exports[_0xc017('0x1b')]=function(_0xf6c2cd){var _0x2df6ea=this;return new Promise(function(_0x1aae47,_0xd8d956){return db[_0xc017('0x16')]['update'](_0xf6c2cd[_0xc017('0x18')],{'raw':_0xf6c2cd[_0xc017('0x19')]?_0xf6c2cd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf6c2cd[_0xc017('0x19')]?_0xf6c2cd['options'][_0xc017('0x1c')]||null:null,'attributes':_0xf6c2cd[_0xc017('0x19')]?_0xf6c2cd[_0xc017('0x19')][_0xc017('0x1d')]||null:null,'limit':_0xf6c2cd[_0xc017('0x19')]?_0xf6c2cd['options'][_0xc017('0x1e')]||null:null})[_0xc017('0xb')](function(_0x5e164e){logger[_0xc017('0x12')](_0xc017('0x1b'),_0xf6c2cd);logger[_0xc017('0x1a')](_0xc017('0x1b'),_0xf6c2cd,JSON['stringify'](_0x5e164e));_0x1aae47(_0x5e164e);})[_0xc017('0x14')](function(_0x342f28){logger['error'](_0xc017('0x1b'),_0x342f28[_0xc017('0x11')],_0xf6c2cd);_0xd8d956(_0x2df6ea['error'](0x1f4,_0x342f28[_0xc017('0x11')]));});});};
\ No newline at end of file
+var _0xc13c=['rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatQueueReport','create','body','options','raw','where','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xc13c,0x155));var _0xcc13=function(_0x762f3,_0x51e97a){_0x762f3=_0x762f3-0x0;var _0x9dbf10=_0xc13c[_0x762f3];return _0x9dbf10;};'use strict';var _=require(_0xcc13('0x0'));var util=require(_0xcc13('0x1'));var moment=require(_0xcc13('0x2'));var BPromise=require(_0xcc13('0x3'));var rs=require(_0xcc13('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc13('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc13('0x6'))(_0xcc13('0x7'));var config=require(_0xcc13('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcc13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fd488,_0x31e64d,_0x1adeb7){return new BPromise(function(_0x33c1fa,_0x235120){return client[_0xcc13('0xa')](_0x4fd488,_0x1adeb7)[_0xcc13('0xb')](function(_0x3499b0){logger[_0xcc13('0xc')](_0xcc13('0xd'),_0x31e64d,_0xcc13('0xe'));logger[_0xcc13('0xf')](_0xcc13('0x10'),_0x31e64d,'request\x20sent',JSON[_0xcc13('0x11')](_0x3499b0));if(_0x3499b0[_0xcc13('0x12')]){if(_0x3499b0[_0xcc13('0x12')]['code']===0x1f4){logger[_0xcc13('0x12')](_0xcc13('0xd'),_0x31e64d,_0x3499b0['error'][_0xcc13('0x13')]);return _0x235120(_0x3499b0[_0xcc13('0x12')]['message']);}logger['error'](_0xcc13('0xd'),_0x31e64d,_0x3499b0[_0xcc13('0x12')][_0xcc13('0x13')]);return _0x33c1fa(_0x3499b0['error'][_0xcc13('0x13')]);}else{logger[_0xcc13('0xc')](_0xcc13('0xd'),_0x31e64d,_0xcc13('0xe'));_0x33c1fa(_0x3499b0['result'][_0xcc13('0x13')]);}})[_0xcc13('0x14')](function(_0x4f8844){logger['error'](_0xcc13('0xd'),_0x31e64d,_0x4f8844);_0x235120(_0x4f8844);});});}exports[_0xcc13('0x15')]=function(_0x4681cd){var _0x4f502f=this;return new Promise(function(_0x2cfa38,_0x2c8811){return db['ChatQueueReport'][_0xcc13('0x16')](_0x4681cd[_0xcc13('0x17')],{'raw':_0x4681cd[_0xcc13('0x18')]?_0x4681cd[_0xcc13('0x18')][_0xcc13('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1fea91){logger[_0xcc13('0xc')]('CreateChatQueueReport',_0x4681cd);logger[_0xcc13('0xf')](_0xcc13('0x15'),_0x4681cd,JSON['stringify'](_0x1fea91));_0x2cfa38(_0x1fea91);})[_0xcc13('0x14')](function(_0x73a3b5){logger[_0xcc13('0x12')](_0xcc13('0x15'),_0x73a3b5[_0xcc13('0x13')],_0x4681cd);_0x2c8811(_0x4f502f[_0xcc13('0x12')](0x1f4,_0x73a3b5[_0xcc13('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x5eeb7f){var _0x363c3b=this;return new Promise(function(_0x2e0bec,_0xb88ec7){return db['ChatQueueReport']['update'](_0x5eeb7f['body'],{'raw':_0x5eeb7f[_0xcc13('0x18')]?_0x5eeb7f[_0xcc13('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eeb7f['options']?_0x5eeb7f[_0xcc13('0x18')][_0xcc13('0x1a')]||null:null,'attributes':_0x5eeb7f['options']?_0x5eeb7f[_0xcc13('0x18')]['attributes']||null:null,'limit':_0x5eeb7f[_0xcc13('0x18')]?_0x5eeb7f['options'][_0xcc13('0x1b')]||null:null})[_0xcc13('0xb')](function(_0x525b32){logger[_0xcc13('0xc')](_0xcc13('0x1c'),_0x5eeb7f);logger['debug']('UpdateChatQueueReport',_0x5eeb7f,JSON[_0xcc13('0x11')](_0x525b32));_0x2e0bec(_0x525b32);})[_0xcc13('0x14')](function(_0x14553f){logger[_0xcc13('0x12')]('UpdateChatQueueReport',_0x14553f['message'],_0x5eeb7f);_0xb88ec7(_0x363c3b[_0xcc13('0x12')](0x1f4,_0x14553f[_0xcc13('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 2b047f9..f2eb737 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 _0x710a=['describe','/:id','post','create','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe'];(function(_0x1a37b2,_0x584b3b){var _0x130c75=function(_0x268407){while(--_0x268407){_0x1a37b2['push'](_0x1a37b2['shift']());}};_0x130c75(++_0x584b3b);}(_0x710a,0xb1));var _0xa710=function(_0x20eb36,_0x41efeb){_0x20eb36=_0x20eb36-0x0;var _0x6abe87=_0x710a[_0x20eb36];return _0x6abe87;};'use strict';var multer=require(_0xa710('0x0'));var util=require(_0xa710('0x1'));var path=require('path');var timeout=require(_0xa710('0x2'));var express=require(_0xa710('0x3'));var router=express[_0xa710('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa710('0x5'));var interaction=require(_0xa710('0x6'));var config=require(_0xa710('0x7'));var controller=require(_0xa710('0x8'));router['get']('/',auth[_0xa710('0x9')](),controller[_0xa710('0xa')]);router[_0xa710('0xb')](_0xa710('0xc'),auth['isAuthenticated'](),controller[_0xa710('0xd')]);router[_0xa710('0xb')](_0xa710('0xe'),auth[_0xa710('0x9')](),controller['show']);router[_0xa710('0xf')]('/',auth['isAuthenticated'](),controller[_0xa710('0x10')]);router['put'](_0xa710('0xe'),auth[_0xa710('0x9')](),controller[_0xa710('0x11')]);router['delete'](_0xa710('0xe'),auth[_0xa710('0x9')](),controller[_0xa710('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x65f5=['destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete'];(function(_0xf15be4,_0x2c2591){var _0x2b6849=function(_0x544282){while(--_0x544282){_0xf15be4['push'](_0xf15be4['shift']());}};_0x2b6849(++_0x2c2591);}(_0x65f5,0x191));var _0x565f=function(_0x2cbede,_0x501eef){_0x2cbede=_0x2cbede-0x0;var _0x33eaa0=_0x65f5[_0x2cbede];return _0x33eaa0;};'use strict';var multer=require(_0x565f('0x0'));var util=require(_0x565f('0x1'));var path=require(_0x565f('0x2'));var timeout=require('connect-timeout');var express=require(_0x565f('0x3'));var router=express[_0x565f('0x4')]();var fs_extra=require(_0x565f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x565f('0x6'));var controller=require(_0x565f('0x7'));router[_0x565f('0x8')]('/',auth[_0x565f('0x9')](),controller[_0x565f('0xa')]);router[_0x565f('0x8')](_0x565f('0xb'),auth[_0x565f('0x9')](),controller[_0x565f('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x565f('0xd')]);router[_0x565f('0xe')]('/',auth[_0x565f('0x9')](),controller[_0x565f('0xf')]);router[_0x565f('0x10')](_0x565f('0x11'),auth[_0x565f('0x9')](),controller['update']);router[_0x565f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x565f('0x13')]);module[_0x565f('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index b70dac7..28906f2 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x41c1ae,_0x2f1102){var _0x11e6c9=function(_0x556e04){while(--_0x556e04){_0x41c1ae['push'](_0x41c1ae['shift']());}};_0x11e6c9(++_0x2f1102);}(_0xaa88,0x137));var _0x8aa8=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xaa88[_0x5216e0];return _0x5b3f40;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xabdc08,_0xe68f5e){var _0x3b4796=function(_0x443ac1){while(--_0x443ac1){_0xabdc08['push'](_0xabdc08['shift']());}};_0x3b4796(++_0xe68f5e);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xedd9[_0x2f5a22];return _0x326b70;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 00270c0..40ba811 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 _0x085c=['where','filters','pick','filter','VIRTUAL','merge','then','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort'];(function(_0x8dc01d,_0x4e8f22){var _0x3ab917=function(_0x17d5ce){while(--_0x17d5ce){_0x8dc01d['push'](_0x8dc01d['shift']());}};_0x3ab917(++_0x4e8f22);}(_0x085c,0xf4));var _0xc085=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x085c[_0x57fa33];return _0x12e724;};'use strict';var emlformat=require(_0xc085('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc085('0x1'));var rp=require(_0xc085('0x2'));var moment=require(_0xc085('0x3'));var BPromise=require(_0xc085('0x4'));var Mustache=require('mustache');var util=require(_0xc085('0x5'));var path=require(_0xc085('0x6'));var sox=require('sox');var csv=require(_0xc085('0x7'));var ejs=require(_0xc085('0x8'));var fs=require('fs');var fs_extra=require(_0xc085('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc085('0xa'));var jsforce=require(_0xc085('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc085('0x7'));var querystring=require(_0xc085('0xc'));var Papa=require(_0xc085('0xd'));var Redis=require('ioredis');var authService=require(_0xc085('0xe'));var qs=require(_0xc085('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc085('0x10'));var logger=require(_0xc085('0x11'))('api');var utils=require(_0xc085('0x12'));var config=require(_0xc085('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc085('0x14'))['db'];function respondWithStatusCode(_0x58c8fd,_0x2b90b6){_0x2b90b6=_0x2b90b6||0xcc;return function(_0x4af916){if(_0x4af916){return _0x58c8fd[_0xc085('0x15')](_0x2b90b6);}return _0x58c8fd['status'](_0x2b90b6)[_0xc085('0x16')]();};}function respondWithResult(_0x11f8fb,_0x2bab59){_0x2bab59=_0x2bab59||0xc8;return function(_0xf8ebf5){if(_0xf8ebf5){return _0x11f8fb['status'](_0x2bab59)[_0xc085('0x17')](_0xf8ebf5);}};}function respondWithFilteredResult(_0x1992da,_0x1278e7){return function(_0x2aeabf){if(_0x2aeabf){var _0x3d807f=typeof _0x1278e7[_0xc085('0x18')]==='undefined'&&typeof _0x1278e7[_0xc085('0x19')]===_0xc085('0x1a');var _0x473e2a=_0x2aeabf[_0xc085('0x1b')];var _0x848a72=_0x3d807f?0x0:_0x1278e7[_0xc085('0x18')];var _0x228c66=_0x3d807f?_0x2aeabf['count']:_0x1278e7['offset']+_0x1278e7[_0xc085('0x19')];var _0x1939ce;if(_0x228c66>=_0x473e2a){_0x228c66=_0x473e2a;_0x1939ce=0xc8;}else{_0x1939ce=0xce;}_0x1992da[_0xc085('0x1c')](_0x1939ce);return _0x1992da[_0xc085('0x1d')](_0xc085('0x1e'),_0x848a72+'-'+_0x228c66+'/'+_0x473e2a)['json'](_0x2aeabf);}return null;};}function patchUpdates(_0x575ab0){return function(_0x3f03e8){try{jsonpatch[_0xc085('0x1f')](_0x3f03e8,_0x575ab0,!![]);}catch(_0x429fc8){return BPromise[_0xc085('0x20')](_0x429fc8);}return _0x3f03e8['save']();};}function saveUpdates(_0x262e38,_0x414a2a){return function(_0x424009){if(_0x424009){return _0x424009[_0xc085('0x21')](_0x262e38)['then'](function(_0x5c9f54){return _0x5c9f54;});}return null;};}function removeEntity(_0x225d21,_0x373c6f){return function(_0x2b0107){if(_0x2b0107){return _0x2b0107[_0xc085('0x22')]()['then'](function(){_0x225d21[_0xc085('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23d02f,_0x2ea9a3){return function(_0x12fa5e){if(!_0x12fa5e){_0x23d02f[_0xc085('0x15')](0x194);}return _0x12fa5e;};}function handleError(_0x23072f,_0x195348){_0x195348=_0x195348||0x1f4;return function(_0x21bd13){logger[_0xc085('0x23')](_0x21bd13[_0xc085('0x24')]);if(_0x21bd13['name']){delete _0x21bd13[_0xc085('0x25')];}_0x23072f[_0xc085('0x1c')](_0x195348)[_0xc085('0x26')](_0x21bd13);};}exports[_0xc085('0x27')]=function(_0x16a555,_0x5af81c){var _0x439213={},_0x5109ce={},_0x4936cf={'count':0x0,'rows':[]};var _0x29fbf7=_[_0xc085('0x28')](db[_0xc085('0x29')][_0xc085('0x2a')],function(_0x1b19f2){return{'name':_0x1b19f2[_0xc085('0x2b')],'type':_0x1b19f2[_0xc085('0x2c')][_0xc085('0x2d')]};});_0x5109ce[_0xc085('0x2e')]=_[_0xc085('0x28')](_0x29fbf7,_0xc085('0x25'));_0x5109ce[_0xc085('0x2f')]=_[_0xc085('0x30')](_0x16a555[_0xc085('0x2f')]);_0x5109ce['filters']=_['intersection'](_0x5109ce[_0xc085('0x2e')],_0x5109ce[_0xc085('0x2f')]);_0x439213[_0xc085('0x31')]=_[_0xc085('0x32')](_0x5109ce['model'],qs[_0xc085('0x33')](_0x16a555[_0xc085('0x2f')][_0xc085('0x33')]));_0x439213['attributes']=_0x439213[_0xc085('0x31')][_0xc085('0x34')]?_0x439213[_0xc085('0x31')]:_0x5109ce['model'];if(!_0x16a555[_0xc085('0x2f')][_0xc085('0x35')]('nolimit')){_0x439213['limit']=qs[_0xc085('0x19')](_0x16a555[_0xc085('0x2f')][_0xc085('0x19')]);_0x439213[_0xc085('0x18')]=qs['offset'](_0x16a555['query'][_0xc085('0x18')]);}_0x439213[_0xc085('0x36')]=qs['sort'](_0x16a555[_0xc085('0x2f')][_0xc085('0x37')]);_0x439213[_0xc085('0x38')]=qs[_0xc085('0x39')](_[_0xc085('0x3a')](_0x16a555['query'],_0x5109ce[_0xc085('0x39')]),_0x29fbf7);if(_0x16a555[_0xc085('0x2f')][_0xc085('0x3b')]){_0x439213[_0xc085('0x38')]=_['merge'](_0x439213[_0xc085('0x38')],{'$or':_[_0xc085('0x28')](_0x29fbf7,function(_0x394b5f){if(_0x394b5f[_0xc085('0x2c')]!==_0xc085('0x3c')){var _0x53b4ac={};_0x53b4ac[_0x394b5f[_0xc085('0x25')]]={'$like':'%'+_0x16a555[_0xc085('0x2f')][_0xc085('0x3b')]+'%'};return _0x53b4ac;}})});}_0x439213=_[_0xc085('0x3d')]({},_0x439213,_0x16a555['options']);var _0x394e61={'where':_0x439213['where']};return db['ChatTransferReport']['count'](_0x394e61)[_0xc085('0x3e')](function(_0x10e5e6){_0x4936cf[_0xc085('0x1b')]=_0x10e5e6;if(_0x16a555[_0xc085('0x2f')][_0xc085('0x3f')]){_0x439213[_0xc085('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xc085('0x41')](_0x439213);})[_0xc085('0x3e')](function(_0x5efeaf){_0x4936cf[_0xc085('0x42')]=_0x5efeaf;return _0x4936cf;})[_0xc085('0x3e')](respondWithFilteredResult(_0x5af81c,_0x439213))[_0xc085('0x43')](handleError(_0x5af81c,null));};exports[_0xc085('0x44')]=function(_0x5a1b76,_0x1de039){var _0x35b4f1={'raw':!![],'where':{'id':_0x5a1b76[_0xc085('0x45')]['id']}},_0x2d2371={};_0x2d2371[_0xc085('0x2e')]=_['keys'](db[_0xc085('0x29')]['rawAttributes']);_0x2d2371[_0xc085('0x2f')]=_[_0xc085('0x30')](_0x5a1b76[_0xc085('0x2f')]);_0x2d2371['filters']=_[_0xc085('0x32')](_0x2d2371['model'],_0x2d2371[_0xc085('0x2f')]);_0x35b4f1['attributes']=_[_0xc085('0x32')](_0x2d2371['model'],qs['fields'](_0x5a1b76[_0xc085('0x2f')][_0xc085('0x33')]));_0x35b4f1[_0xc085('0x31')]=_0x35b4f1['attributes'][_0xc085('0x34')]?_0x35b4f1[_0xc085('0x31')]:_0x2d2371[_0xc085('0x2e')];if(_0x5a1b76[_0xc085('0x2f')][_0xc085('0x3f')]){_0x35b4f1[_0xc085('0x40')]=[{'all':!![]}];}_0x35b4f1=_[_0xc085('0x3d')]({},_0x35b4f1,_0x5a1b76[_0xc085('0x46')]);return db['ChatTransferReport']['find'](_0x35b4f1)[_0xc085('0x3e')](handleEntityNotFound(_0x1de039,null))[_0xc085('0x3e')](respondWithResult(_0x1de039,null))[_0xc085('0x43')](handleError(_0x1de039,null));};exports['create']=function(_0x3a93bf,_0x1b08db){return db['ChatTransferReport'][_0xc085('0x47')](_0x3a93bf['body'],{})[_0xc085('0x3e')](respondWithResult(_0x1b08db,0xc9))[_0xc085('0x43')](handleError(_0x1b08db,null));};exports[_0xc085('0x21')]=function(_0x5e58df,_0x3db3ae){if(_0x5e58df['body']['id']){delete _0x5e58df[_0xc085('0x48')]['id'];}return db[_0xc085('0x29')]['find']({'where':{'id':_0x5e58df['params']['id']}})[_0xc085('0x3e')](handleEntityNotFound(_0x3db3ae,null))[_0xc085('0x3e')](saveUpdates(_0x5e58df['body'],null))['then'](respondWithResult(_0x3db3ae,null))[_0xc085('0x43')](handleError(_0x3db3ae,null));};exports[_0xc085('0x22')]=function(_0x4735d4,_0x59b1a0){return db[_0xc085('0x29')][_0xc085('0x49')]({'where':{'id':_0x4735d4[_0xc085('0x45')]['id']}})[_0xc085('0x3e')](handleEntityNotFound(_0x59b1a0,null))[_0xc085('0x3e')](removeEntity(_0x59b1a0,null))[_0xc085('0x43')](handleError(_0x59b1a0,null));};exports['describe']=function(_0x2342e5,_0x5c1803){return db[_0xc085('0x29')][_0xc085('0x4a')]()[_0xc085('0x3e')](respondWithResult(_0x5c1803,null))[_0xc085('0x43')](handleError(_0x5c1803,null));};
\ No newline at end of file
+var _0xd5a7=['fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatTransferReport','includeAll','include','findAll','show','params','keys','rawAttributes','length','find','catch','create','body','describe','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','end','error','stack','name','send','index','map'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xd5a7,0x67));var _0x7d5a=function(_0x442f2a,_0x3e6ef2){_0x442f2a=_0x442f2a-0x0;var _0x490f46=_0xd5a7[_0x442f2a];return _0x490f46;};'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(_0x7d5a('0x0'));var moment=require('moment');var BPromise=require(_0x7d5a('0x1'));var Mustache=require(_0x7d5a('0x2'));var util=require(_0x7d5a('0x3'));var path=require(_0x7d5a('0x4'));var sox=require(_0x7d5a('0x5'));var csv=require(_0x7d5a('0x6'));var ejs=require(_0x7d5a('0x7'));var fs=require('fs');var fs_extra=require(_0x7d5a('0x8'));var _=require(_0x7d5a('0x9'));var squel=require(_0x7d5a('0xa'));var crypto=require(_0x7d5a('0xb'));var jsforce=require(_0x7d5a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7d5a('0x6'));var querystring=require(_0x7d5a('0xd'));var Papa=require(_0x7d5a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7d5a('0xf'));var as=require(_0x7d5a('0x10'));var hardwareService=require(_0x7d5a('0x11'));var logger=require(_0x7d5a('0x12'))('api');var utils=require(_0x7d5a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7d5a('0x14'))['db'];function respondWithStatusCode(_0x11893a,_0x54fa0d){_0x54fa0d=_0x54fa0d||0xcc;return function(_0x310973){if(_0x310973){return _0x11893a[_0x7d5a('0x15')](_0x54fa0d);}return _0x11893a[_0x7d5a('0x16')](_0x54fa0d)['end']();};}function respondWithResult(_0x259cf1,_0x500f85){_0x500f85=_0x500f85||0xc8;return function(_0x21088b){if(_0x21088b){return _0x259cf1[_0x7d5a('0x16')](_0x500f85)['json'](_0x21088b);}};}function respondWithFilteredResult(_0x253fed,_0x36e685){return function(_0x1ea66e){if(_0x1ea66e){var _0x106c94=typeof _0x36e685[_0x7d5a('0x17')]===_0x7d5a('0x18')&&typeof _0x36e685[_0x7d5a('0x19')]===_0x7d5a('0x18');var _0x36bc11=_0x1ea66e[_0x7d5a('0x1a')];var _0x310c52=_0x106c94?0x0:_0x36e685[_0x7d5a('0x17')];var _0x47edba=_0x106c94?_0x1ea66e[_0x7d5a('0x1a')]:_0x36e685[_0x7d5a('0x17')]+_0x36e685[_0x7d5a('0x19')];var _0x2d6f31;if(_0x47edba>=_0x36bc11){_0x47edba=_0x36bc11;_0x2d6f31=0xc8;}else{_0x2d6f31=0xce;}_0x253fed['status'](_0x2d6f31);return _0x253fed[_0x7d5a('0x1b')](_0x7d5a('0x1c'),_0x310c52+'-'+_0x47edba+'/'+_0x36bc11)[_0x7d5a('0x1d')](_0x1ea66e);}return null;};}function patchUpdates(_0x4c3c48){return function(_0x691fc4){try{jsonpatch[_0x7d5a('0x1e')](_0x691fc4,_0x4c3c48,!![]);}catch(_0x2d709b){return BPromise['reject'](_0x2d709b);}return _0x691fc4['save']();};}function saveUpdates(_0x56c2c2,_0x276dec){return function(_0x261259){if(_0x261259){return _0x261259[_0x7d5a('0x1f')](_0x56c2c2)[_0x7d5a('0x20')](function(_0x59f785){return _0x59f785;});}return null;};}function removeEntity(_0x52c417,_0x444aec){return function(_0x45c61f){if(_0x45c61f){return _0x45c61f[_0x7d5a('0x21')]()['then'](function(){_0x52c417[_0x7d5a('0x16')](0xcc)[_0x7d5a('0x22')]();});}};}function handleEntityNotFound(_0x53f8ac,_0x4fadfb){return function(_0x51ddd4){if(!_0x51ddd4){_0x53f8ac[_0x7d5a('0x15')](0x194);}return _0x51ddd4;};}function handleError(_0x216d8d,_0x35e827){_0x35e827=_0x35e827||0x1f4;return function(_0x161c20){logger[_0x7d5a('0x23')](_0x161c20[_0x7d5a('0x24')]);if(_0x161c20[_0x7d5a('0x25')]){delete _0x161c20[_0x7d5a('0x25')];}_0x216d8d['status'](_0x35e827)[_0x7d5a('0x26')](_0x161c20);};}exports[_0x7d5a('0x27')]=function(_0x19092e,_0x1455cd){var _0x3d0f99={},_0x4e3f7a={},_0x386b50={'count':0x0,'rows':[]};var _0x362970=_[_0x7d5a('0x28')](db['ChatTransferReport']['rawAttributes'],function(_0x675f61){return{'name':_0x675f61[_0x7d5a('0x29')],'type':_0x675f61[_0x7d5a('0x2a')]['key']};});_0x4e3f7a[_0x7d5a('0x2b')]=_[_0x7d5a('0x28')](_0x362970,_0x7d5a('0x25'));_0x4e3f7a[_0x7d5a('0x2c')]=_['keys'](_0x19092e[_0x7d5a('0x2c')]);_0x4e3f7a[_0x7d5a('0x2d')]=_[_0x7d5a('0x2e')](_0x4e3f7a[_0x7d5a('0x2b')],_0x4e3f7a['query']);_0x3d0f99[_0x7d5a('0x2f')]=_['intersection'](_0x4e3f7a[_0x7d5a('0x2b')],qs[_0x7d5a('0x30')](_0x19092e['query'][_0x7d5a('0x30')]));_0x3d0f99[_0x7d5a('0x2f')]=_0x3d0f99['attributes']['length']?_0x3d0f99[_0x7d5a('0x2f')]:_0x4e3f7a[_0x7d5a('0x2b')];if(!_0x19092e[_0x7d5a('0x2c')][_0x7d5a('0x31')](_0x7d5a('0x32'))){_0x3d0f99[_0x7d5a('0x19')]=qs['limit'](_0x19092e[_0x7d5a('0x2c')][_0x7d5a('0x19')]);_0x3d0f99[_0x7d5a('0x17')]=qs[_0x7d5a('0x17')](_0x19092e[_0x7d5a('0x2c')]['offset']);}_0x3d0f99[_0x7d5a('0x33')]=qs[_0x7d5a('0x34')](_0x19092e['query'][_0x7d5a('0x34')]);_0x3d0f99['where']=qs['filters'](_[_0x7d5a('0x35')](_0x19092e[_0x7d5a('0x2c')],_0x4e3f7a[_0x7d5a('0x2d')]),_0x362970);if(_0x19092e[_0x7d5a('0x2c')][_0x7d5a('0x36')]){_0x3d0f99[_0x7d5a('0x37')]=_[_0x7d5a('0x38')](_0x3d0f99[_0x7d5a('0x37')],{'$or':_[_0x7d5a('0x28')](_0x362970,function(_0x42ea9e){if(_0x42ea9e[_0x7d5a('0x2a')]!=='VIRTUAL'){var _0x1fc23c={};_0x1fc23c[_0x42ea9e[_0x7d5a('0x25')]]={'$like':'%'+_0x19092e[_0x7d5a('0x2c')][_0x7d5a('0x36')]+'%'};return _0x1fc23c;}})});}_0x3d0f99=_[_0x7d5a('0x38')]({},_0x3d0f99,_0x19092e[_0x7d5a('0x39')]);var _0x57401d={'where':_0x3d0f99['where']};return db[_0x7d5a('0x3a')][_0x7d5a('0x1a')](_0x57401d)[_0x7d5a('0x20')](function(_0x51a7ca){_0x386b50[_0x7d5a('0x1a')]=_0x51a7ca;if(_0x19092e['query'][_0x7d5a('0x3b')]){_0x3d0f99[_0x7d5a('0x3c')]=[{'all':!![]}];}return db[_0x7d5a('0x3a')][_0x7d5a('0x3d')](_0x3d0f99);})['then'](function(_0xbe93af){_0x386b50['rows']=_0xbe93af;return _0x386b50;})['then'](respondWithFilteredResult(_0x1455cd,_0x3d0f99))['catch'](handleError(_0x1455cd,null));};exports[_0x7d5a('0x3e')]=function(_0x59cf2e,_0x5c19de){var _0x3f757c={'raw':!![],'where':{'id':_0x59cf2e[_0x7d5a('0x3f')]['id']}},_0x570aea={};_0x570aea['model']=_[_0x7d5a('0x40')](db[_0x7d5a('0x3a')][_0x7d5a('0x41')]);_0x570aea[_0x7d5a('0x2c')]=_[_0x7d5a('0x40')](_0x59cf2e[_0x7d5a('0x2c')]);_0x570aea[_0x7d5a('0x2d')]=_['intersection'](_0x570aea[_0x7d5a('0x2b')],_0x570aea['query']);_0x3f757c['attributes']=_['intersection'](_0x570aea[_0x7d5a('0x2b')],qs['fields'](_0x59cf2e[_0x7d5a('0x2c')][_0x7d5a('0x30')]));_0x3f757c[_0x7d5a('0x2f')]=_0x3f757c[_0x7d5a('0x2f')][_0x7d5a('0x42')]?_0x3f757c[_0x7d5a('0x2f')]:_0x570aea[_0x7d5a('0x2b')];if(_0x59cf2e[_0x7d5a('0x2c')][_0x7d5a('0x3b')]){_0x3f757c[_0x7d5a('0x3c')]=[{'all':!![]}];}_0x3f757c=_[_0x7d5a('0x38')]({},_0x3f757c,_0x59cf2e[_0x7d5a('0x39')]);return db[_0x7d5a('0x3a')][_0x7d5a('0x43')](_0x3f757c)[_0x7d5a('0x20')](handleEntityNotFound(_0x5c19de,null))[_0x7d5a('0x20')](respondWithResult(_0x5c19de,null))[_0x7d5a('0x44')](handleError(_0x5c19de,null));};exports[_0x7d5a('0x45')]=function(_0x2f3b0f,_0x1ffa8c){return db[_0x7d5a('0x3a')][_0x7d5a('0x45')](_0x2f3b0f[_0x7d5a('0x46')],{})[_0x7d5a('0x20')](respondWithResult(_0x1ffa8c,0xc9))[_0x7d5a('0x44')](handleError(_0x1ffa8c,null));};exports[_0x7d5a('0x1f')]=function(_0x5a6b34,_0x25f5f9){if(_0x5a6b34[_0x7d5a('0x46')]['id']){delete _0x5a6b34[_0x7d5a('0x46')]['id'];}return db[_0x7d5a('0x3a')][_0x7d5a('0x43')]({'where':{'id':_0x5a6b34['params']['id']}})['then'](handleEntityNotFound(_0x25f5f9,null))[_0x7d5a('0x20')](saveUpdates(_0x5a6b34[_0x7d5a('0x46')],null))[_0x7d5a('0x20')](respondWithResult(_0x25f5f9,null))[_0x7d5a('0x44')](handleError(_0x25f5f9,null));};exports[_0x7d5a('0x21')]=function(_0x4c5dd7,_0x14df4d){return db[_0x7d5a('0x3a')][_0x7d5a('0x43')]({'where':{'id':_0x4c5dd7['params']['id']}})[_0x7d5a('0x20')](handleEntityNotFound(_0x14df4d,null))[_0x7d5a('0x20')](removeEntity(_0x14df4d,null))['catch'](handleError(_0x14df4d,null));};exports[_0x7d5a('0x47')]=function(_0xe98852,_0x4a5bd9){return db[_0x7d5a('0x3a')]['describe']()[_0x7d5a('0x20')](respondWithResult(_0x4a5bd9,null))[_0x7d5a('0x44')](handleError(_0x4a5bd9,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 0c1fd11..d200cc5 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 _0xc1c1=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1c1,0x154));var _0x1c1c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc1c1[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x1c1c('0x0'));var util=require(_0x1c1c('0x1'));var logger=require(_0x1c1c('0x2'))(_0x1c1c('0x3'));var moment=require('moment');var BPromise=require(_0x1c1c('0x4'));var rp=require(_0x1c1c('0x5'));var fs=require('fs');var path=require(_0x1c1c('0x6'));var rimraf=require(_0x1c1c('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x502599,_0x1886f0){return _0x502599['define'](_0x1c1c('0x8'),attributes,{'tableName':_0x1c1c('0x9'),'paranoid':![],'indexes':[{'name':_0x1c1c('0xa'),'fields':[_0x1c1c('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x858e=['../../config/environment','./chatTransferReport.attributes','ChatTransferReport','uniqueid','../../config/logger','request-promise','rimraf'];(function(_0x5c2034,_0x16cb32){var _0x1222d6=function(_0x3e8213){while(--_0x3e8213){_0x5c2034['push'](_0x5c2034['shift']());}};_0x1222d6(++_0x16cb32);}(_0x858e,0x6d));var _0xe858=function(_0x51bdd4,_0x29b4be){_0x51bdd4=_0x51bdd4-0x0;var _0x1d3a75=_0x858e[_0x51bdd4];return _0x1d3a75;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe858('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe858('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe858('0x2'));var config=require(_0xe858('0x3'));var attributes=require(_0xe858('0x4'));module['exports']=function(_0x8b9d87,_0x355f5b){return _0x8b9d87['define'](_0xe858('0x5'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe858('0x6')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 6a66305..f8d57a0 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 _0x5fe2=['../../config/logger','rpc','../../config/environment','client','http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5fe2,0x8e));var _0x25fe=function(_0x1d8990,_0x4382b5){_0x1d8990=_0x1d8990-0x0;var _0x5ce380=_0x5fe2[_0x1d8990];return _0x5ce380;};'use strict';var _=require(_0x25fe('0x0'));var util=require(_0x25fe('0x1'));var moment=require(_0x25fe('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25fe('0x3'))['db'];var utils=require(_0x25fe('0x4'));var logger=require(_0x25fe('0x5'))(_0x25fe('0x6'));var config=require(_0x25fe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x25fe('0x8')][_0x25fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b35b7,_0x1c0002,_0x268980){return new BPromise(function(_0x32bb63,_0x454e78){return client[_0x25fe('0xa')](_0x1b35b7,_0x268980)['then'](function(_0x2e850e){logger['info'](_0x25fe('0xb'),_0x1c0002,_0x25fe('0xc'));logger['debug'](_0x25fe('0xd'),_0x1c0002,_0x25fe('0xc'),JSON[_0x25fe('0xe')](_0x2e850e));if(_0x2e850e[_0x25fe('0xf')]){if(_0x2e850e[_0x25fe('0xf')][_0x25fe('0x10')]===0x1f4){logger[_0x25fe('0xf')](_0x25fe('0xb'),_0x1c0002,_0x2e850e[_0x25fe('0xf')][_0x25fe('0x11')]);return _0x454e78(_0x2e850e[_0x25fe('0xf')]['message']);}logger[_0x25fe('0xf')](_0x25fe('0xb'),_0x1c0002,_0x2e850e[_0x25fe('0xf')]['message']);return _0x32bb63(_0x2e850e[_0x25fe('0xf')]['message']);}else{logger[_0x25fe('0x12')](_0x25fe('0xb'),_0x1c0002,'request\x20sent');_0x32bb63(_0x2e850e[_0x25fe('0x13')]['message']);}})[_0x25fe('0x14')](function(_0x550cf0){logger[_0x25fe('0xf')](_0x25fe('0xb'),_0x1c0002,_0x550cf0);_0x454e78(_0x550cf0);});});}
\ No newline at end of file
+var _0x4271=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x126dfb,_0x4e1bdd){var _0x487792=function(_0x47079d){while(--_0x47079d){_0x126dfb['push'](_0x126dfb['shift']());}};_0x487792(++_0x4e1bdd);}(_0x4271,0x87));var _0x1427=function(_0x244aa4,_0x251b1d){_0x244aa4=_0x244aa4-0x0;var _0x463d24=_0x4271[_0x244aa4];return _0x463d24;};'use strict';var _=require(_0x1427('0x0'));var util=require(_0x1427('0x1'));var moment=require(_0x1427('0x2'));var BPromise=require(_0x1427('0x3'));var rs=require(_0x1427('0x4'));var fs=require('fs');var Redis=require(_0x1427('0x5'));var db=require(_0x1427('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1427('0x7'))('rpc');var config=require(_0x1427('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1427('0x9')][_0x1427('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x214cbc,_0x508ea3,_0x22c89f){return new BPromise(function(_0x291dc2,_0x4d21de){return client[_0x1427('0xb')](_0x214cbc,_0x22c89f)[_0x1427('0xc')](function(_0x24dca1){logger[_0x1427('0xd')](_0x1427('0xe'),_0x508ea3,_0x1427('0xf'));logger[_0x1427('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x508ea3,_0x1427('0xf'),JSON[_0x1427('0x11')](_0x24dca1));if(_0x24dca1[_0x1427('0x12')]){if(_0x24dca1[_0x1427('0x12')][_0x1427('0x13')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x508ea3,_0x24dca1[_0x1427('0x12')][_0x1427('0x14')]);return _0x4d21de(_0x24dca1[_0x1427('0x12')][_0x1427('0x14')]);}logger[_0x1427('0x12')](_0x1427('0xe'),_0x508ea3,_0x24dca1[_0x1427('0x12')][_0x1427('0x14')]);return _0x291dc2(_0x24dca1['error'][_0x1427('0x14')]);}else{logger[_0x1427('0xd')](_0x1427('0xe'),_0x508ea3,_0x1427('0xf'));_0x291dc2(_0x24dca1[_0x1427('0x15')][_0x1427('0x14')]);}})[_0x1427('0x16')](function(_0x3cad64){logger[_0x1427('0x12')](_0x1427('0xe'),_0x508ea3,_0x3cad64);_0x4d21de(_0x3cad64);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index b3c19e8..9154b38 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 _0x2b4d=['update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x4b43c0,_0x3a8091){var _0x574c13=function(_0x39eaf4){while(--_0x39eaf4){_0x4b43c0['push'](_0x4b43c0['shift']());}};_0x574c13(++_0x3a8091);}(_0x2b4d,0xb3));var _0xd2b4=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x2b4d[_0x5d30b4];return _0x1acfb8;};'use strict';var multer=require('multer');var util=require(_0xd2b4('0x0'));var path=require('path');var timeout=require(_0xd2b4('0x1'));var express=require(_0xd2b4('0x2'));var router=express[_0xd2b4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd2b4('0x4'));var config=require(_0xd2b4('0x5'));var controller=require(_0xd2b4('0x6'));router['get']('/',auth[_0xd2b4('0x7')](),controller[_0xd2b4('0x8')]);router[_0xd2b4('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xd2b4('0xa'),auth['isAuthenticated'](),controller[_0xd2b4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd2b4('0xc')]);router['put'](_0xd2b4('0xa'),auth[_0xd2b4('0x7')](),controller[_0xd2b4('0xd')]);router[_0xd2b4('0xe')]('/:id',auth[_0xd2b4('0x7')](),controller['destroy']);module[_0xd2b4('0xf')]=router;
\ No newline at end of file
+var _0xc258=['isAuthenticated','index','show','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc258,0x14c));var _0x8c25=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc258[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x8c25('0x0'));var util=require(_0x8c25('0x1'));var path=require(_0x8c25('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c25('0x3'));var router=express[_0x8c25('0x4')]();var fs_extra=require(_0x8c25('0x5'));var auth=require(_0x8c25('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c25('0x7'));var controller=require(_0x8c25('0x8'));router[_0x8c25('0x9')]('/',auth[_0x8c25('0xa')](),controller[_0x8c25('0xb')]);router['get']('/describe',auth[_0x8c25('0xa')](),controller['describe']);router['get']('/:id',auth[_0x8c25('0xa')](),controller[_0x8c25('0xc')]);router['post']('/',auth[_0x8c25('0xa')](),controller['create']);router[_0x8c25('0xd')](_0x8c25('0xe'),auth['isAuthenticated'](),controller[_0x8c25('0xf')]);router[_0x8c25('0x10')](_0x8c25('0xe'),auth['isAuthenticated'](),controller[_0x8c25('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 1d93f14..dc5e09e 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 _0x9f2b=['offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','#ffffff','BOOLEAN','rounded','We\x20are\x20here!','Chat','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','thumb','text','getDataValue','parse','setDataValue','stringify','input','textarea','Comments'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x9f2b,0x168));var _0xb9f2=function(_0x138ab8,_0x539ea0){_0x138ab8=_0x138ab8-0x0;var _0x3598de=_0x9f2b[_0x138ab8];return _0x3598de;};'use strict';var Sequelize=require(_0xb9f2('0x0'));var rs=require('randomstring');module[_0xb9f2('0x1')]={'name':{'type':Sequelize[_0xb9f2('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xb9f2('0x2')],'allowNull':![],'unique':_0xb9f2('0x3')},'description':{'type':Sequelize[_0xb9f2('0x2')]},'mapKey':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb9f2('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb9f2('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb9f2('0x2')],'allowNull':![],'defaultValue':_0xb9f2('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb9f2('0x2')],'allowNull':![],'defaultValue':_0xb9f2('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded','squared'),'defaultValue':_0xb9f2('0x7')},'header_online':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x8')},'start_chat_button':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x9')},'offline_chat_button':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0xa')},'download_transcript':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb9f2('0xb')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0xc')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb9f2('0xd')]},'closingQuestion':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0xf')},'noteTitle':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x10')},'placeholderMessage':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x11')},'closingMessage':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x12')},'closingMessageButton':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x13')},'skipMessageButton':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x14')},'conditionAgreement':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x15')},'ratingType':{'type':Sequelize[_0xb9f2('0x16')]('star',_0xb9f2('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb9f2('0xb')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb9f2('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0xb9f2('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xb9f2('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb9f2('0x19')]('onlineForm')?JSON[_0xb9f2('0x1a')](this['getDataValue']('onlineForm')):{};},'set':function(_0x3adea3){return this[_0xb9f2('0x1b')]('onlineForm',JSON[_0xb9f2('0x1c')](_0x3adea3));}},'offlineForm':{'type':Sequelize[_0xb9f2('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb9f2('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb9f2('0x4'),'type':_0xb9f2('0x4')},'variable':null},{'type':_0xb9f2('0x1e'),'config':{'placeholder':_0xb9f2('0x1f')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb9f2('0x19')]('offlineForm')?JSON[_0xb9f2('0x1a')](this[_0xb9f2('0x19')](_0xb9f2('0x20'))):{};},'set':function(_0xb61282){return this['setDataValue']('offlineForm',JSON[_0xb9f2('0x1c')](_0xb61282));}},'token':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':function(){return rs[_0xb9f2('0x21')]();}},'autoclose':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb9f2('0x2')]},'waitingTitle':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x22')},'waitingMessage':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x24')},'offlineMessageBody':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x26')},'skipUnmanaged':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x14')},'sendUnmanaged':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb9f2('0xd')],'defaultValue':function(){return _0xb9f2('0x27');}},'notificationSound':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xb9f2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':_0xb9f2('0x28')},'verticalAlignment':{'type':Sequelize[_0xb9f2('0xb')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xb9f2('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xb9f2('0x2')]},'customerAvatar':{'type':Sequelize[_0xb9f2('0xd')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb9f2('0xb')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb9f2('0x2')],'allowNull':![],'defaultValue':_0xb9f2('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb9f2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb9f2('0x2b')},'systemAvatar':{'type':Sequelize[_0xb9f2('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb9f2('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xa1b04f){if(!_0xa1b04f)this[_0xb9f2('0x1b')](_0xb9f2('0x2d'),null);this[_0xb9f2('0x1b')](_0xb9f2('0x2e'),_0xa1b04f);}},'vidaooEscalation':{'type':Sequelize[_0xb9f2('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb9f2('0x2')]},'vidaooTopic':{'type':Sequelize[_0xb9f2('0x2')],'allowNull':![],'defaultValue':_0xb9f2('0x2f')},'vidaooNote':{'type':Sequelize[_0xb9f2('0x2')],'defaultValue':function(){return _0xb9f2('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xb9f2('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb9f2('0xd')]}};
\ No newline at end of file
+var _0x44ac=['STRING','address','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','thumb','input','text','name','email','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize'];(function(_0x4d9cab,_0x488b32){var _0x4a1609=function(_0x1bde59){while(--_0x1bde59){_0x4d9cab['push'](_0x4d9cab['shift']());}};_0x4a1609(++_0x488b32);}(_0x44ac,0x148));var _0xc44a=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x44ac[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xc44a('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xc44a('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xc44a('0x1')],'allowNull':![],'unique':_0xc44a('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'email'},'key':{'type':Sequelize[_0xc44a('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xc44a('0x3')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc44a('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc44a('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc44a('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xc44a('0x1')],'allowNull':![],'defaultValue':_0xc44a('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc44a('0x7')](_0xc44a('0x8'),_0xc44a('0x9')),'defaultValue':_0xc44a('0x8')},'header_online':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0xa')},'start_chat_button':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0xb')},'offline_chat_button':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xc44a('0xc')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xc44a('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xc44a('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc44a('0x11')},'noteTitle':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x12')},'placeholderMessage':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x13')},'closingMessageButton':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x14')},'skipMessageButton':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x15')},'conditionAgreement':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xc44a('0x7')](_0xc44a('0x16'),_0xc44a('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xc44a('0xc')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc44a('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xc44a('0x18'),'variable':null,'config':{'placeholder':'name','type':_0xc44a('0x19'),'required':!![]},'props':{'title':_0xc44a('0x1a'),'helpText':''}},{'type':_0xc44a('0x18'),'props':{'title':_0xc44a('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0xc44a('0x1b'),'type':_0xc44a('0x1b')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc44a('0x1c')](_0xc44a('0x1d'))?JSON[_0xc44a('0x1e')](this['getDataValue'](_0xc44a('0x1d'))):{};},'set':function(_0x2bb050){return this[_0xc44a('0x1f')]('onlineForm',JSON[_0xc44a('0x20')](_0x2bb050));}},'offlineForm':{'type':Sequelize[_0xc44a('0xe')],'defaultValue':function(){return JSON[_0xc44a('0x20')]({'items':[{'type':_0xc44a('0x18'),'props':{'title':_0xc44a('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0xc44a('0x1b'),'type':_0xc44a('0x1b')},'variable':null},{'type':_0xc44a('0x21'),'config':{'placeholder':_0xc44a('0x22')},'props':{'title':_0xc44a('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xc44a('0x1e')](this[_0xc44a('0x1c')](_0xc44a('0x23'))):{};},'set':function(_0x19c8c4){return this[_0xc44a('0x1f')](_0xc44a('0x23'),JSON[_0xc44a('0x20')](_0x19c8c4));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc44a('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc44a('0x1')]},'forwardOffline':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc44a('0x1')]},'waitingTitle':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xc44a('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x28')},'skipUnmanaged':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x15')},'sendUnmanaged':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc44a('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc44a('0x1')]},'notificationTemplate':{'type':Sequelize[_0xc44a('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc44a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xc44a('0xc')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xc44a('0x1')]},'customerAvatar':{'type':Sequelize[_0xc44a('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc44a('0xc')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc44a('0x1')],'allowNull':![],'defaultValue':_0xc44a('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc44a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc44a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc44a('0x1')],'defaultValue':_0xc44a('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc44a('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![],'comment':_0xc44a('0x2c'),'set':function(_0x1dc17a){if(!_0x1dc17a)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc44a('0x1f')](_0xc44a('0x2d'),_0x1dc17a);}},'vidaooEscalation':{'type':Sequelize[_0xc44a('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xc44a('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xc44a('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc44a('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 74c6534..24d76ea 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 _0x0faf=['querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIBadRequestError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','destroy','get','ChatWebsites','UserProfileResource','name','send','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','map','ChatWebsite','rawAttributes','fieldName','key','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','show','mandatoryDispositionPause','fields','includeAll','find','create','body','address','split','forEach','testWildcardValidity','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','ChatWebsiteId','getDispositions','findOne','Disposition','order','findAll','removeDispositions','getAnswers','CannedAnswer','ids','addLogo','file','addAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','Interval','resolve','timezone','ifTime','notify','chat','from','mapKey','isEmpty','CmContact','No\x20available\x20attributes','createdAt','includes','updatedAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','Applications','Intervals','interval','account','applications','orderBy','priority','asc','list','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','ChatQueue','queue','Start','EventManager','offline','Sequelize','no\x20available\x20attributes','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','subjectOffline','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','internal','Tag','Tags','tag','getSnippet','getProactiveActions','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','origin','http://localhost:9000','testWebsiteWithWildcard','x-real-ip','connection','virtual','replace','verticalAlignment','color','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash'];(function(_0x26d0eb,_0x2017ec){var _0x29d250=function(_0x5f46f9){while(--_0x5f46f9){_0x26d0eb['push'](_0x26d0eb['shift']());}};_0x29d250(++_0x2017ec);}(_0x0faf,0x132));var _0xf0fa=function(_0x2c7780,_0x100f4a){_0x2c7780=_0x2c7780-0x0;var _0x580bc8=_0x0faf[_0x2c7780];return _0x580bc8;};'use strict';var Mustache=require(_0xf0fa('0x0'));var util=require('util');var path=require(_0xf0fa('0x1'));var ejs=require(_0xf0fa('0x2'));var fs=require('fs');var fs_extra=require(_0xf0fa('0x3'));var _=require(_0xf0fa('0x4'));var querystring=require(_0xf0fa('0x5'));var htmlToText=require(_0xf0fa('0x6'));var Redis=require(_0xf0fa('0x7'));var jayson=require(_0xf0fa('0x8'));var qs=require(_0xf0fa('0x9'));var logger=require('../../config/logger')(_0xf0fa('0xa'));var config=require(_0xf0fa('0xb'));var APIBadRequestError=require(_0xf0fa('0xc'))[_0xf0fa('0xd')];var APINotFoundError=require(_0xf0fa('0xc'))['APINotFoundError'];var APIOutOfIntervalError=require(_0xf0fa('0xc'))[_0xf0fa('0xe')];var APIHandleError=require('../../errors/api')['handleError'];var APIConflictError=require(_0xf0fa('0xc'))[_0xf0fa('0xf')];var wildcardUtils=require(_0xf0fa('0x10'));var URL=require(_0xf0fa('0x11'))[_0xf0fa('0x12')];var db=require(_0xf0fa('0x13'))['db'];config[_0xf0fa('0x14')]=_[_0xf0fa('0x15')](config['redis'],{'host':_0xf0fa('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf0fa('0x14')]));require('./chatWebsite.socket')[_0xf0fa('0x17')](socket);var client=jayson[_0xf0fa('0x18')][_0xf0fa('0x19')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xf0fa('0x18')]['http']({'port':0x232b});var client9001=jayson[_0xf0fa('0x18')][_0xf0fa('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x10ce43,_0x3203ce,_0x467d5f,_0x33df80){return new Promise(function(_0x28bab8,_0x3f3bb7){var _0x497542=_0x33df80||client;return _0x497542[_0xf0fa('0x1a')](_0x10ce43,_0x467d5f)[_0xf0fa('0x1b')](function(_0x30ce17){logger[_0xf0fa('0x1c')](_0xf0fa('0x1d'),_0x3203ce,_0xf0fa('0x1e'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3203ce,_0xf0fa('0x1e'),JSON[_0xf0fa('0x1f')](_0x30ce17));if(_0x30ce17[_0xf0fa('0x20')]){if(_0x30ce17[_0xf0fa('0x20')][_0xf0fa('0x21')]===0x1f4){logger[_0xf0fa('0x20')](_0xf0fa('0x1d'),_0x3203ce,_0x30ce17[_0xf0fa('0x20')][_0xf0fa('0x22')]);return _0x3f3bb7(_0x30ce17[_0xf0fa('0x20')][_0xf0fa('0x22')]);}logger['error'](_0xf0fa('0x1d'),_0x3203ce,_0x30ce17[_0xf0fa('0x20')][_0xf0fa('0x22')]);return _0x28bab8(_0x30ce17[_0xf0fa('0x20')][_0xf0fa('0x22')]);}else{logger[_0xf0fa('0x1c')](_0xf0fa('0x1d'),_0x3203ce,_0xf0fa('0x1e'));_0x28bab8(_0x30ce17[_0xf0fa('0x23')]['message']);}})[_0xf0fa('0x24')](function(_0x19e392){logger['error'](_0xf0fa('0x1d'),_0x3203ce,_0x19e392);_0x3f3bb7(_0x19e392);});});}function respondWithStatusCode(_0x3703b5,_0x2efe88){_0x2efe88=_0x2efe88||0xcc;return function(_0x59e007){if(_0x59e007){return _0x3703b5[_0xf0fa('0x25')](_0x2efe88);}return _0x3703b5[_0xf0fa('0x26')](_0x2efe88)[_0xf0fa('0x27')]();};}function respondWithResult(_0xf631f6,_0x4e6eef){_0x4e6eef=_0x4e6eef||0xc8;return function(_0x4be235){if(_0x4be235){return _0xf631f6[_0xf0fa('0x26')](_0x4e6eef)[_0xf0fa('0x28')](_0x4be235);}};}function respondWithFilteredResult(_0x1679cf,_0x11085f){return function(_0x57b8e9){if(_0x57b8e9){var _0x4058d6=typeof _0x11085f[_0xf0fa('0x29')]===_0xf0fa('0x2a')&&typeof _0x11085f['limit']===_0xf0fa('0x2a');var _0x593697=_0x57b8e9[_0xf0fa('0x2b')];var _0x1e3875=_0x4058d6?0x0:_0x11085f[_0xf0fa('0x29')];var _0x519661=_0x4058d6?_0x57b8e9[_0xf0fa('0x2b')]:_0x11085f[_0xf0fa('0x29')]+_0x11085f[_0xf0fa('0x2c')];var _0x212986;if(_0x519661>=_0x593697){_0x519661=_0x593697;_0x212986=0xc8;}else{_0x212986=0xce;}_0x1679cf[_0xf0fa('0x26')](_0x212986);return _0x1679cf[_0xf0fa('0x2d')]('Content-Range',_0x1e3875+'-'+_0x519661+'/'+_0x593697)['json'](_0x57b8e9);}return null;};}function saveUpdates(_0x36173a){return function(_0x255f9d){if(_0x255f9d){return _0x255f9d['update'](_0x36173a)[_0xf0fa('0x1b')](function(_0x50e0bd){return _0x50e0bd;});}return null;};}function removeEntity(_0x5ca1b2){return function(_0x47dcbb){if(_0x47dcbb){return _0x47dcbb[_0xf0fa('0x2e')]()['then'](function(){var _0x2c0721=_0x47dcbb[_0xf0fa('0x2f')]({'plain':!![]});var _0x5e1d57=_0xf0fa('0x30');return db[_0xf0fa('0x31')][_0xf0fa('0x2e')]({'where':{'type':_0x5e1d57,'resourceId':_0x2c0721['id']}})[_0xf0fa('0x1b')](function(){return _0x47dcbb;});})[_0xf0fa('0x1b')](function(){_0x5ca1b2['status'](0xcc)[_0xf0fa('0x27')]();});}};}function handleEntityNotFound(_0x307aa8){return function(_0x36dd2b){if(!_0x36dd2b){_0x307aa8['sendStatus'](0x194);}return _0x36dd2b;};}function handleError(_0x2a6749,_0x114feb){_0x114feb=_0x114feb||0x1f4;return function(_0x19b137){logger[_0xf0fa('0x20')](_0x19b137['stack']);if(_0x19b137['name']){delete _0x19b137[_0xf0fa('0x32')];}_0x2a6749[_0xf0fa('0x26')](_0x114feb)[_0xf0fa('0x33')](_0x19b137);};}function createInteractionObject(_0x47486f,_0x3a238d,_0x5cd669,_0x571422){var _0x5a2be0=require('user-agent-parser');var _0x3cdc0e=new _0x5a2be0();var _0x778121=_0x3cdc0e['setUA'](_0x5cd669['user-agent'])[_0xf0fa('0x34')]();var _0x1b8fb8=_0x3a238d[_0xf0fa('0x35')];if(_0x5cd669[_0xf0fa('0x36')]){_0x1b8fb8=_0x5cd669[_0xf0fa('0x36')];}else if(_0x5cd669[_0xf0fa('0x37')]){_0x1b8fb8=_[_0xf0fa('0x38')](_0x5cd669['x-forwarded-for']['split'](','));}return{'ContactId':_0x571422['id'],'ChatWebsiteId':_0x47486f,'from':(_0x571422[_0xf0fa('0x39')]||'')+'\x20'+(_0x571422[_0xf0fa('0x3a')]||''),'customerIp':_0x1b8fb8,'customerPort':_0x5cd669[_0xf0fa('0x3b')]?_0x5cd669[_0xf0fa('0x3b')]:null,'referer':_0x3a238d[_0xf0fa('0x3c')],'browserName':_0x778121[_0xf0fa('0x3d')]['name']&&_0x778121[_0xf0fa('0x3d')]['version']?util[_0xf0fa('0x3e')](_0xf0fa('0x3f'),_0x778121[_0xf0fa('0x3d')][_0xf0fa('0x32')],_0x778121[_0xf0fa('0x3d')][_0xf0fa('0x40')]):_0xf0fa('0x41'),'browserVersion':_0x778121[_0xf0fa('0x3d')][_0xf0fa('0x40')]||'unknown','osName':util['format']('%s\x20%s',_0x778121['os'][_0xf0fa('0x32')],_0x778121['os'][_0xf0fa('0x40')]),'osVersion':_0x778121['os']['version'],'deviceModel':_0x778121[_0xf0fa('0x42')][_0xf0fa('0x43')]&&_0x778121[_0xf0fa('0x42')][_0xf0fa('0x44')]?util['format'](_0xf0fa('0x45'),_0x778121[_0xf0fa('0x42')][_0xf0fa('0x43')],_0x778121[_0xf0fa('0x42')][_0xf0fa('0x44')],_0x778121[_0xf0fa('0x42')][_0xf0fa('0x46')]):null,'deviceVendor':_0x778121[_0xf0fa('0x42')][_0xf0fa('0x44')],'deviceType':_0x778121['device'][_0xf0fa('0x46')],'formData':JSON[_0xf0fa('0x1f')](_0x3a238d)};}exports[_0xf0fa('0x47')]=function(_0x24ae12,_0x856c2e){var _0x2f8c74={'include':[{'model':db[_0xf0fa('0x48')],'as':'mandatoryDispositionPause'}]},_0x53b2a6={},_0xd86643={'count':0x0,'rows':[]};var _0x1e13f6=_[_0xf0fa('0x49')](db[_0xf0fa('0x4a')][_0xf0fa('0x4b')],function(_0x37aad0){return{'name':_0x37aad0[_0xf0fa('0x4c')],'type':_0x37aad0[_0xf0fa('0x46')][_0xf0fa('0x4d')]};});_0x53b2a6[_0xf0fa('0x43')]=_['map'](_0x1e13f6,_0xf0fa('0x32'));_0x53b2a6['query']=_[_0xf0fa('0x4e')](_0x24ae12[_0xf0fa('0x4f')]);_0x53b2a6[_0xf0fa('0x50')]=_['intersection'](_0x53b2a6[_0xf0fa('0x43')],_0x53b2a6[_0xf0fa('0x4f')]);_0x2f8c74[_0xf0fa('0x51')]=_[_0xf0fa('0x52')](_0x53b2a6[_0xf0fa('0x43')],qs['fields'](_0x24ae12[_0xf0fa('0x4f')]['fields']));_0x2f8c74[_0xf0fa('0x51')]=_0x2f8c74[_0xf0fa('0x51')][_0xf0fa('0x53')]?_0x2f8c74[_0xf0fa('0x51')]:_0x53b2a6[_0xf0fa('0x43')];if(!_0x24ae12['query'][_0xf0fa('0x54')](_0xf0fa('0x55'))){_0x2f8c74[_0xf0fa('0x2c')]=qs[_0xf0fa('0x2c')](_0x24ae12[_0xf0fa('0x4f')][_0xf0fa('0x2c')]);_0x2f8c74['offset']=qs[_0xf0fa('0x29')](_0x24ae12['query']['offset']);}_0x2f8c74['order']=qs[_0xf0fa('0x56')](_0x24ae12[_0xf0fa('0x4f')][_0xf0fa('0x56')]);_0x2f8c74[_0xf0fa('0x57')]=qs[_0xf0fa('0x50')](_[_0xf0fa('0x58')](_0x24ae12[_0xf0fa('0x4f')],_0x53b2a6[_0xf0fa('0x50')]),_0x1e13f6);if(_0x24ae12[_0xf0fa('0x4f')]['filter']){_0x2f8c74[_0xf0fa('0x57')]=_['merge'](_0x2f8c74[_0xf0fa('0x57')],{'$or':_[_0xf0fa('0x49')](_0x1e13f6,function(_0x1f95dc){if(_0x1f95dc[_0xf0fa('0x46')]!=='VIRTUAL'){var _0x36e343={};_0x36e343[_0x1f95dc['name']]={'$like':'%'+_0x24ae12[_0xf0fa('0x4f')][_0xf0fa('0x59')]+'%'};return _0x36e343;}})});}_0x2f8c74=_[_0xf0fa('0x5a')]({},_0x2f8c74,_0x24ae12[_0xf0fa('0x5b')]);var _0xa55804={'where':_0x2f8c74[_0xf0fa('0x57')]};return db['ChatWebsite'][_0xf0fa('0x2b')](_0xa55804)[_0xf0fa('0x1b')](function(_0x4a20f4){_0xd86643[_0xf0fa('0x2b')]=_0x4a20f4;if(_0x24ae12[_0xf0fa('0x4f')]['includeAll']){_0x2f8c74[_0xf0fa('0x5c')]=[{'all':!![]}];}return db[_0xf0fa('0x4a')]['findAll'](_0x2f8c74);})[_0xf0fa('0x1b')](function(_0x3c5014){_0xd86643[_0xf0fa('0x5d')]=_0x3c5014;return _0xd86643;})['then'](respondWithFilteredResult(_0x856c2e,_0x2f8c74))[_0xf0fa('0x24')](handleError(_0x856c2e,null));};exports[_0xf0fa('0x5e')]=function(_0x480dc0,_0x22ed85){var _0x34147c={'raw':![],'where':{'id':_0x480dc0['params']['id']},'include':[{'model':db[_0xf0fa('0x48')],'as':_0xf0fa('0x5f')}]},_0x3369e1={};_0x3369e1['model']=_[_0xf0fa('0x4e')](db[_0xf0fa('0x4a')][_0xf0fa('0x4b')]);_0x3369e1[_0xf0fa('0x4f')]=_[_0xf0fa('0x4e')](_0x480dc0[_0xf0fa('0x4f')]);_0x3369e1[_0xf0fa('0x50')]=_[_0xf0fa('0x52')](_0x3369e1[_0xf0fa('0x43')],_0x3369e1[_0xf0fa('0x4f')]);_0x34147c['attributes']=_[_0xf0fa('0x52')](_0x3369e1[_0xf0fa('0x43')],qs[_0xf0fa('0x60')](_0x480dc0[_0xf0fa('0x4f')][_0xf0fa('0x60')]));_0x34147c[_0xf0fa('0x51')]=_0x34147c[_0xf0fa('0x51')]['length']?_0x34147c[_0xf0fa('0x51')]:_0x3369e1[_0xf0fa('0x43')];if(_0x480dc0[_0xf0fa('0x4f')][_0xf0fa('0x61')]){_0x34147c[_0xf0fa('0x5c')]=[{'all':!![]}];}_0x34147c=_[_0xf0fa('0x5a')]({},_0x34147c,_0x480dc0[_0xf0fa('0x5b')]);return db['ChatWebsite'][_0xf0fa('0x62')](_0x34147c)[_0xf0fa('0x1b')](handleEntityNotFound(_0x22ed85,null))[_0xf0fa('0x1b')](respondWithResult(_0x22ed85,null))[_0xf0fa('0x24')](handleError(_0x22ed85,null));};exports[_0xf0fa('0x63')]=function(_0x5bf7f2,_0x5f023b){var _0x5a4e16=null;_0x5bf7f2[_0xf0fa('0x64')][_0xf0fa('0x65')][_0xf0fa('0x66')](',')[_0xf0fa('0x67')](_0x508df9=>{if(_0x508df9['trim']()!==''&&!wildcardUtils[_0xf0fa('0x68')](_0x508df9['trim']())){_0x5a4e16=new APIBadRequestError('\x22'+_0x508df9[_0xf0fa('0x69')]()+_0xf0fa('0x6a'));}});if(_0x5a4e16){return handleError(_0x5f023b,null)(_0x5a4e16);}return db[_0xf0fa('0x4a')][_0xf0fa('0x63')](_0x5bf7f2[_0xf0fa('0x64')],{})['then'](function(_0x130e56){var _0xdc09c7=_0x5bf7f2[_0xf0fa('0x6b')][_0xf0fa('0x2f')]({'plain':!![]});if(!_0xdc09c7)throw new Error(_0xf0fa('0x6c'));if(_0xdc09c7[_0xf0fa('0x6d')]===_0xf0fa('0x6b')){var _0x35e7e7=_0x130e56[_0xf0fa('0x2f')]({'plain':!![]});var _0x4c2fdd='ChatWebsites';return db[_0xf0fa('0x6e')]['find']({'where':{'name':_0x4c2fdd,'userProfileId':_0xdc09c7[_0xf0fa('0x6f')]},'raw':!![]})['then'](function(_0x4b3cb6){if(_0x4b3cb6&&_0x4b3cb6['autoAssociation']===0x0){return db[_0xf0fa('0x31')][_0xf0fa('0x63')]({'name':_0x35e7e7[_0xf0fa('0x32')],'resourceId':_0x35e7e7['id'],'type':_0x4b3cb6[_0xf0fa('0x32')],'sectionId':_0x4b3cb6['id']},{})[_0xf0fa('0x1b')](function(){return _0x130e56;});}else{return _0x130e56;}})[_0xf0fa('0x24')](function(_0x12a969){logger[_0xf0fa('0x20')](_0xf0fa('0x70'),_0x12a969);throw _0x12a969;});}return _0x130e56;})[_0xf0fa('0x1b')](respondWithResult(_0x5f023b,0xc9))['catch'](handleError(_0x5f023b,null));};exports[_0xf0fa('0x71')]=function(_0x5de588,_0x448851){var _0x56c701=null;_0x5de588[_0xf0fa('0x64')]['address'][_0xf0fa('0x66')](',')['forEach'](_0x15f4d5=>{if(_0x15f4d5[_0xf0fa('0x69')]()!==''&&!wildcardUtils[_0xf0fa('0x68')](_0x15f4d5[_0xf0fa('0x69')]())){_0x56c701=new APIBadRequestError('\x22'+_0x15f4d5[_0xf0fa('0x69')]()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x56c701){return handleError(_0x448851,null)(_0x56c701);}if(_0x5de588['body']['id']){delete _0x5de588[_0xf0fa('0x64')]['id'];}return db[_0xf0fa('0x4a')]['find']({'where':{'id':_0x5de588['params']['id']},'include':[{'model':db[_0xf0fa('0x48')],'as':_0xf0fa('0x5f')}]})[_0xf0fa('0x1b')](handleEntityNotFound(_0x448851,null))[_0xf0fa('0x1b')](saveUpdates(_0x5de588[_0xf0fa('0x64')],null))['then'](respondWithResult(_0x448851,null))[_0xf0fa('0x24')](handleError(_0x448851,null));};exports[_0xf0fa('0x2e')]=function(_0x16492b,_0x5ab304){return db['ChatWebsite'][_0xf0fa('0x62')]({'where':{'id':_0x16492b[_0xf0fa('0x72')]['id']}})['then'](handleEntityNotFound(_0x5ab304,null))['then'](removeEntity(_0x5ab304,null))[_0xf0fa('0x24')](handleError(_0x5ab304,null));};exports[_0xf0fa('0x73')]=function(_0x22cf95,_0x509891){return db['ChatWebsite']['describe']()[_0xf0fa('0x1b')](respondWithResult(_0x509891,null))['catch'](handleError(_0x509891,null));};exports['addDisposition']=function(_0xebbb68,_0xfb68fd){if(_0xebbb68[_0xf0fa('0x64')]['id']){delete _0xebbb68[_0xf0fa('0x64')]['id'];}return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0xebbb68['params']['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0xfb68fd,null))[_0xf0fa('0x1b')](function(_0x15dda8){if(_0x15dda8){_0xebbb68['body'][_0xf0fa('0x74')]=_0x15dda8['id'];return db['Disposition']['create'](_0xebbb68[_0xf0fa('0x64')]);}})['then'](respondWithResult(_0xfb68fd,null))['catch'](handleError(_0xfb68fd,null));};exports[_0xf0fa('0x75')]=function(_0x418ee8,_0x83ea6d){var _0x581f37={'raw':![],'where':{}};var _0xe1b0ff={};var _0x168099={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf0fa('0x76')]({'where':{'id':_0x418ee8[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x83ea6d,null))[_0xf0fa('0x1b')](function(_0x1461e1){if(_0x1461e1){_0xe1b0ff[_0xf0fa('0x43')]=_['keys'](db[_0xf0fa('0x77')]['rawAttributes']);_0xe1b0ff[_0xf0fa('0x4f')]=_[_0xf0fa('0x4e')](_0x418ee8[_0xf0fa('0x4f')]);_0xe1b0ff[_0xf0fa('0x50')]=_[_0xf0fa('0x52')](_0xe1b0ff[_0xf0fa('0x43')],_0xe1b0ff[_0xf0fa('0x4f')]);_0x581f37['attributes']=_['intersection'](_0xe1b0ff[_0xf0fa('0x43')],qs[_0xf0fa('0x60')](_0x418ee8['query'][_0xf0fa('0x60')]));_0x581f37['attributes']=_0x581f37['attributes'][_0xf0fa('0x53')]?_0x581f37[_0xf0fa('0x51')]:_0xe1b0ff['model'];if(!_0x418ee8['query'][_0xf0fa('0x54')](_0xf0fa('0x55'))){_0x581f37[_0xf0fa('0x2c')]=qs[_0xf0fa('0x2c')](_0x418ee8[_0xf0fa('0x4f')][_0xf0fa('0x2c')]);_0x581f37['offset']=qs[_0xf0fa('0x29')](_0x418ee8[_0xf0fa('0x4f')]['offset']);}_0x581f37[_0xf0fa('0x78')]=qs['sort'](_0x418ee8[_0xf0fa('0x4f')]['sort']);_0x581f37['where']=qs[_0xf0fa('0x50')](_['pick'](_0x418ee8['query'],_0xe1b0ff['filters']));_0x581f37['where'][_0xf0fa('0x74')]=_0x1461e1['id'];if(_0x418ee8['query'][_0xf0fa('0x59')]){_0x581f37[_0xf0fa('0x57')]=_['merge'](_0x581f37[_0xf0fa('0x57')],{'$or':_[_0xf0fa('0x49')](_0x581f37[_0xf0fa('0x51')],function(_0x2ef7ef){var _0x4e5a0e={};_0x4e5a0e[_0x2ef7ef]={'$like':'%'+_0x418ee8[_0xf0fa('0x4f')]['filter']+'%'};return _0x4e5a0e;})});}_0x581f37=_[_0xf0fa('0x5a')]({},_0x581f37,_0x418ee8['options']);return db[_0xf0fa('0x77')][_0xf0fa('0x2b')]({'where':_0x581f37[_0xf0fa('0x57')]})[_0xf0fa('0x1b')](function(_0x4c4fdd){_0x168099['count']=_0x4c4fdd;if(_0x418ee8[_0xf0fa('0x4f')]['includeAll']){_0x581f37[_0xf0fa('0x5c')]=[{'all':!![]}];}return db[_0xf0fa('0x77')][_0xf0fa('0x79')](_0x581f37);})['then'](function(_0x142f4f){_0x168099['rows']=_0x142f4f;return _0x168099;});}})[_0xf0fa('0x1b')](respondWithFilteredResult(_0x83ea6d,_0x581f37))[_0xf0fa('0x24')](handleError(_0x83ea6d,null));};exports[_0xf0fa('0x7a')]=function(_0x52cf85,_0x227fda){return db['ChatWebsite'][_0xf0fa('0x62')]({'where':{'id':_0x52cf85[_0xf0fa('0x72')]['id']}})['then'](handleEntityNotFound(_0x227fda,null))[_0xf0fa('0x1b')](function(_0x47317b){if(_0x47317b){return _0x47317b[_0xf0fa('0x7a')](_0x52cf85[_0xf0fa('0x4f')]['ids']);}})[_0xf0fa('0x1b')](respondWithStatusCode(_0x227fda,null))['catch'](handleError(_0x227fda,null));};exports['addAnswer']=function(_0x2ea054,_0x381b50){if(_0x2ea054['body']['id']){delete _0x2ea054['body']['id'];}return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0x2ea054['params']['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x381b50,null))['then'](function(_0x2815ca){if(_0x2815ca){_0x2ea054[_0xf0fa('0x64')]['ChatWebsiteId']=_0x2815ca['id'];return db['CannedAnswer'][_0xf0fa('0x63')](_0x2ea054['body']);}})[_0xf0fa('0x1b')](respondWithResult(_0x381b50,null))[_0xf0fa('0x24')](handleError(_0x381b50,null));};exports[_0xf0fa('0x7b')]=function(_0x530b41,_0x577ea1){var _0x174737={'raw':![],'where':{}};var _0x4eddc7={};var _0x24b4d7={'count':0x0,'rows':[]};return db[_0xf0fa('0x4a')]['findOne']({'where':{'id':_0x530b41[_0xf0fa('0x72')]['id']}})['then'](handleEntityNotFound(_0x577ea1,null))[_0xf0fa('0x1b')](function(_0x40ba70){if(_0x40ba70){_0x4eddc7[_0xf0fa('0x43')]=_[_0xf0fa('0x4e')](db['CannedAnswer']['rawAttributes']);_0x4eddc7[_0xf0fa('0x4f')]=_['keys'](_0x530b41[_0xf0fa('0x4f')]);_0x4eddc7['filters']=_['intersection'](_0x4eddc7[_0xf0fa('0x43')],_0x4eddc7['query']);_0x174737['attributes']=_[_0xf0fa('0x52')](_0x4eddc7['model'],qs['fields'](_0x530b41[_0xf0fa('0x4f')][_0xf0fa('0x60')]));_0x174737['attributes']=_0x174737[_0xf0fa('0x51')]['length']?_0x174737['attributes']:_0x4eddc7[_0xf0fa('0x43')];if(!_0x530b41['query']['hasOwnProperty'](_0xf0fa('0x55'))){_0x174737['limit']=qs[_0xf0fa('0x2c')](_0x530b41[_0xf0fa('0x4f')]['limit']);_0x174737[_0xf0fa('0x29')]=qs[_0xf0fa('0x29')](_0x530b41[_0xf0fa('0x4f')]['offset']);}_0x174737[_0xf0fa('0x78')]=qs[_0xf0fa('0x56')](_0x530b41['query']['sort']);_0x174737[_0xf0fa('0x57')]=qs['filters'](_['pick'](_0x530b41[_0xf0fa('0x4f')],_0x4eddc7['filters']));_0x174737['where'][_0xf0fa('0x74')]=_0x40ba70['id'];if(_0x530b41['query'][_0xf0fa('0x59')]){_0x174737[_0xf0fa('0x57')]=_[_0xf0fa('0x5a')](_0x174737[_0xf0fa('0x57')],{'$or':_[_0xf0fa('0x49')](_0x174737['attributes'],function(_0x201f77){var _0x2bd061={};_0x2bd061[_0x201f77]={'$like':'%'+_0x530b41[_0xf0fa('0x4f')][_0xf0fa('0x59')]+'%'};return _0x2bd061;})});}_0x174737=_[_0xf0fa('0x5a')]({},_0x174737,_0x530b41[_0xf0fa('0x5b')]);return db[_0xf0fa('0x7c')][_0xf0fa('0x2b')]({'where':_0x174737['where']})['then'](function(_0x397378){_0x24b4d7['count']=_0x397378;if(_0x530b41['query'][_0xf0fa('0x61')]){_0x174737[_0xf0fa('0x5c')]=[{'all':!![]}];}return db[_0xf0fa('0x7c')][_0xf0fa('0x79')](_0x174737);})[_0xf0fa('0x1b')](function(_0x188052){_0x24b4d7[_0xf0fa('0x5d')]=_0x188052;return _0x24b4d7;});}})[_0xf0fa('0x1b')](respondWithFilteredResult(_0x577ea1,_0x174737))['catch'](handleError(_0x577ea1,null));};exports['removeAnswers']=function(_0x5461cc,_0x50735f){return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0x5461cc['params']['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x50735f,null))[_0xf0fa('0x1b')](function(_0x18d4ce){if(_0x18d4ce){return _0x18d4ce['removeAnswers'](_0x5461cc['query'][_0xf0fa('0x7d')]);}})[_0xf0fa('0x1b')](respondWithStatusCode(_0x50735f,null))[_0xf0fa('0x24')](handleError(_0x50735f,null));};exports[_0xf0fa('0x7e')]=function(_0x44b3cf,_0x45b555){_0x44b3cf['body']['sitepic']=_0x44b3cf[_0xf0fa('0x7f')]['filename'];return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0x44b3cf[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x45b555,null))[_0xf0fa('0x1b')](saveUpdates(_0x44b3cf[_0xf0fa('0x64')],null))[_0xf0fa('0x1b')](respondWithResult(_0x45b555,null))[_0xf0fa('0x24')](handleError(_0x45b555,null));};exports[_0xf0fa('0x80')]=function(_0x4aa74c,_0x3d878b){_0x4aa74c['body']['agentAvatar']=_0x4aa74c[_0xf0fa('0x7f')][_0xf0fa('0x81')];return db['ChatWebsite'][_0xf0fa('0x62')]({'where':{'id':_0x4aa74c[_0xf0fa('0x72')]['id']}})['then'](handleEntityNotFound(_0x3d878b,null))[_0xf0fa('0x1b')](saveUpdates(_0x4aa74c[_0xf0fa('0x64')],null))[_0xf0fa('0x1b')](respondWithResult(_0x3d878b,null))['catch'](handleError(_0x3d878b,null));};exports[_0xf0fa('0x82')]=function(_0x2e30dd,_0x3edfe0){_0x2e30dd['body'][_0xf0fa('0x83')]=_0x2e30dd[_0xf0fa('0x7f')][_0xf0fa('0x81')];return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0x2e30dd[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x3edfe0,null))[_0xf0fa('0x1b')](saveUpdates(_0x2e30dd[_0xf0fa('0x64')],null))[_0xf0fa('0x1b')](respondWithResult(_0x3edfe0,null))[_0xf0fa('0x24')](handleError(_0x3edfe0,null));};exports[_0xf0fa('0x84')]=function(_0x17ca2b,_0x284e7d){_0x17ca2b[_0xf0fa('0x64')][_0xf0fa('0x85')]=_0x17ca2b[_0xf0fa('0x7f')][_0xf0fa('0x81')];return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0x17ca2b[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x284e7d,null))[_0xf0fa('0x1b')](saveUpdates(_0x17ca2b['body'],null))['then'](respondWithResult(_0x284e7d,null))[_0xf0fa('0x24')](handleError(_0x284e7d,null));};exports[_0xf0fa('0x86')]=function(_0x2a8217,_0x15291c){var _0x125713=path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],_0xf0fa('0x89'));var _0x202759={'where':{'id':_0x2a8217[_0xf0fa('0x72')]['id']},'attributes':['id',_0xf0fa('0x8a')],'raw':!![]};var _0x2cd096=![];return require('../../config/license/util')[_0xf0fa('0x8b')]()['then'](function(_0x35fd94){if(_0x35fd94){_0x2cd096=_0x35fd94[_0xf0fa('0x8c')];}})['then'](function(){return db[_0xf0fa('0x4a')][_0xf0fa('0x62')](_0x202759);})[_0xf0fa('0x1b')](handleEntityNotFound(_0x15291c,null))[_0xf0fa('0x1b')](function(_0x16fdd7){if(_0x16fdd7){if(!_[_0xf0fa('0x8d')](_0x16fdd7[_0xf0fa('0x8a')])){if(fs['existsSync'](path['join'](config[_0xf0fa('0x88')],_0xf0fa('0x8e'),_0x16fdd7[_0xf0fa('0x8a')]))&&_0x2cd096){_0x125713=path['join'](config[_0xf0fa('0x88')],_0xf0fa('0x8e'),_0x16fdd7[_0xf0fa('0x8a')]);}}return _0x15291c[_0xf0fa('0x8f')](_0x125713);}})[_0xf0fa('0x24')](handleError(_0x15291c,null));};exports[_0xf0fa('0x90')]=function(_0x6b6050,_0x36c5e3){var _0x18fe3d=path[_0xf0fa('0x87')](config['root'],_0xf0fa('0x91'));var _0x522569={'where':{'id':_0x6b6050[_0xf0fa('0x72')]['id']},'attributes':['id',_0xf0fa('0x92')],'raw':!![]};return db[_0xf0fa('0x4a')][_0xf0fa('0x62')](_0x522569)[_0xf0fa('0x1b')](handleEntityNotFound(_0x36c5e3,null))[_0xf0fa('0x1b')](function(_0x32a10f){if(_0x32a10f){if(!_[_0xf0fa('0x8d')](_0x32a10f['agentAvatar'])){if(fs['existsSync'](path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],_0xf0fa('0x93'),_0x32a10f[_0xf0fa('0x92')]))){_0x18fe3d=path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],_0xf0fa('0x93'),_0x32a10f['agentAvatar']);}}return _0x36c5e3[_0xf0fa('0x8f')](_0x18fe3d);}})[_0xf0fa('0x24')](handleError(_0x36c5e3,null));};exports[_0xf0fa('0x94')]=function(_0x477425,_0x3f068f){var _0xc8e407=path[_0xf0fa('0x87')](config['root'],_0xf0fa('0x95'));var _0x3fc094={'where':{'id':_0x477425[_0xf0fa('0x72')]['id']},'attributes':['id',_0xf0fa('0x83'),_0xf0fa('0x96')],'raw':!![]};return db['ChatWebsite'][_0xf0fa('0x62')](_0x3fc094)['then'](handleEntityNotFound(_0x3f068f,null))[_0xf0fa('0x1b')](function(_0x350b8a){if(_0x350b8a){if(!_[_0xf0fa('0x8d')](_0x350b8a['customerAvatar'])){if(fs['existsSync'](path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],_0xf0fa('0x93'),_0x350b8a[_0xf0fa('0x83')]))&&_0x350b8a['showCustomerAvatar']){_0xc8e407=path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],_0xf0fa('0x93'),_0x350b8a[_0xf0fa('0x83')]);}}return _0x3f068f[_0xf0fa('0x8f')](_0xc8e407);}})[_0xf0fa('0x24')](handleError(_0x3f068f,null));};exports['getSystemAvatar']=function(_0x42c62c,_0x4f21e9){var _0x5252ba=path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],'server/files/images/avatars/system_avatar.png');var _0x31f378={'where':{'id':_0x42c62c['params']['id']},'attributes':['id',_0xf0fa('0x85')],'raw':!![]};return db['ChatWebsite']['find'](_0x31f378)[_0xf0fa('0x1b')](handleEntityNotFound(_0x4f21e9,null))[_0xf0fa('0x1b')](function(_0x2ab565){if(_0x2ab565){if(!_[_0xf0fa('0x8d')](_0x2ab565[_0xf0fa('0x85')])){if(fs[_0xf0fa('0x97')](path['join'](config[_0xf0fa('0x88')],_0xf0fa('0x93'),_0x2ab565[_0xf0fa('0x85')]))){_0x5252ba=path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],_0xf0fa('0x93'),_0x2ab565[_0xf0fa('0x85')]);}}return _0x4f21e9[_0xf0fa('0x8f')](_0x5252ba);}})['catch'](handleError(_0x4f21e9,null));};function checkWebsiteInterval(_0x32d4bf){var _0x2a895e=_0x32d4bf[_0xf0fa('0x98')];if(!_0x2a895e){return Promise[_0xf0fa('0x99')](_0x32d4bf);}var _0x117071=_0x32d4bf[_0xf0fa('0x9a')]||undefined;return _0x2a895e[_0xf0fa('0x9b')](_0x117071)[_0xf0fa('0x1b')](function(_0x114487){if(!_0x114487){throw new APIOutOfIntervalError();}return _0x32d4bf;});}exports[_0xf0fa('0x9c')]=function(_0x27c397,_0x49448a){var _0x29b1e9={'body':_0x27c397[_0xf0fa('0x64')],'channel':_0xf0fa('0x9d')};var _0x24c93c=[];var _0xb688a1=[];var _0x274f0d={};var _0x3daa6e=![];if(_0x27c397[_0xf0fa('0x64')]['id']){delete _0x27c397['body']['id'];}if(_[_0xf0fa('0x8d')](_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x9e')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xf0fa('0x8d')](_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x9f')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xf0fa('0xa0')](_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x64')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x212b4a=_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x35')]&&_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x3c')];return db[_0xf0fa('0xa1')][_0xf0fa('0x73')]()['then'](function(_0x5421b7){if(!_0x5421b7){throw new Error(_0xf0fa('0xa2'));}_0x24c93c=Object['keys'](_0x5421b7)[_0xf0fa('0x59')](function(_0x4be965){return![_0xf0fa('0xa3'),'updatedAt'][_0xf0fa('0xa4')](_0x4be965);});_0xb688a1=Object[_0xf0fa('0x4e')](_0x5421b7)[_0xf0fa('0x59')](function(_0x51417a){return!['createdAt',_0xf0fa('0xa5'),_0xf0fa('0xa6'),_0xf0fa('0xa7')]['includes'](_0x51417a);});if(!_['includes'](_0xb688a1,_0x27c397['body']['mapKey'])){throw new APIBadRequestError(_0xf0fa('0xa8')+_0xb688a1['join'](',\x20'));}_0x274f0d[_0x27c397['body'][_0xf0fa('0x9f')]]=_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x9e')];})[_0xf0fa('0x1b')](function(){return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0x27c397['params']['id']},'include':[{'model':db[_0xf0fa('0xa9')],'as':_0xf0fa('0xaa'),'include':[{'model':db[_0xf0fa('0xa1')],'as':_0xf0fa('0xab'),'where':_0x274f0d,'limit':0x1,'order':[[_0xf0fa('0xa5'),_0xf0fa('0xac')]]}]},{'model':db['ChatApplication'],'as':_0xf0fa('0xad')},{'model':db['Interval'],'as':_0xf0fa('0x98'),'include':[{'model':db[_0xf0fa('0x98')],'as':_0xf0fa('0xae'),'attributes':['id',_0xf0fa('0xaf')],'raw':!![]}]}]});})[_0xf0fa('0x1b')](function(_0x1eec60){if(!_0x1eec60){throw new APINotFoundError(util[_0xf0fa('0x3e')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x27c397[_0xf0fa('0x72')]['id']));}if(_0x212b4a){return checkWebsiteInterval(_0x1eec60);}return _0x1eec60;})[_0xf0fa('0x1b')](function(_0x4765f8){_0x29b1e9[_0xf0fa('0xb0')]=_0x4765f8;_0x29b1e9[_0xf0fa('0xb1')]=_[_0xf0fa('0xb2')](_0x4765f8['Applications'],[_0xf0fa('0xb3')],[_0xf0fa('0xb4')]);if(_0x29b1e9[_0xf0fa('0xb0')][_0xf0fa('0xad')]){delete _0x29b1e9[_0xf0fa('0xb0')][_0xf0fa('0xad')];}_0x29b1e9[_0xf0fa('0xb5')]=_0x4765f8[_0xf0fa('0xaa')]||{'id':_0x4765f8[_0xf0fa('0xa7')]};if(_0x29b1e9[_0xf0fa('0xb5')]&&_0x29b1e9[_0xf0fa('0xb5')][_0xf0fa('0xab')][_0xf0fa('0x53')]){return _0x29b1e9[_0xf0fa('0xb5')][_0xf0fa('0xab')][0x0];}var _0x322116=_['defaults'](_0x27c397[_0xf0fa('0x64')],{'firstName':_0x27c397['body'][_0xf0fa('0x9e')],'ListId':_0x4765f8[_0xf0fa('0xa7')]});_0x322116[_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x9f')]]=_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x9e')];return db[_0xf0fa('0xa1')][_0xf0fa('0x63')](_0x322116,{'fields':_0x24c93c,'raw':!![]});})[_0xf0fa('0x1b')](function(_0x4fb7e8){_0x29b1e9[_0xf0fa('0xb6')]=_0x4fb7e8;var _0x3ba4e3=createInteractionObject(_0x27c397[_0xf0fa('0x72')]['id'],_0x27c397[_0xf0fa('0x64')],_0x27c397[_0xf0fa('0xb7')],_0x4fb7e8);var _0x30ece0={'ChatWebsiteId':_0x27c397['params']['id']};if(_0x27c397[_0xf0fa('0x64')][_0xf0fa('0xb8')]){_0x30ece0[_0xf0fa('0xb8')]=_0x27c397[_0xf0fa('0x64')]['threadId'];_0x30ece0[_0xf0fa('0xb9')]=![];return db[_0xf0fa('0xba')][_0xf0fa('0x62')]({'where':_0x30ece0})['then'](function(_0x3b751e){var _0x20a66f=_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x35')]&&_0x27c397[_0xf0fa('0x64')]['referer'];if(_0x3b751e){_0x3daa6e=!![];return _0x3b751e;}else if(!_0x20a66f&&_0x3b751e&&_0x3b751e[_0xf0fa('0xb9')]){throw new APIConflictError(_0xf0fa('0xbb'));}_0x3ba4e3[_0xf0fa('0xb8')]=_0x27c397[_0xf0fa('0x64')][_0xf0fa('0xb8')];_0x3ba4e3['externalUrl']=_0x27c397[_0xf0fa('0x64')][_0xf0fa('0xbc')];return db[_0xf0fa('0xba')][_0xf0fa('0x63')](_0x3ba4e3);});}_0x30ece0[_0xf0fa('0xbd')]=_0x4fb7e8['id'];if(_0x27c397[_0xf0fa('0x64')]['interaction']&&_0x27c397[_0xf0fa('0x64')]['interaction']['id']){_0x30ece0['id']=_0x27c397[_0xf0fa('0x64')][_0xf0fa('0xbe')]['id'];return db[_0xf0fa('0xba')][_0xf0fa('0x62')]({'where':_0x30ece0})[_0xf0fa('0x1b')](function(_0x3a9e84){var _0xf57911=_0x27c397['body'][_0xf0fa('0x35')]&&_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x3c')];if(!_0xf57911&&_0x3a9e84&&_0x3a9e84['closed']){throw new APIConflictError(_0xf0fa('0xbb'));}else if(_0x3a9e84){_0x3daa6e=!![];return _0x3a9e84;}else{return db['ChatInteraction']['create'](_0x3ba4e3);}});}return db['ChatInteraction'][_0xf0fa('0x63')](_0x3ba4e3);})['then'](function(_0x3a6594){if(!_0x3daa6e){return _0x3a6594;}var _0x26524d={'from':(_0x29b1e9['contact']['firstName']||'')+'\x20'+(_0x29b1e9[_0xf0fa('0xb6')][_0xf0fa('0x3a')]||'')};if(_0x27c397['body'][_0xf0fa('0xb8')]&&_0x27c397['body']['messageId']&&_0x27c397[_0xf0fa('0x64')][_0xf0fa('0xb8')]!=_0x27c397[_0xf0fa('0x64')][_0xf0fa('0xbf')]){_0x26524d['threadId']=_0x27c397['body'][_0xf0fa('0xbf')];}return _0x3a6594[_0xf0fa('0x71')](_0x26524d);})[_0xf0fa('0x1b')](function(_0x22b9b6){_0x29b1e9[_0xf0fa('0xbe')]=_0x22b9b6['get']({'plain':!![]});_0x29b1e9[_0xf0fa('0xbe')][_0xf0fa('0xc0')]=!_0x3daa6e;if(_0x29b1e9[_0xf0fa('0xbe')][_0xf0fa('0xc0')]){if(_0x29b1e9[_0xf0fa('0xb0')][_0xf0fa('0xc1')]){_0x29b1e9[_0xf0fa('0xb1')][_0xf0fa('0xc2')]({'id':0x0,'priority':_0x29b1e9['applications'][_0xf0fa('0x53')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xf0fa('0xc3')});}}return db[_0xf0fa('0xc4')][_0xf0fa('0x63')]({'body':_0x27c397[_0xf0fa('0x64')][_0xf0fa('0x64')],'ChatWebsiteId':_0x27c397[_0xf0fa('0x72')]['id'],'ChatInteractionId':_0x22b9b6['id'],'direction':'in','ContactId':_0x29b1e9['contact']['id'],'AttachmentId':_0x27c397[_0xf0fa('0x64')][_0xf0fa('0xc5')]});})[_0xf0fa('0x1b')](function(_0x1514a4){_0x29b1e9[_0xf0fa('0x22')]=_0x1514a4;if(!_0x29b1e9['interaction'][_0xf0fa('0xc6')]){return;}return db['User'][_0xf0fa('0x62')]({'attributes':['id','name'],'where':{'id':_0x29b1e9[_0xf0fa('0xbe')][_0xf0fa('0xc6')]}});})['then'](function(_0x25d33c){if(_0x25d33c){_0x29b1e9[_0xf0fa('0xb1')][_0xf0fa('0xc7')]({'id':0x0,'priority':0x0,'app':_0xf0fa('0xc8'),'appdata':_0x25d33c[_0xf0fa('0x32')]+','+(_0x29b1e9['account'][_0xf0fa('0xc9')]||0xa),'interval':_0xf0fa('0xc3')});_0x29b1e9['forcedOwnership']=!![];}if(!_0x29b1e9[_0xf0fa('0xbe')][_0xf0fa('0xca')]){return;}return db[_0xf0fa('0xcb')]['find']({'attributes':['id',_0xf0fa('0x32')],'where':{'id':_0x29b1e9[_0xf0fa('0xbe')]['queueId']}});})[_0xf0fa('0x1b')](function(_0x5453b6){if(_0x5453b6){_0x29b1e9[_0xf0fa('0xb1')][_0xf0fa('0xc7')]({'id':0x0,'priority':0x1,'app':_0xf0fa('0xcc'),'appdata':_0x5453b6[_0xf0fa('0x32')]+','+(_0x29b1e9[_0xf0fa('0xb0')]['waitForTheAssignedQueue']||0x12c),'interval':_0xf0fa('0xc3')});}return respondWithRpcPromise(_0xf0fa('0xcd'),'startRouting',_0x29b1e9);})['then'](function(_0x551b54){respondWithRpcPromise(_0xf0fa('0xce'),'EventManager',{'event':_0xf0fa('0x9c'),'message':_0x551b54},client9002);return _0x551b54;})['then'](respondWithResult(_0x49448a,null))['catch'](APIHandleError(_0x49448a));};exports[_0xf0fa('0xcf')]=function(_0x14f4d7,_0x46f6fd){var _0x58566d,_0x198210,_0x2ecf7d;var _0x78b0da=[];var _0x18be1d={};var _0x32e7ee=_0x14f4d7['files']||[];var _0x51ffae=[];var _0x4784e7;return db['CmContact'][_0xf0fa('0x73')]()[_0xf0fa('0x1b')](function(_0x2f0641){if(!_0x2f0641){throw new db[(_0xf0fa('0xd0'))]['ValidationError'](_0xf0fa('0xd1'));}_0x78b0da=_['difference'](_[_0xf0fa('0x4e')](_0x2f0641),['createdAt','updatedAt',_0xf0fa('0xa6'),_0xf0fa('0xa7')]);if(_0x14f4d7[_0xf0fa('0x64')]['id']){delete _0x14f4d7[_0xf0fa('0x64')]['id'];}if(_[_0xf0fa('0x8d')](_0x14f4d7['body'][_0xf0fa('0x9e')])){throw _0x46f6fd[_0xf0fa('0x26')](0x1f4)[_0xf0fa('0x33')](new db[(_0xf0fa('0xd0'))][(_0xf0fa('0xd2'))](_0xf0fa('0xd3')));}if(_['isNil'](_0x14f4d7[_0xf0fa('0x64')][_0xf0fa('0x64')])||_0x14f4d7[_0xf0fa('0x64')]['body']===''){throw _0x46f6fd['status'](0x1f4)['send'](new db[(_0xf0fa('0xd0'))][(_0xf0fa('0xd2'))](_0xf0fa('0xd4')));}if(_[_0xf0fa('0x8d')](_0x14f4d7[_0xf0fa('0x64')]['mapKeyOffline'])){throw _0x46f6fd['status'](0x1f4)[_0xf0fa('0x33')](new db[(_0xf0fa('0xd0'))]['ValidationError'](_0xf0fa('0xd5')+_0x78b0da));}if(!_[_0xf0fa('0xa4')](_0x78b0da,_0x14f4d7[_0xf0fa('0x64')][_0xf0fa('0xd6')])){throw _0x46f6fd[_0xf0fa('0x26')](0x1f4)[_0xf0fa('0x33')](new db[(_0xf0fa('0xd0'))][(_0xf0fa('0xd2'))](_0xf0fa('0xd7')+_0x78b0da));}_0x18be1d[_0x14f4d7[_0xf0fa('0x64')][_0xf0fa('0xd6')]]=_0x14f4d7['body'][_0xf0fa('0x9e')];})[_0xf0fa('0x1b')](function(){return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0x14f4d7[_0xf0fa('0x72')]['id']},'include':[{'model':db[_0xf0fa('0xa9')],'as':'List'},{'model':db[_0xf0fa('0xd8')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x46f6fd,null))['then'](function(_0x4814bd){if(_0x4814bd&&_0x4814bd[_0xf0fa('0xaa')]){_0x198210=_0x4814bd;var _0x420256=_['defaults'](_0x14f4d7[_0xf0fa('0x64')],{'firstName':_0x14f4d7[_0xf0fa('0x64')]['from'],'phone':_0x14f4d7[_0xf0fa('0x64')]['from'],'ListId':_0x4814bd[_0xf0fa('0xa7')]});_0x420256[_0x14f4d7[_0xf0fa('0x64')][_0xf0fa('0xd6')]]=_0x14f4d7[_0xf0fa('0x64')]['from'];return db['CmContact'][_0xf0fa('0xd9')]({'where':_0x18be1d,'defaults':_0x420256});}})[_0xf0fa('0xda')](function(_0x13e5e2){if(_0x13e5e2){_0x2ecf7d=_0x13e5e2;var _0x424332=fs['readFileSync'](path[_0xf0fa('0x87')](config['root'],_0xf0fa('0xdb')),_0xf0fa('0xdc'));var _0x4238f0=ejs['render'](_0x424332,{'body':_[_0xf0fa('0xdd')](_0x14f4d7[_0xf0fa('0x64')]['body']),'bodyTitle':_0x198210[_0xf0fa('0xde')]});return db['ChatOfflineMessage'][_0xf0fa('0x63')]({'body':_0x4238f0,'plainBody':htmlToText[_0xf0fa('0xdf')](_0x4238f0),'ContactId':_0x13e5e2['id'],'ChatWebsiteId':_0x198210['id']});}})[_0xf0fa('0x1b')](function(_0x5ea55e){_0x4784e7=_0x5ea55e;if(_0x32e7ee[_0xf0fa('0x53')]){var _0xcf0df8=_0x32e7ee[_0xf0fa('0x49')](function(_0x117823){return{'name':_0x117823[_0xf0fa('0xe0')],'basename':_0x117823[_0xf0fa('0x81')],'type':_0x117823[_0xf0fa('0xe1')],'ChatOfflineMessageId':_0x5ea55e['id']};});_0x51ffae=_0xcf0df8[_0xf0fa('0x49')](_0x68a2d3=>{var _0x577ad2={'filename':_0x68a2d3[_0xf0fa('0x32')],'path':path[_0xf0fa('0x87')](config['root'],_0xf0fa('0xe2'),_0xf0fa('0xe3'),_0xf0fa('0xe4'),_0xf0fa('0xe5'),_0x68a2d3[_0xf0fa('0xe6')])};return _0x577ad2;});if(!_0x198210['openNewInteraction']){return db[_0xf0fa('0xe7')]['transaction'](function(_0x47d348){return db[_0xf0fa('0xe8')][_0xf0fa('0xe9')](_0xcf0df8,{'transaction':_0x47d348});});}}})['then'](function(){if(_0x4784e7){_0x58566d=_0x4784e7;return db[_0xf0fa('0xd8')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf0fa('0xea')],'as':_0xf0fa('0xeb'),'raw':!![],'include':[{'model':db[_0xf0fa('0xec')],'as':_0xf0fa('0xec'),'raw':!![]}]}]});}})[_0xf0fa('0x1b')](function(_0x4cdac1){if(_0x4cdac1&&_0x4cdac1[_0xf0fa('0xeb')]&&_0x198210['forwardOffline']&&_0x198210[_0xf0fa('0xed')]){var _0x273837=_0x4cdac1[_0xf0fa('0xee')]();return respondWithRpcPromise('SendMail',_0xf0fa('0xef'),{'account':_0x273837,'message':{'from':util['format'](_0xf0fa('0xf0'),_0x4cdac1[_0xf0fa('0x32')],_0x4cdac1[_0xf0fa('0xf1')]||_0x4cdac1[_0xf0fa('0xeb')]['user']),'to':_0x198210[_0xf0fa('0xed')],'subject':_0x198210['offlineMessageSubject'],'html':_0x58566d[_0xf0fa('0x64')],'attachments':_0x51ffae}},client9003)[_0xf0fa('0x1b')](function(){return _0x58566d;})[_0xf0fa('0x24')](function(_0x2e7035){logger[_0xf0fa('0x20')](_0x2e7035);});}})[_0xf0fa('0x1b')](function(){if(_0x198210&&_0x198210[_0xf0fa('0xf2')]&&_0x198210[_0xf0fa('0xf3')]){var _0x1b42b7=[];if(_0x32e7ee[_0xf0fa('0x53')]){_0x1b42b7=_0x32e7ee['map'](function(_0x5e0d64){return{'name':_0x5e0d64[_0xf0fa('0xe0')],'basename':_0x5e0d64[_0xf0fa('0x81')],'type':_0x5e0d64[_0xf0fa('0xe1')],'ChatOfflineMessageId':_0x4784e7['id']};});}var _0x1b7959;if(!_['isNil'](_0x198210[_0xf0fa('0xf4')])){var _0x19526b=_[_0xf0fa('0x49')](_0x14f4d7['body'],function(_0x1ea16c){return _0x1ea16c;});var _0x16af6e=_['toPairsIn'](_0x19526b)[0x0];var _0x2383ff=_[_0xf0fa('0xf5')](_0x16af6e,function(_0xc659b3){return _0xc659b3;});_0x1b7959=_0x2383ff[0x1][_0x198210[_0xf0fa('0xf4')]];}var _0x327677={'from':_0x2ecf7d[_0xf0fa('0xf1')],'firstName':_0x2ecf7d['firstName'],'lastName':_0x2ecf7d[_0xf0fa('0x3a')],'mapKey':'email','message':{'from':_0x2ecf7d[_0xf0fa('0xf1')],'to':_0x198210[_0xf0fa('0xd8')]['email'],'cc':'','subject':_[_0xf0fa('0x8d')](_0x1b7959)?_0x198210[_0xf0fa('0xf6')]:_0x1b7959,'messageId':'','sentAt':new Date(),'attach':_0x1b42b7[_0xf0fa('0x53')],'attachments':_0x1b42b7,'originChannel':_0xf0fa('0xf7'),'ChatWebsiteId':_0x198210['id'],'ChatOfflineMessageId':_0x58566d['id'],'originTo':_0x198210[_0xf0fa('0xd8')][_0xf0fa('0xf1')]},'body':_0x58566d['body']};var _0x45a8fa={'account':{'id':_0x198210['MailAccountId']},'body':_0x327677,'log':_0xf0fa('0xf8')};return respondWithRpcPromise(_0xf0fa('0xf8'),_0xf0fa('0xf9'),_0x45a8fa,client9001)['then'](function(){return _0x58566d;})['catch'](function(_0x5243f4){logger[_0xf0fa('0x20')](_0x5243f4);});}return;})['then'](function(){if(_0x58566d){return _0x58566d;}})[_0xf0fa('0x1b')](respondWithResult(_0x46f6fd,null))['catch'](function(){for(var _0x3724af of _0x32e7ee){var _0x4bdf4d=path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],'server','files',_0xf0fa('0xe4'),_0xf0fa('0xe5'),_0x3724af['filename']);fs_extra[_0xf0fa('0xfa')](_0x4bdf4d)[_0xf0fa('0x24')](function(_0x1c51ea){logger[_0xf0fa('0x20')](_0xf0fa('0xfb'),_0x4bdf4d,_0x1c51ea);});}});};exports[_0xf0fa('0xfc')]=function(_0x400beb,_0x48f8db){return db[_0xf0fa('0xba')][_0xf0fa('0x62')]({'where':{'id':_0x400beb['params']['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x48f8db,null))[_0xf0fa('0x1b')](function(_0x25d74d){if(_0x25d74d){return _0x25d74d[_0xf0fa('0xfc')](_0x400beb[_0xf0fa('0x64')][_0xf0fa('0x7d')],_[_0xf0fa('0xfd')](_0x400beb[_0xf0fa('0x64')],[_0xf0fa('0x7d'),'id'])||{});}})['then'](respondWithResult(_0x48f8db,null))[_0xf0fa('0x24')](handleError(_0x48f8db,null));};exports['getInteractions']=function(_0x302bfd,_0x12d88f){var _0x48eaa0={'raw':![],'where':{}};var _0x3d2806={};var _0x14afdf={'count':0x0,'rows':[]};return db[_0xf0fa('0x4a')][_0xf0fa('0x76')]({'where':{'id':_0x302bfd[_0xf0fa('0x72')]['id']}})['then'](handleEntityNotFound(_0x12d88f,null))[_0xf0fa('0x1b')](function(_0x5a92e5){if(_0x5a92e5){_0x3d2806[_0xf0fa('0x43')]=_[_0xf0fa('0x4e')](db[_0xf0fa('0xba')]['rawAttributes']);_0x3d2806[_0xf0fa('0x4f')]=_[_0xf0fa('0x4e')](_0x302bfd['query']);_0x3d2806['filters']=_[_0xf0fa('0x52')](_0x3d2806['model'],_0x3d2806[_0xf0fa('0x4f')]);_0x48eaa0[_0xf0fa('0x51')]=_['intersection'](_0x3d2806[_0xf0fa('0x43')],qs[_0xf0fa('0x60')](_0x302bfd['query'][_0xf0fa('0x60')]));_0x48eaa0['attributes']=_0x48eaa0[_0xf0fa('0x51')]['length']?_0x48eaa0[_0xf0fa('0x51')]:_0x3d2806[_0xf0fa('0x43')];if(!_0x302bfd[_0xf0fa('0x4f')]['hasOwnProperty'](_0xf0fa('0x55'))){_0x48eaa0['limit']=qs['limit'](_0x302bfd[_0xf0fa('0x4f')][_0xf0fa('0x2c')]);_0x48eaa0['offset']=qs[_0xf0fa('0x29')](_0x302bfd[_0xf0fa('0x4f')][_0xf0fa('0x29')]);}_0x48eaa0[_0xf0fa('0x78')]=qs[_0xf0fa('0x56')](_0x302bfd[_0xf0fa('0x4f')][_0xf0fa('0x56')]);_0x48eaa0[_0xf0fa('0x57')]=qs[_0xf0fa('0x50')](_[_0xf0fa('0x58')](_0x302bfd[_0xf0fa('0x4f')],_0x3d2806[_0xf0fa('0x50')]));_0x48eaa0[_0xf0fa('0x57')][_0xf0fa('0x74')]=_0x5a92e5['id'];if(_0x302bfd['query']['filter']){_0x48eaa0[_0xf0fa('0x57')]=_[_0xf0fa('0x5a')](_0x48eaa0[_0xf0fa('0x57')],{'$or':_['map'](_0x48eaa0['attributes'],function(_0x144f00){var _0x2c72ad={};_0x2c72ad[_0x144f00]={'$like':'%'+_0x302bfd[_0xf0fa('0x4f')]['filter']+'%'};return _0x2c72ad;})});}_0x48eaa0=_['merge']({},_0x48eaa0,_0x302bfd[_0xf0fa('0x5b')]);return db[_0xf0fa('0xba')][_0xf0fa('0x2b')]({'where':_0x48eaa0['where']})[_0xf0fa('0x1b')](function(_0x4dd350){_0x14afdf[_0xf0fa('0x2b')]=_0x4dd350;if(_0x302bfd['query'][_0xf0fa('0x61')]){_0x48eaa0[_0xf0fa('0x5c')]=[{'model':db['CmContact'],'as':_0xf0fa('0xfe'),'required':![]},{'model':db[_0xf0fa('0xff')],'as':_0xf0fa('0x100'),'attributes':[_0xf0fa('0x32'),'fullname',_0xf0fa('0x101')],'required':![]},{'model':db[_0xf0fa('0x102')],'as':_0xf0fa('0x103'),'attributes':['id',_0xf0fa('0x32'),'color'],'where':_0x302bfd[_0xf0fa('0x4f')][_0xf0fa('0x104')]?{'id':_0x302bfd[_0xf0fa('0x4f')][_0xf0fa('0x104')]}:undefined,'required':_0x302bfd[_0xf0fa('0x4f')][_0xf0fa('0x104')]?!![]:![]}];}return db['ChatInteraction'][_0xf0fa('0x79')](_0x48eaa0);})[_0xf0fa('0x1b')](function(_0x31b02c){_0x14afdf[_0xf0fa('0x5d')]=_0x31b02c;return _0x14afdf;});}})[_0xf0fa('0x1b')](respondWithFilteredResult(_0x12d88f,_0x48eaa0))[_0xf0fa('0x24')](handleError(_0x12d88f,null));};exports[_0xf0fa('0x105')]=function(_0x3a771a,_0xb2cec){var _0x2f48e5=0x0;var _0x24a65e=0x0;var _0x4a86b0=![];var _0x10f1e6;var _0x4af21c;return db['ChatWebsite'][_0xf0fa('0x62')]({'where':{'id':_0x3a771a['params']['id']},'include':[{'model':db[_0xf0fa('0x98')],'as':_0xf0fa('0x98'),'include':[{'model':db[_0xf0fa('0x98')],'as':_0xf0fa('0xae'),'attributes':['id',_0xf0fa('0xaf')]}]}]})['then'](handleEntityNotFound(_0xb2cec,null))['then'](function(_0x10182b){if(_0x10182b){_0x10f1e6=_0x10182b;return _0x10182b[_0xf0fa('0x106')]({'raw':!![]});}})['then'](function(_0x29b02a){if(_0x10f1e6){if(_0x29b02a){_0x4af21c=_0x29b02a;}}return require('../../config/license/util')['getLicense']();})[_0xf0fa('0x1b')](function(_0x37e3c9){if(_0x37e3c9){_0x24a65e=_0x37e3c9['virtual'];_0x4a86b0=_0x37e3c9[_0xf0fa('0x8c')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xf0fa('0x1b')](function(_0x454635){_0x2f48e5=_0x454635;if(_0x24a65e&&_0x454635>_0x24a65e){return db[_0xf0fa('0x107')]['findOne']({'where':{'id':0x1}})[_0xf0fa('0x1b')](function(_0x516b94){if(_0x516b94){_0x516b94[_0xf0fa('0x108')](_0xf0fa('0x109'));}});}})[_0xf0fa('0x1b')](function(){var _0x439d09=_0x10f1e6[_0xf0fa('0x98')];var _0x5bc810=_0x10f1e6[_0xf0fa('0x9a')]||undefined;return _0x439d09?_0x439d09[_0xf0fa('0x9b')](_0x5bc810):!![];})[_0xf0fa('0x1b')](function(_0x482924){var _0x1ee758=fs[_0xf0fa('0x10a')](path[_0xf0fa('0x87')](config[_0xf0fa('0x88')],_0xf0fa('0x10b')),_0xf0fa('0xdc'));var _0x3ec6e8='3.13.0';var _0x105c08=![];var _0x347180,_0x3c814b;if(_0x3a771a[_0xf0fa('0xb7')][_0xf0fa('0x3c')]){_0x347180=new URL(_0x3a771a[_0xf0fa('0xb7')][_0xf0fa('0x3c')])[_0xf0fa('0x10c')];}else if(_0x3a771a[_0xf0fa('0xb7')][_0xf0fa('0x10c')]){_0x347180=new URL(_0x3a771a['headers'][_0xf0fa('0x10c')])[_0xf0fa('0x10c')];}else{_0x347180=_0xf0fa('0x10d');}_0x3c814b=typeof _0x10f1e6[_0xf0fa('0x65')][_0xf0fa('0x66')](',')[_0xf0fa('0x62')](function(_0x960a4c){return wildcardUtils[_0xf0fa('0x10e')](_0x960a4c,_0x347180);})!=='undefined';var _0x5db875={'chatVersion':_0x3ec6e8,'chatWebsiteAddressOrigin':_0x3c814b?_0x347180:_0x10f1e6[_0xf0fa('0x65')],'remote':_0x10f1e6['remote'],'query':querystring[_0xf0fa('0x1f')](_[_0xf0fa('0x5a')](_0x10f1e6[_0xf0fa('0x2f')]({'plain':!![]}),{'customerIp':_0x3a771a['headers']['x-forwarded-for']||_0x3a771a[_0xf0fa('0xb7')][_0xf0fa('0x10f')]||_0x3a771a[_0xf0fa('0x110')]['remoteAddress']||_0x3a771a['ip'],'referer':_0x3a771a['headers'][_0xf0fa('0x3c')],'openedInteractions':_0x2f48e5,'maxInteractions':_0x24a65e,'virtual':_0x4a86b0[_0xf0fa('0x111')],'online':_0x482924,'custom':_0x4a86b0,'address':_0x3c814b?_0x347180:null}))[_0xf0fa('0x112')](/'/g,'\x5c\x27')};_0xb2cec[_0xf0fa('0x33')](ejs['render'](Mustache['render'](_0x1ee758,_0x5db875),{'proactiveActions':_0x4af21c,'alignment':_0x10f1e6['alignment'],'verticalAlignment':_0x10f1e6[_0xf0fa('0x113')],'div_color':_0x10f1e6[_0xf0fa('0x114')],'labelText':_0x10f1e6[_0xf0fa('0x115')],'text_color':_0x10f1e6[_0xf0fa('0x116')],'text_button_color':_0x10f1e6[_0xf0fa('0x117')],'button_color':_0x10f1e6[_0xf0fa('0x118')],'background_color':_0x10f1e6['backgroundColor'],'hideWhenOffline':_0x10f1e6[_0xf0fa('0x119')],'intervalId':_0x10f1e6[_0xf0fa('0x11a')],'isDevelopment':_0x105c08,'chatVersion':_0x3ec6e8}));})[_0xf0fa('0x24')](handleError(_0xb2cec,null));};exports[_0xf0fa('0x11b')]=function(_0x34d2f2,_0x3527eb){var _0x5672a5=_0x34d2f2['params']['id'];var _0x52e00b=_0x34d2f2[_0xf0fa('0x64')];var _0x90a29e=0xc8;var _0x257eec=null;return db['sequelize'][_0xf0fa('0x11c')]({'isolationLevel':db[_0xf0fa('0xe7')][_0xf0fa('0x11d')][_0xf0fa('0x11e')][_0xf0fa('0x11f')]},function(_0x4fb8ea){return db[_0xf0fa('0x4a')]['findOne']({'where':{'id':_0x5672a5},'transaction':_0x4fb8ea})[_0xf0fa('0x1b')](function(_0x2706f0){if(_0x2706f0){return db[_0xf0fa('0x120')][_0xf0fa('0x2e')]({'where':{'ChatWebsiteId':_0x5672a5},'transaction':_0x4fb8ea})[_0xf0fa('0x1b')](function(){var _0x46e8e3=_[_0xf0fa('0x49')](_0x52e00b,function(_0x35bce9){_0x35bce9[_0xf0fa('0x74')]=_0x5672a5;return _0x35bce9;});return db[_0xf0fa('0x120')][_0xf0fa('0xe9')](_0x46e8e3,{'transaction':_0x4fb8ea});});}else{_0x90a29e=0x194;_0x257eec=[];}});})['then'](function(){if(_0x90a29e!==0x194){return db[_0xf0fa('0x120')][_0xf0fa('0x121')]({'where':{'ChatWebsiteId':_0x5672a5},'order':_0xf0fa('0xb3')})[_0xf0fa('0x1b')](function(_0x46262c){_0x257eec=_0x46262c;});}})[_0xf0fa('0x24')](function(_0x1e90de){_0x90a29e=0x1f4;logger['error'](_0x1e90de[_0xf0fa('0x122')]);if(_0x1e90de[_0xf0fa('0x32')]){delete _0x1e90de[_0xf0fa('0x32')];}_0x257eec=_0x1e90de;})[_0xf0fa('0x123')](function(){if(_0x257eec===null){_0x3527eb[_0xf0fa('0x25')](_0x90a29e);}else{if(_0x90a29e===0x1f4){_0x3527eb[_0xf0fa('0x26')](_0x90a29e)[_0xf0fa('0x33')](_0x257eec);}else{_0x3527eb[_0xf0fa('0x26')](_0x90a29e)[_0xf0fa('0x28')](_0x257eec);}}});};exports[_0xf0fa('0x124')]=function(_0x4f94d1,_0x9fb94){var _0x23b783={};var _0x48bb9d={};var _0x597ee4;var _0x479d27;return db[_0xf0fa('0x4a')][_0xf0fa('0x76')]({'where':{'id':_0x4f94d1[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x9fb94,null))['then'](function(_0x3f1558){if(_0x3f1558){_0x597ee4=_0x3f1558;_0x48bb9d[_0xf0fa('0x43')]=_[_0xf0fa('0x4e')](db[_0xf0fa('0x120')]['rawAttributes']);_0x48bb9d[_0xf0fa('0x4f')]=_['keys'](_0x4f94d1[_0xf0fa('0x4f')]);_0x48bb9d['filters']=_[_0xf0fa('0x52')](_0x48bb9d[_0xf0fa('0x43')],_0x48bb9d['query']);_0x23b783['attributes']=_['intersection'](_0x48bb9d[_0xf0fa('0x43')],qs['fields'](_0x4f94d1['query'][_0xf0fa('0x60')]));_0x23b783[_0xf0fa('0x51')]=_0x23b783[_0xf0fa('0x51')]['length']?_0x23b783['attributes']:_0x48bb9d[_0xf0fa('0x43')];_0x23b783[_0xf0fa('0x78')]=qs[_0xf0fa('0x56')](_0x4f94d1[_0xf0fa('0x4f')][_0xf0fa('0x56')]);_0x23b783[_0xf0fa('0x57')]=qs['filters'](_[_0xf0fa('0x58')](_0x4f94d1[_0xf0fa('0x4f')],_0x48bb9d[_0xf0fa('0x50')]));if(_0x4f94d1['query']['filter']){_0x23b783[_0xf0fa('0x57')]=_['merge'](_0x23b783[_0xf0fa('0x57')],{'$or':_['map'](_0x23b783['attributes'],function(_0x401c07){var _0x333812={};_0x333812[_0x401c07]={'$like':'%'+_0x4f94d1['query']['filter']+'%'};return _0x333812;})});}_0x23b783=_[_0xf0fa('0x5a')]({},_0x23b783,_0x4f94d1[_0xf0fa('0x5b')]);return _0x597ee4['getApplications'](_0x23b783);}})[_0xf0fa('0x1b')](function(_0x77eb11){if(_0x77eb11){_0x479d27=_0x77eb11[_0xf0fa('0x53')];if(!_0x4f94d1[_0xf0fa('0x4f')][_0xf0fa('0x54')](_0xf0fa('0x55'))){_0x23b783[_0xf0fa('0x2c')]=qs[_0xf0fa('0x2c')](_0x4f94d1['query'][_0xf0fa('0x2c')]);_0x23b783['offset']=qs[_0xf0fa('0x29')](_0x4f94d1[_0xf0fa('0x4f')]['offset']);}return _0x597ee4[_0xf0fa('0x124')](_0x23b783);}})[_0xf0fa('0x1b')](function(_0x400482){if(_0x400482){return _0x400482?{'count':_0x479d27,'rows':_0x400482}:null;}})[_0xf0fa('0x1b')](respondWithResult(_0x9fb94,null))[_0xf0fa('0x24')](handleError(_0x9fb94,null));};exports[_0xf0fa('0x125')]=function(_0x2f1287,_0x289f8e){return db['chatProactiveAction'][_0xf0fa('0x62')]({'where':{'id':_0x2f1287[_0xf0fa('0x72')]['id']}})['then'](handleEntityNotFound(_0x289f8e,null))[_0xf0fa('0x1b')](function(_0x3eaddd){if(_0x3eaddd){return _0x3eaddd['addProactiveActions'](_0x2f1287[_0xf0fa('0x64')][_0xf0fa('0x7d')],_['omit'](_0x2f1287[_0xf0fa('0x64')],[_0xf0fa('0x7d'),'id'])||{});}})[_0xf0fa('0x1b')](respondWithResult(_0x289f8e,null))[_0xf0fa('0x24')](handleError(_0x289f8e,null));};exports[_0xf0fa('0x106')]=function(_0x309c2e,_0x338f3f){var _0x4270f8={};var _0x50afc4={};var _0x7c3c08;var _0xac6798;return db[_0xf0fa('0x4a')][_0xf0fa('0x76')]({'where':{'id':_0x309c2e[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x338f3f,null))[_0xf0fa('0x1b')](function(_0x1935f1){if(_0x1935f1){_0x7c3c08=_0x1935f1;_0x50afc4['model']=_['keys'](db[_0xf0fa('0x126')]['rawAttributes']);_0x50afc4['query']=_[_0xf0fa('0x4e')](_0x309c2e[_0xf0fa('0x4f')]);_0x50afc4['filters']=_[_0xf0fa('0x52')](_0x50afc4[_0xf0fa('0x43')],_0x50afc4['query']);_0x4270f8[_0xf0fa('0x51')]=_[_0xf0fa('0x52')](_0x50afc4[_0xf0fa('0x43')],qs[_0xf0fa('0x60')](_0x309c2e[_0xf0fa('0x4f')]['fields']));_0x4270f8[_0xf0fa('0x51')]=_0x4270f8[_0xf0fa('0x51')][_0xf0fa('0x53')]?_0x4270f8[_0xf0fa('0x51')]:_0x50afc4[_0xf0fa('0x43')];_0x4270f8[_0xf0fa('0x78')]=qs[_0xf0fa('0x56')](_0x309c2e[_0xf0fa('0x4f')][_0xf0fa('0x56')]);_0x4270f8['where']=qs['filters'](_[_0xf0fa('0x58')](_0x309c2e[_0xf0fa('0x4f')],_0x50afc4[_0xf0fa('0x50')]));if(_0x309c2e[_0xf0fa('0x4f')][_0xf0fa('0x59')]){_0x4270f8[_0xf0fa('0x57')]=_['merge'](_0x4270f8['where'],{'$or':_['map'](_0x4270f8[_0xf0fa('0x51')],function(_0x4d3309){var _0x4cd024={};_0x4cd024[_0x4d3309]={'$like':'%'+_0x309c2e[_0xf0fa('0x4f')]['filter']+'%'};return _0x4cd024;})});}_0x4270f8=_['merge']({},_0x4270f8,_0x309c2e[_0xf0fa('0x5b')]);return _0x7c3c08[_0xf0fa('0x106')](_0x4270f8);}})[_0xf0fa('0x1b')](function(_0x4b385b){if(_0x4b385b){_0xac6798=_0x4b385b[_0xf0fa('0x53')];if(!_0x309c2e['query'][_0xf0fa('0x54')](_0xf0fa('0x55'))){_0x4270f8['limit']=qs['limit'](_0x309c2e[_0xf0fa('0x4f')][_0xf0fa('0x2c')]);_0x4270f8[_0xf0fa('0x29')]=qs[_0xf0fa('0x29')](_0x309c2e[_0xf0fa('0x4f')][_0xf0fa('0x29')]);}return _0x7c3c08[_0xf0fa('0x106')](_0x4270f8);}})[_0xf0fa('0x1b')](function(_0x500e27){if(_0x500e27){return _0x500e27?{'count':_0xac6798,'rows':_0x500e27}:null;}})['then'](respondWithResult(_0x338f3f,null))[_0xf0fa('0x24')](handleError(_0x338f3f,null));};exports[_0xf0fa('0x127')]=function(_0x593571,_0x4dbd0b){var _0x170c1e=_0x593571[_0xf0fa('0x4f')][_0xf0fa('0x128')]===_0xf0fa('0x129')?_0xf0fa('0x12a'):_0xf0fa('0x12b');return db[_0xf0fa('0x4a')]['find']({'attributes':['id',_0x170c1e],'where':{'id':_0x593571[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x4dbd0b,null))[_0xf0fa('0x1b')](function(_0x1eb934){if(_0x1eb934){var _0x19a5a6=_0x1eb934[_0x170c1e];var _0xc70a96=_0x19a5a6&&_0x19a5a6['items']?_0x19a5a6['items']:[];_0x4dbd0b['send']({'fromKey':_[_0xf0fa('0x8d')](_0x19a5a6[_0xf0fa('0x12c')])?undefined:_0x19a5a6[_0xf0fa('0x12c')],'count':_0xc70a96[_0xf0fa('0x53')],'rows':_0xc70a96});}})[_0xf0fa('0x24')](handleError(_0x4dbd0b,null));};exports[_0xf0fa('0x12d')]=function(_0x76f5e1,_0x2e15e1){var _0xf491a2={'raw':![],'where':{}};var _0x4c62fd={};var _0x551134={'count':0x0,'rows':[]};return db[_0xf0fa('0x4a')][_0xf0fa('0x76')]({'where':{'id':_0x76f5e1[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x2e15e1,null))[_0xf0fa('0x1b')](function(_0x122141){if(_0x122141){_0x4c62fd[_0xf0fa('0x43')]=_[_0xf0fa('0x4e')](db[_0xf0fa('0x12e')][_0xf0fa('0x4b')]);_0x4c62fd['query']=_[_0xf0fa('0x4e')](_0x76f5e1[_0xf0fa('0x4f')]);_0x4c62fd[_0xf0fa('0x50')]=_[_0xf0fa('0x52')](_0x4c62fd[_0xf0fa('0x43')],_0x4c62fd['query']);_0xf491a2[_0xf0fa('0x51')]=_[_0xf0fa('0x52')](_0x4c62fd[_0xf0fa('0x43')],qs['fields'](_0x76f5e1[_0xf0fa('0x4f')][_0xf0fa('0x60')]));_0xf491a2[_0xf0fa('0x51')]=_0xf491a2['attributes']['length']?_0xf491a2[_0xf0fa('0x51')]:_0x4c62fd[_0xf0fa('0x43')];if(!_0x76f5e1[_0xf0fa('0x4f')]['hasOwnProperty'](_0xf0fa('0x55'))){_0xf491a2['limit']=qs[_0xf0fa('0x2c')](_0x76f5e1['query'][_0xf0fa('0x2c')]);_0xf491a2[_0xf0fa('0x29')]=qs[_0xf0fa('0x29')](_0x76f5e1[_0xf0fa('0x4f')]['offset']);}_0xf491a2[_0xf0fa('0x78')]=qs['sort'](_0x76f5e1[_0xf0fa('0x4f')][_0xf0fa('0x56')]);_0xf491a2[_0xf0fa('0x57')]=qs['filters'](_[_0xf0fa('0x58')](_0x76f5e1[_0xf0fa('0x4f')],_0x4c62fd['filters']));_0xf491a2[_0xf0fa('0x57')][_0xf0fa('0x74')]=_0x122141['id'];if(_0x76f5e1[_0xf0fa('0x4f')][_0xf0fa('0x59')]){_0xf491a2[_0xf0fa('0x57')]=_[_0xf0fa('0x5a')](_0xf491a2[_0xf0fa('0x57')],{'$or':_['map'](_0xf491a2['attributes'],function(_0x1308e0){var _0xd84d9f={};_0xd84d9f[_0x1308e0]={'$like':'%'+_0x76f5e1['query'][_0xf0fa('0x59')]+'%'};return _0xd84d9f;})});}_0xf491a2=_[_0xf0fa('0x5a')]({},_0xf491a2,_0x76f5e1[_0xf0fa('0x5b')]);return db[_0xf0fa('0x12e')]['count']({'where':_0xf491a2[_0xf0fa('0x57')]})['then'](function(_0x34b8bf){_0x551134['count']=_0x34b8bf;if(_0x76f5e1[_0xf0fa('0x4f')][_0xf0fa('0x61')]){_0xf491a2[_0xf0fa('0x5c')]=[{'all':!![]}];}else{_0xf491a2['include']=[{'model':db[_0xf0fa('0xa1')],'as':'Contact','required':![]},{'model':db[_0xf0fa('0xe8')],'as':_0xf0fa('0x12f'),'required':![]}];}return db[_0xf0fa('0x12e')][_0xf0fa('0x79')](_0xf491a2);})[_0xf0fa('0x1b')](function(_0x1791fa){_0x551134[_0xf0fa('0x5d')]=_0x1791fa;return _0x551134;});}})[_0xf0fa('0x1b')](respondWithFilteredResult(_0x2e15e1,_0xf491a2))['catch'](handleError(_0x2e15e1,null));};exports[_0xf0fa('0x130')]=function(_0x3e3672,_0x2ba0b7){return db[_0xf0fa('0x4a')][_0xf0fa('0x62')]({'where':{'id':_0x3e3672['params']['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x2ba0b7,null))[_0xf0fa('0x1b')](function(_0x44e7f6){if(_0x44e7f6){return _0x44e7f6[_0xf0fa('0x130')](_0x3e3672['body']['ids'],_[_0xf0fa('0xfd')](_0x3e3672[_0xf0fa('0x64')],[_0xf0fa('0x7d'),'id'])||{})['spread'](function(_0x1c11d8){for(var _0x57878a=0x0;_0x57878a<_0x3e3672['body'][_0xf0fa('0x7d')][_0xf0fa('0x53')];_0x57878a+=0x1){socket[_0xf0fa('0x131')](_0xf0fa('0x132'),{'UserId':Number(_0x3e3672[_0xf0fa('0x64')][_0xf0fa('0x7d')][_0x57878a]),'ChatWebsiteId':Number(_0x3e3672[_0xf0fa('0x72')]['id'])});}return _0x1c11d8;});}})[_0xf0fa('0x1b')](respondWithResult(_0x2ba0b7,null))[_0xf0fa('0x24')](handleError(_0x2ba0b7,null));};exports[_0xf0fa('0x133')]=function(_0x3d47dd,_0x2cdf61){return db['ChatWebsite'][_0xf0fa('0x62')]({'where':{'id':_0x3d47dd[_0xf0fa('0x72')]['id']}})[_0xf0fa('0x1b')](handleEntityNotFound(_0x2cdf61,null))['then'](function(_0x160498){if(_0x160498){return _0x160498[_0xf0fa('0x133')](_0x3d47dd[_0xf0fa('0x4f')]['ids'])['then'](function(){if(_[_0xf0fa('0x134')](_0x3d47dd['query']['ids'])){for(var _0x14b1a8=0x0;_0x14b1a8<_0x3d47dd[_0xf0fa('0x4f')][_0xf0fa('0x7d')]['length'];_0x14b1a8+=0x1){socket[_0xf0fa('0x131')]('userChatWebsite:remove',{'UserId':Number(_0x3d47dd[_0xf0fa('0x4f')][_0xf0fa('0x7d')][_0x14b1a8]),'ChatWebsiteId':Number(_0x3d47dd[_0xf0fa('0x72')]['id'])});}}else{socket['emit'](_0xf0fa('0x135'),{'UserId':Number(_0x3d47dd[_0xf0fa('0x4f')]['ids']),'ChatWebsiteId':Number(_0x3d47dd[_0xf0fa('0x72')]['id'])});}});}})[_0xf0fa('0x1b')](respondWithStatusCode(_0x2cdf61,null))[_0xf0fa('0x24')](handleError(_0x2cdf61,null));};exports[_0xf0fa('0x136')]=function(_0x3bccb1,_0x5ba9b0){var _0x6ae366={};var _0x4e7525={};var _0x37c4f0;var _0x274673;return db[_0xf0fa('0x4a')][_0xf0fa('0x76')]({'where':{'id':_0x3bccb1[_0xf0fa('0x72')]['id']}})['then'](handleEntityNotFound(_0x5ba9b0,null))['then'](function(_0x466e06){if(_0x466e06){_0x37c4f0=_0x466e06;_0x4e7525['model']=_['keys'](db[_0xf0fa('0xff')][_0xf0fa('0x4b')]);_0x4e7525['query']=_['keys'](_0x3bccb1[_0xf0fa('0x4f')]);_0x4e7525[_0xf0fa('0x50')]=_['intersection'](_0x4e7525[_0xf0fa('0x43')],_0x4e7525['query']);_0x6ae366[_0xf0fa('0x51')]=_['intersection'](_0x4e7525['model'],qs[_0xf0fa('0x60')](_0x3bccb1[_0xf0fa('0x4f')][_0xf0fa('0x60')]));_0x6ae366[_0xf0fa('0x51')]=_0x6ae366[_0xf0fa('0x51')][_0xf0fa('0x53')]?_0x6ae366[_0xf0fa('0x51')]:_0x4e7525[_0xf0fa('0x43')];_0x6ae366['order']=qs[_0xf0fa('0x56')](_0x3bccb1['query'][_0xf0fa('0x56')]);_0x6ae366[_0xf0fa('0x57')]=qs[_0xf0fa('0x50')](_['pick'](_0x3bccb1['query'],_0x4e7525[_0xf0fa('0x50')]));if(_0x3bccb1[_0xf0fa('0x4f')]['filter']){_0x6ae366[_0xf0fa('0x57')]=_[_0xf0fa('0x5a')](_0x6ae366['where'],{'$or':_[_0xf0fa('0x49')](_0x6ae366[_0xf0fa('0x51')],function(_0x1ea500){var _0x1a0665={};_0x1a0665[_0x1ea500]={'$like':'%'+_0x3bccb1[_0xf0fa('0x4f')][_0xf0fa('0x59')]+'%'};return _0x1a0665;})});}_0x6ae366=_[_0xf0fa('0x5a')]({},_0x6ae366,_0x3bccb1['options']);return _0x37c4f0[_0xf0fa('0x136')](_0x6ae366);}})['then'](function(_0x4cae54){if(_0x4cae54){_0x274673=_0x4cae54[_0xf0fa('0x53')];if(!_0x3bccb1[_0xf0fa('0x4f')]['hasOwnProperty'](_0xf0fa('0x55'))){_0x6ae366['limit']=qs[_0xf0fa('0x2c')](_0x3bccb1[_0xf0fa('0x4f')][_0xf0fa('0x2c')]);_0x6ae366[_0xf0fa('0x29')]=qs[_0xf0fa('0x29')](_0x3bccb1[_0xf0fa('0x4f')][_0xf0fa('0x29')]);}return _0x37c4f0[_0xf0fa('0x136')](_0x6ae366);}})['then'](function(_0x112af9){if(_0x112af9){return _0x112af9?{'count':_0x274673,'rows':_0x112af9}:null;}})['then'](respondWithResult(_0x5ba9b0,null))['catch'](handleError(_0x5ba9b0,null));};
\ No newline at end of file
+var _0x5ad3=['chat','from','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','No\x20available\x20attributes','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','DESC','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','orderBy','Applications','priority','asc','account','list','Contacts','defaults','contact','headers','threadId','ChatInteraction','referer','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','firstName','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','queue','Start','startRouting','EventManager','notify','offline','files','CmContact','Sequelize','ValidationError','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','getLicense','virtual','License','increment','chatLicenseExceeded','readFileSync','3.13.0','origin','testWebsiteWithWildcard','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','APIConflictError','./helpers/wildcard-expressions','URL','../../mysqldb','redis','localhost','./chatWebsite.socket','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','set','destroy','get','ChatWebsites','UserProfileResource','stack','send','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','name','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','stringify','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','ChatWebsite','count','includeAll','findAll','catch','params','include','create','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','findOne','Disposition','hasOwnProperty','rows','removeDispositions','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','timezone','ifTime'];(function(_0x319d30,_0x169ec5){var _0x2d2197=function(_0x5aa0f6){while(--_0x5aa0f6){_0x319d30['push'](_0x319d30['shift']());}};_0x2d2197(++_0x169ec5);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x33f34e,_0x4fde5b){_0x33f34e=_0x33f34e-0x0;var _0x58dc01=_0x5ad3[_0x33f34e];return _0x58dc01;};'use strict';var Mustache=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var path=require(_0x35ad('0x2'));var ejs=require(_0x35ad('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35ad('0x4'));var querystring=require(_0x35ad('0x5'));var htmlToText=require(_0x35ad('0x6'));var Redis=require(_0x35ad('0x7'));var jayson=require(_0x35ad('0x8'));var qs=require(_0x35ad('0x9'));var logger=require(_0x35ad('0xa'))(_0x35ad('0xb'));var config=require(_0x35ad('0xc'));var APIBadRequestError=require(_0x35ad('0xd'))['APIBadRequestError'];var APINotFoundError=require(_0x35ad('0xd'))[_0x35ad('0xe')];var APIOutOfIntervalError=require(_0x35ad('0xd'))['APIOutOfIntervalError'];var APIHandleError=require(_0x35ad('0xd'))['handleError'];var APIConflictError=require('../../errors/api')[_0x35ad('0xf')];var wildcardUtils=require(_0x35ad('0x10'));var URL=require('url')[_0x35ad('0x11')];var db=require(_0x35ad('0x12'))['db'];config['redis']=_['defaults'](config[_0x35ad('0x13')],{'host':_0x35ad('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35ad('0x13')]));require(_0x35ad('0x15'))['register'](socket);var client=jayson['client'][_0x35ad('0x16')]({'port':0x232c});var client9002=jayson[_0x35ad('0x17')][_0x35ad('0x16')]({'port':0x232a});var client9003=jayson['client'][_0x35ad('0x16')]({'port':0x232b});var client9001=jayson[_0x35ad('0x17')]['http']({'port':0x2329});function respondWithRpcPromise(_0x1494be,_0x4d5185,_0x4e3cd8,_0x3a981a){return new Promise(function(_0x3ff2f0,_0x27efeb){var _0x56cb8e=_0x3a981a||client;return _0x56cb8e[_0x35ad('0x18')](_0x1494be,_0x4e3cd8)[_0x35ad('0x19')](function(_0x233394){logger[_0x35ad('0x1a')](_0x35ad('0x1b'),_0x4d5185,_0x35ad('0x1c'));logger['debug'](_0x35ad('0x1d'),_0x4d5185,_0x35ad('0x1c'),JSON['stringify'](_0x233394));if(_0x233394['error']){if(_0x233394[_0x35ad('0x1e')][_0x35ad('0x1f')]===0x1f4){logger['error'](_0x35ad('0x1b'),_0x4d5185,_0x233394[_0x35ad('0x1e')]['message']);return _0x27efeb(_0x233394[_0x35ad('0x1e')][_0x35ad('0x20')]);}logger[_0x35ad('0x1e')](_0x35ad('0x1b'),_0x4d5185,_0x233394[_0x35ad('0x1e')][_0x35ad('0x20')]);return _0x3ff2f0(_0x233394[_0x35ad('0x1e')][_0x35ad('0x20')]);}else{logger[_0x35ad('0x1a')](_0x35ad('0x1b'),_0x4d5185,'request\x20sent');_0x3ff2f0(_0x233394[_0x35ad('0x21')][_0x35ad('0x20')]);}})['catch'](function(_0x43059e){logger[_0x35ad('0x1e')](_0x35ad('0x1b'),_0x4d5185,_0x43059e);_0x27efeb(_0x43059e);});});}function respondWithStatusCode(_0xfc80ac,_0x368468){_0x368468=_0x368468||0xcc;return function(_0x561cae){if(_0x561cae){return _0xfc80ac[_0x35ad('0x22')](_0x368468);}return _0xfc80ac[_0x35ad('0x23')](_0x368468)[_0x35ad('0x24')]();};}function respondWithResult(_0x1ca61d,_0x2ddb59){_0x2ddb59=_0x2ddb59||0xc8;return function(_0x20a682){if(_0x20a682){return _0x1ca61d[_0x35ad('0x23')](_0x2ddb59)[_0x35ad('0x25')](_0x20a682);}};}function respondWithFilteredResult(_0x5418c2,_0x2e7ddd){return function(_0x11da54){if(_0x11da54){var _0x2f8b3=typeof _0x2e7ddd[_0x35ad('0x26')]===_0x35ad('0x27')&&typeof _0x2e7ddd['limit']==='undefined';var _0x131d65=_0x11da54['count'];var _0x235e5e=_0x2f8b3?0x0:_0x2e7ddd['offset'];var _0x53603f=_0x2f8b3?_0x11da54['count']:_0x2e7ddd['offset']+_0x2e7ddd[_0x35ad('0x28')];var _0x5a60e1;if(_0x53603f>=_0x131d65){_0x53603f=_0x131d65;_0x5a60e1=0xc8;}else{_0x5a60e1=0xce;}_0x5418c2['status'](_0x5a60e1);return _0x5418c2[_0x35ad('0x29')]('Content-Range',_0x235e5e+'-'+_0x53603f+'/'+_0x131d65)[_0x35ad('0x25')](_0x11da54);}return null;};}function saveUpdates(_0x51cf37){return function(_0x4005ad){if(_0x4005ad){return _0x4005ad['update'](_0x51cf37)[_0x35ad('0x19')](function(_0x4a75ee){return _0x4a75ee;});}return null;};}function removeEntity(_0x13f8f4){return function(_0x2766dd){if(_0x2766dd){return _0x2766dd[_0x35ad('0x2a')]()['then'](function(){var _0x2852e2=_0x2766dd[_0x35ad('0x2b')]({'plain':!![]});var _0x129710=_0x35ad('0x2c');return db[_0x35ad('0x2d')]['destroy']({'where':{'type':_0x129710,'resourceId':_0x2852e2['id']}})['then'](function(){return _0x2766dd;});})[_0x35ad('0x19')](function(){_0x13f8f4[_0x35ad('0x23')](0xcc)[_0x35ad('0x24')]();});}};}function handleEntityNotFound(_0x1c8a3d){return function(_0x55e676){if(!_0x55e676){_0x1c8a3d[_0x35ad('0x22')](0x194);}return _0x55e676;};}function handleError(_0x15b057,_0x30a247){_0x30a247=_0x30a247||0x1f4;return function(_0x1eb043){logger[_0x35ad('0x1e')](_0x1eb043[_0x35ad('0x2e')]);if(_0x1eb043['name']){delete _0x1eb043['name'];}_0x15b057[_0x35ad('0x23')](_0x30a247)[_0x35ad('0x2f')](_0x1eb043);};}function createInteractionObject(_0x1d24bb,_0x448abf,_0x3c9f2e,_0x240722){var _0x11e7e2=require(_0x35ad('0x30'));var _0x4625dd=new _0x11e7e2();var _0x549231=_0x4625dd[_0x35ad('0x31')](_0x3c9f2e['user-agent'])[_0x35ad('0x32')]();var _0x18e3a5=_0x448abf[_0x35ad('0x33')];if(_0x3c9f2e[_0x35ad('0x34')]){_0x18e3a5=_0x3c9f2e[_0x35ad('0x34')];}else if(_0x3c9f2e[_0x35ad('0x35')]){_0x18e3a5=_[_0x35ad('0x36')](_0x3c9f2e[_0x35ad('0x35')][_0x35ad('0x37')](','));}return{'ContactId':_0x240722['id'],'ChatWebsiteId':_0x1d24bb,'from':(_0x240722['firstName']||'')+'\x20'+(_0x240722[_0x35ad('0x38')]||''),'customerIp':_0x18e3a5,'customerPort':_0x3c9f2e[_0x35ad('0x39')]?_0x3c9f2e[_0x35ad('0x39')]:null,'referer':_0x448abf['referer'],'browserName':_0x549231[_0x35ad('0x3a')][_0x35ad('0x3b')]&&_0x549231[_0x35ad('0x3a')][_0x35ad('0x3c')]?util[_0x35ad('0x3d')](_0x35ad('0x3e'),_0x549231[_0x35ad('0x3a')][_0x35ad('0x3b')],_0x549231[_0x35ad('0x3a')][_0x35ad('0x3c')]):_0x35ad('0x3f'),'browserVersion':_0x549231['browser'][_0x35ad('0x3c')]||'unknown','osName':util[_0x35ad('0x3d')](_0x35ad('0x3e'),_0x549231['os'][_0x35ad('0x3b')],_0x549231['os'][_0x35ad('0x3c')]),'osVersion':_0x549231['os'][_0x35ad('0x3c')],'deviceModel':_0x549231[_0x35ad('0x40')][_0x35ad('0x41')]&&_0x549231[_0x35ad('0x40')][_0x35ad('0x42')]?util['format'](_0x35ad('0x43'),_0x549231[_0x35ad('0x40')][_0x35ad('0x41')],_0x549231[_0x35ad('0x40')][_0x35ad('0x42')],_0x549231['device'][_0x35ad('0x44')]):null,'deviceVendor':_0x549231[_0x35ad('0x40')]['vendor'],'deviceType':_0x549231['device'][_0x35ad('0x44')],'formData':JSON[_0x35ad('0x45')](_0x448abf)};}exports[_0x35ad('0x46')]=function(_0x3e4093,_0x57a5f5){var _0x19c5f1={'include':[{'model':db[_0x35ad('0x47')],'as':_0x35ad('0x48')}]},_0x1e3794={},_0x3c148a={'count':0x0,'rows':[]};var _0x2cbbdc=_[_0x35ad('0x49')](db['ChatWebsite'][_0x35ad('0x4a')],function(_0x39f7b1){return{'name':_0x39f7b1[_0x35ad('0x4b')],'type':_0x39f7b1['type']['key']};});_0x1e3794['model']=_[_0x35ad('0x49')](_0x2cbbdc,_0x35ad('0x3b'));_0x1e3794[_0x35ad('0x4c')]=_[_0x35ad('0x4d')](_0x3e4093['query']);_0x1e3794[_0x35ad('0x4e')]=_[_0x35ad('0x4f')](_0x1e3794[_0x35ad('0x41')],_0x1e3794[_0x35ad('0x4c')]);_0x19c5f1[_0x35ad('0x50')]=_[_0x35ad('0x4f')](_0x1e3794['model'],qs['fields'](_0x3e4093[_0x35ad('0x4c')][_0x35ad('0x51')]));_0x19c5f1['attributes']=_0x19c5f1['attributes'][_0x35ad('0x52')]?_0x19c5f1[_0x35ad('0x50')]:_0x1e3794[_0x35ad('0x41')];if(!_0x3e4093['query']['hasOwnProperty'](_0x35ad('0x53'))){_0x19c5f1[_0x35ad('0x28')]=qs[_0x35ad('0x28')](_0x3e4093['query'][_0x35ad('0x28')]);_0x19c5f1[_0x35ad('0x26')]=qs[_0x35ad('0x26')](_0x3e4093[_0x35ad('0x4c')][_0x35ad('0x26')]);}_0x19c5f1[_0x35ad('0x54')]=qs['sort'](_0x3e4093[_0x35ad('0x4c')][_0x35ad('0x55')]);_0x19c5f1[_0x35ad('0x56')]=qs['filters'](_[_0x35ad('0x57')](_0x3e4093[_0x35ad('0x4c')],_0x1e3794[_0x35ad('0x4e')]),_0x2cbbdc);if(_0x3e4093[_0x35ad('0x4c')]['filter']){_0x19c5f1['where']=_[_0x35ad('0x58')](_0x19c5f1[_0x35ad('0x56')],{'$or':_[_0x35ad('0x49')](_0x2cbbdc,function(_0xddf762){if(_0xddf762[_0x35ad('0x44')]!=='VIRTUAL'){var _0x25d816={};_0x25d816[_0xddf762[_0x35ad('0x3b')]]={'$like':'%'+_0x3e4093[_0x35ad('0x4c')][_0x35ad('0x59')]+'%'};return _0x25d816;}})});}_0x19c5f1=_[_0x35ad('0x58')]({},_0x19c5f1,_0x3e4093[_0x35ad('0x5a')]);var _0x58da31={'where':_0x19c5f1['where']};return db[_0x35ad('0x5b')][_0x35ad('0x5c')](_0x58da31)[_0x35ad('0x19')](function(_0x30ebff){_0x3c148a[_0x35ad('0x5c')]=_0x30ebff;if(_0x3e4093[_0x35ad('0x4c')][_0x35ad('0x5d')]){_0x19c5f1['include']=[{'all':!![]}];}return db[_0x35ad('0x5b')][_0x35ad('0x5e')](_0x19c5f1);})[_0x35ad('0x19')](function(_0x2ee8f1){_0x3c148a['rows']=_0x2ee8f1;return _0x3c148a;})[_0x35ad('0x19')](respondWithFilteredResult(_0x57a5f5,_0x19c5f1))[_0x35ad('0x5f')](handleError(_0x57a5f5,null));};exports['show']=function(_0x1d66c6,_0x1aed75){var _0x1da9ca={'raw':![],'where':{'id':_0x1d66c6[_0x35ad('0x60')]['id']},'include':[{'model':db[_0x35ad('0x47')],'as':_0x35ad('0x48')}]},_0x3f9607={};_0x3f9607[_0x35ad('0x41')]=_['keys'](db[_0x35ad('0x5b')][_0x35ad('0x4a')]);_0x3f9607[_0x35ad('0x4c')]=_['keys'](_0x1d66c6[_0x35ad('0x4c')]);_0x3f9607['filters']=_[_0x35ad('0x4f')](_0x3f9607[_0x35ad('0x41')],_0x3f9607[_0x35ad('0x4c')]);_0x1da9ca[_0x35ad('0x50')]=_['intersection'](_0x3f9607[_0x35ad('0x41')],qs[_0x35ad('0x51')](_0x1d66c6[_0x35ad('0x4c')][_0x35ad('0x51')]));_0x1da9ca[_0x35ad('0x50')]=_0x1da9ca['attributes'][_0x35ad('0x52')]?_0x1da9ca['attributes']:_0x3f9607[_0x35ad('0x41')];if(_0x1d66c6[_0x35ad('0x4c')]['includeAll']){_0x1da9ca[_0x35ad('0x61')]=[{'all':!![]}];}_0x1da9ca=_['merge']({},_0x1da9ca,_0x1d66c6[_0x35ad('0x5a')]);return db[_0x35ad('0x5b')]['find'](_0x1da9ca)[_0x35ad('0x19')](handleEntityNotFound(_0x1aed75,null))[_0x35ad('0x19')](respondWithResult(_0x1aed75,null))[_0x35ad('0x5f')](handleError(_0x1aed75,null));};exports[_0x35ad('0x62')]=function(_0x38d087,_0xa6d541){var _0x1ada40=null;_0x38d087['body'][_0x35ad('0x63')][_0x35ad('0x37')](',')[_0x35ad('0x64')](_0x3c7b45=>{if(_0x3c7b45[_0x35ad('0x65')]()!==''&&!wildcardUtils[_0x35ad('0x66')](_0x3c7b45[_0x35ad('0x65')]())){_0x1ada40=new APIBadRequestError('\x22'+_0x3c7b45['trim']()+_0x35ad('0x67'));}});if(_0x1ada40){return handleError(_0xa6d541,null)(_0x1ada40);}return db[_0x35ad('0x5b')][_0x35ad('0x62')](_0x38d087[_0x35ad('0x68')],{})[_0x35ad('0x19')](function(_0x49a255){var _0xf36ac7=_0x38d087[_0x35ad('0x69')]['get']({'plain':!![]});if(!_0xf36ac7)throw new Error(_0x35ad('0x6a'));if(_0xf36ac7[_0x35ad('0x6b')]===_0x35ad('0x69')){var _0x286543=_0x49a255['get']({'plain':!![]});var _0x351f14='ChatWebsites';return db[_0x35ad('0x6c')][_0x35ad('0x6d')]({'where':{'name':_0x351f14,'userProfileId':_0xf36ac7[_0x35ad('0x6e')]},'raw':!![]})['then'](function(_0x395370){if(_0x395370&&_0x395370['autoAssociation']===0x0){return db[_0x35ad('0x2d')]['create']({'name':_0x286543['name'],'resourceId':_0x286543['id'],'type':_0x395370[_0x35ad('0x3b')],'sectionId':_0x395370['id']},{})[_0x35ad('0x19')](function(){return _0x49a255;});}else{return _0x49a255;}})['catch'](function(_0x29337b){logger[_0x35ad('0x1e')](_0x35ad('0x6f'),_0x29337b);throw _0x29337b;});}return _0x49a255;})['then'](respondWithResult(_0xa6d541,0xc9))['catch'](handleError(_0xa6d541,null));};exports['update']=function(_0x54a89a,_0x3f98a2){var _0x1a9fbf=null;_0x54a89a[_0x35ad('0x68')][_0x35ad('0x63')][_0x35ad('0x37')](',')[_0x35ad('0x64')](_0x4b6f5b=>{if(_0x4b6f5b[_0x35ad('0x65')]()!==''&&!wildcardUtils[_0x35ad('0x66')](_0x4b6f5b['trim']())){_0x1a9fbf=new APIBadRequestError('\x22'+_0x4b6f5b[_0x35ad('0x65')]()+_0x35ad('0x67'));}});if(_0x1a9fbf){return handleError(_0x3f98a2,null)(_0x1a9fbf);}if(_0x54a89a['body']['id']){delete _0x54a89a[_0x35ad('0x68')]['id'];}return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'where':{'id':_0x54a89a[_0x35ad('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0x35ad('0x48')}]})[_0x35ad('0x19')](handleEntityNotFound(_0x3f98a2,null))[_0x35ad('0x19')](saveUpdates(_0x54a89a[_0x35ad('0x68')],null))[_0x35ad('0x19')](respondWithResult(_0x3f98a2,null))[_0x35ad('0x5f')](handleError(_0x3f98a2,null));};exports[_0x35ad('0x2a')]=function(_0x3dc5e5,_0xd021df){return db[_0x35ad('0x5b')]['find']({'where':{'id':_0x3dc5e5['params']['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0xd021df,null))[_0x35ad('0x19')](removeEntity(_0xd021df,null))['catch'](handleError(_0xd021df,null));};exports[_0x35ad('0x70')]=function(_0x1d4bdb,_0x112b37){return db[_0x35ad('0x5b')][_0x35ad('0x70')]()[_0x35ad('0x19')](respondWithResult(_0x112b37,null))['catch'](handleError(_0x112b37,null));};exports[_0x35ad('0x71')]=function(_0x260a38,_0x3e881b){if(_0x260a38[_0x35ad('0x68')]['id']){delete _0x260a38[_0x35ad('0x68')]['id'];}return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'where':{'id':_0x260a38[_0x35ad('0x60')]['id']}})['then'](handleEntityNotFound(_0x3e881b,null))[_0x35ad('0x19')](function(_0x3530eb){if(_0x3530eb){_0x260a38[_0x35ad('0x68')][_0x35ad('0x72')]=_0x3530eb['id'];return db['Disposition'][_0x35ad('0x62')](_0x260a38['body']);}})[_0x35ad('0x19')](respondWithResult(_0x3e881b,null))['catch'](handleError(_0x3e881b,null));};exports['getDispositions']=function(_0x7b2480,_0x308daf){var _0x1c7558={'raw':![],'where':{}};var _0x5522d8={};var _0x3106bf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x35ad('0x73')]({'where':{'id':_0x7b2480[_0x35ad('0x60')]['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x308daf,null))[_0x35ad('0x19')](function(_0x4c6eca){if(_0x4c6eca){_0x5522d8[_0x35ad('0x41')]=_['keys'](db[_0x35ad('0x74')]['rawAttributes']);_0x5522d8[_0x35ad('0x4c')]=_[_0x35ad('0x4d')](_0x7b2480['query']);_0x5522d8['filters']=_['intersection'](_0x5522d8[_0x35ad('0x41')],_0x5522d8[_0x35ad('0x4c')]);_0x1c7558[_0x35ad('0x50')]=_[_0x35ad('0x4f')](_0x5522d8[_0x35ad('0x41')],qs['fields'](_0x7b2480['query'][_0x35ad('0x51')]));_0x1c7558['attributes']=_0x1c7558[_0x35ad('0x50')]['length']?_0x1c7558[_0x35ad('0x50')]:_0x5522d8[_0x35ad('0x41')];if(!_0x7b2480[_0x35ad('0x4c')][_0x35ad('0x75')]('nolimit')){_0x1c7558[_0x35ad('0x28')]=qs[_0x35ad('0x28')](_0x7b2480[_0x35ad('0x4c')][_0x35ad('0x28')]);_0x1c7558[_0x35ad('0x26')]=qs[_0x35ad('0x26')](_0x7b2480[_0x35ad('0x4c')][_0x35ad('0x26')]);}_0x1c7558['order']=qs[_0x35ad('0x55')](_0x7b2480[_0x35ad('0x4c')]['sort']);_0x1c7558['where']=qs['filters'](_[_0x35ad('0x57')](_0x7b2480[_0x35ad('0x4c')],_0x5522d8[_0x35ad('0x4e')]));_0x1c7558[_0x35ad('0x56')]['ChatWebsiteId']=_0x4c6eca['id'];if(_0x7b2480[_0x35ad('0x4c')][_0x35ad('0x59')]){_0x1c7558[_0x35ad('0x56')]=_[_0x35ad('0x58')](_0x1c7558[_0x35ad('0x56')],{'$or':_[_0x35ad('0x49')](_0x1c7558[_0x35ad('0x50')],function(_0x45e2df){var _0x35b822={};_0x35b822[_0x45e2df]={'$like':'%'+_0x7b2480[_0x35ad('0x4c')][_0x35ad('0x59')]+'%'};return _0x35b822;})});}_0x1c7558=_['merge']({},_0x1c7558,_0x7b2480[_0x35ad('0x5a')]);return db[_0x35ad('0x74')][_0x35ad('0x5c')]({'where':_0x1c7558[_0x35ad('0x56')]})[_0x35ad('0x19')](function(_0x48fdf4){_0x3106bf['count']=_0x48fdf4;if(_0x7b2480[_0x35ad('0x4c')][_0x35ad('0x5d')]){_0x1c7558[_0x35ad('0x61')]=[{'all':!![]}];}return db[_0x35ad('0x74')][_0x35ad('0x5e')](_0x1c7558);})[_0x35ad('0x19')](function(_0x3c7bd8){_0x3106bf[_0x35ad('0x76')]=_0x3c7bd8;return _0x3106bf;});}})[_0x35ad('0x19')](respondWithFilteredResult(_0x308daf,_0x1c7558))[_0x35ad('0x5f')](handleError(_0x308daf,null));};exports['removeDispositions']=function(_0x27ec92,_0x52c150){return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'where':{'id':_0x27ec92[_0x35ad('0x60')]['id']}})['then'](handleEntityNotFound(_0x52c150,null))[_0x35ad('0x19')](function(_0x1540fa){if(_0x1540fa){return _0x1540fa[_0x35ad('0x77')](_0x27ec92[_0x35ad('0x4c')]['ids']);}})[_0x35ad('0x19')](respondWithStatusCode(_0x52c150,null))[_0x35ad('0x5f')](handleError(_0x52c150,null));};exports['addAnswer']=function(_0x5d04d8,_0x961ce6){if(_0x5d04d8[_0x35ad('0x68')]['id']){delete _0x5d04d8['body']['id'];}return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'where':{'id':_0x5d04d8[_0x35ad('0x60')]['id']}})['then'](handleEntityNotFound(_0x961ce6,null))[_0x35ad('0x19')](function(_0x550020){if(_0x550020){_0x5d04d8[_0x35ad('0x68')]['ChatWebsiteId']=_0x550020['id'];return db[_0x35ad('0x78')][_0x35ad('0x62')](_0x5d04d8[_0x35ad('0x68')]);}})[_0x35ad('0x19')](respondWithResult(_0x961ce6,null))[_0x35ad('0x5f')](handleError(_0x961ce6,null));};exports['getAnswers']=function(_0x6212c6,_0x2f3116){var _0x3b9232={'raw':![],'where':{}};var _0x102801={};var _0x5daf78={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x35ad('0x73')]({'where':{'id':_0x6212c6['params']['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x2f3116,null))['then'](function(_0xc8d2b7){if(_0xc8d2b7){_0x102801['model']=_['keys'](db[_0x35ad('0x78')]['rawAttributes']);_0x102801[_0x35ad('0x4c')]=_[_0x35ad('0x4d')](_0x6212c6[_0x35ad('0x4c')]);_0x102801[_0x35ad('0x4e')]=_[_0x35ad('0x4f')](_0x102801[_0x35ad('0x41')],_0x102801[_0x35ad('0x4c')]);_0x3b9232[_0x35ad('0x50')]=_['intersection'](_0x102801[_0x35ad('0x41')],qs[_0x35ad('0x51')](_0x6212c6[_0x35ad('0x4c')][_0x35ad('0x51')]));_0x3b9232['attributes']=_0x3b9232[_0x35ad('0x50')][_0x35ad('0x52')]?_0x3b9232['attributes']:_0x102801['model'];if(!_0x6212c6[_0x35ad('0x4c')][_0x35ad('0x75')](_0x35ad('0x53'))){_0x3b9232['limit']=qs[_0x35ad('0x28')](_0x6212c6['query'][_0x35ad('0x28')]);_0x3b9232[_0x35ad('0x26')]=qs[_0x35ad('0x26')](_0x6212c6[_0x35ad('0x4c')][_0x35ad('0x26')]);}_0x3b9232[_0x35ad('0x54')]=qs[_0x35ad('0x55')](_0x6212c6[_0x35ad('0x4c')][_0x35ad('0x55')]);_0x3b9232['where']=qs[_0x35ad('0x4e')](_[_0x35ad('0x57')](_0x6212c6[_0x35ad('0x4c')],_0x102801['filters']));_0x3b9232['where'][_0x35ad('0x72')]=_0xc8d2b7['id'];if(_0x6212c6[_0x35ad('0x4c')][_0x35ad('0x59')]){_0x3b9232[_0x35ad('0x56')]=_['merge'](_0x3b9232[_0x35ad('0x56')],{'$or':_[_0x35ad('0x49')](_0x3b9232[_0x35ad('0x50')],function(_0x1f41d2){var _0x336feb={};_0x336feb[_0x1f41d2]={'$like':'%'+_0x6212c6[_0x35ad('0x4c')][_0x35ad('0x59')]+'%'};return _0x336feb;})});}_0x3b9232=_[_0x35ad('0x58')]({},_0x3b9232,_0x6212c6[_0x35ad('0x5a')]);return db[_0x35ad('0x78')]['count']({'where':_0x3b9232['where']})[_0x35ad('0x19')](function(_0x32c93b){_0x5daf78[_0x35ad('0x5c')]=_0x32c93b;if(_0x6212c6[_0x35ad('0x4c')][_0x35ad('0x5d')]){_0x3b9232[_0x35ad('0x61')]=[{'all':!![]}];}return db[_0x35ad('0x78')]['findAll'](_0x3b9232);})['then'](function(_0x4081b9){_0x5daf78[_0x35ad('0x76')]=_0x4081b9;return _0x5daf78;});}})['then'](respondWithFilteredResult(_0x2f3116,_0x3b9232))['catch'](handleError(_0x2f3116,null));};exports[_0x35ad('0x79')]=function(_0x4f2f03,_0x218c89){return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'where':{'id':_0x4f2f03['params']['id']}})['then'](handleEntityNotFound(_0x218c89,null))['then'](function(_0x2d4286){if(_0x2d4286){return _0x2d4286[_0x35ad('0x79')](_0x4f2f03[_0x35ad('0x4c')][_0x35ad('0x7a')]);}})[_0x35ad('0x19')](respondWithStatusCode(_0x218c89,null))[_0x35ad('0x5f')](handleError(_0x218c89,null));};exports[_0x35ad('0x7b')]=function(_0x8ed8f,_0x5ab8a6){_0x8ed8f[_0x35ad('0x68')][_0x35ad('0x7c')]=_0x8ed8f[_0x35ad('0x7d')][_0x35ad('0x7e')];return db['ChatWebsite'][_0x35ad('0x6d')]({'where':{'id':_0x8ed8f['params']['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x5ab8a6,null))[_0x35ad('0x19')](saveUpdates(_0x8ed8f[_0x35ad('0x68')],null))[_0x35ad('0x19')](respondWithResult(_0x5ab8a6,null))['catch'](handleError(_0x5ab8a6,null));};exports[_0x35ad('0x7f')]=function(_0x1cdcd4,_0x45fe0d){_0x1cdcd4['body'][_0x35ad('0x80')]=_0x1cdcd4[_0x35ad('0x7d')][_0x35ad('0x7e')];return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'where':{'id':_0x1cdcd4[_0x35ad('0x60')]['id']}})['then'](handleEntityNotFound(_0x45fe0d,null))[_0x35ad('0x19')](saveUpdates(_0x1cdcd4[_0x35ad('0x68')],null))[_0x35ad('0x19')](respondWithResult(_0x45fe0d,null))[_0x35ad('0x5f')](handleError(_0x45fe0d,null));};exports[_0x35ad('0x81')]=function(_0x3c66f6,_0x738f2c){_0x3c66f6[_0x35ad('0x68')][_0x35ad('0x82')]=_0x3c66f6[_0x35ad('0x7d')][_0x35ad('0x7e')];return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'where':{'id':_0x3c66f6[_0x35ad('0x60')]['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x738f2c,null))[_0x35ad('0x19')](saveUpdates(_0x3c66f6[_0x35ad('0x68')],null))['then'](respondWithResult(_0x738f2c,null))[_0x35ad('0x5f')](handleError(_0x738f2c,null));};exports[_0x35ad('0x83')]=function(_0xb68b35,_0x3d4f03){_0xb68b35[_0x35ad('0x68')][_0x35ad('0x84')]=_0xb68b35[_0x35ad('0x7d')][_0x35ad('0x7e')];return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'where':{'id':_0xb68b35[_0x35ad('0x60')]['id']}})['then'](handleEntityNotFound(_0x3d4f03,null))[_0x35ad('0x19')](saveUpdates(_0xb68b35['body'],null))[_0x35ad('0x19')](respondWithResult(_0x3d4f03,null))['catch'](handleError(_0x3d4f03,null));};exports[_0x35ad('0x85')]=function(_0x53f700,_0x1e081f){var _0x1bed38=path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0x88'));var _0x4867a9={'where':{'id':_0x53f700[_0x35ad('0x60')]['id']},'attributes':['id',_0x35ad('0x7c')],'raw':!![]};var _0x34181a=![];return require(_0x35ad('0x89'))['getLicense']()[_0x35ad('0x19')](function(_0x18aeb0){if(_0x18aeb0){_0x34181a=_0x18aeb0[_0x35ad('0x8a')];}})['then'](function(){return db['ChatWebsite'][_0x35ad('0x6d')](_0x4867a9);})[_0x35ad('0x19')](handleEntityNotFound(_0x1e081f,null))[_0x35ad('0x19')](function(_0x379783){if(_0x379783){if(!_[_0x35ad('0x8b')](_0x379783[_0x35ad('0x7c')])){if(fs[_0x35ad('0x8c')](path[_0x35ad('0x86')](config['root'],_0x35ad('0x8d'),_0x379783['sitepic']))&&_0x34181a){_0x1bed38=path[_0x35ad('0x86')](config[_0x35ad('0x87')],'server/files/images/logos/',_0x379783['sitepic']);}}return _0x1e081f[_0x35ad('0x8e')](_0x1bed38);}})[_0x35ad('0x5f')](handleError(_0x1e081f,null));};exports[_0x35ad('0x8f')]=function(_0x56c09a,_0x23fe9b){var _0x594247=path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0x90'));var _0x5aa94b={'where':{'id':_0x56c09a['params']['id']},'attributes':['id',_0x35ad('0x80')],'raw':!![]};return db['ChatWebsite'][_0x35ad('0x6d')](_0x5aa94b)[_0x35ad('0x19')](handleEntityNotFound(_0x23fe9b,null))[_0x35ad('0x19')](function(_0xeb83b1){if(_0xeb83b1){if(!_[_0x35ad('0x8b')](_0xeb83b1[_0x35ad('0x80')])){if(fs[_0x35ad('0x8c')](path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0x91'),_0xeb83b1[_0x35ad('0x80')]))){_0x594247=path[_0x35ad('0x86')](config['root'],_0x35ad('0x91'),_0xeb83b1[_0x35ad('0x80')]);}}return _0x23fe9b[_0x35ad('0x8e')](_0x594247);}})[_0x35ad('0x5f')](handleError(_0x23fe9b,null));};exports[_0x35ad('0x92')]=function(_0x265832,_0x364fcb){var _0xcfcbcb=path['join'](config[_0x35ad('0x87')],_0x35ad('0x93'));var _0x30fe3d={'where':{'id':_0x265832[_0x35ad('0x60')]['id']},'attributes':['id',_0x35ad('0x82'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x35ad('0x6d')](_0x30fe3d)['then'](handleEntityNotFound(_0x364fcb,null))['then'](function(_0x5e8291){if(_0x5e8291){if(!_[_0x35ad('0x8b')](_0x5e8291[_0x35ad('0x82')])){if(fs[_0x35ad('0x8c')](path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0x91'),_0x5e8291[_0x35ad('0x82')]))&&_0x5e8291[_0x35ad('0x94')]){_0xcfcbcb=path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0x91'),_0x5e8291['customerAvatar']);}}return _0x364fcb[_0x35ad('0x8e')](_0xcfcbcb);}})[_0x35ad('0x5f')](handleError(_0x364fcb,null));};exports['getSystemAvatar']=function(_0x521e08,_0x345da6){var _0x288068=path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0x95'));var _0x2758f9={'where':{'id':_0x521e08[_0x35ad('0x60')]['id']},'attributes':['id',_0x35ad('0x84')],'raw':!![]};return db[_0x35ad('0x5b')][_0x35ad('0x6d')](_0x2758f9)[_0x35ad('0x19')](handleEntityNotFound(_0x345da6,null))[_0x35ad('0x19')](function(_0x48c23a){if(_0x48c23a){if(!_[_0x35ad('0x8b')](_0x48c23a[_0x35ad('0x84')])){if(fs[_0x35ad('0x8c')](path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0x91'),_0x48c23a[_0x35ad('0x84')]))){_0x288068=path[_0x35ad('0x86')](config['root'],_0x35ad('0x91'),_0x48c23a[_0x35ad('0x84')]);}}return _0x345da6['download'](_0x288068);}})[_0x35ad('0x5f')](handleError(_0x345da6,null));};function checkWebsiteInterval(_0x452afc){var _0x304c0f=_0x452afc['Interval'];if(!_0x304c0f){return Promise['resolve'](_0x452afc);}var _0x1d1c02=_0x452afc[_0x35ad('0x96')]||undefined;return _0x304c0f[_0x35ad('0x97')](_0x1d1c02)[_0x35ad('0x19')](function(_0x156de8){if(!_0x156de8){throw new APIOutOfIntervalError();}return _0x452afc;});}exports['notify']=function(_0x1257da,_0x9d1163){var _0x1b8bc8={'body':_0x1257da[_0x35ad('0x68')],'channel':_0x35ad('0x98')};var _0x162365=[];var _0x39a1db=[];var _0x23598a={};var _0x4f9680=![];if(_0x1257da['body']['id']){delete _0x1257da[_0x35ad('0x68')]['id'];}if(_[_0x35ad('0x8b')](_0x1257da['body'][_0x35ad('0x99')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x35ad('0x8b')](_0x1257da[_0x35ad('0x68')][_0x35ad('0x9a')])){throw new APIBadRequestError(_0x35ad('0x9b'));}if(_[_0x35ad('0x9c')](_0x1257da[_0x35ad('0x68')][_0x35ad('0x68')])){throw new APIBadRequestError(_0x35ad('0x9d'));}var _0x1f0fcb=_0x1257da[_0x35ad('0x68')]['customerIp']&&_0x1257da[_0x35ad('0x68')]['referer'];return db['CmContact']['describe']()['then'](function(_0x3c6582){if(!_0x3c6582){throw new Error(_0x35ad('0x9e'));}_0x162365=Object[_0x35ad('0x4d')](_0x3c6582)['filter'](function(_0x455561){return![_0x35ad('0x9f'),_0x35ad('0xa0')][_0x35ad('0xa1')](_0x455561);});_0x39a1db=Object[_0x35ad('0x4d')](_0x3c6582)['filter'](function(_0x26c88a){return![_0x35ad('0x9f'),_0x35ad('0xa0'),_0x35ad('0xa2'),_0x35ad('0xa3')][_0x35ad('0xa1')](_0x26c88a);});if(!_[_0x35ad('0xa1')](_0x39a1db,_0x1257da[_0x35ad('0x68')][_0x35ad('0x9a')])){throw new APIBadRequestError(_0x35ad('0xa4')+_0x39a1db[_0x35ad('0x86')](',\x20'));}_0x23598a[_0x1257da[_0x35ad('0x68')][_0x35ad('0x9a')]]=_0x1257da['body'][_0x35ad('0x99')];})['then'](function(){return db[_0x35ad('0x5b')]['find']({'where':{'id':_0x1257da[_0x35ad('0x60')]['id']},'include':[{'model':db[_0x35ad('0xa5')],'as':_0x35ad('0xa6'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x23598a,'limit':0x1,'order':[['updatedAt',_0x35ad('0xa7')]]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db[_0x35ad('0xa8')],'as':_0x35ad('0xa8'),'include':[{'model':db[_0x35ad('0xa8')],'as':_0x35ad('0xa9'),'attributes':['id',_0x35ad('0xaa')],'raw':!![]}]}]});})['then'](function(_0x30d239){if(!_0x30d239){throw new APINotFoundError(util[_0x35ad('0x3d')](_0x35ad('0xab'),_0x1257da[_0x35ad('0x60')]['id']));}if(_0x1f0fcb){return checkWebsiteInterval(_0x30d239);}return _0x30d239;})[_0x35ad('0x19')](function(_0xe0da68){_0x1b8bc8['account']=_0xe0da68;_0x1b8bc8[_0x35ad('0xac')]=_[_0x35ad('0xad')](_0xe0da68[_0x35ad('0xae')],[_0x35ad('0xaf')],[_0x35ad('0xb0')]);if(_0x1b8bc8[_0x35ad('0xb1')]['Applications']){delete _0x1b8bc8[_0x35ad('0xb1')][_0x35ad('0xae')];}_0x1b8bc8[_0x35ad('0xb2')]=_0xe0da68[_0x35ad('0xa6')]||{'id':_0xe0da68[_0x35ad('0xa3')]};if(_0x1b8bc8[_0x35ad('0xb2')]&&_0x1b8bc8['list']['Contacts'][_0x35ad('0x52')]){return _0x1b8bc8[_0x35ad('0xb2')][_0x35ad('0xb3')][0x0];}var _0x50eba3=_[_0x35ad('0xb4')](_0x1257da[_0x35ad('0x68')],{'firstName':_0x1257da[_0x35ad('0x68')][_0x35ad('0x99')],'ListId':_0xe0da68[_0x35ad('0xa3')]});_0x50eba3[_0x1257da[_0x35ad('0x68')][_0x35ad('0x9a')]]=_0x1257da['body']['from'];return db['CmContact']['create'](_0x50eba3,{'fields':_0x162365,'raw':!![]});})[_0x35ad('0x19')](function(_0x28eaee){_0x1b8bc8[_0x35ad('0xb5')]=_0x28eaee;var _0x4313c9=createInteractionObject(_0x1257da['params']['id'],_0x1257da[_0x35ad('0x68')],_0x1257da[_0x35ad('0xb6')],_0x28eaee);var _0x42895d={'ChatWebsiteId':_0x1257da[_0x35ad('0x60')]['id']};if(_0x1257da[_0x35ad('0x68')]['threadId']){_0x42895d[_0x35ad('0xb7')]=_0x1257da[_0x35ad('0x68')][_0x35ad('0xb7')];_0x42895d['closed']=![];return db[_0x35ad('0xb8')][_0x35ad('0x6d')]({'where':_0x42895d})[_0x35ad('0x19')](function(_0x4ac9bf){var _0x5f0433=_0x1257da['body'][_0x35ad('0x33')]&&_0x1257da[_0x35ad('0x68')][_0x35ad('0xb9')];if(_0x4ac9bf){_0x4f9680=!![];return _0x4ac9bf;}else if(!_0x5f0433&&_0x4ac9bf&&_0x4ac9bf[_0x35ad('0xba')]){throw new APIConflictError(_0x35ad('0xbb'));}_0x4313c9[_0x35ad('0xb7')]=_0x1257da['body'][_0x35ad('0xb7')];_0x4313c9[_0x35ad('0xbc')]=_0x1257da[_0x35ad('0x68')]['externalUrl'];return db['ChatInteraction'][_0x35ad('0x62')](_0x4313c9);});}_0x42895d[_0x35ad('0xbd')]=_0x28eaee['id'];if(_0x1257da[_0x35ad('0x68')][_0x35ad('0xbe')]&&_0x1257da[_0x35ad('0x68')][_0x35ad('0xbe')]['id']){_0x42895d['id']=_0x1257da['body']['interaction']['id'];return db['ChatInteraction'][_0x35ad('0x6d')]({'where':_0x42895d})[_0x35ad('0x19')](function(_0x1e8f91){var _0x4b5e4f=_0x1257da['body']['customerIp']&&_0x1257da[_0x35ad('0x68')][_0x35ad('0xb9')];if(!_0x4b5e4f&&_0x1e8f91&&_0x1e8f91['closed']){throw new APIConflictError(_0x35ad('0xbb'));}else if(_0x1e8f91){_0x4f9680=!![];return _0x1e8f91;}else{return db['ChatInteraction'][_0x35ad('0x62')](_0x4313c9);}});}return db[_0x35ad('0xb8')]['create'](_0x4313c9);})[_0x35ad('0x19')](function(_0xf40d55){if(!_0x4f9680){return _0xf40d55;}var _0x3120cd={'from':(_0x1b8bc8[_0x35ad('0xb5')][_0x35ad('0xbf')]||'')+'\x20'+(_0x1b8bc8[_0x35ad('0xb5')][_0x35ad('0x38')]||'')};if(_0x1257da[_0x35ad('0x68')][_0x35ad('0xb7')]&&_0x1257da['body'][_0x35ad('0xc0')]&&_0x1257da[_0x35ad('0x68')][_0x35ad('0xb7')]!=_0x1257da[_0x35ad('0x68')]['messageId']){_0x3120cd[_0x35ad('0xb7')]=_0x1257da['body']['messageId'];}return _0xf40d55[_0x35ad('0xc1')](_0x3120cd);})[_0x35ad('0x19')](function(_0x54abbf){_0x1b8bc8['interaction']=_0x54abbf[_0x35ad('0x2b')]({'plain':!![]});_0x1b8bc8[_0x35ad('0xbe')]['created']=!_0x4f9680;if(_0x1b8bc8[_0x35ad('0xbe')][_0x35ad('0xc2')]){if(_0x1b8bc8['account'][_0x35ad('0xc3')]){_0x1b8bc8[_0x35ad('0xac')][_0x35ad('0xc4')]({'id':0x0,'priority':_0x1b8bc8[_0x35ad('0xac')][_0x35ad('0x52')]+0x1,'app':_0x35ad('0xc5'),'appdata':_0x35ad('0xc6'),'interval':_0x35ad('0xc7')});}}return db[_0x35ad('0xc8')]['create']({'body':_0x1257da[_0x35ad('0x68')][_0x35ad('0x68')],'ChatWebsiteId':_0x1257da['params']['id'],'ChatInteractionId':_0x54abbf['id'],'direction':'in','ContactId':_0x1b8bc8[_0x35ad('0xb5')]['id'],'AttachmentId':_0x1257da[_0x35ad('0x68')][_0x35ad('0xc9')]});})[_0x35ad('0x19')](function(_0x55aabf){_0x1b8bc8['message']=_0x55aabf;if(!_0x1b8bc8['interaction']['UserId']){return;}return db[_0x35ad('0xca')]['find']({'attributes':['id',_0x35ad('0x3b')],'where':{'id':_0x1b8bc8['interaction'][_0x35ad('0xcb')]}});})[_0x35ad('0x19')](function(_0x3deadf){if(_0x3deadf){_0x1b8bc8[_0x35ad('0xac')]['unshift']({'id':0x0,'priority':0x0,'app':_0x35ad('0xcc'),'appdata':_0x3deadf['name']+','+(_0x1b8bc8[_0x35ad('0xb1')][_0x35ad('0xcd')]||0xa),'interval':_0x35ad('0xc7')});_0x1b8bc8[_0x35ad('0xce')]=!![];}if(!_0x1b8bc8[_0x35ad('0xbe')][_0x35ad('0xcf')]){return;}return db[_0x35ad('0xd0')][_0x35ad('0x6d')]({'attributes':['id',_0x35ad('0x3b')],'where':{'id':_0x1b8bc8[_0x35ad('0xbe')][_0x35ad('0xcf')]}});})[_0x35ad('0x19')](function(_0x4202e9){if(_0x4202e9){_0x1b8bc8['applications'][_0x35ad('0xd1')]({'id':0x0,'priority':0x1,'app':_0x35ad('0xd2'),'appdata':_0x4202e9[_0x35ad('0x3b')]+','+(_0x1b8bc8[_0x35ad('0xb1')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x35ad('0xd3'),_0x35ad('0xd4'),_0x1b8bc8);})[_0x35ad('0x19')](function(_0x3e25cf){respondWithRpcPromise('EventManager',_0x35ad('0xd5'),{'event':_0x35ad('0xd6'),'message':_0x3e25cf},client9002);return _0x3e25cf;})['then'](respondWithResult(_0x9d1163,null))[_0x35ad('0x5f')](APIHandleError(_0x9d1163));};exports[_0x35ad('0xd7')]=function(_0x12630f,_0x378362){var _0x4dbe1c,_0x2bac03,_0x3a2819;var _0x3c856b=[];var _0x34874e={};var _0x190ecb=_0x12630f[_0x35ad('0xd8')]||[];var _0x54bad8=[];var _0x27d199;return db[_0x35ad('0xd9')][_0x35ad('0x70')]()[_0x35ad('0x19')](function(_0x26a9b0){if(!_0x26a9b0){throw new db[(_0x35ad('0xda'))][(_0x35ad('0xdb'))]('no\x20available\x20attributes');}_0x3c856b=_['difference'](_[_0x35ad('0x4d')](_0x26a9b0),[_0x35ad('0x9f'),_0x35ad('0xa0'),_0x35ad('0xa2'),_0x35ad('0xa3')]);if(_0x12630f[_0x35ad('0x68')]['id']){delete _0x12630f['body']['id'];}if(_[_0x35ad('0x8b')](_0x12630f[_0x35ad('0x68')]['from'])){throw _0x378362[_0x35ad('0x23')](0x1f4)[_0x35ad('0x2f')](new db[(_0x35ad('0xda'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x35ad('0x8b')](_0x12630f[_0x35ad('0x68')]['body'])||_0x12630f[_0x35ad('0x68')][_0x35ad('0x68')]===''){throw _0x378362[_0x35ad('0x23')](0x1f4)[_0x35ad('0x2f')](new db[(_0x35ad('0xda'))][(_0x35ad('0xdb'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x35ad('0x8b')](_0x12630f['body'][_0x35ad('0xdc')])){throw _0x378362[_0x35ad('0x23')](0x1f4)['send'](new db[(_0x35ad('0xda'))][(_0x35ad('0xdb'))](_0x35ad('0xdd')+_0x3c856b));}if(!_[_0x35ad('0xa1')](_0x3c856b,_0x12630f['body']['mapKeyOffline'])){throw _0x378362[_0x35ad('0x23')](0x1f4)[_0x35ad('0x2f')](new db[(_0x35ad('0xda'))][(_0x35ad('0xdb'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c856b));}_0x34874e[_0x12630f[_0x35ad('0x68')]['mapKeyOffline']]=_0x12630f[_0x35ad('0x68')][_0x35ad('0x99')];})[_0x35ad('0x19')](function(){return db[_0x35ad('0x5b')]['find']({'where':{'id':_0x12630f[_0x35ad('0x60')]['id']},'include':[{'model':db[_0x35ad('0xa5')],'as':_0x35ad('0xa6')},{'model':db[_0x35ad('0xde')],'as':_0x35ad('0xde')}]});})[_0x35ad('0x19')](handleEntityNotFound(_0x378362,null))[_0x35ad('0x19')](function(_0x3c8544){if(_0x3c8544&&_0x3c8544[_0x35ad('0xa6')]){_0x2bac03=_0x3c8544;var _0x4c7e3e=_[_0x35ad('0xb4')](_0x12630f[_0x35ad('0x68')],{'firstName':_0x12630f['body'][_0x35ad('0x99')],'phone':_0x12630f['body']['from'],'ListId':_0x3c8544[_0x35ad('0xa3')]});_0x4c7e3e[_0x12630f[_0x35ad('0x68')][_0x35ad('0xdc')]]=_0x12630f[_0x35ad('0x68')]['from'];return db[_0x35ad('0xd9')][_0x35ad('0xdf')]({'where':_0x34874e,'defaults':_0x4c7e3e});}})[_0x35ad('0xe0')](function(_0x1ff13b){if(_0x1ff13b){_0x3a2819=_0x1ff13b;var _0x5ab2f9=fs['readFileSync'](path[_0x35ad('0x86')](config['root'],_0x35ad('0xe1')),_0x35ad('0xe2'));var _0x1b4c34=ejs['render'](_0x5ab2f9,{'body':_[_0x35ad('0xe3')](_0x12630f['body'][_0x35ad('0x68')]),'bodyTitle':_0x2bac03[_0x35ad('0xe4')]});return db['ChatOfflineMessage'][_0x35ad('0x62')]({'body':_0x1b4c34,'plainBody':htmlToText[_0x35ad('0xe5')](_0x1b4c34),'ContactId':_0x1ff13b['id'],'ChatWebsiteId':_0x2bac03['id']});}})['then'](function(_0x1e0e35){_0x27d199=_0x1e0e35;if(_0x190ecb[_0x35ad('0x52')]){var _0x5a1392=_0x190ecb[_0x35ad('0x49')](function(_0x22ed7d){return{'name':_0x22ed7d[_0x35ad('0xe6')],'basename':_0x22ed7d['filename'],'type':_0x22ed7d[_0x35ad('0xe7')],'ChatOfflineMessageId':_0x1e0e35['id']};});_0x54bad8=_0x5a1392['map'](_0x2c4504=>{var _0x159e9a={'filename':_0x2c4504[_0x35ad('0x3b')],'path':path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0xe8'),_0x35ad('0xd8'),_0x35ad('0xe9'),_0x35ad('0xea'),_0x2c4504['basename'])};return _0x159e9a;});if(!_0x2bac03['openNewInteraction']){return db[_0x35ad('0xeb')][_0x35ad('0xec')](function(_0x4c0ea8){return db['Attachment'][_0x35ad('0xed')](_0x5a1392,{'transaction':_0x4c0ea8});});}}})[_0x35ad('0x19')](function(){if(_0x27d199){_0x4dbe1c=_0x27d199;return db[_0x35ad('0xde')][_0x35ad('0x73')]({'where':{'service':!![]},'include':[{'model':db[_0x35ad('0xee')],'as':_0x35ad('0xef'),'raw':!![],'include':[{'model':db[_0x35ad('0xf0')],'as':_0x35ad('0xf0'),'raw':!![]}]}]});}})[_0x35ad('0x19')](function(_0x24ec72){if(_0x24ec72&&_0x24ec72[_0x35ad('0xef')]&&_0x2bac03[_0x35ad('0xf1')]&&_0x2bac03[_0x35ad('0xf2')]){var _0x5b2882=_0x24ec72[_0x35ad('0xf3')]();return respondWithRpcPromise(_0x35ad('0xf4'),_0x35ad('0xf5'),{'account':_0x5b2882,'message':{'from':util[_0x35ad('0x3d')](_0x35ad('0xf6'),_0x24ec72[_0x35ad('0x3b')],_0x24ec72[_0x35ad('0xf7')]||_0x24ec72[_0x35ad('0xef')][_0x35ad('0x69')]),'to':_0x2bac03[_0x35ad('0xf2')],'subject':_0x2bac03['offlineMessageSubject'],'html':_0x4dbe1c[_0x35ad('0x68')],'attachments':_0x54bad8}},client9003)['then'](function(){return _0x4dbe1c;})['catch'](function(_0x1b2ab8){logger[_0x35ad('0x1e')](_0x1b2ab8);});}})['then'](function(){if(_0x2bac03&&_0x2bac03[_0x35ad('0xf8')]&&_0x2bac03[_0x35ad('0xf9')]){var _0x53ce66=[];if(_0x190ecb[_0x35ad('0x52')]){_0x53ce66=_0x190ecb[_0x35ad('0x49')](function(_0x47fb6c){return{'name':_0x47fb6c[_0x35ad('0xe6')],'basename':_0x47fb6c['filename'],'type':_0x47fb6c[_0x35ad('0xe7')],'ChatOfflineMessageId':_0x27d199['id']};});}var _0x5bfd6d;if(!_[_0x35ad('0x8b')](_0x2bac03[_0x35ad('0xfa')])){var _0xfc20bd=_[_0x35ad('0x49')](_0x12630f[_0x35ad('0x68')],function(_0x508b7a){return _0x508b7a;});var _0x2d5220=_[_0x35ad('0xfb')](_0xfc20bd)[0x0];var _0x1e9544=_[_0x35ad('0xfc')](_0x2d5220,function(_0x236091){return _0x236091;});_0x5bfd6d=_0x1e9544[0x1][_0x2bac03[_0x35ad('0xfa')]];}var _0x7be2f3={'from':_0x3a2819[_0x35ad('0xf7')],'firstName':_0x3a2819[_0x35ad('0xbf')],'lastName':_0x3a2819[_0x35ad('0x38')],'mapKey':_0x35ad('0xf7'),'message':{'from':_0x3a2819['email'],'to':_0x2bac03['MailAccount']['email'],'cc':'','subject':_[_0x35ad('0x8b')](_0x5bfd6d)?_0x2bac03['offlineMessageSubject']:_0x5bfd6d,'messageId':'','sentAt':new Date(),'attach':_0x53ce66[_0x35ad('0x52')],'attachments':_0x53ce66,'originChannel':'Chat','ChatWebsiteId':_0x2bac03['id'],'ChatOfflineMessageId':_0x4dbe1c['id'],'originTo':_0x2bac03[_0x35ad('0xde')][_0x35ad('0xf7')]},'body':_0x4dbe1c['body']};var _0x472d76={'account':{'id':_0x2bac03['MailAccountId']},'body':_0x7be2f3,'log':_0x35ad('0xfd')};return respondWithRpcPromise(_0x35ad('0xfd'),_0x35ad('0xfe'),_0x472d76,client9001)[_0x35ad('0x19')](function(){return _0x4dbe1c;})[_0x35ad('0x5f')](function(_0x12e4e8){logger[_0x35ad('0x1e')](_0x12e4e8);});}return;})[_0x35ad('0x19')](function(){if(_0x4dbe1c){return _0x4dbe1c;}})[_0x35ad('0x19')](respondWithResult(_0x378362,null))[_0x35ad('0x5f')](function(){for(var _0x5c81f5 of _0x190ecb){var _0xc9e73b=path[_0x35ad('0x86')](config[_0x35ad('0x87')],_0x35ad('0xe8'),_0x35ad('0xd8'),_0x35ad('0xe9'),_0x35ad('0xea'),_0x5c81f5[_0x35ad('0x7e')]);fs_extra[_0x35ad('0xff')](_0xc9e73b)[_0x35ad('0x5f')](function(_0x5c6b69){logger[_0x35ad('0x1e')](_0x35ad('0x100'),_0xc9e73b,_0x5c6b69);});}});};exports[_0x35ad('0x101')]=function(_0x1c9dce,_0x1a8b38){return db[_0x35ad('0xb8')][_0x35ad('0x6d')]({'where':{'id':_0x1c9dce['params']['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x1a8b38,null))[_0x35ad('0x19')](function(_0x1e7178){if(_0x1e7178){return _0x1e7178['addInteraction'](_0x1c9dce['body']['ids'],_[_0x35ad('0x102')](_0x1c9dce[_0x35ad('0x68')],[_0x35ad('0x7a'),'id'])||{});}})[_0x35ad('0x19')](respondWithResult(_0x1a8b38,null))['catch'](handleError(_0x1a8b38,null));};exports['getInteractions']=function(_0x2e89c4,_0x20c5b1){var _0x5d2740={'raw':![],'where':{}};var _0x735d43={};var _0x335d7b={'count':0x0,'rows':[]};return db[_0x35ad('0x5b')][_0x35ad('0x73')]({'where':{'id':_0x2e89c4[_0x35ad('0x60')]['id']}})['then'](handleEntityNotFound(_0x20c5b1,null))[_0x35ad('0x19')](function(_0x38d879){if(_0x38d879){_0x735d43[_0x35ad('0x41')]=_[_0x35ad('0x4d')](db[_0x35ad('0xb8')][_0x35ad('0x4a')]);_0x735d43[_0x35ad('0x4c')]=_['keys'](_0x2e89c4[_0x35ad('0x4c')]);_0x735d43['filters']=_[_0x35ad('0x4f')](_0x735d43['model'],_0x735d43['query']);_0x5d2740['attributes']=_['intersection'](_0x735d43['model'],qs[_0x35ad('0x51')](_0x2e89c4[_0x35ad('0x4c')][_0x35ad('0x51')]));_0x5d2740[_0x35ad('0x50')]=_0x5d2740[_0x35ad('0x50')][_0x35ad('0x52')]?_0x5d2740['attributes']:_0x735d43[_0x35ad('0x41')];if(!_0x2e89c4[_0x35ad('0x4c')][_0x35ad('0x75')](_0x35ad('0x53'))){_0x5d2740[_0x35ad('0x28')]=qs[_0x35ad('0x28')](_0x2e89c4['query'][_0x35ad('0x28')]);_0x5d2740['offset']=qs['offset'](_0x2e89c4[_0x35ad('0x4c')][_0x35ad('0x26')]);}_0x5d2740[_0x35ad('0x54')]=qs[_0x35ad('0x55')](_0x2e89c4[_0x35ad('0x4c')]['sort']);_0x5d2740[_0x35ad('0x56')]=qs[_0x35ad('0x4e')](_[_0x35ad('0x57')](_0x2e89c4['query'],_0x735d43['filters']));_0x5d2740[_0x35ad('0x56')][_0x35ad('0x72')]=_0x38d879['id'];if(_0x2e89c4['query'][_0x35ad('0x59')]){_0x5d2740['where']=_['merge'](_0x5d2740[_0x35ad('0x56')],{'$or':_['map'](_0x5d2740[_0x35ad('0x50')],function(_0x47f047){var _0x5a0e51={};_0x5a0e51[_0x47f047]={'$like':'%'+_0x2e89c4[_0x35ad('0x4c')][_0x35ad('0x59')]+'%'};return _0x5a0e51;})});}_0x5d2740=_['merge']({},_0x5d2740,_0x2e89c4[_0x35ad('0x5a')]);return db[_0x35ad('0xb8')]['count']({'where':_0x5d2740['where']})[_0x35ad('0x19')](function(_0x37cb29){_0x335d7b[_0x35ad('0x5c')]=_0x37cb29;if(_0x2e89c4[_0x35ad('0x4c')][_0x35ad('0x5d')]){_0x5d2740[_0x35ad('0x61')]=[{'model':db[_0x35ad('0xd9')],'as':_0x35ad('0x103'),'required':![]},{'model':db[_0x35ad('0xca')],'as':_0x35ad('0x104'),'attributes':[_0x35ad('0x3b'),_0x35ad('0x105'),_0x35ad('0x106')],'required':![]},{'model':db[_0x35ad('0x107')],'as':_0x35ad('0x108'),'attributes':['id',_0x35ad('0x3b'),_0x35ad('0x109')],'where':_0x2e89c4[_0x35ad('0x4c')][_0x35ad('0x10a')]?{'id':_0x2e89c4['query'][_0x35ad('0x10a')]}:undefined,'required':_0x2e89c4[_0x35ad('0x4c')]['tag']?!![]:![]}];}return db[_0x35ad('0xb8')]['findAll'](_0x5d2740);})[_0x35ad('0x19')](function(_0x26a97c){_0x335d7b[_0x35ad('0x76')]=_0x26a97c;return _0x335d7b;});}})['then'](respondWithFilteredResult(_0x20c5b1,_0x5d2740))[_0x35ad('0x5f')](handleError(_0x20c5b1,null));};exports[_0x35ad('0x10b')]=function(_0x5b4423,_0x472796){var _0x51ac94=0x0;var _0x59f17c=0x0;var _0x3dedad=![];var _0x1455db;var _0x117be3;return db[_0x35ad('0x5b')]['find']({'where':{'id':_0x5b4423[_0x35ad('0x60')]['id']},'include':[{'model':db[_0x35ad('0xa8')],'as':'Interval','include':[{'model':db[_0x35ad('0xa8')],'as':'Intervals','attributes':['id','interval']}]}]})[_0x35ad('0x19')](handleEntityNotFound(_0x472796,null))['then'](function(_0x4bfbe3){if(_0x4bfbe3){_0x1455db=_0x4bfbe3;return _0x4bfbe3['getProactiveActions']({'raw':!![]});}})[_0x35ad('0x19')](function(_0x4e0ab0){if(_0x1455db){if(_0x4e0ab0){_0x117be3=_0x4e0ab0;}}return require('../../config/license/util')[_0x35ad('0x10c')]();})['then'](function(_0x92f21d){if(_0x92f21d){_0x59f17c=_0x92f21d[_0x35ad('0x10d')];_0x3dedad=_0x92f21d[_0x35ad('0x8a')];}})['then'](function(){return db[_0x35ad('0xb8')]['count']({'where':{'closed':![]}});})[_0x35ad('0x19')](function(_0x402c16){_0x51ac94=_0x402c16;if(_0x59f17c&&_0x402c16>_0x59f17c){return db[_0x35ad('0x10e')]['findOne']({'where':{'id':0x1}})['then'](function(_0x12efc1){if(_0x12efc1){_0x12efc1[_0x35ad('0x10f')](_0x35ad('0x110'));}});}})[_0x35ad('0x19')](function(){var _0xe72c44=_0x1455db['Interval'];var _0x9a1871=_0x1455db[_0x35ad('0x96')]||undefined;return _0xe72c44?_0xe72c44[_0x35ad('0x97')](_0x9a1871):!![];})['then'](function(_0x199476){var _0x1f1579=fs[_0x35ad('0x111')](path[_0x35ad('0x86')](config[_0x35ad('0x87')],'server/files/chat/iframe.ejs'),'utf8');var _0x305e75=_0x35ad('0x112');var _0x1d759b=![];var _0x11e739,_0x3a9f26;if(_0x5b4423[_0x35ad('0xb6')][_0x35ad('0xb9')]){_0x11e739=new URL(_0x5b4423[_0x35ad('0xb6')]['referer'])[_0x35ad('0x113')];}else if(_0x5b4423[_0x35ad('0xb6')][_0x35ad('0x113')]){_0x11e739=new URL(_0x5b4423['headers'][_0x35ad('0x113')])[_0x35ad('0x113')];}else{_0x11e739='http://localhost:9000';}_0x3a9f26=typeof _0x1455db['address'][_0x35ad('0x37')](',')[_0x35ad('0x6d')](function(_0x1c803b){return wildcardUtils[_0x35ad('0x114')](_0x1c803b,_0x11e739);})!=='undefined';var _0x4eaac3={'chatVersion':_0x305e75,'chatWebsiteAddressOrigin':_0x3a9f26?_0x11e739:_0x1455db[_0x35ad('0x63')],'remote':_0x1455db['remote'],'query':querystring[_0x35ad('0x45')](_['merge'](_0x1455db[_0x35ad('0x2b')]({'plain':!![]}),{'customerIp':_0x5b4423[_0x35ad('0xb6')]['x-forwarded-for']||_0x5b4423['headers'][_0x35ad('0x115')]||_0x5b4423[_0x35ad('0x116')][_0x35ad('0x117')]||_0x5b4423['ip'],'referer':_0x5b4423['headers'][_0x35ad('0xb9')],'openedInteractions':_0x51ac94,'maxInteractions':_0x59f17c,'virtual':_0x3dedad[_0x35ad('0x10d')],'online':_0x199476,'custom':_0x3dedad,'address':_0x3a9f26?_0x11e739:null}))['replace'](/'/g,'\x5c\x27')};_0x472796[_0x35ad('0x2f')](ejs[_0x35ad('0x118')](Mustache['render'](_0x1f1579,_0x4eaac3),{'proactiveActions':_0x117be3,'alignment':_0x1455db[_0x35ad('0x119')],'verticalAlignment':_0x1455db[_0x35ad('0x11a')],'div_color':_0x1455db[_0x35ad('0x109')],'labelText':_0x1455db[_0x35ad('0x11b')],'text_color':_0x1455db[_0x35ad('0x11c')],'text_button_color':_0x1455db['textButtonColor'],'button_color':_0x1455db[_0x35ad('0x11d')],'background_color':_0x1455db[_0x35ad('0x11e')],'hideWhenOffline':_0x1455db[_0x35ad('0x11f')],'intervalId':_0x1455db[_0x35ad('0x120')],'isDevelopment':_0x1d759b,'chatVersion':_0x305e75}));})[_0x35ad('0x5f')](handleError(_0x472796,null));};exports[_0x35ad('0x121')]=function(_0x7c9e89,_0x1af0ce){var _0x16f4aa=_0x7c9e89[_0x35ad('0x60')]['id'];var _0x26b5c6=_0x7c9e89['body'];var _0x336f22=0xc8;var _0x21a8f8=null;return db['sequelize'][_0x35ad('0xec')]({'isolationLevel':db[_0x35ad('0xeb')][_0x35ad('0x122')][_0x35ad('0x123')]['READ_COMMITTED']},function(_0x52a70f){return db[_0x35ad('0x5b')][_0x35ad('0x73')]({'where':{'id':_0x16f4aa},'transaction':_0x52a70f})[_0x35ad('0x19')](function(_0x5ae3ce){if(_0x5ae3ce){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x16f4aa},'transaction':_0x52a70f})['then'](function(){var _0x183474=_[_0x35ad('0x49')](_0x26b5c6,function(_0x319076){_0x319076['ChatWebsiteId']=_0x16f4aa;return _0x319076;});return db[_0x35ad('0x124')][_0x35ad('0xed')](_0x183474,{'transaction':_0x52a70f});});}else{_0x336f22=0x194;_0x21a8f8=[];}});})[_0x35ad('0x19')](function(){if(_0x336f22!==0x194){return db[_0x35ad('0x124')][_0x35ad('0x125')]({'where':{'ChatWebsiteId':_0x16f4aa},'order':_0x35ad('0xaf')})[_0x35ad('0x19')](function(_0x40ec18){_0x21a8f8=_0x40ec18;});}})[_0x35ad('0x5f')](function(_0x2a36a1){_0x336f22=0x1f4;logger[_0x35ad('0x1e')](_0x2a36a1[_0x35ad('0x2e')]);if(_0x2a36a1[_0x35ad('0x3b')]){delete _0x2a36a1['name'];}_0x21a8f8=_0x2a36a1;})[_0x35ad('0x126')](function(){if(_0x21a8f8===null){_0x1af0ce[_0x35ad('0x22')](_0x336f22);}else{if(_0x336f22===0x1f4){_0x1af0ce[_0x35ad('0x23')](_0x336f22)[_0x35ad('0x2f')](_0x21a8f8);}else{_0x1af0ce['status'](_0x336f22)[_0x35ad('0x25')](_0x21a8f8);}}});};exports['getApplications']=function(_0x54b56b,_0xd8fb4){var _0x576355={};var _0x3b1208={};var _0x2e4f2d;var _0x496a5d;return db[_0x35ad('0x5b')][_0x35ad('0x73')]({'where':{'id':_0x54b56b[_0x35ad('0x60')]['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0xd8fb4,null))[_0x35ad('0x19')](function(_0x513569){if(_0x513569){_0x2e4f2d=_0x513569;_0x3b1208[_0x35ad('0x41')]=_[_0x35ad('0x4d')](db[_0x35ad('0x124')]['rawAttributes']);_0x3b1208[_0x35ad('0x4c')]=_[_0x35ad('0x4d')](_0x54b56b[_0x35ad('0x4c')]);_0x3b1208[_0x35ad('0x4e')]=_['intersection'](_0x3b1208[_0x35ad('0x41')],_0x3b1208[_0x35ad('0x4c')]);_0x576355[_0x35ad('0x50')]=_[_0x35ad('0x4f')](_0x3b1208[_0x35ad('0x41')],qs[_0x35ad('0x51')](_0x54b56b[_0x35ad('0x4c')][_0x35ad('0x51')]));_0x576355[_0x35ad('0x50')]=_0x576355[_0x35ad('0x50')]['length']?_0x576355[_0x35ad('0x50')]:_0x3b1208['model'];_0x576355[_0x35ad('0x54')]=qs[_0x35ad('0x55')](_0x54b56b['query']['sort']);_0x576355['where']=qs[_0x35ad('0x4e')](_['pick'](_0x54b56b['query'],_0x3b1208[_0x35ad('0x4e')]));if(_0x54b56b['query'][_0x35ad('0x59')]){_0x576355[_0x35ad('0x56')]=_[_0x35ad('0x58')](_0x576355[_0x35ad('0x56')],{'$or':_[_0x35ad('0x49')](_0x576355['attributes'],function(_0xbb801){var _0x370996={};_0x370996[_0xbb801]={'$like':'%'+_0x54b56b['query'][_0x35ad('0x59')]+'%'};return _0x370996;})});}_0x576355=_['merge']({},_0x576355,_0x54b56b['options']);return _0x2e4f2d[_0x35ad('0x127')](_0x576355);}})[_0x35ad('0x19')](function(_0x30728d){if(_0x30728d){_0x496a5d=_0x30728d[_0x35ad('0x52')];if(!_0x54b56b[_0x35ad('0x4c')][_0x35ad('0x75')](_0x35ad('0x53'))){_0x576355[_0x35ad('0x28')]=qs[_0x35ad('0x28')](_0x54b56b[_0x35ad('0x4c')][_0x35ad('0x28')]);_0x576355[_0x35ad('0x26')]=qs[_0x35ad('0x26')](_0x54b56b[_0x35ad('0x4c')][_0x35ad('0x26')]);}return _0x2e4f2d['getApplications'](_0x576355);}})['then'](function(_0x4ebeb5){if(_0x4ebeb5){return _0x4ebeb5?{'count':_0x496a5d,'rows':_0x4ebeb5}:null;}})[_0x35ad('0x19')](respondWithResult(_0xd8fb4,null))[_0x35ad('0x5f')](handleError(_0xd8fb4,null));};exports[_0x35ad('0x128')]=function(_0x7d16de,_0x1de368){return db[_0x35ad('0x129')][_0x35ad('0x6d')]({'where':{'id':_0x7d16de['params']['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x1de368,null))[_0x35ad('0x19')](function(_0x1293e9){if(_0x1293e9){return _0x1293e9[_0x35ad('0x128')](_0x7d16de[_0x35ad('0x68')][_0x35ad('0x7a')],_[_0x35ad('0x102')](_0x7d16de[_0x35ad('0x68')],[_0x35ad('0x7a'),'id'])||{});}})[_0x35ad('0x19')](respondWithResult(_0x1de368,null))['catch'](handleError(_0x1de368,null));};exports['getProactiveActions']=function(_0x49c46f,_0x48bc36){var _0x518711={};var _0x2dfe5c={};var _0x259a7a;var _0x4c47cb;return db[_0x35ad('0x5b')]['findOne']({'where':{'id':_0x49c46f[_0x35ad('0x60')]['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x48bc36,null))['then'](function(_0x2e0776){if(_0x2e0776){_0x259a7a=_0x2e0776;_0x2dfe5c[_0x35ad('0x41')]=_[_0x35ad('0x4d')](db['ChatProactiveAction'][_0x35ad('0x4a')]);_0x2dfe5c['query']=_[_0x35ad('0x4d')](_0x49c46f['query']);_0x2dfe5c[_0x35ad('0x4e')]=_[_0x35ad('0x4f')](_0x2dfe5c[_0x35ad('0x41')],_0x2dfe5c[_0x35ad('0x4c')]);_0x518711[_0x35ad('0x50')]=_['intersection'](_0x2dfe5c[_0x35ad('0x41')],qs['fields'](_0x49c46f[_0x35ad('0x4c')][_0x35ad('0x51')]));_0x518711['attributes']=_0x518711[_0x35ad('0x50')]['length']?_0x518711[_0x35ad('0x50')]:_0x2dfe5c[_0x35ad('0x41')];_0x518711[_0x35ad('0x54')]=qs[_0x35ad('0x55')](_0x49c46f[_0x35ad('0x4c')][_0x35ad('0x55')]);_0x518711[_0x35ad('0x56')]=qs[_0x35ad('0x4e')](_[_0x35ad('0x57')](_0x49c46f[_0x35ad('0x4c')],_0x2dfe5c[_0x35ad('0x4e')]));if(_0x49c46f[_0x35ad('0x4c')][_0x35ad('0x59')]){_0x518711[_0x35ad('0x56')]=_[_0x35ad('0x58')](_0x518711['where'],{'$or':_[_0x35ad('0x49')](_0x518711['attributes'],function(_0xfc554f){var _0x29ae9c={};_0x29ae9c[_0xfc554f]={'$like':'%'+_0x49c46f['query'][_0x35ad('0x59')]+'%'};return _0x29ae9c;})});}_0x518711=_[_0x35ad('0x58')]({},_0x518711,_0x49c46f[_0x35ad('0x5a')]);return _0x259a7a[_0x35ad('0x12a')](_0x518711);}})[_0x35ad('0x19')](function(_0x22baf8){if(_0x22baf8){_0x4c47cb=_0x22baf8['length'];if(!_0x49c46f[_0x35ad('0x4c')][_0x35ad('0x75')]('nolimit')){_0x518711[_0x35ad('0x28')]=qs[_0x35ad('0x28')](_0x49c46f[_0x35ad('0x4c')][_0x35ad('0x28')]);_0x518711['offset']=qs[_0x35ad('0x26')](_0x49c46f[_0x35ad('0x4c')][_0x35ad('0x26')]);}return _0x259a7a[_0x35ad('0x12a')](_0x518711);}})[_0x35ad('0x19')](function(_0x681307){if(_0x681307){return _0x681307?{'count':_0x4c47cb,'rows':_0x681307}:null;}})[_0x35ad('0x19')](respondWithResult(_0x48bc36,null))[_0x35ad('0x5f')](handleError(_0x48bc36,null));};exports[_0x35ad('0x12b')]=function(_0x1023f9,_0x505c4e){var _0x2570a4=_0x1023f9[_0x35ad('0x4c')][_0x35ad('0x12c')]===_0x35ad('0x12d')?_0x35ad('0x12e'):_0x35ad('0x12f');return db[_0x35ad('0x5b')][_0x35ad('0x6d')]({'attributes':['id',_0x2570a4],'where':{'id':_0x1023f9[_0x35ad('0x60')]['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x505c4e,null))[_0x35ad('0x19')](function(_0x45ed9b){if(_0x45ed9b){var _0x2a72c4=_0x45ed9b[_0x2570a4];var _0x33614a=_0x2a72c4&&_0x2a72c4[_0x35ad('0x130')]?_0x2a72c4[_0x35ad('0x130')]:[];_0x505c4e['send']({'fromKey':_['isNil'](_0x2a72c4[_0x35ad('0x131')])?undefined:_0x2a72c4[_0x35ad('0x131')],'count':_0x33614a[_0x35ad('0x52')],'rows':_0x33614a});}})[_0x35ad('0x5f')](handleError(_0x505c4e,null));};exports[_0x35ad('0x132')]=function(_0x286eaf,_0x5dbaf8){var _0x4f3669={'raw':![],'where':{}};var _0x450e30={};var _0x15e7f0={'count':0x0,'rows':[]};return db[_0x35ad('0x5b')][_0x35ad('0x73')]({'where':{'id':_0x286eaf[_0x35ad('0x60')]['id']}})['then'](handleEntityNotFound(_0x5dbaf8,null))[_0x35ad('0x19')](function(_0x2727d6){if(_0x2727d6){_0x450e30['model']=_[_0x35ad('0x4d')](db[_0x35ad('0x133')][_0x35ad('0x4a')]);_0x450e30[_0x35ad('0x4c')]=_[_0x35ad('0x4d')](_0x286eaf[_0x35ad('0x4c')]);_0x450e30[_0x35ad('0x4e')]=_['intersection'](_0x450e30[_0x35ad('0x41')],_0x450e30[_0x35ad('0x4c')]);_0x4f3669['attributes']=_[_0x35ad('0x4f')](_0x450e30[_0x35ad('0x41')],qs[_0x35ad('0x51')](_0x286eaf[_0x35ad('0x4c')]['fields']));_0x4f3669[_0x35ad('0x50')]=_0x4f3669['attributes'][_0x35ad('0x52')]?_0x4f3669[_0x35ad('0x50')]:_0x450e30[_0x35ad('0x41')];if(!_0x286eaf[_0x35ad('0x4c')][_0x35ad('0x75')](_0x35ad('0x53'))){_0x4f3669[_0x35ad('0x28')]=qs['limit'](_0x286eaf[_0x35ad('0x4c')][_0x35ad('0x28')]);_0x4f3669['offset']=qs[_0x35ad('0x26')](_0x286eaf[_0x35ad('0x4c')]['offset']);}_0x4f3669[_0x35ad('0x54')]=qs[_0x35ad('0x55')](_0x286eaf[_0x35ad('0x4c')][_0x35ad('0x55')]);_0x4f3669[_0x35ad('0x56')]=qs['filters'](_[_0x35ad('0x57')](_0x286eaf[_0x35ad('0x4c')],_0x450e30['filters']));_0x4f3669['where'][_0x35ad('0x72')]=_0x2727d6['id'];if(_0x286eaf[_0x35ad('0x4c')][_0x35ad('0x59')]){_0x4f3669['where']=_[_0x35ad('0x58')](_0x4f3669[_0x35ad('0x56')],{'$or':_[_0x35ad('0x49')](_0x4f3669[_0x35ad('0x50')],function(_0x227b62){var _0x37f51a={};_0x37f51a[_0x227b62]={'$like':'%'+_0x286eaf['query'][_0x35ad('0x59')]+'%'};return _0x37f51a;})});}_0x4f3669=_['merge']({},_0x4f3669,_0x286eaf[_0x35ad('0x5a')]);return db['ChatOfflineMessage'][_0x35ad('0x5c')]({'where':_0x4f3669['where']})[_0x35ad('0x19')](function(_0x183d4c){_0x15e7f0['count']=_0x183d4c;if(_0x286eaf[_0x35ad('0x4c')][_0x35ad('0x5d')]){_0x4f3669[_0x35ad('0x61')]=[{'all':!![]}];}else{_0x4f3669[_0x35ad('0x61')]=[{'model':db['CmContact'],'as':_0x35ad('0x103'),'required':![]},{'model':db[_0x35ad('0x134')],'as':_0x35ad('0x135'),'required':![]}];}return db[_0x35ad('0x133')][_0x35ad('0x5e')](_0x4f3669);})['then'](function(_0x3760e3){_0x15e7f0[_0x35ad('0x76')]=_0x3760e3;return _0x15e7f0;});}})['then'](respondWithFilteredResult(_0x5dbaf8,_0x4f3669))['catch'](handleError(_0x5dbaf8,null));};exports[_0x35ad('0x136')]=function(_0x8f00c5,_0x1af22e){return db[_0x35ad('0x5b')]['find']({'where':{'id':_0x8f00c5[_0x35ad('0x60')]['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x1af22e,null))[_0x35ad('0x19')](function(_0xe7a305){if(_0xe7a305){return _0xe7a305['addAgents'](_0x8f00c5[_0x35ad('0x68')]['ids'],_[_0x35ad('0x102')](_0x8f00c5['body'],[_0x35ad('0x7a'),'id'])||{})['spread'](function(_0x55325e){for(var _0x4c591e=0x0;_0x4c591e<_0x8f00c5[_0x35ad('0x68')][_0x35ad('0x7a')]['length'];_0x4c591e+=0x1){socket[_0x35ad('0x137')](_0x35ad('0x138'),{'UserId':Number(_0x8f00c5['body'][_0x35ad('0x7a')][_0x4c591e]),'ChatWebsiteId':Number(_0x8f00c5[_0x35ad('0x60')]['id'])});}return _0x55325e;});}})[_0x35ad('0x19')](respondWithResult(_0x1af22e,null))[_0x35ad('0x5f')](handleError(_0x1af22e,null));};exports[_0x35ad('0x139')]=function(_0x33a3be,_0x49b8a8){return db['ChatWebsite'][_0x35ad('0x6d')]({'where':{'id':_0x33a3be[_0x35ad('0x60')]['id']}})['then'](handleEntityNotFound(_0x49b8a8,null))[_0x35ad('0x19')](function(_0x40f956){if(_0x40f956){return _0x40f956[_0x35ad('0x139')](_0x33a3be['query'][_0x35ad('0x7a')])[_0x35ad('0x19')](function(){if(_[_0x35ad('0x13a')](_0x33a3be['query'][_0x35ad('0x7a')])){for(var _0x4405af=0x0;_0x4405af<_0x33a3be[_0x35ad('0x4c')][_0x35ad('0x7a')][_0x35ad('0x52')];_0x4405af+=0x1){socket['emit'](_0x35ad('0x13b'),{'UserId':Number(_0x33a3be['query'][_0x35ad('0x7a')][_0x4405af]),'ChatWebsiteId':Number(_0x33a3be[_0x35ad('0x60')]['id'])});}}else{socket[_0x35ad('0x137')](_0x35ad('0x13b'),{'UserId':Number(_0x33a3be[_0x35ad('0x4c')][_0x35ad('0x7a')]),'ChatWebsiteId':Number(_0x33a3be['params']['id'])});}});}})[_0x35ad('0x19')](respondWithStatusCode(_0x49b8a8,null))[_0x35ad('0x5f')](handleError(_0x49b8a8,null));};exports[_0x35ad('0x13c')]=function(_0x2d94ce,_0x553f66){var _0xa11b01={};var _0x5bf0cf={};var _0x144961;var _0x4edb81;return db[_0x35ad('0x5b')]['findOne']({'where':{'id':_0x2d94ce[_0x35ad('0x60')]['id']}})[_0x35ad('0x19')](handleEntityNotFound(_0x553f66,null))[_0x35ad('0x19')](function(_0x38ed1e){if(_0x38ed1e){_0x144961=_0x38ed1e;_0x5bf0cf['model']=_[_0x35ad('0x4d')](db[_0x35ad('0xca')][_0x35ad('0x4a')]);_0x5bf0cf[_0x35ad('0x4c')]=_[_0x35ad('0x4d')](_0x2d94ce['query']);_0x5bf0cf[_0x35ad('0x4e')]=_[_0x35ad('0x4f')](_0x5bf0cf[_0x35ad('0x41')],_0x5bf0cf[_0x35ad('0x4c')]);_0xa11b01['attributes']=_[_0x35ad('0x4f')](_0x5bf0cf[_0x35ad('0x41')],qs[_0x35ad('0x51')](_0x2d94ce[_0x35ad('0x4c')][_0x35ad('0x51')]));_0xa11b01[_0x35ad('0x50')]=_0xa11b01['attributes'][_0x35ad('0x52')]?_0xa11b01[_0x35ad('0x50')]:_0x5bf0cf[_0x35ad('0x41')];_0xa11b01[_0x35ad('0x54')]=qs['sort'](_0x2d94ce['query'][_0x35ad('0x55')]);_0xa11b01['where']=qs[_0x35ad('0x4e')](_[_0x35ad('0x57')](_0x2d94ce['query'],_0x5bf0cf[_0x35ad('0x4e')]));if(_0x2d94ce[_0x35ad('0x4c')][_0x35ad('0x59')]){_0xa11b01[_0x35ad('0x56')]=_[_0x35ad('0x58')](_0xa11b01[_0x35ad('0x56')],{'$or':_[_0x35ad('0x49')](_0xa11b01[_0x35ad('0x50')],function(_0x4c82cc){var _0x41778b={};_0x41778b[_0x4c82cc]={'$like':'%'+_0x2d94ce[_0x35ad('0x4c')][_0x35ad('0x59')]+'%'};return _0x41778b;})});}_0xa11b01=_['merge']({},_0xa11b01,_0x2d94ce[_0x35ad('0x5a')]);return _0x144961[_0x35ad('0x13c')](_0xa11b01);}})[_0x35ad('0x19')](function(_0x1645f4){if(_0x1645f4){_0x4edb81=_0x1645f4[_0x35ad('0x52')];if(!_0x2d94ce['query']['hasOwnProperty'](_0x35ad('0x53'))){_0xa11b01[_0x35ad('0x28')]=qs[_0x35ad('0x28')](_0x2d94ce[_0x35ad('0x4c')]['limit']);_0xa11b01[_0x35ad('0x26')]=qs['offset'](_0x2d94ce[_0x35ad('0x4c')][_0x35ad('0x26')]);}return _0x144961[_0x35ad('0x13c')](_0xa11b01);}})['then'](function(_0x53027b){if(_0x53027b){return _0x53027b?{'count':_0x4edb81,'rows':_0x53027b}:null;}})[_0x35ad('0x19')](respondWithResult(_0x553f66,null))[_0x35ad('0x5f')](handleError(_0x553f66,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 1f8f9b8..e967d22 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 _0x1af5=['emit','hasOwnProperty','hook','events','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0xd04611,_0x6f7365){var _0x72e2db=function(_0x349948){while(--_0x349948){_0xd04611['push'](_0xd04611['shift']());}};_0x72e2db(++_0x6f7365);}(_0x1af5,0x17d));var _0x51af=function(_0x53199e,_0x58c424){_0x53199e=_0x53199e-0x0;var _0x2cb521=_0x1af5[_0x53199e];return _0x2cb521;};'use strict';var EventEmitter=require(_0x51af('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x51af('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x51af('0x2')](0x0);var events={'afterCreate':_0x51af('0x3'),'afterUpdate':_0x51af('0x4'),'afterDestroy':_0x51af('0x5')};function emitEvent(_0x3fa933){return function(_0x3e09ac,_0x1ef226,_0x115556){ChatWebsiteEvents[_0x51af('0x6')](_0x3fa933+':'+_0x3e09ac['id'],_0x3e09ac);ChatWebsiteEvents[_0x51af('0x6')](_0x3fa933,_0x3e09ac);_0x115556(null);};}for(var e in events){if(events[_0x51af('0x7')](e)){var event=events[e];ChatWebsite[_0x51af('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4989=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x31c480,_0x13f64a){var _0x3687ce=function(_0x46fbc0){while(--_0x46fbc0){_0x31c480['push'](_0x31c480['shift']());}};_0x3687ce(++_0x13f64a);}(_0x4989,0x79));var _0x9498=function(_0x1e744a,_0xa8fdb1){_0x1e744a=_0x1e744a-0x0;var _0x1ac4d0=_0x4989[_0x1e744a];return _0x1ac4d0;};'use strict';var EventEmitter=require(_0x9498('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9498('0x1')](0x0);var events={'afterCreate':_0x9498('0x2'),'afterUpdate':_0x9498('0x3'),'afterDestroy':_0x9498('0x4')};function emitEvent(_0x5953c0){return function(_0x55fabb,_0x84ed1b,_0x47922b){ChatWebsiteEvents[_0x9498('0x5')](_0x5953c0+':'+_0x55fabb['id'],_0x55fabb);ChatWebsiteEvents[_0x9498('0x5')](_0x5953c0,_0x55fabb);_0x47922b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x9498('0x6')](e,emitEvent(event));}}module[_0x9498('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 01a53e8..f198cf2 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 _0xf7e2=['../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x485038,_0x3e26e8){var _0xa87ace=function(_0x1cf247){while(--_0x1cf247){_0x485038['push'](_0x485038['shift']());}};_0xa87ace(++_0x3e26e8);}(_0xf7e2,0x119));var _0x2f7e=function(_0x3930a0,_0xf416c0){_0x3930a0=_0x3930a0-0x0;var _0x11c08f=_0xf7e2[_0x3930a0];return _0x11c08f;};'use strict';var _=require(_0x2f7e('0x0'));var util=require(_0x2f7e('0x1'));var logger=require(_0x2f7e('0x2'))(_0x2f7e('0x3'));var moment=require('moment');var BPromise=require(_0x2f7e('0x4'));var rp=require(_0x2f7e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f7e('0x6'));var config=require(_0x2f7e('0x7'));var attributes=require(_0x2f7e('0x8'));module['exports']=function(_0x52b464,_0xdc7705){return _0x52b464[_0x2f7e('0x9')](_0x2f7e('0xa'),attributes,{'tableName':_0x2f7e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x44ce=['exports','ChatWebsite','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatWebsite.attributes'];(function(_0x16294f,_0x2b591d){var _0x2086f7=function(_0x38ea30){while(--_0x38ea30){_0x16294f['push'](_0x16294f['shift']());}};_0x2086f7(++_0x2b591d);}(_0x44ce,0x10a));var _0xe44c=function(_0x4cec57,_0x98c58a){_0x4cec57=_0x4cec57-0x0;var _0x18b817=_0x44ce[_0x4cec57];return _0x18b817;};'use strict';var _=require(_0xe44c('0x0'));var util=require(_0xe44c('0x1'));var logger=require(_0xe44c('0x2'))(_0xe44c('0x3'));var moment=require(_0xe44c('0x4'));var BPromise=require('bluebird');var rp=require(_0xe44c('0x5'));var fs=require('fs');var path=require(_0xe44c('0x6'));var rimraf=require('rimraf');var config=require(_0xe44c('0x7'));var attributes=require(_0xe44c('0x8'));module[_0xe44c('0x9')]=function(_0x186c3c,_0x583e15){return _0x186c3c['define'](_0xe44c('0xa'),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 6f1c9c5..f773c26 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 _0xb931=['request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x2c044c,_0x217c40){var _0x2144a0=function(_0x3a4696){while(--_0x3a4696){_0x2c044c['push'](_0x2c044c['shift']());}};_0x2144a0(++_0x217c40);}(_0xb931,0x97));var _0x1b93=function(_0x2e706a,_0x49c551){_0x2e706a=_0x2e706a-0x0;var _0xfdc71c=_0xb931[_0x2e706a];return _0xfdc71c;};'use strict';var _=require(_0x1b93('0x0'));var util=require(_0x1b93('0x1'));var moment=require(_0x1b93('0x2'));var BPromise=require(_0x1b93('0x3'));var rs=require(_0x1b93('0x4'));var fs=require('fs');var Redis=require(_0x1b93('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b93('0x6'));var logger=require(_0x1b93('0x7'))(_0x1b93('0x8'));var config=require('../../config/environment');var jayson=require(_0x1b93('0x9'));var client=jayson[_0x1b93('0xa')][_0x1b93('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1b93('0xc')],{'host':_0x1b93('0xd'),'port':0x18eb});var socket=require(_0x1b93('0xe'))(new Redis(config[_0x1b93('0xc')]));require(_0x1b93('0xf'))[_0x1b93('0x10')](socket);function respondWithRpcPromise(_0x430927,_0x3b7208,_0x38e3dc){return new BPromise(function(_0x3e5d4b,_0x42ebf2){return client[_0x1b93('0x11')](_0x430927,_0x38e3dc)[_0x1b93('0x12')](function(_0x16025f){logger[_0x1b93('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x3b7208,_0x1b93('0x14'));logger[_0x1b93('0x15')](_0x1b93('0x16'),_0x3b7208,'request\x20sent',JSON[_0x1b93('0x17')](_0x16025f));if(_0x16025f[_0x1b93('0x18')]){if(_0x16025f[_0x1b93('0x18')]['code']===0x1f4){logger[_0x1b93('0x18')](_0x1b93('0x19'),_0x3b7208,_0x16025f['error'][_0x1b93('0x1a')]);return _0x42ebf2(_0x16025f['error'][_0x1b93('0x1a')]);}logger['error'](_0x1b93('0x19'),_0x3b7208,_0x16025f['error'][_0x1b93('0x1a')]);return _0x3e5d4b(_0x16025f['error'][_0x1b93('0x1a')]);}else{logger[_0x1b93('0x13')](_0x1b93('0x19'),_0x3b7208,_0x1b93('0x14'));_0x3e5d4b(_0x16025f['result'][_0x1b93('0x1a')]);}})[_0x1b93('0x1b')](function(_0x2c497d){logger[_0x1b93('0x18')](_0x1b93('0x19'),_0x3b7208,_0x2c497d);_0x42ebf2(_0x2c497d);});});}
\ No newline at end of file
+var _0x5d6c=['client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x368a3e,_0x47b292){var _0x3cb213=function(_0x1c283d){while(--_0x1c283d){_0x368a3e['push'](_0x368a3e['shift']());}};_0x3cb213(++_0x47b292);}(_0x5d6c,0x149));var _0xc5d6=function(_0x1db5cf,_0x25c3a4){_0x1db5cf=_0x1db5cf-0x0;var _0x931fe5=_0x5d6c[_0x1db5cf];return _0x931fe5;};'use strict';var _=require(_0xc5d6('0x0'));var util=require(_0xc5d6('0x1'));var moment=require(_0xc5d6('0x2'));var BPromise=require('bluebird');var rs=require(_0xc5d6('0x3'));var fs=require('fs');var Redis=require(_0xc5d6('0x4'));var db=require(_0xc5d6('0x5'))['db'];var utils=require(_0xc5d6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc5d6('0x7'));var jayson=require(_0xc5d6('0x8'));var client=jayson[_0xc5d6('0x9')]['http']({'port':0x232a});config[_0xc5d6('0xa')]=_[_0xc5d6('0xb')](config[_0xc5d6('0xa')],{'host':_0xc5d6('0xc'),'port':0x18eb});var socket=require(_0xc5d6('0xd'))(new Redis(config[_0xc5d6('0xa')]));require(_0xc5d6('0xe'))['register'](socket);function respondWithRpcPromise(_0x5b438c,_0x2f05bc,_0x39c4bb){return new BPromise(function(_0xc6204f,_0x37063f){return client[_0xc5d6('0xf')](_0x5b438c,_0x39c4bb)[_0xc5d6('0x10')](function(_0x3cccb8){logger[_0xc5d6('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x2f05bc,'request\x20sent');logger[_0xc5d6('0x12')](_0xc5d6('0x13'),_0x2f05bc,_0xc5d6('0x14'),JSON['stringify'](_0x3cccb8));if(_0x3cccb8[_0xc5d6('0x15')]){if(_0x3cccb8['error'][_0xc5d6('0x16')]===0x1f4){logger[_0xc5d6('0x15')](_0xc5d6('0x17'),_0x2f05bc,_0x3cccb8[_0xc5d6('0x15')][_0xc5d6('0x18')]);return _0x37063f(_0x3cccb8[_0xc5d6('0x15')][_0xc5d6('0x18')]);}logger[_0xc5d6('0x15')](_0xc5d6('0x17'),_0x2f05bc,_0x3cccb8[_0xc5d6('0x15')]['message']);return _0xc6204f(_0x3cccb8[_0xc5d6('0x15')][_0xc5d6('0x18')]);}else{logger[_0xc5d6('0x11')](_0xc5d6('0x17'),_0x2f05bc,_0xc5d6('0x14'));_0xc6204f(_0x3cccb8['result'][_0xc5d6('0x18')]);}})[_0xc5d6('0x19')](function(_0x45c8fe){logger[_0xc5d6('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x2f05bc,_0x45c8fe);_0x37063f(_0x45c8fe);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e057110..48e3614 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 _0x0bc3=['register','length','chatWebsite:','save','remove','update','removeListener'];(function(_0x4b0830,_0x2e3b0a){var _0x1f53a7=function(_0x4b5503){while(--_0x4b5503){_0x4b0830['push'](_0x4b0830['shift']());}};_0x1f53a7(++_0x2e3b0a);}(_0x0bc3,0x1b5));var _0x30bc=function(_0x2b0be8,_0x404bc5){_0x2b0be8=_0x2b0be8-0x0;var _0x423f1d=_0x0bc3[_0x2b0be8];return _0x423f1d;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x30bc('0x0'),_0x30bc('0x1'),_0x30bc('0x2')];function createListener(_0x3f2894,_0x53998e){return function(_0x5a0318){_0x53998e['emit'](_0x3f2894,_0x5a0318);};}function removeListener(_0x369b55,_0x5b0036){return function(){ChatWebsiteEvents[_0x30bc('0x3')](_0x369b55,_0x5b0036);};}exports[_0x30bc('0x4')]=function(_0x3ce35c){for(var _0x4c8074=0x0,_0xf762f=events[_0x30bc('0x5')];_0x4c8074<_0xf762f;_0x4c8074++){var _0x31bac9=events[_0x4c8074];var _0x5aacb5=createListener(_0x30bc('0x6')+_0x31bac9,_0x3ce35c);ChatWebsiteEvents['on'](_0x31bac9,_0x5aacb5);}};
\ No newline at end of file
+var _0xbe06=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x4df9d4,_0x5d3644){var _0x301a8b=function(_0x5d0113){while(--_0x5d0113){_0x4df9d4['push'](_0x4df9d4['shift']());}};_0x301a8b(++_0x5d3644);}(_0xbe06,0x1b4));var _0x6be0=function(_0x27d621,_0x1b4ab0){_0x27d621=_0x27d621-0x0;var _0x1911b7=_0xbe06[_0x27d621];return _0x1911b7;};'use strict';var ChatWebsiteEvents=require(_0x6be0('0x0'));var events=[_0x6be0('0x1'),_0x6be0('0x2'),_0x6be0('0x3')];function createListener(_0x4f8dcc,_0x4b3269){return function(_0x166c0b){_0x4b3269['emit'](_0x4f8dcc,_0x166c0b);};}function removeListener(_0x4d6f5e,_0x164f6c){return function(){ChatWebsiteEvents[_0x6be0('0x4')](_0x4d6f5e,_0x164f6c);};}exports[_0x6be0('0x5')]=function(_0x2c2369){for(var _0x2ee2ea=0x0,_0x1e7956=events[_0x6be0('0x6')];_0x2ee2ea<_0x1e7956;_0x2ee2ea++){var _0x3a69ba=events[_0x2ee2ea];var _0x33afb4=createListener(_0x6be0('0x7')+_0x3a69ba,_0x2c2369);ChatWebsiteEvents['on'](_0x3a69ba,_0x33afb4);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index 62bfd6c..9c58534 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf108=['exports','../../../utils/misc','url','URL','test','trim','replace','([\x5cw]+)'];(function(_0x2dd25a,_0x473907){var _0x59f26c=function(_0x4d2253){while(--_0x4d2253){_0x2dd25a['push'](_0x2dd25a['shift']());}};_0x59f26c(++_0x473907);}(_0xf108,0x1d9));var _0x8f10=function(_0x558cd0,_0x333581){_0x558cd0=_0x558cd0-0x0;var _0x5ac038=_0xf108[_0x558cd0];return _0x5ac038;};var escapeRegExp=require(_0x8f10('0x0'))['escapeRegExp'];var URL=require(_0x8f10('0x1'))[_0x8f10('0x2')];function testWildcardValidity(_0x19096f){var _0x4d49e8=!![];try{new URL(_0x19096f['replace']('*','localhost'));}catch(_0x440ee7){_0x4d49e8=![];}return _0x4d49e8&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x8f10('0x3')](_0x19096f);}function testWebsiteWithWildcard(_0x511ab7,_0x30a472){var _0x2e3419;var _0x235737=escapeRegExp(_0x511ab7[_0x8f10('0x4')]()[_0x8f10('0x5')](/\/$/,''))[_0x8f10('0x5')]('\x5c*',_0x8f10('0x6'));try{new URL(_0x511ab7[_0x8f10('0x5')]('\x5c*','localhost'));_0x2e3419=new RegExp(_0x235737)[_0x8f10('0x3')](_0x30a472);}catch(_0x1787d2){_0x2e3419=![];}return _0x2e3419;}module[_0x8f10('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0xb44a=['url','localhost','test','trim','replace','([\x5cw]+)'];(function(_0x5cdc9f,_0xa89ea5){var _0x4e9327=function(_0x1ad213){while(--_0x1ad213){_0x5cdc9f['push'](_0x5cdc9f['shift']());}};_0x4e9327(++_0xa89ea5);}(_0xb44a,0x1c2));var _0xab44=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xb44a[_0x25bca6];return _0x3f8d02;};var escapeRegExp=require('../../../utils/misc')['escapeRegExp'];var URL=require(_0xab44('0x0'))['URL'];function testWildcardValidity(_0x186fec){var _0x5c825d=!![];try{new URL(_0x186fec['replace']('*',_0xab44('0x1')));}catch(_0x5c93b4){_0x5c825d=![];}return _0x5c825d&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xab44('0x2')](_0x186fec);}function testWebsiteWithWildcard(_0x32396c,_0x2e3662){var _0x28681a;var _0x2f3948=escapeRegExp(_0x32396c[_0xab44('0x3')]()[_0xab44('0x4')](/\/$/,''))[_0xab44('0x4')]('\x5c*',_0xab44('0x5'));try{new URL(_0x32396c[_0xab44('0x4')]('\x5c*',_0xab44('0x1')));_0x28681a=new RegExp(_0x2f3948)[_0xab44('0x2')](_0x2e3662);}catch(_0xa14367){_0x28681a=![];}return _0x28681a;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7047d09..9783bf4 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 _0x6520=['server/files/images/avatars/','%s-%s','/:id/avatar','addAvatar','single','addSystemAvatar','/:id/notify','notify','offline-chat','replace','offline','/:id/interactions','addInteraction','addProactiveActions','/:id/users','put','update','delete','removeDispositions','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','get','isAuthenticated','describe','/:id','show','getDispositions','getAnswers','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','getSnippet','/:id/applications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','format','now','originalname','/:id/logo','file','join'];(function(_0x455ccb,_0x5fe7cd){var _0xbb3bb5=function(_0x41203e){while(--_0x41203e){_0x455ccb['push'](_0x455ccb['shift']());}};_0xbb3bb5(++_0x5fe7cd);}(_0x6520,0x189));var _0x0652=function(_0x33444b,_0xd30d56){_0x33444b=_0x33444b-0x0;var _0x38f918=_0x6520[_0x33444b];return _0x38f918;};'use strict';var multer=require(_0x0652('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0652('0x1'));var express=require(_0x0652('0x2'));var router=express['Router']();var fs_extra=require(_0x0652('0x3'));var auth=require(_0x0652('0x4'));var interaction=require(_0x0652('0x5'));var config=require(_0x0652('0x6'));var controller=require(_0x0652('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0652('0x8')]);router[_0x0652('0x9')]('/describe',auth[_0x0652('0xa')](),controller[_0x0652('0xb')]);router[_0x0652('0x9')](_0x0652('0xc'),auth[_0x0652('0xa')](),controller[_0x0652('0xd')]);router[_0x0652('0x9')]('/:id/dispositions',auth[_0x0652('0xa')](),controller[_0x0652('0xe')]);router[_0x0652('0x9')]('/:id/canned_answers',auth[_0x0652('0xa')](),controller[_0x0652('0xf')]);router[_0x0652('0x9')]('/:id/logo',controller['getLogo']);router['get']('/:id/avatar',controller['getAvatar']);router[_0x0652('0x9')](_0x0652('0x10'),controller[_0x0652('0x11')]);router['get'](_0x0652('0x12'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x0652('0xa')](),controller[_0x0652('0x13')]);router[_0x0652('0x9')]('/:id/snippet',controller[_0x0652('0x14')]);router[_0x0652('0x9')](_0x0652('0x15'),auth[_0x0652('0xa')](),controller['getApplications']);router[_0x0652('0x9')]('/:id/proactive_actions',auth[_0x0652('0xa')](),controller[_0x0652('0x16')]);router[_0x0652('0x9')]('/:id/fields',controller[_0x0652('0x17')]);router[_0x0652('0x9')](_0x0652('0x18'),auth[_0x0652('0xa')](),controller[_0x0652('0x19')]);router['get']('/:id/users',auth[_0x0652('0xa')](),controller[_0x0652('0x1a')]);router['post']('/',auth[_0x0652('0xa')](),controller[_0x0652('0x1b')]);router[_0x0652('0x1c')](_0x0652('0x1d'),auth[_0x0652('0xa')](),controller[_0x0652('0x1e')]);router[_0x0652('0x1c')](_0x0652('0x1f'),auth[_0x0652('0xa')](),controller[_0x0652('0x20')]);var upload=multer({'storage':multer[_0x0652('0x21')]({'destination':function(_0x516ec5,_0x452b6b,_0x49a314){_0x49a314(null,path['join'](config[_0x0652('0x22')],'server/files/images/logos/'));},'filename':function(_0x128991,_0x122ccf,_0x53a61e){_0x53a61e(null,util[_0x0652('0x23')]('%s-%s',Date[_0x0652('0x24')](),_0x122ccf[_0x0652('0x25')]));}})});router[_0x0652('0x1c')](_0x0652('0x26'),upload['single'](_0x0652('0x27')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3abe46,_0x595522,_0x350fdc){_0x350fdc(null,path[_0x0652('0x28')](config['root'],_0x0652('0x29')));},'filename':function(_0x4c9cc6,_0x4718c5,_0x5b38c0){_0x5b38c0(null,util[_0x0652('0x23')](_0x0652('0x2a'),Date[_0x0652('0x24')](),_0x4718c5[_0x0652('0x25')]));}})});router['post'](_0x0652('0x2b'),upload['single'](_0x0652('0x27')),controller[_0x0652('0x2c')]);var upload=multer({'storage':multer[_0x0652('0x21')]({'destination':function(_0x4b15c9,_0x8ada00,_0x2bc1de){_0x2bc1de(null,path[_0x0652('0x28')](config[_0x0652('0x22')],_0x0652('0x29')));},'filename':function(_0x26c790,_0x3aab99,_0x2b9957){_0x2b9957(null,util[_0x0652('0x23')](_0x0652('0x2a'),Date[_0x0652('0x24')](),_0x3aab99['originalname']));}})});router['post'](_0x0652('0x10'),upload[_0x0652('0x2d')](_0x0652('0x27')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x595210,_0x2d1800,_0x300019){_0x300019(null,path[_0x0652('0x28')](config[_0x0652('0x22')],'server/files/images/avatars/'));},'filename':function(_0x149f06,_0x49a7f0,_0x5aa1a6){_0x5aa1a6(null,util[_0x0652('0x23')](_0x0652('0x2a'),Date[_0x0652('0x24')](),_0x49a7f0[_0x0652('0x25')]));}})});router[_0x0652('0x1c')](_0x0652('0x12'),upload[_0x0652('0x2d')](_0x0652('0x27')),controller[_0x0652('0x2e')]);router[_0x0652('0x1c')](_0x0652('0x2f'),controller[_0x0652('0x30')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x485b40,_0x4e543b,_0x56a26a){const _0x2dab92=path[_0x0652('0x28')](config[_0x0652('0x22')],'server/files','attachments',_0x0652('0x31'));fs_extra['ensureDir'](_0x2dab92,function(){_0x56a26a(null,_0x2dab92);});},'filename':function(_0x27ae47,_0x27d38a,_0x3a44ab){const _0x148ee3=_0x27d38a[_0x0652('0x25')][_0x0652('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x542a90=path['extname'](_0x148ee3);const _0x5f182c=Date['now']()+'-'+_0x148ee3[_0x0652('0x32')](_0x542a90,'')+_0x542a90;_0x3a44ab(null,_0x5f182c);}})});router[_0x0652('0x1c')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x0652('0x33')]);router[_0x0652('0x1c')](_0x0652('0x34'),auth['isAuthenticated'](),controller[_0x0652('0x35')]);router['post'](_0x0652('0x15'),auth[_0x0652('0xa')](),controller['addApplications']);router[_0x0652('0x1c')]('/:id/proactive_actions',auth[_0x0652('0xa')](),controller[_0x0652('0x36')]);router[_0x0652('0x1c')](_0x0652('0x37'),auth[_0x0652('0xa')](),controller['addAgents']);router[_0x0652('0x38')](_0x0652('0xc'),auth['isAuthenticated'](),controller[_0x0652('0x39')]);router[_0x0652('0x3a')](_0x0652('0xc'),auth[_0x0652('0xa')](),controller['destroy']);router[_0x0652('0x3a')](_0x0652('0x1d'),auth[_0x0652('0xa')](),controller[_0x0652('0x3b')]);router[_0x0652('0x3a')](_0x0652('0x1f'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x0652('0x3a')](_0x0652('0x37'),auth[_0x0652('0xa')](),controller[_0x0652('0x3c')]);module[_0x0652('0x3d')]=router;
\ No newline at end of file
+var _0x6c55=['addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','join','server/files/images/avatars/','addCustomerAvatar','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','/describe','get','show','/:id/dispositions','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create'];(function(_0x4cf0a9,_0x3dc400){var _0x359cad=function(_0x449d53){while(--_0x449d53){_0x4cf0a9['push'](_0x4cf0a9['shift']());}};_0x359cad(++_0x3dc400);}(_0x6c55,0xe1));var _0x56c5=function(_0x4b8980,_0x2559d8){_0x4b8980=_0x4b8980-0x0;var _0x2e93b4=_0x6c55[_0x4b8980];return _0x2e93b4;};'use strict';var multer=require(_0x56c5('0x0'));var util=require('util');var path=require(_0x56c5('0x1'));var timeout=require(_0x56c5('0x2'));var express=require(_0x56c5('0x3'));var router=express['Router']();var fs_extra=require(_0x56c5('0x4'));var auth=require(_0x56c5('0x5'));var interaction=require(_0x56c5('0x6'));var config=require('../../config/environment');var controller=require(_0x56c5('0x7'));router['get']('/',auth[_0x56c5('0x8')](),controller[_0x56c5('0x9')]);router['get'](_0x56c5('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x56c5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x56c5('0xc')]);router[_0x56c5('0xb')](_0x56c5('0xd'),auth[_0x56c5('0x8')](),controller['getDispositions']);router[_0x56c5('0xb')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x56c5('0xb')](_0x56c5('0xe'),controller[_0x56c5('0xf')]);router[_0x56c5('0xb')]('/:id/avatar',controller[_0x56c5('0x10')]);router[_0x56c5('0xb')](_0x56c5('0x11'),controller[_0x56c5('0x12')]);router[_0x56c5('0xb')](_0x56c5('0x13'),controller[_0x56c5('0x14')]);router[_0x56c5('0xb')](_0x56c5('0x15'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x16')]);router[_0x56c5('0xb')](_0x56c5('0x17'),controller['getSnippet']);router[_0x56c5('0xb')](_0x56c5('0x18'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x19')]);router[_0x56c5('0xb')](_0x56c5('0x1a'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x1b')]);router[_0x56c5('0xb')](_0x56c5('0x1c'),controller[_0x56c5('0x1d')]);router[_0x56c5('0xb')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x56c5('0x1e')]);router[_0x56c5('0xb')](_0x56c5('0x1f'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x20')]);router[_0x56c5('0x21')]('/',auth[_0x56c5('0x8')](),controller[_0x56c5('0x22')]);router[_0x56c5('0x21')](_0x56c5('0xd'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x23')]);router['post'](_0x56c5('0x24'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x25')]);var upload=multer({'storage':multer[_0x56c5('0x26')]({'destination':function(_0x3ce3c4,_0x5d899d,_0x5d12c8){_0x5d12c8(null,path['join'](config[_0x56c5('0x27')],_0x56c5('0x28')));},'filename':function(_0x1fec64,_0x3c62ce,_0x4895dc){_0x4895dc(null,util[_0x56c5('0x29')](_0x56c5('0x2a'),Date[_0x56c5('0x2b')](),_0x3c62ce[_0x56c5('0x2c')]));}})});router[_0x56c5('0x21')](_0x56c5('0xe'),upload[_0x56c5('0x2d')](_0x56c5('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x56c5('0x26')]({'destination':function(_0x577a66,_0x2c5a2b,_0x337373){_0x337373(null,path[_0x56c5('0x2f')](config[_0x56c5('0x27')],'server/files/images/avatars/'));},'filename':function(_0x2afce1,_0x42260a,_0x563378){_0x563378(null,util[_0x56c5('0x29')](_0x56c5('0x2a'),Date[_0x56c5('0x2b')](),_0x42260a[_0x56c5('0x2c')]));}})});router[_0x56c5('0x21')]('/:id/avatar',upload[_0x56c5('0x2d')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x56c5('0x26')]({'destination':function(_0x1497e5,_0x3e0dbf,_0x2c2a98){_0x2c2a98(null,path[_0x56c5('0x2f')](config[_0x56c5('0x27')],_0x56c5('0x30')));},'filename':function(_0x14d8b6,_0x26b3c7,_0x5b2ea6){_0x5b2ea6(null,util[_0x56c5('0x29')](_0x56c5('0x2a'),Date[_0x56c5('0x2b')](),_0x26b3c7[_0x56c5('0x2c')]));}})});router['post']('/:id/customer_avatar',upload[_0x56c5('0x2d')](_0x56c5('0x2e')),controller[_0x56c5('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5161ef,_0x543748,_0x323bdd){_0x323bdd(null,path[_0x56c5('0x2f')](config[_0x56c5('0x27')],'server/files/images/avatars/'));},'filename':function(_0x352110,_0x15c586,_0x3ebf72){_0x3ebf72(null,util['format'](_0x56c5('0x2a'),Date[_0x56c5('0x2b')](),_0x15c586['originalname']));}})});router[_0x56c5('0x21')](_0x56c5('0x13'),upload[_0x56c5('0x2d')](_0x56c5('0x2e')),controller['addSystemAvatar']);router[_0x56c5('0x21')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x56c5('0x26')]({'destination':function(_0x2e6ff3,_0x460604,_0x3ac59b){const _0x12f246=path[_0x56c5('0x2f')](config[_0x56c5('0x27')],'server/files','attachments',_0x56c5('0x32'));fs_extra[_0x56c5('0x33')](_0x12f246,function(){_0x3ac59b(null,_0x12f246);});},'filename':function(_0x4a11a8,_0x574fba,_0x4c1509){const _0x16910b=_0x574fba[_0x56c5('0x2c')][_0x56c5('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3e7a17=path[_0x56c5('0x35')](_0x16910b);const _0x168da5=Date['now']()+'-'+_0x16910b['replace'](_0x3e7a17,'')+_0x3e7a17;_0x4c1509(null,_0x168da5);}})});router[_0x56c5('0x21')](_0x56c5('0x36'),offlineUploadMulter[_0x56c5('0x37')](),controller[_0x56c5('0x38')]);router['post']('/:id/interactions',auth[_0x56c5('0x8')](),controller[_0x56c5('0x39')]);router[_0x56c5('0x21')](_0x56c5('0x18'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x3a')]);router[_0x56c5('0x21')](_0x56c5('0x1a'),auth[_0x56c5('0x8')](),controller['addProactiveActions']);router[_0x56c5('0x21')](_0x56c5('0x1f'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x3b')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x56c5('0x3c')]('/:id',auth[_0x56c5('0x8')](),controller[_0x56c5('0x3d')]);router[_0x56c5('0x3c')](_0x56c5('0xd'),auth[_0x56c5('0x8')](),controller[_0x56c5('0x3e')]);router[_0x56c5('0x3c')](_0x56c5('0x24'),auth[_0x56c5('0x8')](),controller['removeAnswers']);router[_0x56c5('0x3c')](_0x56c5('0x1f'),auth['isAuthenticated'](),controller[_0x56c5('0x3f')]);module[_0x56c5('0x40')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 9b2df32..ceef3f2 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f76=['Router','env','production','app','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','../config/environment'];(function(_0x5c1906,_0x42435a){var _0x2b340d=function(_0x59a039){while(--_0x59a039){_0x5c1906['push'](_0x5c1906['shift']());}};_0x2b340d(++_0x42435a);}(_0x6f76,0xf5));var _0x66f7=function(_0x293c4e,_0x4f80fb){_0x293c4e=_0x293c4e-0x0;var _0x4550e8=_0x6f76[_0x293c4e];return _0x4550e8;};var beaverLogger=require(_0x66f7('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x66f7('0x1'));var router=express[_0x66f7('0x2')]();var isProduction=config[_0x66f7('0x3')]===_0x66f7('0x4')||![];function clientSideLogs(_0x521725,_0x121bc6,_0x3cb73b){var _0x4d25aa=_0x521725[_0x66f7('0x5')][_0x66f7('0x6')](_0x66f7('0x7'));if(!_0x4d25aa){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x66f7('0x8')]({'uri':_0x66f7('0x9'),'logger':_0x4d25aa,'enableCors':!isProduction})(_0x521725,_0x121bc6,_0x3cb73b);}router[_0x66f7('0xa')](auth[_0x66f7('0xb')](),clientSideLogs);module[_0x66f7('0xc')]=router;
\ No newline at end of file
+var _0x80ba=['env','production','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express','Router'];(function(_0x5318e3,_0x5553c6){var _0x22b7e2=function(_0x381aa0){while(--_0x381aa0){_0x5318e3['push'](_0x5318e3['shift']());}};_0x22b7e2(++_0x5553c6);}(_0x80ba,0x129));var _0xa80b=function(_0x27c3bf,_0xfd4e1b){_0x27c3bf=_0x27c3bf-0x0;var _0x14cbd2=_0x80ba[_0x27c3bf];return _0x14cbd2;};var beaverLogger=require(_0xa80b('0x0'));var express=require(_0xa80b('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0xa80b('0x2')]();var isProduction=config[_0xa80b('0x3')]===_0xa80b('0x4')||![];function clientSideLogs(_0x79b0d6,_0xfc7a01,_0x40fddf){var _0xae4e0b=_0x79b0d6['app'][_0xa80b('0x5')]('client-side-logger');if(!_0xae4e0b){throw new Error(_0xa80b('0x6'));}return beaverLogger[_0xa80b('0x7')]({'uri':'/client-logs','logger':_0xae4e0b,'enableCors':!isProduction})(_0x79b0d6,_0xfc7a01,_0x40fddf);}router['use'](auth[_0xa80b('0x8')](),clientSideLogs);module[_0xa80b('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 7b7f086..45e7439 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 _0x8de3=['STRING','ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x3eb2bc,_0x3d4dfe){var _0x1b4d2f=function(_0x5162cb){while(--_0x5162cb){_0x3eb2bc['push'](_0x3eb2bc['shift']());}};_0x1b4d2f(++_0x3d4dfe);}(_0x8de3,0x11c));var _0x38de=function(_0x59fc33,_0x2e182d){_0x59fc33=_0x59fc33-0x0;var _0x39066f=_0x8de3[_0x59fc33];return _0x39066f;};'use strict';var Sequelize=require(_0x38de('0x0'));module[_0x38de('0x1')]={'name':{'type':Sequelize[_0x38de('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x38de('0x3')]('AmazonAWS',_0x38de('0x4'),_0x38de('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x38de('0x3')](_0x38de('0x6'),_0x38de('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x38de('0x2')],'comment':_0x38de('0x8')},'data3':{'type':Sequelize[_0x38de('0x2')],'comment':_0x38de('0x9')},'data4':{'type':Sequelize[_0x38de('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x38de('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x38de('0xa')],'comment':_0x38de('0xb')},'data7':{'type':Sequelize[_0x38de('0xa')],'comment':_0x38de('0xc')}};
\ No newline at end of file
+var _0x2b1e=['AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM'];(function(_0x27ea40,_0x481630){var _0x197a30=function(_0x527650){while(--_0x527650){_0x27ea40['push'](_0x27ea40['shift']());}};_0x197a30(++_0x481630);}(_0x2b1e,0xdb));var _0xe2b1=function(_0xabeecb,_0x4f1ad6){_0xabeecb=_0xabeecb-0x0;var _0x10feb9=_0x2b1e[_0xabeecb];return _0x10feb9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe2b1('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe2b1('0x1')](_0xe2b1('0x2'),_0xe2b1('0x3'),_0xe2b1('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe2b1('0x1')](_0xe2b1('0x5'),_0xe2b1('0x6'))},'data1':{'type':Sequelize[_0xe2b1('0x0')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xe2b1('0x0')],'comment':_0xe2b1('0x7')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xe2b1('0x0')],'comment':_0xe2b1('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':_0xe2b1('0x9')},'data6':{'type':Sequelize[_0xe2b1('0xa')],'comment':_0xe2b1('0xb')},'data7':{'type':Sequelize[_0xe2b1('0xa')],'comment':_0xe2b1('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index fe85842..f37c16c 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 _0x3f64=['getOauth2MicrosoftAccessToken','code','data5','access_token','data6','startRefreshInterval','emit','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','json','limit','offset','count','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','CloudProvider','includeAll','findAll','data3','catch','params','include','find','MicrosoftAzure','decryptString','create','body','service','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','from','base64','ascii','parse','isValidIdToken','id_token','oauth2Claims'];(function(_0xcc0cda,_0x353d30){var _0x4988cd=function(_0x38a5cf){while(--_0x38a5cf){_0xcc0cda['push'](_0xcc0cda['shift']());}};_0x4988cd(++_0x353d30);}(_0x3f64,0xbd));var _0x43f6=function(_0x56dd44,_0x110177){_0x56dd44=_0x56dd44-0x0;var _0x24c3ec=_0x3f64[_0x56dd44];return _0x24c3ec;};'use strict';var _=require(_0x43f6('0x0'));var Redis=require(_0x43f6('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x43f6('0x2'));var config=require(_0x43f6('0x3'));var logger=require(_0x43f6('0x4'))('api');var db=require(_0x43f6('0x5'))['db'];var oauth=require(_0x43f6('0x6'));config[_0x43f6('0x7')]=_['defaults'](config[_0x43f6('0x7')],{'host':_0x43f6('0x8'),'port':0x18eb});var socket=require(_0x43f6('0x9'))(new Redis(config[_0x43f6('0x7')]));var redis=new Redis(config[_0x43f6('0x7')]);function respondWithStatusCode(_0x405643,_0x4834b8){_0x4834b8=_0x4834b8||0xcc;return function(_0x480f24){if(_0x480f24){return _0x405643[_0x43f6('0xa')](_0x4834b8);}return _0x405643[_0x43f6('0xb')](_0x4834b8)['end']();};}function respondWithResult(_0x53b8db,_0x21de26){_0x21de26=_0x21de26||0xc8;return function(_0x41733e){if(_0x41733e){return _0x53b8db[_0x43f6('0xb')](_0x21de26)[_0x43f6('0xc')](_0x41733e);}};}function respondWithFilteredResult(_0x473799,_0x1317da){return function(_0x48d3bc){if(_0x48d3bc){var _0x3a45cf=typeof _0x1317da['offset']==='undefined'&&typeof _0x1317da[_0x43f6('0xd')]==='undefined';var _0x3cc58c=_0x48d3bc['count'];var _0x328029=_0x3a45cf?0x0:_0x1317da[_0x43f6('0xe')];var _0x285cf8=_0x3a45cf?_0x48d3bc[_0x43f6('0xf')]:_0x1317da['offset']+_0x1317da['limit'];var _0x2f9a5e;if(_0x285cf8>=_0x3cc58c){_0x285cf8=_0x3cc58c;_0x2f9a5e=0xc8;}else{_0x2f9a5e=0xce;}_0x473799[_0x43f6('0xb')](_0x2f9a5e);return _0x473799[_0x43f6('0x10')](_0x43f6('0x11'),_0x328029+'-'+_0x285cf8+'/'+_0x3cc58c)['json'](_0x48d3bc);}return null;};}function saveUpdates(_0x287333){return function(_0x3d1592){if(_0x3d1592){return _0x3d1592[_0x43f6('0x12')](_0x287333)[_0x43f6('0x13')](function(_0x5e7b9c){return _0x5e7b9c;});}return null;};}function removeEntity(_0x2657e0){return function(_0x467a92){if(_0x467a92){return _0x467a92[_0x43f6('0x14')]()[_0x43f6('0x13')](function(){_0x2657e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a64c){return function(_0x47eec3){if(!_0x47eec3){_0x28a64c[_0x43f6('0xa')](0x194);}return _0x47eec3;};}function handleError(_0x33f2bf,_0x5dc1c4){_0x5dc1c4=_0x5dc1c4||0x1f4;return function(_0x19f43c){logger[_0x43f6('0x15')](_0x19f43c[_0x43f6('0x16')]);if(_0x19f43c[_0x43f6('0x17')]){delete _0x19f43c['name'];}_0x33f2bf[_0x43f6('0xb')](_0x5dc1c4)[_0x43f6('0x18')](_0x19f43c);};}function maskClientSecret(_0x51efe1){return _[_0x43f6('0x19')](_0x51efe1[_0x43f6('0x1a')](0x0,0x3),0x14,'*');}exports['index']=function(_0xe70aca,_0x3dbaf1){var _0x80b0d3={},_0x488ab4={},_0x2f7c29={'count':0x0,'rows':[]};var _0x59a26e=_[_0x43f6('0x1b')](db['CloudProvider'][_0x43f6('0x1c')],function(_0x4f8b90){return{'name':_0x4f8b90[_0x43f6('0x1d')],'type':_0x4f8b90[_0x43f6('0x1e')]['key']};});_0x488ab4['model']=_[_0x43f6('0x1b')](_0x59a26e,_0x43f6('0x17'));_0x488ab4[_0x43f6('0x1f')]=_[_0x43f6('0x20')](_0xe70aca[_0x43f6('0x1f')]);_0x488ab4[_0x43f6('0x21')]=_[_0x43f6('0x22')](_0x488ab4[_0x43f6('0x23')],_0x488ab4['query']);_0x80b0d3[_0x43f6('0x24')]=_[_0x43f6('0x22')](_0x488ab4[_0x43f6('0x23')],qs[_0x43f6('0x25')](_0xe70aca['query']['fields']));_0x80b0d3[_0x43f6('0x24')]=_0x80b0d3['attributes'][_0x43f6('0x26')]?_0x80b0d3['attributes']:_0x488ab4[_0x43f6('0x23')];if(!_0xe70aca[_0x43f6('0x1f')]['hasOwnProperty'](_0x43f6('0x27'))){_0x80b0d3['limit']=qs['limit'](_0xe70aca[_0x43f6('0x1f')][_0x43f6('0xd')]);_0x80b0d3[_0x43f6('0xe')]=qs[_0x43f6('0xe')](_0xe70aca[_0x43f6('0x1f')][_0x43f6('0xe')]);}_0x80b0d3[_0x43f6('0x28')]=qs[_0x43f6('0x29')](_0xe70aca[_0x43f6('0x1f')]['sort']);_0x80b0d3['where']=qs[_0x43f6('0x21')](_[_0x43f6('0x2a')](_0xe70aca[_0x43f6('0x1f')],_0x488ab4[_0x43f6('0x21')]),_0x59a26e);if(_0xe70aca['query'][_0x43f6('0x2b')]){_0x80b0d3[_0x43f6('0x2c')]=_[_0x43f6('0x2d')](_0x80b0d3[_0x43f6('0x2c')],{'$or':_[_0x43f6('0x1b')](_0x59a26e,function(_0x60787){if(_0x60787[_0x43f6('0x1e')]!=='VIRTUAL'){var _0x29a3bc={};_0x29a3bc[_0x60787[_0x43f6('0x17')]]={'$like':'%'+_0xe70aca[_0x43f6('0x1f')]['filter']+'%'};return _0x29a3bc;}})});}_0x80b0d3=_[_0x43f6('0x2d')]({},_0x80b0d3,_0xe70aca[_0x43f6('0x2e')]);var _0x352157={'where':_0x80b0d3[_0x43f6('0x2c')]};return db[_0x43f6('0x2f')][_0x43f6('0xf')](_0x352157)['then'](function(_0x39a63d){_0x2f7c29['count']=_0x39a63d;if(_0xe70aca[_0x43f6('0x1f')][_0x43f6('0x30')]){_0x80b0d3['include']=[{'all':!![]}];}return db[_0x43f6('0x2f')][_0x43f6('0x31')](_0x80b0d3);})[_0x43f6('0x13')](function(_0x2cd58a){_0x2f7c29['rows']=_['map'](_0x2cd58a,function(_0x306cef){if(_0x306cef['service']==='MicrosoftAzure'){var _0x35d604=encryptor['decryptString'](_0x306cef[_0x43f6('0x32')]);_0x306cef[_0x43f6('0x32')]=maskClientSecret(_0x35d604);}return _0x306cef;});return _0x2f7c29;})[_0x43f6('0x13')](respondWithFilteredResult(_0x3dbaf1,_0x80b0d3))[_0x43f6('0x33')](handleError(_0x3dbaf1,null));};exports['show']=function(_0x35d8db,_0x32d675){var _0x230b7a={'raw':!![],'where':{'id':_0x35d8db[_0x43f6('0x34')]['id']}},_0xff6358={};_0xff6358[_0x43f6('0x23')]=_[_0x43f6('0x20')](db[_0x43f6('0x2f')][_0x43f6('0x1c')]);_0xff6358['query']=_['keys'](_0x35d8db[_0x43f6('0x1f')]);_0xff6358[_0x43f6('0x21')]=_[_0x43f6('0x22')](_0xff6358[_0x43f6('0x23')],_0xff6358[_0x43f6('0x1f')]);_0x230b7a[_0x43f6('0x24')]=_[_0x43f6('0x22')](_0xff6358[_0x43f6('0x23')],qs['fields'](_0x35d8db[_0x43f6('0x1f')][_0x43f6('0x25')]));_0x230b7a[_0x43f6('0x24')]=_0x230b7a[_0x43f6('0x24')][_0x43f6('0x26')]?_0x230b7a[_0x43f6('0x24')]:_0xff6358[_0x43f6('0x23')];if(_0x35d8db[_0x43f6('0x1f')]['includeAll']){_0x230b7a[_0x43f6('0x35')]=[{'all':!![]}];}_0x230b7a=_['merge']({},_0x230b7a,_0x35d8db[_0x43f6('0x2e')]);return db[_0x43f6('0x2f')][_0x43f6('0x36')](_0x230b7a)[_0x43f6('0x13')](handleEntityNotFound(_0x32d675,null))[_0x43f6('0x13')](function(_0xa19b29){if(_0xa19b29['service']===_0x43f6('0x37')){var _0x35d050=encryptor[_0x43f6('0x38')](_0xa19b29[_0x43f6('0x32')]);_0xa19b29[_0x43f6('0x32')]=maskClientSecret(_0x35d050);}return _0xa19b29;})[_0x43f6('0x13')](respondWithResult(_0x32d675,null))[_0x43f6('0x33')](handleError(_0x32d675,null));};exports[_0x43f6('0x39')]=function(_0x36dbdf,_0x509705){if(!_0x36dbdf[_0x43f6('0x3a')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x36dbdf[_0x43f6('0x3a')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x7a7584=db[_0x43f6('0x2f')][_0x43f6('0x1c')][_0x43f6('0x3b')]['values'];if(!_0x7a7584[_0x43f6('0x3c')](_0x36dbdf['body']['service']))throw new Error(_0x43f6('0x3d')+_0x7a7584[_0x43f6('0x3e')](',\x20'));if(_0x36dbdf[_0x43f6('0x3a')][_0x43f6('0x3b')]===_0x43f6('0x37')&&_0x36dbdf[_0x43f6('0x3a')][_0x43f6('0x32')]){_0x36dbdf[_0x43f6('0x3a')][_0x43f6('0x32')]=encryptor[_0x43f6('0x3f')](_0x36dbdf[_0x43f6('0x3a')][_0x43f6('0x32')]);}return db[_0x43f6('0x2f')][_0x43f6('0x39')](_0x36dbdf[_0x43f6('0x3a')],{})[_0x43f6('0x13')](respondWithResult(_0x509705,0xc9))[_0x43f6('0x33')](handleError(_0x509705,null));};exports[_0x43f6('0x12')]=function(_0x48b7eb,_0x152113){if(_0x48b7eb['body']['id']){delete _0x48b7eb[_0x43f6('0x3a')]['id'];}return db[_0x43f6('0x2f')][_0x43f6('0x36')]({'where':{'id':_0x48b7eb['params']['id']}})[_0x43f6('0x13')](handleEntityNotFound(_0x152113,null))['then'](function(_0x222a93){if(_0x222a93[_0x43f6('0x3b')]===_0x43f6('0x37')&&_0x48b7eb[_0x43f6('0x3a')]['data3']){_0x48b7eb[_0x43f6('0x3a')]['data3']=encryptor[_0x43f6('0x3f')](_0x48b7eb[_0x43f6('0x3a')][_0x43f6('0x32')]);}return _0x222a93;})[_0x43f6('0x13')](saveUpdates(_0x48b7eb[_0x43f6('0x3a')],null))[_0x43f6('0x13')](respondWithResult(_0x152113,null))[_0x43f6('0x33')](handleError(_0x152113,null));};exports[_0x43f6('0x14')]=function(_0x4b0b77,_0x41b459){return db[_0x43f6('0x2f')][_0x43f6('0x36')]({'where':{'id':_0x4b0b77[_0x43f6('0x34')]['id']}})['then'](handleEntityNotFound(_0x41b459,null))[_0x43f6('0x13')](removeEntity(_0x41b459,null))['catch'](handleError(_0x41b459,null));};exports[_0x43f6('0x40')]=function(_0x521ad7,_0x319f7b){return db[_0x43f6('0x2f')][_0x43f6('0x41')]({'where':{'id':_0x521ad7[_0x43f6('0x34')]['id']},'raw':!![]})[_0x43f6('0x13')](function(_0x338c5d){if(!_0x338c5d)return _0x319f7b[_0x43f6('0xa')](0x194);return{'url':oauth[_0x43f6('0x42')](_0x338c5d,_0x521ad7[_0x43f6('0x43')]['id'])};})[_0x43f6('0x13')](respondWithResult(_0x319f7b,null))['catch'](handleError(_0x319f7b,null));};exports[_0x43f6('0x44')]=function(_0x2dcfe1,_0x22a550){var _0x4c7ecd=_0x2dcfe1['body'];var _0x16175d;var _0x3360fa;if(_0x4c7ecd[_0x43f6('0x15')])throw _0x4c7ecd;redis[_0x43f6('0x45')](_0x4c7ecd[_0x43f6('0x46')])['then'](function(_0x5ab442){if(!_0x5ab442)throw new Error('Invalid\x20state\x20parameter');_0x16175d=JSON['parse'](_0x5ab442);var _0x4b6989=Buffer[_0x43f6('0x47')](_0x4c7ecd[_0x43f6('0x46')],_0x43f6('0x48'))['toString'](_0x43f6('0x49'));_0x3360fa=JSON[_0x43f6('0x4a')](_0x4b6989);if(!oauth[_0x43f6('0x4b')](_0x4c7ecd[_0x43f6('0x4c')],_0x16175d[_0x43f6('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x4c7ecd[_0x43f6('0x46')]);return oauth[_0x43f6('0x4e')](_0x4c7ecd[_0x43f6('0x4f')],_0x16175d);})[_0x43f6('0x13')](function(_0xfa15db){_0x16175d[_0x43f6('0x50')]=_0xfa15db[_0x43f6('0x51')];_0x16175d['data6']=_0xfa15db['refresh_token'];return db[_0x43f6('0x2f')][_0x43f6('0x12')]({'data5':_0x16175d[_0x43f6('0x50')],'data6':_0x16175d[_0x43f6('0x52')]},{'where':{'id':_0x16175d['id']}});})['then'](function(){oauth[_0x43f6('0x53')](_0x16175d);socket[_0x43f6('0x54')]('microsoftAuthorization:success',{'id':_0x3360fa['id']});return;})[_0x43f6('0x13')](respondWithStatusCode(_0x22a550,null))[_0x43f6('0x33')](function(_0x137ed7){if(_0x3360fa){socket['emit']('microsoftAuthorization:error',{'id':_0x3360fa['id']});}if(!_0x16175d){logger[_0x43f6('0x15')](_0x43f6('0x55'),_0x137ed7);return _0x22a550[_0x43f6('0xb')](0x1f4)[_0x43f6('0x18')](_0x137ed7[_0x43f6('0x56')]);}logger[_0x43f6('0x15')](_0x43f6('0x57'),_0x16175d['id'],JSON[_0x43f6('0x58')](_0x137ed7));});};
\ No newline at end of file
+var _0xb38b=['filters','intersection','attributes','query','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','length','options','find','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','destroy','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','error','stack','name','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys'];(function(_0x188d46,_0x295bf0){var _0x62adb8=function(_0x268cfe){while(--_0x268cfe){_0x188d46['push'](_0x188d46['shift']());}};_0x62adb8(++_0x295bf0);}(_0xb38b,0x163));var _0xbb38=function(_0x8077fc,_0x49010e){_0x8077fc=_0x8077fc-0x0;var _0x4d16fa=_0xb38b[_0x8077fc];return _0x4d16fa;};'use strict';var _=require(_0xbb38('0x0'));var Redis=require(_0xbb38('0x1'));var qs=require(_0xbb38('0x2'));var encryptor=require(_0xbb38('0x3'));var config=require(_0xbb38('0x4'));var logger=require('../../config/logger')(_0xbb38('0x5'));var db=require(_0xbb38('0x6'))['db'];var oauth=require(_0xbb38('0x7'));config['redis']=_[_0xbb38('0x8')](config[_0xbb38('0x9')],{'host':_0xbb38('0xa'),'port':0x18eb});var socket=require(_0xbb38('0xb'))(new Redis(config[_0xbb38('0x9')]));var redis=new Redis(config[_0xbb38('0x9')]);function respondWithStatusCode(_0x3ad985,_0x46081e){_0x46081e=_0x46081e||0xcc;return function(_0x2ce356){if(_0x2ce356){return _0x3ad985[_0xbb38('0xc')](_0x46081e);}return _0x3ad985[_0xbb38('0xd')](_0x46081e)[_0xbb38('0xe')]();};}function respondWithResult(_0x3b12cb,_0x8ec922){_0x8ec922=_0x8ec922||0xc8;return function(_0x1627c0){if(_0x1627c0){return _0x3b12cb[_0xbb38('0xd')](_0x8ec922)['json'](_0x1627c0);}};}function respondWithFilteredResult(_0x28a914,_0x52fd9e){return function(_0x29fa28){if(_0x29fa28){var _0x1b0c73=typeof _0x52fd9e[_0xbb38('0xf')]===_0xbb38('0x10')&&typeof _0x52fd9e[_0xbb38('0x11')]===_0xbb38('0x10');var _0x598929=_0x29fa28[_0xbb38('0x12')];var _0x29b95f=_0x1b0c73?0x0:_0x52fd9e[_0xbb38('0xf')];var _0x11080d=_0x1b0c73?_0x29fa28[_0xbb38('0x12')]:_0x52fd9e['offset']+_0x52fd9e['limit'];var _0x476fbe;if(_0x11080d>=_0x598929){_0x11080d=_0x598929;_0x476fbe=0xc8;}else{_0x476fbe=0xce;}_0x28a914[_0xbb38('0xd')](_0x476fbe);return _0x28a914[_0xbb38('0x13')](_0xbb38('0x14'),_0x29b95f+'-'+_0x11080d+'/'+_0x598929)[_0xbb38('0x15')](_0x29fa28);}return null;};}function saveUpdates(_0x2c63ee){return function(_0x43c5d1){if(_0x43c5d1){return _0x43c5d1[_0xbb38('0x16')](_0x2c63ee)[_0xbb38('0x17')](function(_0x36edde){return _0x36edde;});}return null;};}function removeEntity(_0x3a69e0){return function(_0x122332){if(_0x122332){return _0x122332['destroy']()[_0xbb38('0x17')](function(){_0x3a69e0[_0xbb38('0xd')](0xcc)[_0xbb38('0xe')]();});}};}function handleEntityNotFound(_0xe9e82e){return function(_0xa01ac9){if(!_0xa01ac9){_0xe9e82e['sendStatus'](0x194);}return _0xa01ac9;};}function handleError(_0x4a1ffd,_0x97cd30){_0x97cd30=_0x97cd30||0x1f4;return function(_0x5da99f){logger[_0xbb38('0x18')](_0x5da99f[_0xbb38('0x19')]);if(_0x5da99f[_0xbb38('0x1a')]){delete _0x5da99f['name'];}_0x4a1ffd[_0xbb38('0xd')](_0x97cd30)['send'](_0x5da99f);};}function maskClientSecret(_0x9d135c){return _[_0xbb38('0x1b')](_0x9d135c['slice'](0x0,0x3),0x14,'*');}exports[_0xbb38('0x1c')]=function(_0x32f312,_0x5d4ad1){var _0x1c7a80={},_0x522585={},_0x138d26={'count':0x0,'rows':[]};var _0x4815bc=_[_0xbb38('0x1d')](db[_0xbb38('0x1e')][_0xbb38('0x1f')],function(_0x4db9b7){return{'name':_0x4db9b7[_0xbb38('0x20')],'type':_0x4db9b7[_0xbb38('0x21')][_0xbb38('0x22')]};});_0x522585[_0xbb38('0x23')]=_[_0xbb38('0x1d')](_0x4815bc,_0xbb38('0x1a'));_0x522585['query']=_[_0xbb38('0x24')](_0x32f312['query']);_0x522585[_0xbb38('0x25')]=_[_0xbb38('0x26')](_0x522585[_0xbb38('0x23')],_0x522585['query']);_0x1c7a80[_0xbb38('0x27')]=_[_0xbb38('0x26')](_0x522585[_0xbb38('0x23')],qs['fields'](_0x32f312[_0xbb38('0x28')][_0xbb38('0x29')]));_0x1c7a80[_0xbb38('0x27')]=_0x1c7a80['attributes']['length']?_0x1c7a80[_0xbb38('0x27')]:_0x522585['model'];if(!_0x32f312[_0xbb38('0x28')]['hasOwnProperty'](_0xbb38('0x2a'))){_0x1c7a80['limit']=qs['limit'](_0x32f312['query'][_0xbb38('0x11')]);_0x1c7a80[_0xbb38('0xf')]=qs[_0xbb38('0xf')](_0x32f312[_0xbb38('0x28')]['offset']);}_0x1c7a80[_0xbb38('0x2b')]=qs[_0xbb38('0x2c')](_0x32f312[_0xbb38('0x28')][_0xbb38('0x2c')]);_0x1c7a80['where']=qs[_0xbb38('0x25')](_['pick'](_0x32f312[_0xbb38('0x28')],_0x522585[_0xbb38('0x25')]),_0x4815bc);if(_0x32f312[_0xbb38('0x28')][_0xbb38('0x2d')]){_0x1c7a80[_0xbb38('0x2e')]=_[_0xbb38('0x2f')](_0x1c7a80[_0xbb38('0x2e')],{'$or':_['map'](_0x4815bc,function(_0x4a4f0b){if(_0x4a4f0b[_0xbb38('0x21')]!==_0xbb38('0x30')){var _0x206bdf={};_0x206bdf[_0x4a4f0b[_0xbb38('0x1a')]]={'$like':'%'+_0x32f312['query'][_0xbb38('0x2d')]+'%'};return _0x206bdf;}})});}_0x1c7a80=_[_0xbb38('0x2f')]({},_0x1c7a80,_0x32f312['options']);var _0x1dad0b={'where':_0x1c7a80[_0xbb38('0x2e')]};return db[_0xbb38('0x1e')]['count'](_0x1dad0b)[_0xbb38('0x17')](function(_0x85c070){_0x138d26[_0xbb38('0x12')]=_0x85c070;if(_0x32f312[_0xbb38('0x28')][_0xbb38('0x31')]){_0x1c7a80[_0xbb38('0x32')]=[{'all':!![]}];}return db[_0xbb38('0x1e')][_0xbb38('0x33')](_0x1c7a80);})['then'](function(_0x19660b){_0x138d26[_0xbb38('0x34')]=_[_0xbb38('0x1d')](_0x19660b,function(_0x43dffd){if(_0x43dffd[_0xbb38('0x35')]===_0xbb38('0x36')){var _0x2ed241=encryptor[_0xbb38('0x37')](_0x43dffd[_0xbb38('0x38')]);_0x43dffd[_0xbb38('0x38')]=maskClientSecret(_0x2ed241);}return _0x43dffd;});return _0x138d26;})[_0xbb38('0x17')](respondWithFilteredResult(_0x5d4ad1,_0x1c7a80))[_0xbb38('0x39')](handleError(_0x5d4ad1,null));};exports[_0xbb38('0x3a')]=function(_0x4159f8,_0x1fffc6){var _0x393296={'raw':!![],'where':{'id':_0x4159f8[_0xbb38('0x3b')]['id']}},_0x495b7c={};_0x495b7c[_0xbb38('0x23')]=_[_0xbb38('0x24')](db[_0xbb38('0x1e')][_0xbb38('0x1f')]);_0x495b7c[_0xbb38('0x28')]=_['keys'](_0x4159f8[_0xbb38('0x28')]);_0x495b7c[_0xbb38('0x25')]=_['intersection'](_0x495b7c[_0xbb38('0x23')],_0x495b7c[_0xbb38('0x28')]);_0x393296[_0xbb38('0x27')]=_[_0xbb38('0x26')](_0x495b7c[_0xbb38('0x23')],qs['fields'](_0x4159f8[_0xbb38('0x28')][_0xbb38('0x29')]));_0x393296['attributes']=_0x393296[_0xbb38('0x27')][_0xbb38('0x3c')]?_0x393296[_0xbb38('0x27')]:_0x495b7c[_0xbb38('0x23')];if(_0x4159f8[_0xbb38('0x28')][_0xbb38('0x31')]){_0x393296[_0xbb38('0x32')]=[{'all':!![]}];}_0x393296=_[_0xbb38('0x2f')]({},_0x393296,_0x4159f8[_0xbb38('0x3d')]);return db[_0xbb38('0x1e')][_0xbb38('0x3e')](_0x393296)[_0xbb38('0x17')](handleEntityNotFound(_0x1fffc6,null))[_0xbb38('0x17')](function(_0x225500){if(_0x225500[_0xbb38('0x35')]==='MicrosoftAzure'){var _0x6b6ae2=encryptor['decryptString'](_0x225500[_0xbb38('0x38')]);_0x225500[_0xbb38('0x38')]=maskClientSecret(_0x6b6ae2);}return _0x225500;})['then'](respondWithResult(_0x1fffc6,null))[_0xbb38('0x39')](handleError(_0x1fffc6,null));};exports['create']=function(_0x5d4ab2,_0x28981b){if(!_0x5d4ab2['body'][_0xbb38('0x1a')])throw new Error(_0xbb38('0x3f'));if(!_0x5d4ab2[_0xbb38('0x40')][_0xbb38('0x35')])throw new Error(_0xbb38('0x41'));var _0x506bff=db[_0xbb38('0x1e')]['rawAttributes'][_0xbb38('0x35')][_0xbb38('0x42')];if(!_0x506bff[_0xbb38('0x43')](_0x5d4ab2[_0xbb38('0x40')]['service']))throw new Error(_0xbb38('0x44')+_0x506bff[_0xbb38('0x45')](',\x20'));if(_0x5d4ab2[_0xbb38('0x40')][_0xbb38('0x35')]==='MicrosoftAzure'&&_0x5d4ab2[_0xbb38('0x40')][_0xbb38('0x38')]){_0x5d4ab2[_0xbb38('0x40')][_0xbb38('0x38')]=encryptor[_0xbb38('0x46')](_0x5d4ab2['body'][_0xbb38('0x38')]);}return db[_0xbb38('0x1e')][_0xbb38('0x47')](_0x5d4ab2[_0xbb38('0x40')],{})[_0xbb38('0x17')](respondWithResult(_0x28981b,0xc9))['catch'](handleError(_0x28981b,null));};exports[_0xbb38('0x16')]=function(_0x1045e6,_0x362741){if(_0x1045e6[_0xbb38('0x40')]['id']){delete _0x1045e6[_0xbb38('0x40')]['id'];}return db[_0xbb38('0x1e')][_0xbb38('0x3e')]({'where':{'id':_0x1045e6['params']['id']}})['then'](handleEntityNotFound(_0x362741,null))[_0xbb38('0x17')](function(_0x409c7f){if(_0x409c7f[_0xbb38('0x35')]==='MicrosoftAzure'&&_0x1045e6['body'][_0xbb38('0x38')]){_0x1045e6[_0xbb38('0x40')][_0xbb38('0x38')]=encryptor[_0xbb38('0x46')](_0x1045e6[_0xbb38('0x40')][_0xbb38('0x38')]);}return _0x409c7f;})['then'](saveUpdates(_0x1045e6[_0xbb38('0x40')],null))[_0xbb38('0x17')](respondWithResult(_0x362741,null))[_0xbb38('0x39')](handleError(_0x362741,null));};exports[_0xbb38('0x48')]=function(_0x348f91,_0x4f8570){return db[_0xbb38('0x1e')][_0xbb38('0x3e')]({'where':{'id':_0x348f91[_0xbb38('0x3b')]['id']}})[_0xbb38('0x17')](handleEntityNotFound(_0x4f8570,null))[_0xbb38('0x17')](removeEntity(_0x4f8570,null))[_0xbb38('0x39')](handleError(_0x4f8570,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5b021b,_0x320e5b){return db[_0xbb38('0x1e')][_0xbb38('0x49')]({'where':{'id':_0x5b021b[_0xbb38('0x3b')]['id']},'raw':!![]})[_0xbb38('0x17')](function(_0x3d2d94){if(!_0x3d2d94)return _0x320e5b[_0xbb38('0xc')](0x194);return{'url':oauth[_0xbb38('0x4a')](_0x3d2d94,_0x5b021b['user']['id'])};})[_0xbb38('0x17')](respondWithResult(_0x320e5b,null))[_0xbb38('0x39')](handleError(_0x320e5b,null));};exports[_0xbb38('0x4b')]=function(_0x1b028c,_0x51856f){var _0x4317b5=_0x1b028c[_0xbb38('0x40')];var _0x23bdef;var _0x533bb5;if(_0x4317b5[_0xbb38('0x18')])throw _0x4317b5;redis[_0xbb38('0x4c')](_0x4317b5[_0xbb38('0x4d')])[_0xbb38('0x17')](function(_0x200f60){if(!_0x200f60)throw new Error('Invalid\x20state\x20parameter');_0x23bdef=JSON[_0xbb38('0x4e')](_0x200f60);var _0x4c72d2=Buffer[_0xbb38('0x4f')](_0x4317b5[_0xbb38('0x4d')],_0xbb38('0x50'))[_0xbb38('0x51')](_0xbb38('0x52'));_0x533bb5=JSON[_0xbb38('0x4e')](_0x4c72d2);if(!oauth[_0xbb38('0x53')](_0x4317b5[_0xbb38('0x54')],_0x23bdef['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xbb38('0x55')](_0x4317b5['state']);return oauth[_0xbb38('0x56')](_0x4317b5[_0xbb38('0x57')],_0x23bdef);})[_0xbb38('0x17')](function(_0x552a4f){_0x23bdef[_0xbb38('0x58')]=_0x552a4f[_0xbb38('0x59')];_0x23bdef[_0xbb38('0x5a')]=_0x552a4f[_0xbb38('0x5b')];return db['CloudProvider'][_0xbb38('0x16')]({'data5':_0x23bdef['data5'],'data6':_0x23bdef[_0xbb38('0x5a')]},{'where':{'id':_0x23bdef['id']}});})['then'](function(){oauth[_0xbb38('0x5c')](_0x23bdef);socket[_0xbb38('0x5d')](_0xbb38('0x5e'),{'id':_0x533bb5['id']});return;})[_0xbb38('0x17')](respondWithStatusCode(_0x51856f,null))[_0xbb38('0x39')](function(_0x1ecee5){if(_0x533bb5){socket[_0xbb38('0x5d')](_0xbb38('0x5f'),{'id':_0x533bb5['id']});}if(!_0x23bdef){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x1ecee5);return _0x51856f[_0xbb38('0xd')](0x1f4)['send'](_0x1ecee5[_0xbb38('0x60')]);}logger[_0xbb38('0x18')](_0xbb38('0x61'),_0x23bdef['id'],JSON['stringify'](_0x1ecee5));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 7312bf6..7862d7e 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 _0x5ee9=['cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x38df93,_0x1745db){var _0x3b4abd=function(_0x3b2e22){while(--_0x3b2e22){_0x38df93['push'](_0x38df93['shift']());}};_0x3b4abd(++_0x1745db);}(_0x5ee9,0x187));var _0x95ee=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5ee9[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x95ee('0x0'));var util=require(_0x95ee('0x1'));var logger=require(_0x95ee('0x2'))(_0x95ee('0x3'));var moment=require(_0x95ee('0x4'));var BPromise=require(_0x95ee('0x5'));var rp=require(_0x95ee('0x6'));var fs=require('fs');var path=require(_0x95ee('0x7'));var rimraf=require(_0x95ee('0x8'));var config=require(_0x95ee('0x9'));var attributes=require(_0x95ee('0xa'));module[_0x95ee('0xb')]=function(_0x24065b,_0x1b833f){return _0x24065b['define']('CloudProvider',attributes,{'tableName':_0x95ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd341=['cloud_providers','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x529966,_0x25c320){var _0xe643a7=function(_0x39433b){while(--_0x39433b){_0x529966['push'](_0x529966['shift']());}};_0xe643a7(++_0x25c320);}(_0xd341,0x121));var _0x1d34=function(_0x10241c,_0x23677b){_0x10241c=_0x10241c-0x0;var _0x2c3eee=_0xd341[_0x10241c];return _0x2c3eee;};'use strict';var _=require('lodash');var util=require(_0x1d34('0x0'));var logger=require(_0x1d34('0x1'))(_0x1d34('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1d34('0x3'));var fs=require('fs');var path=require(_0x1d34('0x4'));var rimraf=require(_0x1d34('0x5'));var config=require(_0x1d34('0x6'));var attributes=require(_0x1d34('0x7'));module[_0x1d34('0x8')]=function(_0x5a190a,_0x483f5b){return _0x5a190a[_0x1d34('0x9')](_0x1d34('0xa'),attributes,{'tableName':_0x1d34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index c53d8b6..e389dc5 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebf3=['oauth2Claims','oauth2/','set','payload','issuer','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','catch','inspect','exports','lodash','crypto','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','stringify','randomBytes','toString','hex','client_id','data1','response_type','redirect_uri','data4','scope','state','nonce','login','key'];(function(_0x3e5c74,_0x95bce8){var _0x5a45ad=function(_0x18b939){while(--_0x18b939){_0x3e5c74['push'](_0x3e5c74['shift']());}};_0x5a45ad(++_0x95bce8);}(_0xebf3,0x147));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ebf('0x0'));var crypto=require(_0x3ebf('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x3ebf('0x2'));var encryptor=require(_0x3ebf('0x3'));var config=require(_0x3ebf('0x4'));var logger=require(_0x3ebf('0x5'))('api');var schedule=require(_0x3ebf('0x6'));var db=require(_0x3ebf('0x7'))['db'];config[_0x3ebf('0x8')]=_[_0x3ebf('0x9')](config[_0x3ebf('0x8')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x3ebf('0x8')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x3ebf('0xa'),_0x3ebf('0xb'),_0x3ebf('0xc'),_0x3ebf('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x3ebf('0xe')],'Dynamics365':[_0x3ebf('0xa'),_0x3ebf('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x3ebf('0xf');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x16b297){var _0x168eba=_[_0x3ebf('0x10')](AZURE_AUTH_SCOPES[_0x16b297[_0x3ebf('0x11')]]);if(_0x16b297[_0x3ebf('0x11')]===_0x3ebf('0x12'))_0x168eba[_0x3ebf('0x13')](_0x16b297['data7']+_0x3ebf('0x14'));return _0x168eba[_0x3ebf('0x15')]('\x20');}function getAccessTokenScope(_0x444ea1){if(_0x444ea1[_0x3ebf('0x11')]===_0x3ebf('0x16'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x444ea1[_0x3ebf('0x11')]==='Dynamics365')return _0x444ea1[_0x3ebf('0x17')]+_0x3ebf('0x14');}function generateMicrosoftAuthorizationUrl(_0x4b9530,_0x477e31){var _0x35fffd=MICROSOFT_AUTH_URL[_0x3ebf('0x18')](_0x3ebf('0x19'),_0x4b9530[_0x3ebf('0x1a')]);var _0xf1f3f1=[_0x3ebf('0x1b'),_0x3ebf('0x1c')];var _0x33f1b4=Buffer['from'](JSON[_0x3ebf('0x1d')]({'id':_0x477e31}))['toString']('base64');var _0x1cee42=crypto[_0x3ebf('0x1e')](0x10)[_0x3ebf('0x1f')](_0x3ebf('0x20'));var _0xaaf544=getAuthorizationScopes(_0x4b9530);var _0x352562=[{'key':_0x3ebf('0x21'),'value':_0x4b9530[_0x3ebf('0x22')]},{'key':_0x3ebf('0x23'),'value':encodeURIComponent(_0xf1f3f1[_0x3ebf('0x15')]('\x20'))},{'key':_0x3ebf('0x24'),'value':_0x4b9530[_0x3ebf('0x25')]},{'key':'response_mode','value':'form_post'},{'key':_0x3ebf('0x26'),'value':encodeURIComponent(_0xaaf544)},{'key':_0x3ebf('0x27'),'value':_0x33f1b4},{'key':_0x3ebf('0x28'),'value':_0x1cee42},{'key':'prompt','value':_0x3ebf('0x29')}];var _0x2d2244=_0x35fffd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x3ebf('0x10')](_0x352562,function(_0x5491bd){return _0x5491bd[_0x3ebf('0x2a')]+'='+_0x5491bd['value'];})['join']('&');_0x4b9530[_0x3ebf('0x2b')]={'issuer':_0x35fffd[_0x3ebf('0x18')](_0x3ebf('0x2c'),''),'audience':_0x4b9530['data1'],'state':_0x33f1b4,'nonce':_0x1cee42};redis[_0x3ebf('0x2d')](_0x33f1b4,JSON[_0x3ebf('0x1d')](_0x4b9530));return _0x2d2244;}function isValidIdToken(_0x7b7a16,_0x3d79d4){try{var _0x4c2f99=jwt['decode'](_0x7b7a16,{'complete':!![]});var _0x358640=_0x4c2f99[_0x3ebf('0x2e')];if(_0x358640['iss']!==_0x3d79d4[_0x3ebf('0x2f')])return![];if(_0x358640['aud']!==_0x3d79d4[_0x3ebf('0x30')])return![];if(_0x358640[_0x3ebf('0x28')]!==_0x3d79d4['nonce'])return![];if(moment()[_0x3ebf('0x31')](moment[_0x3ebf('0x32')](_0x358640[_0x3ebf('0x33')])))return![];return!![];}catch(_0x43971e){throw _0x43971e;}}function refreshOauth2MicrosoftAccessToken(_0x217da5){return Promise[_0x3ebf('0x34')]()[_0x3ebf('0x35')](function(){if(_0x217da5[_0x3ebf('0x36')])return _0x217da5;return db[_0x3ebf('0x37')][_0x3ebf('0x38')]({'where':{'id':_0x217da5['id']},'raw':!![]});})[_0x3ebf('0x35')](function(_0x5180b0){var _0x29a90d={'grant_type':_0x3ebf('0x39'),'refresh_token':_0x5180b0[_0x3ebf('0x3a')],'scope':getAccessTokenScope(_0x5180b0),'redirect_uri':_0x5180b0[_0x3ebf('0x25')],'client_id':_0x5180b0[_0x3ebf('0x22')],'client_secret':encryptor[_0x3ebf('0x3b')](_0x5180b0['data3'])};var _0xd4bc19={'method':_0x3ebf('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3ebf('0x19'),_0x5180b0[_0x3ebf('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x29a90d,'json':!![]};return rp(_0xd4bc19);})[_0x3ebf('0x35')](function(_0x31e1de){_0x217da5[_0x3ebf('0x3d')]=_0x31e1de[_0x3ebf('0x3e')];_0x217da5[_0x3ebf('0x3a')]=_0x31e1de[_0x3ebf('0x39')];return db['CloudProvider'][_0x3ebf('0x3f')]({'data5':_0x217da5[_0x3ebf('0x3d')],'data6':_0x217da5[_0x3ebf('0x3a')]},{'where':{'id':_0x217da5['id']}});})['then'](function(){return _0x217da5;})['catch'](function(_0x48cfdd){logger[_0x3ebf('0x40')](_0x3ebf('0x41'),_0x217da5['id'],_0x48cfdd);});}function getOauth2MicrosoftAccessToken(_0x4200b3,_0x504718){var _0x5d9bd6={'grant_type':_0x3ebf('0x42'),'code':_0x4200b3,'scope':getAccessTokenScope(_0x504718),'redirect_uri':_0x504718['data4'],'client_id':_0x504718[_0x3ebf('0x22')],'client_secret':encryptor[_0x3ebf('0x3b')](_0x504718['data3'])};var _0x31f9ef={'method':_0x3ebf('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3ebf('0x19'),_0x504718[_0x3ebf('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5d9bd6,'json':!![]};return rp(_0x31f9ef);}function startRefreshInterval(_0x43cb57){var _0x12efc4=schedule[_0x3ebf('0x43')];if(_0x12efc4[_0x43cb57['id']])clearInterval(_0x12efc4[_0x43cb57['id']]);_0x12efc4[_0x43cb57['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3ebf('0x44')](this,{'id':_0x43cb57['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x12efc4;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x3ebf('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3ebf('0x35')](function(_0x48221d){var _0x3991fc=_0x48221d[_0x3ebf('0x10')](function(_0x220880){return refreshOauth2MicrosoftAccessToken(_0x220880)['then'](function(_0x5358d1){startRefreshInterval(_0x5358d1);});});return Promise[_0x3ebf('0x46')](_0x3991fc);})[_0x3ebf('0x47')](function(_0x27a40d){var _0x452c4f=_0x27a40d?util[_0x3ebf('0x48')](_0x27a40d,{'showHidden':![],'depth':null}):'';logger[_0x3ebf('0x40')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x452c4f);});}module[_0x3ebf('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xd11a=['response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','key','value','oauth2/','set','decode','payload','iss','issuer','aud','audience','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','update','catch','authorization_code','intervals','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','randomBytes','hex','client_id','data1'];(function(_0x2a597f,_0x19e010){var _0x2917d8=function(_0x58e509){while(--_0x58e509){_0x2a597f['push'](_0x2a597f['shift']());}};_0x2917d8(++_0x19e010);}(_0xd11a,0x156));var _0xad11=function(_0x4723df,_0x10910e){_0x4723df=_0x4723df-0x0;var _0x5d240d=_0xd11a[_0x4723df];return _0x5d240d;};'use strict';var _=require('lodash');var crypto=require(_0xad11('0x0'));var jwt=require(_0xad11('0x1'));var moment=require(_0xad11('0x2'));var Redis=require('ioredis');var rp=require(_0xad11('0x3'));var util=require(_0xad11('0x4'));var encryptor=require(_0xad11('0x5'));var config=require(_0xad11('0x6'));var logger=require(_0xad11('0x7'))(_0xad11('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xad11('0x9'))['db'];config['redis']=_['defaults'](config[_0xad11('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xad11('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xad11('0xb'),_0xad11('0xc'),_0xad11('0xd'),_0xad11('0xe'),_0xad11('0xf'),_0xad11('0x10'),_0xad11('0x11')],'Dynamics365':[_0xad11('0xb'),_0xad11('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xad11('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1c8c42){var _0x2e1e37=_[_0xad11('0x13')](AZURE_AUTH_SCOPES[_0x1c8c42[_0xad11('0x14')]]);if(_0x1c8c42[_0xad11('0x14')]===_0xad11('0x15'))_0x2e1e37[_0xad11('0x16')](_0x1c8c42[_0xad11('0x17')]+_0xad11('0x18'));return _0x2e1e37[_0xad11('0x19')]('\x20');}function getAccessTokenScope(_0x5527e9){if(_0x5527e9['type']===_0xad11('0x1a'))return _0xad11('0xf');if(_0x5527e9['type']===_0xad11('0x15'))return _0x5527e9[_0xad11('0x17')]+_0xad11('0x18');}function generateMicrosoftAuthorizationUrl(_0x4abb51,_0x3d8d99){var _0x19c6b6=MICROSOFT_AUTH_URL[_0xad11('0x1b')](_0xad11('0x1c'),_0x4abb51[_0xad11('0x1d')]);var _0x599dc1=[_0xad11('0x1e'),'id_token'];var _0x1470ec=Buffer[_0xad11('0x1f')](JSON[_0xad11('0x20')]({'id':_0x3d8d99}))[_0xad11('0x21')]('base64');var _0x571b05=crypto[_0xad11('0x22')](0x10)[_0xad11('0x21')](_0xad11('0x23'));var _0x296b75=getAuthorizationScopes(_0x4abb51);var _0x1abaf0=[{'key':_0xad11('0x24'),'value':_0x4abb51[_0xad11('0x25')]},{'key':_0xad11('0x26'),'value':encodeURIComponent(_0x599dc1[_0xad11('0x19')]('\x20'))},{'key':_0xad11('0x27'),'value':_0x4abb51[_0xad11('0x28')]},{'key':_0xad11('0x29'),'value':_0xad11('0x2a')},{'key':_0xad11('0x2b'),'value':encodeURIComponent(_0x296b75)},{'key':_0xad11('0x2c'),'value':_0x1470ec},{'key':_0xad11('0x2d'),'value':_0x571b05},{'key':'prompt','value':'login'}];var _0x4e218a=_0x19c6b6+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xad11('0x13')](_0x1abaf0,function(_0x13d468){return _0x13d468[_0xad11('0x2e')]+'='+_0x13d468[_0xad11('0x2f')];})[_0xad11('0x19')]('&');_0x4abb51['oauth2Claims']={'issuer':_0x19c6b6['replace'](_0xad11('0x30'),''),'audience':_0x4abb51[_0xad11('0x25')],'state':_0x1470ec,'nonce':_0x571b05};redis[_0xad11('0x31')](_0x1470ec,JSON[_0xad11('0x20')](_0x4abb51));return _0x4e218a;}function isValidIdToken(_0x516087,_0x88d71a){try{var _0x25b73c=jwt[_0xad11('0x32')](_0x516087,{'complete':!![]});var _0x3294bd=_0x25b73c[_0xad11('0x33')];if(_0x3294bd[_0xad11('0x34')]!==_0x88d71a[_0xad11('0x35')])return![];if(_0x3294bd[_0xad11('0x36')]!==_0x88d71a[_0xad11('0x37')])return![];if(_0x3294bd[_0xad11('0x2d')]!==_0x88d71a[_0xad11('0x2d')])return![];if(moment()['isAfter'](moment[_0xad11('0x38')](_0x3294bd[_0xad11('0x39')])))return![];return!![];}catch(_0x3cb58d){throw _0x3cb58d;}}function refreshOauth2MicrosoftAccessToken(_0x1b2397){return Promise['resolve']()[_0xad11('0x3a')](function(){if(_0x1b2397[_0xad11('0x3b')])return _0x1b2397;return db[_0xad11('0x3c')][_0xad11('0x3d')]({'where':{'id':_0x1b2397['id']},'raw':!![]});})['then'](function(_0x54518c){var _0x10e062={'grant_type':_0xad11('0x3e'),'refresh_token':_0x54518c[_0xad11('0x3f')],'scope':getAccessTokenScope(_0x54518c),'redirect_uri':_0x54518c[_0xad11('0x28')],'client_id':_0x54518c[_0xad11('0x25')],'client_secret':encryptor[_0xad11('0x40')](_0x54518c[_0xad11('0x3b')])};var _0x55de40={'method':_0xad11('0x41'),'uri':MICROSOFT_AUTH_URL[_0xad11('0x1b')](_0xad11('0x1c'),_0x54518c['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x10e062,'json':!![]};return rp(_0x55de40);})[_0xad11('0x3a')](function(_0x255315){_0x1b2397[_0xad11('0x42')]=_0x255315['access_token'];_0x1b2397['data6']=_0x255315['refresh_token'];return db[_0xad11('0x3c')][_0xad11('0x43')]({'data5':_0x1b2397[_0xad11('0x42')],'data6':_0x1b2397[_0xad11('0x3f')]},{'where':{'id':_0x1b2397['id']}});})[_0xad11('0x3a')](function(){return _0x1b2397;})[_0xad11('0x44')](function(_0x2364f8){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x1b2397['id'],_0x2364f8);});}function getOauth2MicrosoftAccessToken(_0x1d21a1,_0x4ba858){var _0x391f03={'grant_type':_0xad11('0x45'),'code':_0x1d21a1,'scope':getAccessTokenScope(_0x4ba858),'redirect_uri':_0x4ba858[_0xad11('0x28')],'client_id':_0x4ba858['data1'],'client_secret':encryptor['decryptString'](_0x4ba858['data3'])};var _0x1490c1={'method':_0xad11('0x41'),'uri':MICROSOFT_AUTH_URL['replace'](_0xad11('0x1c'),_0x4ba858['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x391f03,'json':!![]};return rp(_0x1490c1);}function startRefreshInterval(_0x2643b8){var _0x244fbd=schedule['intervals'];if(_0x244fbd[_0x2643b8['id']])clearInterval(_0x244fbd[_0x2643b8['id']]);_0x244fbd[_0x2643b8['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x2643b8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xad11('0x46')]=_0x244fbd;}function startAllRefreshIntervals(){return db[_0xad11('0x3c')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x5c94eb){var _0x40d6f6=_0x5c94eb[_0xad11('0x13')](function(_0x5ab9bf){return refreshOauth2MicrosoftAccessToken(_0x5ab9bf)[_0xad11('0x3a')](function(_0x51e798){startRefreshInterval(_0x51e798);});});return Promise[_0xad11('0x47')](_0x40d6f6);})[_0xad11('0x44')](function(_0x54ba61){var _0x30dcd1=_0x54ba61?util[_0xad11('0x48')](_0x54ba61,{'showHidden':![],'depth':null}):'';logger[_0xad11('0x49')](_0xad11('0x4a'),_0x30dcd1);});}module[_0xad11('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 31e1178..ec5fa2e 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 _0x762e=['CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x33bf36,_0xfb40b6){var _0x1921a9=function(_0x1e1009){while(--_0x1e1009){_0x33bf36['push'](_0x33bf36['shift']());}};_0x1921a9(++_0xfb40b6);}(_0x762e,0xea));var _0xe762=function(_0x2caa50,_0x2c936c){_0x2caa50=_0x2caa50-0x0;var _0x47a23f=_0x762e[_0x2caa50];return _0x47a23f;};'use strict';var _=require(_0xe762('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe762('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe762('0x2'))['db'];var utils=require(_0xe762('0x3'));var logger=require(_0xe762('0x4'))('rpc');var config=require(_0xe762('0x5'));var jayson=require(_0xe762('0x6'));var client=jayson[_0xe762('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4726,_0x7a1740,_0x2511ad){return new BPromise(function(_0xf20548,_0x26a4fc){return client[_0xe762('0x8')](_0x1f4726,_0x2511ad)['then'](function(_0x50dd96){logger[_0xe762('0x9')](_0xe762('0xa'),_0x7a1740,_0xe762('0xb'));logger[_0xe762('0xc')](_0xe762('0xd'),_0x7a1740,_0xe762('0xb'),JSON['stringify'](_0x50dd96));if(_0x50dd96[_0xe762('0xe')]){if(_0x50dd96[_0xe762('0xe')][_0xe762('0xf')]===0x1f4){logger['error'](_0xe762('0xa'),_0x7a1740,_0x50dd96['error'][_0xe762('0x10')]);return _0x26a4fc(_0x50dd96['error'][_0xe762('0x10')]);}logger[_0xe762('0xe')](_0xe762('0xa'),_0x7a1740,_0x50dd96['error']['message']);return _0xf20548(_0x50dd96[_0xe762('0xe')][_0xe762('0x10')]);}else{logger[_0xe762('0x9')](_0xe762('0xa'),_0x7a1740,_0xe762('0xb'));_0xf20548(_0x50dd96[_0xe762('0x11')][_0xe762('0x10')]);}})[_0xe762('0x12')](function(_0x531587){logger[_0xe762('0xe')](_0xe762('0xa'),_0x7a1740,_0x531587);_0x26a4fc(_0x531587);});});}
\ No newline at end of file
+var _0x6257=['info','request\x20sent','debug','code','message','error','CloudProvider,\x20%s,\x20%s','result','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x6257,0x1d4));var _0x7625=function(_0xdf62ba,_0x739410){_0xdf62ba=_0xdf62ba-0x0;var _0x3eac73=_0x6257[_0xdf62ba];return _0x3eac73;};'use strict';var _=require(_0x7625('0x0'));var util=require('util');var moment=require(_0x7625('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7625('0x2'));var db=require(_0x7625('0x3'))['db'];var utils=require(_0x7625('0x4'));var logger=require(_0x7625('0x5'))(_0x7625('0x6'));var config=require(_0x7625('0x7'));var jayson=require(_0x7625('0x8'));var client=jayson[_0x7625('0x9')][_0x7625('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x427050,_0x5cf7a8,_0x4b790d){return new BPromise(function(_0x287434,_0x1a02de){return client['request'](_0x427050,_0x4b790d)[_0x7625('0xb')](function(_0x2a2625){logger[_0x7625('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5cf7a8,_0x7625('0xd'));logger[_0x7625('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5cf7a8,_0x7625('0xd'),JSON['stringify'](_0x2a2625));if(_0x2a2625['error']){if(_0x2a2625['error'][_0x7625('0xf')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5cf7a8,_0x2a2625['error'][_0x7625('0x10')]);return _0x1a02de(_0x2a2625[_0x7625('0x11')][_0x7625('0x10')]);}logger[_0x7625('0x11')](_0x7625('0x12'),_0x5cf7a8,_0x2a2625[_0x7625('0x11')]['message']);return _0x287434(_0x2a2625['error'][_0x7625('0x10')]);}else{logger['info'](_0x7625('0x12'),_0x5cf7a8,_0x7625('0xd'));_0x287434(_0x2a2625[_0x7625('0x13')]['message']);}})['catch'](function(_0x43206e){logger[_0x7625('0x11')](_0x7625('0x12'),_0x5cf7a8,_0x43206e);_0x1a02de(_0x43206e);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6b884d6..aa5d69c 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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x27b563,_0x4ead98){var _0x22aae0=function(_0x22e04e){while(--_0x22e04e){_0x27b563['push'](_0x27b563['shift']());}};_0x22aae0(++_0x4ead98);}(_0xdb28,0x106));var _0x8db2=function(_0x5bb080,_0x3d6c47){_0x5bb080=_0x5bb080-0x0;var _0xb75fc2=_0xdb28[_0x5bb080];return _0xb75fc2;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x10f8fb,_0x1748be){var _0x81292e=function(_0x525ec7){while(--_0x525ec7){_0x10f8fb['push'](_0x10f8fb['shift']());}};_0x81292e(++_0x1748be);}(_0xdb28,0x106));var _0x8db2=function(_0x39d434,_0x4b85a2){_0x39d434=_0x39d434-0x0;var _0x3ada07=_0xdb28[_0x39d434];return _0x3ada07;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 82222f3..610cc3a 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 _0x1744=['STRING','name','sequelize'];(function(_0x4834c7,_0x320620){var _0x597940=function(_0x58ece4){while(--_0x58ece4){_0x4834c7['push'](_0x4834c7['shift']());}};_0x597940(++_0x320620);}(_0x1744,0xa1));var _0x4174=function(_0x5dfbe2,_0x23dd83){_0x5dfbe2=_0x5dfbe2-0x0;var _0x56f520=_0x1744[_0x5dfbe2];return _0x56f520;};'use strict';var Sequelize=require(_0x4174('0x0'));module['exports']={'name':{'type':Sequelize[_0x4174('0x1')],'unique':_0x4174('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4174('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x4174('0x1')]},'phone':{'type':Sequelize[_0x4174('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4174('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4174('0x1')]},'country':{'type':Sequelize[_0x4174('0x1')]},'email':{'type':Sequelize[_0x4174('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4174('0x1')]},'sStreet':{'type':Sequelize[_0x4174('0x1')]},'sPostalCode':{'type':Sequelize[_0x4174('0x1')]},'sCity':{'type':Sequelize[_0x4174('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4174('0x1')]}};
\ No newline at end of file
+var _0x7192=['exports','STRING','name'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0x7192,0x1ad));var _0x2719=function(_0x3fd4c5,_0x530fdb){_0x3fd4c5=_0x3fd4c5-0x0;var _0x4eb8f2=_0x7192[_0x3fd4c5];return _0x4eb8f2;};'use strict';var Sequelize=require('sequelize');module[_0x2719('0x0')]={'name':{'type':Sequelize[_0x2719('0x1')],'unique':_0x2719('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x2719('0x1')]},'website':{'type':Sequelize[_0x2719('0x1')]},'phone':{'type':Sequelize[_0x2719('0x1')]},'fax':{'type':Sequelize[_0x2719('0x1')]},'type':{'type':Sequelize[_0x2719('0x1')]},'street':{'type':Sequelize[_0x2719('0x1')]},'postalCode':{'type':Sequelize[_0x2719('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2719('0x1')]},'email':{'type':Sequelize[_0x2719('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2719('0x1')]},'sStreet':{'type':Sequelize[_0x2719('0x1')]},'sPostalCode':{'type':Sequelize[_0x2719('0x1')]},'sCity':{'type':Sequelize[_0x2719('0x1')]},'sCountry':{'type':Sequelize[_0x2719('0x1')]},'description':{'type':Sequelize[_0x2719('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index e088f77..9b864a0 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 _0x8d26=['send','index','CmCompany','describe','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','findOne','rawAttributes','length','getContacts','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name'];(function(_0x578a6a,_0x3176b4){var _0x346e31=function(_0x201209){while(--_0x201209){_0x578a6a['push'](_0x578a6a['shift']());}};_0x346e31(++_0x3176b4);}(_0x8d26,0x1d8));var _0x68d2=function(_0x4346aa,_0x1e597e){_0x4346aa=_0x4346aa-0x0;var _0x31a809=_0x8d26[_0x4346aa];return _0x31a809;};'use strict';var emlformat=require(_0x68d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68d2('0x1'));var jsonpatch=require(_0x68d2('0x2'));var rp=require(_0x68d2('0x3'));var moment=require(_0x68d2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x68d2('0x5'));var sox=require(_0x68d2('0x6'));var csv=require(_0x68d2('0x7'));var ejs=require(_0x68d2('0x8'));var fs=require('fs');var fs_extra=require(_0x68d2('0x9'));var _=require(_0x68d2('0xa'));var squel=require(_0x68d2('0xb'));var crypto=require(_0x68d2('0xc'));var jsforce=require(_0x68d2('0xd'));var deskjs=require(_0x68d2('0xe'));var toCsv=require(_0x68d2('0x7'));var querystring=require('querystring');var Papa=require(_0x68d2('0xf'));var Redis=require(_0x68d2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x68d2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68d2('0x12'));var logger=require('../../config/logger')(_0x68d2('0x13'));var utils=require(_0x68d2('0x14'));var config=require(_0x68d2('0x15'));var licenseUtil=require(_0x68d2('0x16'));var db=require(_0x68d2('0x17'))['db'];function respondWithStatusCode(_0x2cfba1,_0x333767){_0x333767=_0x333767||0xcc;return function(_0x450284){if(_0x450284){return _0x2cfba1[_0x68d2('0x18')](_0x333767);}return _0x2cfba1['status'](_0x333767)[_0x68d2('0x19')]();};}function respondWithResult(_0x331ebe,_0x1a5a63){_0x1a5a63=_0x1a5a63||0xc8;return function(_0x359418){if(_0x359418){return _0x331ebe[_0x68d2('0x1a')](_0x1a5a63)['json'](_0x359418);}};}function respondWithFilteredResult(_0x460a4b,_0x3e02f1){return function(_0x56039d){if(_0x56039d){var _0x4c7989=typeof _0x3e02f1['offset']===_0x68d2('0x1b')&&typeof _0x3e02f1[_0x68d2('0x1c')]===_0x68d2('0x1b');var _0x35ca01=_0x56039d[_0x68d2('0x1d')];var _0x77d237=_0x4c7989?0x0:_0x3e02f1[_0x68d2('0x1e')];var _0x5e8b42=_0x4c7989?_0x56039d[_0x68d2('0x1d')]:_0x3e02f1[_0x68d2('0x1e')]+_0x3e02f1[_0x68d2('0x1c')];var _0x51b7f8;if(_0x5e8b42>=_0x35ca01){_0x5e8b42=_0x35ca01;_0x51b7f8=0xc8;}else{_0x51b7f8=0xce;}_0x460a4b[_0x68d2('0x1a')](_0x51b7f8);return _0x460a4b['set'](_0x68d2('0x1f'),_0x77d237+'-'+_0x5e8b42+'/'+_0x35ca01)[_0x68d2('0x20')](_0x56039d);}return null;};}function patchUpdates(_0x11c212){return function(_0x31a19b){try{jsonpatch[_0x68d2('0x21')](_0x31a19b,_0x11c212,!![]);}catch(_0x9eefa0){return BPromise['reject'](_0x9eefa0);}return _0x31a19b[_0x68d2('0x22')]();};}function saveUpdates(_0x20407e,_0xa443d8){return function(_0x49f53e){if(_0x49f53e){return _0x49f53e[_0x68d2('0x23')](_0x20407e)[_0x68d2('0x24')](function(_0x4e8e44){return _0x4e8e44;});}return null;};}function removeEntity(_0x17225e,_0x36d7bb){return function(_0x1bb65c){if(_0x1bb65c){return _0x1bb65c[_0x68d2('0x25')]()[_0x68d2('0x24')](function(){var _0x52f29c=_0x1bb65c[_0x68d2('0x26')]({'plain':!![]});var _0x1dabee=_0x68d2('0x27');return db[_0x68d2('0x28')][_0x68d2('0x25')]({'where':{'type':_0x1dabee,'resourceId':_0x52f29c['id']}})[_0x68d2('0x24')](function(){return _0x1bb65c;});})[_0x68d2('0x24')](function(){_0x17225e[_0x68d2('0x1a')](0xcc)[_0x68d2('0x19')]();});}};}function handleEntityNotFound(_0x4f6c4c,_0x5dd205){return function(_0x6bb765){if(!_0x6bb765){_0x4f6c4c[_0x68d2('0x18')](0x194);}return _0x6bb765;};}function handleError(_0x183333,_0x497787){_0x497787=_0x497787||0x1f4;return function(_0x3a474a){logger[_0x68d2('0x29')](_0x3a474a[_0x68d2('0x2a')]);if(_0x3a474a[_0x68d2('0x2b')]){delete _0x3a474a[_0x68d2('0x2b')];}_0x183333[_0x68d2('0x1a')](_0x497787)[_0x68d2('0x2c')](_0x3a474a);};}exports[_0x68d2('0x2d')]=function(_0x4a3031,_0x16e5ce){var _0x46b0fa={},_0x1e3bbb={},_0x2c6556={'count':0x0,'rows':[]};return db[_0x68d2('0x2e')][_0x68d2('0x2f')]()[_0x68d2('0x24')](function(_0x47603a){_0x1e3bbb[_0x68d2('0x30')]=_['keys'](_0x47603a);_0x1e3bbb['query']=_[_0x68d2('0x31')](_0x4a3031['query']);_0x1e3bbb[_0x68d2('0x32')]=_[_0x68d2('0x33')](_0x1e3bbb[_0x68d2('0x30')],_0x1e3bbb[_0x68d2('0x34')]);_0x46b0fa[_0x68d2('0x35')]=_[_0x68d2('0x33')](_0x1e3bbb[_0x68d2('0x30')],qs[_0x68d2('0x36')](_0x4a3031['query']['fields']));_0x46b0fa[_0x68d2('0x35')]=_0x46b0fa[_0x68d2('0x35')]['length']?_0x46b0fa[_0x68d2('0x35')]:_0x1e3bbb[_0x68d2('0x30')];if(!_0x4a3031[_0x68d2('0x34')][_0x68d2('0x37')](_0x68d2('0x38'))){_0x46b0fa[_0x68d2('0x1c')]=qs[_0x68d2('0x1c')](_0x4a3031['query']['limit']);_0x46b0fa[_0x68d2('0x1e')]=qs[_0x68d2('0x1e')](_0x4a3031[_0x68d2('0x34')][_0x68d2('0x1e')]);}_0x46b0fa['order']=qs[_0x68d2('0x39')](_0x4a3031['query'][_0x68d2('0x39')]);_0x46b0fa[_0x68d2('0x3a')]=qs[_0x68d2('0x32')](_[_0x68d2('0x3b')](_0x4a3031[_0x68d2('0x34')],_0x1e3bbb['filters']),_0x47603a);if(_0x4a3031[_0x68d2('0x34')][_0x68d2('0x3c')]){_0x46b0fa[_0x68d2('0x3a')]=_[_0x68d2('0x3d')](_0x46b0fa[_0x68d2('0x3a')],{'$or':_[_0x68d2('0x3e')](_0x46b0fa[_0x68d2('0x35')],function(_0x2910b0){var _0x591c62={};_0x591c62[_0x2910b0]={'$like':'%'+_0x4a3031[_0x68d2('0x34')][_0x68d2('0x3c')]+'%'};return _0x591c62;})});}_0x46b0fa=_[_0x68d2('0x3d')]({},_0x46b0fa,_0x4a3031[_0x68d2('0x3f')]);var _0x5c30a2={'where':_0x46b0fa[_0x68d2('0x3a')]};return db['CmCompany'][_0x68d2('0x1d')](_0x5c30a2)[_0x68d2('0x24')](function(_0x2449f7){_0x2c6556[_0x68d2('0x1d')]=_0x2449f7;if(_0x4a3031[_0x68d2('0x34')][_0x68d2('0x40')]){_0x46b0fa[_0x68d2('0x41')]=[{'all':!![]}];}return db['CmCompany'][_0x68d2('0x42')](_0x46b0fa);})['then'](function(_0x5031c1){_0x2c6556['rows']=_0x5031c1;return _0x2c6556;})[_0x68d2('0x24')](respondWithFilteredResult(_0x16e5ce,_0x46b0fa))['catch'](handleError(_0x16e5ce,null));})[_0x68d2('0x43')](handleError(_0x16e5ce,null));};exports[_0x68d2('0x44')]=function(_0x370631,_0x510fe7){var _0x181932={'raw':![],'where':{'id':_0x370631[_0x68d2('0x45')]['id']}},_0x353e48={};_0x353e48['model']=_[_0x68d2('0x31')](db[_0x68d2('0x2e')]['rawAttributes']);_0x353e48[_0x68d2('0x34')]=_[_0x68d2('0x31')](_0x370631[_0x68d2('0x34')]);_0x353e48[_0x68d2('0x32')]=_[_0x68d2('0x33')](_0x353e48[_0x68d2('0x30')],_0x353e48[_0x68d2('0x34')]);_0x181932['attributes']=_[_0x68d2('0x33')](_0x353e48[_0x68d2('0x30')],qs[_0x68d2('0x36')](_0x370631['query'][_0x68d2('0x36')]));_0x181932[_0x68d2('0x35')]=_0x181932[_0x68d2('0x35')]['length']?_0x181932[_0x68d2('0x35')]:_0x353e48[_0x68d2('0x30')];if(_0x370631[_0x68d2('0x34')][_0x68d2('0x40')]){_0x181932['include']=[{'all':!![]}];}_0x181932=_[_0x68d2('0x3d')]({},_0x181932,_0x370631[_0x68d2('0x3f')]);return db[_0x68d2('0x2e')]['find'](_0x181932)['then'](handleEntityNotFound(_0x510fe7,null))[_0x68d2('0x24')](respondWithResult(_0x510fe7,null))['catch'](handleError(_0x510fe7,null));};exports[_0x68d2('0x46')]=function(_0x1dad3c,_0x237a43){return db[_0x68d2('0x2e')][_0x68d2('0x46')](_0x1dad3c['body'],{})[_0x68d2('0x24')](function(_0x1f5782){var _0x135881=_0x1dad3c[_0x68d2('0x47')][_0x68d2('0x26')]({'plain':!![]});if(!_0x135881)throw new Error(_0x68d2('0x48'));if(_0x135881[_0x68d2('0x49')]===_0x68d2('0x47')){var _0x2474ac=_0x1f5782['get']({'plain':!![]});var _0x52fb8a=_0x68d2('0x27');return db['UserProfileSection'][_0x68d2('0x4a')]({'where':{'name':_0x52fb8a,'userProfileId':_0x135881[_0x68d2('0x4b')]},'raw':!![]})['then'](function(_0x32ab54){if(_0x32ab54&&_0x32ab54[_0x68d2('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x2474ac[_0x68d2('0x2b')],'resourceId':_0x2474ac['id'],'type':_0x32ab54[_0x68d2('0x2b')],'sectionId':_0x32ab54['id']},{})['then'](function(){return _0x1f5782;});}else{return _0x1f5782;}})[_0x68d2('0x43')](function(_0xc76dd9){logger['error'](_0x68d2('0x4d'),_0xc76dd9);throw _0xc76dd9;});}return _0x1f5782;})[_0x68d2('0x24')](respondWithResult(_0x237a43,0xc9))['catch'](handleError(_0x237a43,null));};exports[_0x68d2('0x23')]=function(_0x1e23ec,_0x51e889){if(_0x1e23ec['body']['id']){delete _0x1e23ec[_0x68d2('0x4e')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x1e23ec['params']['id']}})[_0x68d2('0x24')](handleEntityNotFound(_0x51e889,null))['then'](saveUpdates(_0x1e23ec['body'],null))[_0x68d2('0x24')](respondWithResult(_0x51e889,null))[_0x68d2('0x43')](handleError(_0x51e889,null));};exports[_0x68d2('0x25')]=function(_0x425e50,_0x20f417){return db['CmCompany'][_0x68d2('0x4a')]({'where':{'id':_0x425e50[_0x68d2('0x45')]['id']}})[_0x68d2('0x24')](handleEntityNotFound(_0x20f417,null))[_0x68d2('0x24')](removeEntity(_0x20f417,null))[_0x68d2('0x43')](handleError(_0x20f417,null));};exports['describe']=function(_0x1163ed,_0x3c8021){return db[_0x68d2('0x2e')]['describe']()[_0x68d2('0x24')](respondWithResult(_0x3c8021,null))[_0x68d2('0x43')](handleError(_0x3c8021,null));};exports[_0x68d2('0x4f')]=function(_0x415cc0,_0x5e3882,_0x4a412f){return db[_0x68d2('0x50')][_0x68d2('0x4a')]({'where':{'id':_0x415cc0['params']['id']}})[_0x68d2('0x24')](handleEntityNotFound(_0x5e3882,null))[_0x68d2('0x24')](function(_0x23c6e6){if(_0x23c6e6){return _0x23c6e6[_0x68d2('0x4f')](_0x415cc0[_0x68d2('0x4e')][_0x68d2('0x51')],_['omit'](_0x415cc0[_0x68d2('0x4e')],['ids','id'])||{});}})[_0x68d2('0x24')](respondWithResult(_0x5e3882,null))[_0x68d2('0x43')](handleError(_0x5e3882,null));};exports['getContacts']=function(_0xaf790e,_0x1d009a,_0x4f1d3d){var _0x180063={};var _0x38e0f3={};var _0x1f7d12;var _0x3b9774;return db[_0x68d2('0x2e')][_0x68d2('0x52')]({'where':{'id':_0xaf790e['params']['id']}})[_0x68d2('0x24')](handleEntityNotFound(_0x1d009a,null))[_0x68d2('0x24')](function(_0x131f35){if(_0x131f35){_0x1f7d12=_0x131f35;_0x38e0f3[_0x68d2('0x30')]=_['keys'](db['CmContact'][_0x68d2('0x53')]);_0x38e0f3['query']=_['keys'](_0xaf790e[_0x68d2('0x34')]);_0x38e0f3[_0x68d2('0x32')]=_[_0x68d2('0x33')](_0x38e0f3['model'],_0x38e0f3[_0x68d2('0x34')]);_0x180063['attributes']=_[_0x68d2('0x33')](_0x38e0f3['model'],qs[_0x68d2('0x36')](_0xaf790e[_0x68d2('0x34')][_0x68d2('0x36')]));_0x180063[_0x68d2('0x35')]=_0x180063['attributes'][_0x68d2('0x54')]?_0x180063['attributes']:_0x38e0f3[_0x68d2('0x30')];_0x180063['order']=qs['sort'](_0xaf790e['query'][_0x68d2('0x39')]);_0x180063['where']=qs['filters'](_[_0x68d2('0x3b')](_0xaf790e[_0x68d2('0x34')],_0x38e0f3[_0x68d2('0x32')]));if(_0xaf790e[_0x68d2('0x34')][_0x68d2('0x3c')]){_0x180063[_0x68d2('0x3a')]=_['merge'](_0x180063['where'],{'$or':_['map'](_0x180063[_0x68d2('0x35')],function(_0x2af247){var _0xb8b5ad={};_0xb8b5ad[_0x2af247]={'$like':'%'+_0xaf790e['query']['filter']+'%'};return _0xb8b5ad;})});}_0x180063=_[_0x68d2('0x3d')]({},_0x180063,_0xaf790e[_0x68d2('0x3f')]);return _0x1f7d12[_0x68d2('0x55')](_0x180063);}})['then'](function(_0x238411){if(_0x238411){_0x3b9774=_0x238411[_0x68d2('0x54')];if(!_0xaf790e[_0x68d2('0x34')][_0x68d2('0x37')](_0x68d2('0x38'))){_0x180063['limit']=qs[_0x68d2('0x1c')](_0xaf790e['query'][_0x68d2('0x1c')]);_0x180063[_0x68d2('0x1e')]=qs[_0x68d2('0x1e')](_0xaf790e[_0x68d2('0x34')][_0x68d2('0x1e')]);}return _0x1f7d12[_0x68d2('0x55')](_0x180063);}})['then'](function(_0x378d6b){if(_0x378d6b){return _0x378d6b?{'count':_0x3b9774,'rows':_0x378d6b}:null;}})[_0x68d2('0x24')](respondWithResult(_0x1d009a,null))[_0x68d2('0x43')](handleError(_0x1d009a,null));};
\ No newline at end of file
+var _0x96a5=['options','getContacts','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','UserProfileResource','error','stack','name','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','filter','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','update','describe','CmContact','addContacts','ids','omit','findOne','pick','map'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x96a5,0x1b0));var _0x596a=function(_0x22386b,_0x13ef9a){_0x22386b=_0x22386b-0x0;var _0x264264=_0x96a5[_0x22386b];return _0x264264;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x596a('0x0'));var jsonpatch=require(_0x596a('0x1'));var rp=require('request-promise');var moment=require(_0x596a('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x596a('0x3'));var path=require(_0x596a('0x4'));var sox=require(_0x596a('0x5'));var csv=require(_0x596a('0x6'));var ejs=require(_0x596a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x596a('0x8'));var squel=require(_0x596a('0x9'));var crypto=require(_0x596a('0xa'));var jsforce=require(_0x596a('0xb'));var deskjs=require(_0x596a('0xc'));var toCsv=require(_0x596a('0x6'));var querystring=require(_0x596a('0xd'));var Papa=require(_0x596a('0xe'));var Redis=require(_0x596a('0xf'));var authService=require(_0x596a('0x10'));var qs=require(_0x596a('0x11'));var as=require(_0x596a('0x12'));var hardwareService=require(_0x596a('0x13'));var logger=require(_0x596a('0x14'))(_0x596a('0x15'));var utils=require(_0x596a('0x16'));var config=require(_0x596a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x596a('0x18'))['db'];function respondWithStatusCode(_0x1f67bd,_0x4e5cdb){_0x4e5cdb=_0x4e5cdb||0xcc;return function(_0x443635){if(_0x443635){return _0x1f67bd[_0x596a('0x19')](_0x4e5cdb);}return _0x1f67bd['status'](_0x4e5cdb)[_0x596a('0x1a')]();};}function respondWithResult(_0x4d0497,_0x336a76){_0x336a76=_0x336a76||0xc8;return function(_0x844585){if(_0x844585){return _0x4d0497[_0x596a('0x1b')](_0x336a76)[_0x596a('0x1c')](_0x844585);}};}function respondWithFilteredResult(_0x5d26e2,_0x3d0090){return function(_0x65cbc5){if(_0x65cbc5){var _0x18508e=typeof _0x3d0090[_0x596a('0x1d')]==='undefined'&&typeof _0x3d0090[_0x596a('0x1e')]===_0x596a('0x1f');var _0x3d4f17=_0x65cbc5['count'];var _0xee4652=_0x18508e?0x0:_0x3d0090[_0x596a('0x1d')];var _0x2d2e55=_0x18508e?_0x65cbc5[_0x596a('0x20')]:_0x3d0090[_0x596a('0x1d')]+_0x3d0090[_0x596a('0x1e')];var _0x2ca15e;if(_0x2d2e55>=_0x3d4f17){_0x2d2e55=_0x3d4f17;_0x2ca15e=0xc8;}else{_0x2ca15e=0xce;}_0x5d26e2[_0x596a('0x1b')](_0x2ca15e);return _0x5d26e2[_0x596a('0x21')](_0x596a('0x22'),_0xee4652+'-'+_0x2d2e55+'/'+_0x3d4f17)[_0x596a('0x1c')](_0x65cbc5);}return null;};}function patchUpdates(_0x4a2b83){return function(_0xeab52e){try{jsonpatch['apply'](_0xeab52e,_0x4a2b83,!![]);}catch(_0x247803){return BPromise[_0x596a('0x23')](_0x247803);}return _0xeab52e[_0x596a('0x24')]();};}function saveUpdates(_0x3c7a4d,_0x236ad8){return function(_0x3e75c2){if(_0x3e75c2){return _0x3e75c2['update'](_0x3c7a4d)[_0x596a('0x25')](function(_0x162ea0){return _0x162ea0;});}return null;};}function removeEntity(_0x69be1a,_0x5178f1){return function(_0x37a7f7){if(_0x37a7f7){return _0x37a7f7[_0x596a('0x26')]()['then'](function(){var _0x5eb369=_0x37a7f7['get']({'plain':!![]});var _0x1c1891='Companies';return db[_0x596a('0x27')][_0x596a('0x26')]({'where':{'type':_0x1c1891,'resourceId':_0x5eb369['id']}})[_0x596a('0x25')](function(){return _0x37a7f7;});})[_0x596a('0x25')](function(){_0x69be1a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e559,_0x36ad9c){return function(_0xca8979){if(!_0xca8979){_0x55e559[_0x596a('0x19')](0x194);}return _0xca8979;};}function handleError(_0x425bb9,_0x1134a1){_0x1134a1=_0x1134a1||0x1f4;return function(_0x2cc794){logger[_0x596a('0x28')](_0x2cc794[_0x596a('0x29')]);if(_0x2cc794[_0x596a('0x2a')]){delete _0x2cc794[_0x596a('0x2a')];}_0x425bb9[_0x596a('0x1b')](_0x1134a1)['send'](_0x2cc794);};}exports[_0x596a('0x2b')]=function(_0x3ca4b9,_0x338f41){var _0x25e698={},_0xf2ee2b={},_0x2fc774={'count':0x0,'rows':[]};return db[_0x596a('0x2c')]['describe']()[_0x596a('0x25')](function(_0x35c6e6){_0xf2ee2b[_0x596a('0x2d')]=_[_0x596a('0x2e')](_0x35c6e6);_0xf2ee2b[_0x596a('0x2f')]=_[_0x596a('0x2e')](_0x3ca4b9[_0x596a('0x2f')]);_0xf2ee2b[_0x596a('0x30')]=_[_0x596a('0x31')](_0xf2ee2b['model'],_0xf2ee2b[_0x596a('0x2f')]);_0x25e698[_0x596a('0x32')]=_[_0x596a('0x31')](_0xf2ee2b[_0x596a('0x2d')],qs[_0x596a('0x33')](_0x3ca4b9['query'][_0x596a('0x33')]));_0x25e698[_0x596a('0x32')]=_0x25e698['attributes'][_0x596a('0x34')]?_0x25e698[_0x596a('0x32')]:_0xf2ee2b['model'];if(!_0x3ca4b9[_0x596a('0x2f')][_0x596a('0x35')]('nolimit')){_0x25e698[_0x596a('0x1e')]=qs[_0x596a('0x1e')](_0x3ca4b9[_0x596a('0x2f')][_0x596a('0x1e')]);_0x25e698[_0x596a('0x1d')]=qs[_0x596a('0x1d')](_0x3ca4b9['query'][_0x596a('0x1d')]);}_0x25e698['order']=qs[_0x596a('0x36')](_0x3ca4b9[_0x596a('0x2f')]['sort']);_0x25e698[_0x596a('0x37')]=qs['filters'](_['pick'](_0x3ca4b9[_0x596a('0x2f')],_0xf2ee2b['filters']),_0x35c6e6);if(_0x3ca4b9[_0x596a('0x2f')]['filter']){_0x25e698[_0x596a('0x37')]=_[_0x596a('0x38')](_0x25e698[_0x596a('0x37')],{'$or':_['map'](_0x25e698[_0x596a('0x32')],function(_0x32ce2a){var _0x307014={};_0x307014[_0x32ce2a]={'$like':'%'+_0x3ca4b9[_0x596a('0x2f')][_0x596a('0x39')]+'%'};return _0x307014;})});}_0x25e698=_[_0x596a('0x38')]({},_0x25e698,_0x3ca4b9['options']);var _0x12aba0={'where':_0x25e698['where']};return db['CmCompany']['count'](_0x12aba0)[_0x596a('0x25')](function(_0x3cb454){_0x2fc774[_0x596a('0x20')]=_0x3cb454;if(_0x3ca4b9[_0x596a('0x2f')][_0x596a('0x3a')]){_0x25e698['include']=[{'all':!![]}];}return db[_0x596a('0x2c')][_0x596a('0x3b')](_0x25e698);})['then'](function(_0x4ca786){_0x2fc774[_0x596a('0x3c')]=_0x4ca786;return _0x2fc774;})[_0x596a('0x25')](respondWithFilteredResult(_0x338f41,_0x25e698))[_0x596a('0x3d')](handleError(_0x338f41,null));})[_0x596a('0x3d')](handleError(_0x338f41,null));};exports['show']=function(_0x418c54,_0x15d8b8){var _0x22e4f8={'raw':![],'where':{'id':_0x418c54[_0x596a('0x3e')]['id']}},_0x3a39d3={};_0x3a39d3[_0x596a('0x2d')]=_[_0x596a('0x2e')](db[_0x596a('0x2c')][_0x596a('0x3f')]);_0x3a39d3['query']=_['keys'](_0x418c54[_0x596a('0x2f')]);_0x3a39d3['filters']=_['intersection'](_0x3a39d3[_0x596a('0x2d')],_0x3a39d3[_0x596a('0x2f')]);_0x22e4f8[_0x596a('0x32')]=_['intersection'](_0x3a39d3[_0x596a('0x2d')],qs['fields'](_0x418c54[_0x596a('0x2f')][_0x596a('0x33')]));_0x22e4f8[_0x596a('0x32')]=_0x22e4f8[_0x596a('0x32')][_0x596a('0x34')]?_0x22e4f8[_0x596a('0x32')]:_0x3a39d3[_0x596a('0x2d')];if(_0x418c54[_0x596a('0x2f')][_0x596a('0x3a')]){_0x22e4f8[_0x596a('0x40')]=[{'all':!![]}];}_0x22e4f8=_['merge']({},_0x22e4f8,_0x418c54['options']);return db[_0x596a('0x2c')][_0x596a('0x41')](_0x22e4f8)[_0x596a('0x25')](handleEntityNotFound(_0x15d8b8,null))[_0x596a('0x25')](respondWithResult(_0x15d8b8,null))[_0x596a('0x3d')](handleError(_0x15d8b8,null));};exports[_0x596a('0x42')]=function(_0x38079d,_0x595ee8){return db[_0x596a('0x2c')][_0x596a('0x42')](_0x38079d[_0x596a('0x43')],{})[_0x596a('0x25')](function(_0x54d3c1){var _0xee697d=_0x38079d[_0x596a('0x44')][_0x596a('0x45')]({'plain':!![]});if(!_0xee697d)throw new Error(_0x596a('0x46'));if(_0xee697d['role']===_0x596a('0x44')){var _0x2b8554=_0x54d3c1['get']({'plain':!![]});var _0xb4deeb=_0x596a('0x47');return db[_0x596a('0x48')][_0x596a('0x41')]({'where':{'name':_0xb4deeb,'userProfileId':_0xee697d[_0x596a('0x49')]},'raw':!![]})['then'](function(_0x503e6f){if(_0x503e6f&&_0x503e6f[_0x596a('0x4a')]===0x0){return db[_0x596a('0x27')]['create']({'name':_0x2b8554['name'],'resourceId':_0x2b8554['id'],'type':_0x503e6f[_0x596a('0x2a')],'sectionId':_0x503e6f['id']},{})[_0x596a('0x25')](function(){return _0x54d3c1;});}else{return _0x54d3c1;}})[_0x596a('0x3d')](function(_0x3f19e0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f19e0);throw _0x3f19e0;});}return _0x54d3c1;})[_0x596a('0x25')](respondWithResult(_0x595ee8,0xc9))['catch'](handleError(_0x595ee8,null));};exports[_0x596a('0x4b')]=function(_0xe66302,_0x1a509e){if(_0xe66302[_0x596a('0x43')]['id']){delete _0xe66302[_0x596a('0x43')]['id'];}return db[_0x596a('0x2c')][_0x596a('0x41')]({'where':{'id':_0xe66302['params']['id']}})[_0x596a('0x25')](handleEntityNotFound(_0x1a509e,null))[_0x596a('0x25')](saveUpdates(_0xe66302[_0x596a('0x43')],null))[_0x596a('0x25')](respondWithResult(_0x1a509e,null))[_0x596a('0x3d')](handleError(_0x1a509e,null));};exports['destroy']=function(_0x3698a9,_0x5be07b){return db[_0x596a('0x2c')][_0x596a('0x41')]({'where':{'id':_0x3698a9[_0x596a('0x3e')]['id']}})[_0x596a('0x25')](handleEntityNotFound(_0x5be07b,null))[_0x596a('0x25')](removeEntity(_0x5be07b,null))[_0x596a('0x3d')](handleError(_0x5be07b,null));};exports[_0x596a('0x4c')]=function(_0x520c0d,_0xe6b1a){return db['CmCompany'][_0x596a('0x4c')]()[_0x596a('0x25')](respondWithResult(_0xe6b1a,null))[_0x596a('0x3d')](handleError(_0xe6b1a,null));};exports['addContacts']=function(_0x1c12f9,_0x556c95,_0x39d997){return db[_0x596a('0x4d')][_0x596a('0x41')]({'where':{'id':_0x1c12f9[_0x596a('0x3e')]['id']}})[_0x596a('0x25')](handleEntityNotFound(_0x556c95,null))[_0x596a('0x25')](function(_0x4e383c){if(_0x4e383c){return _0x4e383c[_0x596a('0x4e')](_0x1c12f9[_0x596a('0x43')][_0x596a('0x4f')],_[_0x596a('0x50')](_0x1c12f9[_0x596a('0x43')],['ids','id'])||{});}})['then'](respondWithResult(_0x556c95,null))[_0x596a('0x3d')](handleError(_0x556c95,null));};exports['getContacts']=function(_0x224b95,_0x16f445,_0x6d8231){var _0x594d28={};var _0x3dacba={};var _0x5083c9;var _0x2f4ff9;return db[_0x596a('0x2c')][_0x596a('0x51')]({'where':{'id':_0x224b95[_0x596a('0x3e')]['id']}})[_0x596a('0x25')](handleEntityNotFound(_0x16f445,null))['then'](function(_0x517c3f){if(_0x517c3f){_0x5083c9=_0x517c3f;_0x3dacba[_0x596a('0x2d')]=_[_0x596a('0x2e')](db['CmContact']['rawAttributes']);_0x3dacba[_0x596a('0x2f')]=_[_0x596a('0x2e')](_0x224b95[_0x596a('0x2f')]);_0x3dacba[_0x596a('0x30')]=_['intersection'](_0x3dacba['model'],_0x3dacba[_0x596a('0x2f')]);_0x594d28[_0x596a('0x32')]=_[_0x596a('0x31')](_0x3dacba[_0x596a('0x2d')],qs[_0x596a('0x33')](_0x224b95[_0x596a('0x2f')][_0x596a('0x33')]));_0x594d28[_0x596a('0x32')]=_0x594d28[_0x596a('0x32')][_0x596a('0x34')]?_0x594d28['attributes']:_0x3dacba[_0x596a('0x2d')];_0x594d28['order']=qs[_0x596a('0x36')](_0x224b95[_0x596a('0x2f')][_0x596a('0x36')]);_0x594d28[_0x596a('0x37')]=qs[_0x596a('0x30')](_[_0x596a('0x52')](_0x224b95['query'],_0x3dacba[_0x596a('0x30')]));if(_0x224b95[_0x596a('0x2f')][_0x596a('0x39')]){_0x594d28[_0x596a('0x37')]=_[_0x596a('0x38')](_0x594d28[_0x596a('0x37')],{'$or':_[_0x596a('0x53')](_0x594d28[_0x596a('0x32')],function(_0x4b0412){var _0x1e9452={};_0x1e9452[_0x4b0412]={'$like':'%'+_0x224b95[_0x596a('0x2f')][_0x596a('0x39')]+'%'};return _0x1e9452;})});}_0x594d28=_[_0x596a('0x38')]({},_0x594d28,_0x224b95[_0x596a('0x54')]);return _0x5083c9[_0x596a('0x55')](_0x594d28);}})[_0x596a('0x25')](function(_0x424cc1){if(_0x424cc1){_0x2f4ff9=_0x424cc1[_0x596a('0x34')];if(!_0x224b95['query'][_0x596a('0x35')]('nolimit')){_0x594d28[_0x596a('0x1e')]=qs['limit'](_0x224b95['query'][_0x596a('0x1e')]);_0x594d28['offset']=qs[_0x596a('0x1d')](_0x224b95[_0x596a('0x2f')][_0x596a('0x1d')]);}return _0x5083c9[_0x596a('0x55')](_0x594d28);}})[_0x596a('0x25')](function(_0x17b051){if(_0x17b051){return _0x17b051?{'count':_0x2f4ff9,'rows':_0x17b051}:null;}})[_0x596a('0x25')](respondWithResult(_0x16f445,null))['catch'](handleError(_0x16f445,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index cc81d04..b893a47 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 _0x6178=['exports','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x24d711,_0x3cdb28){var _0x3491b4=function(_0xd5957e){while(--_0xd5957e){_0x24d711['push'](_0x24d711['shift']());}};_0x3491b4(++_0x3cdb28);}(_0x6178,0xf1));var _0x8617=function(_0x12ec65,_0x5bd7c9){_0x12ec65=_0x12ec65-0x0;var _0x28502f=_0x6178[_0x12ec65];return _0x28502f;};'use strict';var _=require(_0x8617('0x0'));var util=require(_0x8617('0x1'));var logger=require('../../config/logger')(_0x8617('0x2'));var moment=require(_0x8617('0x3'));var BPromise=require('bluebird');var rp=require(_0x8617('0x4'));var fs=require('fs');var path=require(_0x8617('0x5'));var rimraf=require(_0x8617('0x6'));var config=require(_0x8617('0x7'));var attributes=require(_0x8617('0x8'));module[_0x8617('0x9')]=function(_0x1ac47c,_0x491605){return _0x1ac47c['define']('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96c4=['exports','define','util','api','bluebird','request-promise','rimraf'];(function(_0x20bb5a,_0x3a325a){var _0x30e0eb=function(_0x2f12e3){while(--_0x2f12e3){_0x20bb5a['push'](_0x20bb5a['shift']());}};_0x30e0eb(++_0x3a325a);}(_0x96c4,0x79));var _0x496c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x96c4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x496c('0x0'));var logger=require('../../config/logger')(_0x496c('0x1'));var moment=require('moment');var BPromise=require(_0x496c('0x2'));var rp=require(_0x496c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x496c('0x4'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x496c('0x5')]=function(_0x2b7557,_0x41e040){return _0x2b7557[_0x496c('0x6')]('CmCompany',attributes,{'tableName':'cm_companies','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 ca3d0b2..fc43ecb 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 _0x269a=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x19ea51,_0x24be66){var _0xba11b=function(_0x2f796c){while(--_0x2f796c){_0x19ea51['push'](_0x19ea51['shift']());}};_0xba11b(++_0x24be66);}(_0x269a,0x14a));var _0xa269=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x269a[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var util=require(_0xa269('0x0'));var moment=require(_0xa269('0x1'));var BPromise=require(_0xa269('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa269('0x3'));var db=require(_0xa269('0x4'))['db'];var utils=require(_0xa269('0x5'));var logger=require(_0xa269('0x6'))('rpc');var config=require(_0xa269('0x7'));var jayson=require(_0xa269('0x8'));var client=jayson[_0xa269('0x9')][_0xa269('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47b91f,_0x33249f,_0x44d510){return new BPromise(function(_0x48dd40,_0x430883){return client[_0xa269('0xb')](_0x47b91f,_0x44d510)[_0xa269('0xc')](function(_0x2a6527){logger['info'](_0xa269('0xd'),_0x33249f,'request\x20sent');logger['debug'](_0xa269('0xe'),_0x33249f,'request\x20sent',JSON[_0xa269('0xf')](_0x2a6527));if(_0x2a6527[_0xa269('0x10')]){if(_0x2a6527[_0xa269('0x10')][_0xa269('0x11')]===0x1f4){logger[_0xa269('0x10')](_0xa269('0xd'),_0x33249f,_0x2a6527[_0xa269('0x10')][_0xa269('0x12')]);return _0x430883(_0x2a6527[_0xa269('0x10')][_0xa269('0x12')]);}logger[_0xa269('0x10')](_0xa269('0xd'),_0x33249f,_0x2a6527[_0xa269('0x10')][_0xa269('0x12')]);return _0x48dd40(_0x2a6527[_0xa269('0x10')][_0xa269('0x12')]);}else{logger[_0xa269('0x13')](_0xa269('0xd'),_0x33249f,'request\x20sent');_0x48dd40(_0x2a6527[_0xa269('0x14')][_0xa269('0x12')]);}})[_0xa269('0x15')](function(_0x500853){logger['error'](_0xa269('0xd'),_0x33249f,_0x500853);_0x430883(_0x500853);});});}
\ No newline at end of file
+var _0x72ed=['../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0xb1eb5c,_0x141fc4){var _0x2cde86=function(_0x20b558){while(--_0x20b558){_0xb1eb5c['push'](_0xb1eb5c['shift']());}};_0x2cde86(++_0x141fc4);}(_0x72ed,0x16f));var _0xd72e=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x72ed[_0x576170];return _0x397c70;};'use strict';var _=require('lodash');var util=require(_0xd72e('0x0'));var moment=require(_0xd72e('0x1'));var BPromise=require(_0xd72e('0x2'));var rs=require(_0xd72e('0x3'));var fs=require('fs');var Redis=require(_0xd72e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd72e('0x5'))(_0xd72e('0x6'));var config=require(_0xd72e('0x7'));var jayson=require(_0xd72e('0x8'));var client=jayson['client'][_0xd72e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c8d0b,_0x32e145,_0x17fa61){return new BPromise(function(_0x57dcb2,_0x4a5781){return client[_0xd72e('0xa')](_0x3c8d0b,_0x17fa61)[_0xd72e('0xb')](function(_0x42e1bc){logger[_0xd72e('0xc')](_0xd72e('0xd'),_0x32e145,_0xd72e('0xe'));logger[_0xd72e('0xf')](_0xd72e('0x10'),_0x32e145,_0xd72e('0xe'),JSON[_0xd72e('0x11')](_0x42e1bc));if(_0x42e1bc[_0xd72e('0x12')]){if(_0x42e1bc[_0xd72e('0x12')][_0xd72e('0x13')]===0x1f4){logger[_0xd72e('0x12')]('CmCompany,\x20%s,\x20%s',_0x32e145,_0x42e1bc[_0xd72e('0x12')]['message']);return _0x4a5781(_0x42e1bc[_0xd72e('0x12')][_0xd72e('0x14')]);}logger[_0xd72e('0x12')](_0xd72e('0xd'),_0x32e145,_0x42e1bc[_0xd72e('0x12')][_0xd72e('0x14')]);return _0x57dcb2(_0x42e1bc[_0xd72e('0x12')][_0xd72e('0x14')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x32e145,_0xd72e('0xe'));_0x57dcb2(_0x42e1bc[_0xd72e('0x15')][_0xd72e('0x14')]);}})['catch'](function(_0x1ea80e){logger[_0xd72e('0x12')](_0xd72e('0xd'),_0x32e145,_0x1ea80e);_0x4a5781(_0x1ea80e);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 54cefda..6cffd9c 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 _0xab64=['describe','/:id','show','/:id/contacts','getContacts','create','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get'];(function(_0x2e1da7,_0x4e26dc){var _0x151559=function(_0x1002b2){while(--_0x1002b2){_0x2e1da7['push'](_0x2e1da7['shift']());}};_0x151559(++_0x4e26dc);}(_0xab64,0xa0));var _0x4ab6=function(_0x4c85c5,_0x38bcf8){_0x4c85c5=_0x4c85c5-0x0;var _0x148b9b=_0xab64[_0x4c85c5];return _0x148b9b;};'use strict';var multer=require(_0x4ab6('0x0'));var util=require(_0x4ab6('0x1'));var path=require(_0x4ab6('0x2'));var timeout=require(_0x4ab6('0x3'));var express=require('express');var router=express[_0x4ab6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ab6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4ab6('0x6'));var controller=require(_0x4ab6('0x7'));router['get']('/',auth[_0x4ab6('0x8')](),controller[_0x4ab6('0x9')]);router[_0x4ab6('0xa')]('/describe',auth[_0x4ab6('0x8')](),controller[_0x4ab6('0xb')]);router[_0x4ab6('0xa')](_0x4ab6('0xc'),auth[_0x4ab6('0x8')](),controller[_0x4ab6('0xd')]);router[_0x4ab6('0xa')](_0x4ab6('0xe'),auth[_0x4ab6('0x8')](),controller[_0x4ab6('0xf')]);router['post']('/',auth[_0x4ab6('0x8')](),controller[_0x4ab6('0x10')]);router['post']('/:id/contacts',auth[_0x4ab6('0x8')](),controller['addContacts']);router['put'](_0x4ab6('0xc'),auth[_0x4ab6('0x8')](),controller['update']);router[_0x4ab6('0x11')](_0x4ab6('0xc'),auth[_0x4ab6('0x8')](),controller['destroy']);module[_0x4ab6('0x12')]=router;
\ No newline at end of file
+var _0x2198=['isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get'];(function(_0x314f6e,_0x3b43b0){var _0x33f886=function(_0x588569){while(--_0x588569){_0x314f6e['push'](_0x314f6e['shift']());}};_0x33f886(++_0x3b43b0);}(_0x2198,0x1ee));var _0x8219=function(_0x2765c0,_0x55f7ed){_0x2765c0=_0x2765c0-0x0;var _0x211c3e=_0x2198[_0x2765c0];return _0x211c3e;};'use strict';var multer=require(_0x8219('0x0'));var util=require(_0x8219('0x1'));var path=require(_0x8219('0x2'));var timeout=require('connect-timeout');var express=require(_0x8219('0x3'));var router=express[_0x8219('0x4')]();var fs_extra=require(_0x8219('0x5'));var auth=require(_0x8219('0x6'));var interaction=require(_0x8219('0x7'));var config=require('../../config/environment');var controller=require(_0x8219('0x8'));router[_0x8219('0x9')]('/',auth[_0x8219('0xa')](),controller['index']);router[_0x8219('0x9')](_0x8219('0xb'),auth[_0x8219('0xa')](),controller[_0x8219('0xc')]);router['get'](_0x8219('0xd'),auth['isAuthenticated'](),controller[_0x8219('0xe')]);router[_0x8219('0x9')](_0x8219('0xf'),auth[_0x8219('0xa')](),controller['getContacts']);router[_0x8219('0x10')]('/',auth[_0x8219('0xa')](),controller[_0x8219('0x11')]);router[_0x8219('0x10')](_0x8219('0xf'),auth[_0x8219('0xa')](),controller[_0x8219('0x12')]);router[_0x8219('0x13')]('/:id',auth[_0x8219('0xa')](),controller[_0x8219('0x14')]);router[_0x8219('0x15')](_0x8219('0xd'),auth[_0x8219('0xa')](),controller[_0x8219('0x16')]);module[_0x8219('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 2d2818f..65468e0 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 _0xb0c1=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x403fb1,_0x5eb616){var _0x45ce2c=function(_0x5114ed){while(--_0x5114ed){_0x403fb1['push'](_0x403fb1['shift']());}};_0x45ce2c(++_0x5eb616);}(_0xb0c1,0xb1));var _0x1b0c=function(_0x2654eb,_0x25fd2a){_0x2654eb=_0x2654eb-0x0;var _0x4faa95=_0xb0c1[_0x2654eb];return _0x4faa95;};'use strict';var _=require(_0x1b0c('0x0'));var Sequelize=require('sequelize');module[_0x1b0c('0x1')]={'firstName':{'type':Sequelize[_0x1b0c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1b0c('0x2')]},'street':{'type':Sequelize[_0x1b0c('0x2')]},'postalCode':{'type':Sequelize[_0x1b0c('0x2')]},'city':{'type':Sequelize[_0x1b0c('0x2')]},'country':{'type':Sequelize[_0x1b0c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1b0c('0x2')]},'description':{'type':Sequelize[_0x1b0c('0x3')]},'phone':{'type':Sequelize[_0x1b0c('0x2')]},'mobile':{'type':Sequelize[_0x1b0c('0x2')]},'fax':{'type':Sequelize[_0x1b0c('0x2')]},'email':{'type':Sequelize[_0x1b0c('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x1b0c('0x2')]},'fb_data':{'type':Sequelize[_0x1b0c('0x2')]},'twitter':{'type':Sequelize[_0x1b0c('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1b0c('0x2')]},'viber':{'type':Sequelize[_0x1b0c('0x2')]},'line':{'type':Sequelize[_0x1b0c('0x2')]},'wechat':{'type':Sequelize[_0x1b0c('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1b0c('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x1b0c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1b0c('0x6')],'defaultValue':Sequelize[_0x1b0c('0x7')]},'dialTimezone':{'type':Sequelize[_0x1b0c('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa8ab=['UNSIGNED','NOW','lodash','STRING','INTEGER'];(function(_0x630223,_0x3c8fa3){var _0x1f57ec=function(_0x259a73){while(--_0x259a73){_0x630223['push'](_0x630223['shift']());}};_0x1f57ec(++_0x3c8fa3);}(_0xa8ab,0x183));var _0xba8a=function(_0x4fc125,_0x2c8989){_0x4fc125=_0x4fc125-0x0;var _0x19962b=_0xa8ab[_0x4fc125];return _0x19962b;};'use strict';var _=require(_0xba8a('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0xba8a('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xba8a('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xba8a('0x1')]},'city':{'type':Sequelize[_0xba8a('0x1')]},'country':{'type':Sequelize[_0xba8a('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xba8a('0x1')]},'mobile':{'type':Sequelize[_0xba8a('0x1')]},'fax':{'type':Sequelize[_0xba8a('0x1')]},'email':{'type':Sequelize[_0xba8a('0x1')]},'url':{'type':Sequelize[_0xba8a('0x1')]},'facebook':{'type':Sequelize[_0xba8a('0x1')]},'fb_data':{'type':Sequelize[_0xba8a('0x1')]},'twitter':{'type':Sequelize[_0xba8a('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xba8a('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xba8a('0x1')]},'wechat':{'type':Sequelize[_0xba8a('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xba8a('0x2')](0x2)[_0xba8a('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xba8a('0x4')]},'dialTimezone':{'type':Sequelize[_0xba8a('0x1')]},'utcOffset':{'type':Sequelize[_0xba8a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 1b95668..90f5df8 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 _0x39d3=['CmCustomField','findAll','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','CmHopperBlack','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','dialTimezone','isNil','timezones','utcOffset','additionalPhones','each','duplicates','where','push','ListId','spread','show','Tag','Tags','tag','CmContactHasItem','Phones','ContactItemType','sequelize','Phones.OrderBy','$and','omit','format','cf_%d','pickBy','map','isEmpty','table','setFields','id\x20=\x20?','phone','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','filter','getTags','setTags','ids','setAdditionalPhones','all','item_types','items','ItemTypeId','description','CmHopperAdditionalPhone','item','PHONE','OrderBy','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','bulkCreate','literal','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','nolimit','pick','ContactId','options','rows','getHopperHistories','includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','import','agent','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','exit','User','fork','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userThirdDisposition','UserId','DESC','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','fullname','color','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','openchannel','externalUrl','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','path','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/environment/shared','redis','defaults','./cmContact.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','index','describe','getOptions','query','catch','CmContact','find','params','tags','length','keys','startsWith','cf_','displayName'];(function(_0x285974,_0x429798){var _0x1bf1f4=function(_0xcab200){while(--_0xcab200){_0x285974['push'](_0x285974['shift']());}};_0x1bf1f4(++_0x429798);}(_0x39d3,0x1c8));var _0x339d=function(_0xae92eb,_0x18ab88){_0xae92eb=_0xae92eb-0x0;var _0x2594f3=_0x39d3[_0xae92eb];return _0x2594f3;};'use strict';var moment=require(_0x339d('0x0'));var BPromise=require(_0x339d('0x1'));var util=require('util');var path=require(_0x339d('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x339d('0x3'));var Papa=require('papaparse');var Redis=require(_0x339d('0x4'));var contacts=require('../../components/contacts');var qs=require(_0x339d('0x5'));var logger=require(_0x339d('0x6'))('api');var config=require(_0x339d('0x7'));var shared=require(_0x339d('0x8'));var db=require('../../mysqldb')['db'];config[_0x339d('0x9')]=_[_0x339d('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x339d('0x9')]));require(_0x339d('0xb'))[_0x339d('0xc')](socket);function respondWithResult(_0x4d518b,_0x33ca2c){_0x33ca2c=_0x33ca2c||0xc8;return function(_0x34ab8e){if(_0x34ab8e){return _0x4d518b[_0x339d('0xd')](_0x33ca2c)[_0x339d('0xe')](_0x34ab8e);}};}function respondWithFilteredResult(_0x1eeda5,_0x5e74ff){return function(_0x54bffb){if(_0x54bffb){var _0x538c81=typeof _0x5e74ff[_0x339d('0xf')]===_0x339d('0x10')&&typeof _0x5e74ff['limit']===_0x339d('0x10');var _0x27c55e=_0x54bffb['count'];var _0x28d8ee=_0x538c81?0x0:_0x5e74ff[_0x339d('0xf')];var _0x302142=_0x538c81?_0x54bffb[_0x339d('0x11')]:_0x5e74ff[_0x339d('0xf')]+_0x5e74ff[_0x339d('0x12')];var _0x5c6f6a;if(_0x302142>=_0x27c55e){_0x302142=_0x27c55e;_0x5c6f6a=0xc8;}else{_0x5c6f6a=0xce;}_0x1eeda5[_0x339d('0xd')](_0x5c6f6a);return _0x1eeda5[_0x339d('0x13')](_0x339d('0x14'),_0x28d8ee+'-'+_0x302142+'/'+_0x27c55e)['json'](_0x54bffb);}return null;};}function saveUpdates(_0xab6227){return function(_0x593959){if(_0x593959){return _0x593959['update'](_0xab6227)[_0x339d('0x15')](function(_0x24b983){return _0x24b983;});}return null;};}function removeEntity(_0x3eddc6){return function(_0xad90f9){if(_0xad90f9){return _0xad90f9[_0x339d('0x16')]()[_0x339d('0x15')](function(){_0x3eddc6[_0x339d('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfb3685){return function(_0x530f5d){if(!_0x530f5d){_0xfb3685[_0x339d('0x17')](0x194);}return _0x530f5d;};}function handleError(_0x646ac7,_0x357e60){_0x357e60=_0x357e60||0x1f4;return function(_0x3cefbb){logger[_0x339d('0x18')](_0x3cefbb[_0x339d('0x19')]);if(_0x3cefbb[_0x339d('0x1a')]){delete _0x3cefbb[_0x339d('0x1a')];}_0x646ac7[_0x339d('0xd')](_0x357e60)[_0x339d('0x1b')](_0x3cefbb);};}exports[_0x339d('0x1c')]=function(_0x443590,_0x546e72){var _0x72a79c={};return contacts[_0x339d('0x1d')]()[_0x339d('0x15')](function(_0xf14cf3){_0x72a79c=qs[_0x339d('0x1e')](_0xf14cf3,_0x443590);return contacts['findAll'](_0x443590[_0x339d('0x1f')],_0x443590['user'],_0x72a79c,_0xf14cf3);})[_0x339d('0x15')](respondWithFilteredResult(_0x546e72,_0x72a79c))[_0x339d('0x20')](handleError(_0x546e72,null));};exports['destroy']=function(_0x5d1016,_0x4bdda7){return db[_0x339d('0x21')][_0x339d('0x22')]({'where':{'id':_0x5d1016[_0x339d('0x23')]['id']}})[_0x339d('0x15')](handleEntityNotFound(_0x4bdda7,null))[_0x339d('0x15')](removeEntity(_0x4bdda7,null))[_0x339d('0x20')](handleError(_0x4bdda7,null));};exports[_0x339d('0x1d')]=function(_0x37ca07,_0x514d34){return db[_0x339d('0x21')][_0x339d('0x1d')]()[_0x339d('0x15')](function(_0x4455f2){delete _0x4455f2[_0x339d('0x24')];for(var _0x348aa7=0x0;_0x348aa7
','Attachments','Title'];(function(_0x5da730,_0x27c81c){var _0x459c62=function(_0x506a8e){while(--_0x506a8e){_0x5da730['push'](_0x5da730['shift']());}};_0x459c62(++_0x27c81c);}(_0xaa05,0x120));var _0x5aa0=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0xaa05[_0x1ca9eb];return _0x2e284e;};'use strict';var _=require(_0x5aa0('0x0'));var moment=require(_0x5aa0('0x1'));var random=require(_0x5aa0('0x2'));var fs=require('fs');var path=require(_0x5aa0('0x3'));var util=require(_0x5aa0('0x4'));var tnef=require(_0x5aa0('0x5'));var logger=require(_0x5aa0('0x6'))(_0x5aa0('0x7'));var config=require(_0x5aa0('0x8'));function getAddress(_0x56b1c3){var _0x5603a8=_['head'](_0x56b1c3[_0x5aa0('0x9')]);return _0x5603a8&&_0x5603a8['address']?_0x5603a8[_0x5aa0('0xa')]:'anonymous'+random[_0x5aa0('0xb')](0x6)+_0x5aa0('0xc');}function getFirstName(_0x5a65d5){var _0x2adc56=_[_0x5aa0('0xd')](_0x5a65d5[_0x5aa0('0x9')]);if(_0x2adc56&&_0x2adc56[_0x5aa0('0xe')]){if(_0x2adc56['name']==_0x2adc56[_0x5aa0('0xa')]){return _0x2adc56[_0x5aa0('0xe')][_0x5aa0('0xf')](0x0,_0x2adc56[_0x5aa0('0xe')][_0x5aa0('0x10')]('@'));}var _0x57aaf5=_0x2adc56[_0x5aa0('0xe')]['split'](/\s+/);return _0x57aaf5[_0x5aa0('0x11')]>0x1?_0x57aaf5[_0x5aa0('0x12')](0x0,-0x1)[_0x5aa0('0x13')]('\x20'):_0x2adc56['name'];}return _0x5aa0('0x14');}function getLastName(_0x13211e){var _0x27e42b=_[_0x5aa0('0xd')](_0x13211e[_0x5aa0('0x9')]);if(_0x27e42b&&_0x27e42b[_0x5aa0('0xe')]){var _0x3f401a=_0x27e42b[_0x5aa0('0xe')]['split'](/\s+/);return _0x3f401a[_0x5aa0('0x11')]>0x1?_0x3f401a['pop']():'';}return'';}function getMails(_0x563801,_0x5c1dd9){var _0x3ae106='';for(var _0x526705=0x0;_0x526705<_0x5c1dd9[_0x5aa0('0x9')]['length'];_0x526705+=0x1){if(_0x5c1dd9['value'][_0x526705]['address']!==_0x563801){if(!_[_0x5aa0('0x15')](_0x3ae106)){_0x3ae106+=',';}_0x3ae106+=_0x5c1dd9[_0x5aa0('0x9')][_0x526705][_0x5aa0('0xe')]||_0x5c1dd9[_0x5aa0('0x9')][_0x526705][_0x5aa0('0xa')]||'';_0x3ae106+='\x20<';_0x3ae106+=_0x5c1dd9['value'][_0x526705]['address']?_0x5c1dd9[_0x5aa0('0x9')][_0x526705][_0x5aa0('0xa')]:_0x5aa0('0x16')+random[_0x5aa0('0xb')](0x6)+_0x5aa0('0xc');_0x3ae106+='>';}}return _0x3ae106;}function parseEmail(_0x538e28,_0x143bd2,_0x5662b8){if(_0x143bd2[_0x5aa0('0x17')]){var _0x29e124=/