From: Andrea Bianco
Date: Sun, 9 May 2021 09:52:36 +0000 (+0200)
Subject: Built motion from commit (unavailable).|2.5.27
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=4e0b73e06d7042ced04e80d6415b01527473ed91;p=motion2.git
Built motion from commit (unavailable).|2.5.27
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 8fda92a..3f230d1 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.5.26",
+ "version": "2.5.27",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-05-07T09:05:38.915Z",
+ "time": "2021-05-09T09:43:58.957Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index e43659a..bb2aece 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.5.26",
+ "version": "2.5.27",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-05-07T09:05:38.915Z",
+ "time": "2021-05-09T09:43:58.957Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/package.json b/package.json
index 4458090..fa4bbbb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.5.26",
+ "version": "2.5.27",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
@@ -12,22 +12,23 @@
},
"author": "xCALLY Team",
"contributors": [
- "Giuseppe Careri ",
+ "Giuseppe Careri ",
"Daniele Cinti ",
"Innocenzo Biondo ",
- "Massimiliano Bungaro ",
- "Andrea Bianco ",
- "Fabio Lodato ",
- "Andrea Cuccaro ",
+ "Massimiliano Bungaro ",
+ "Andrea Bianco ",
+ "Fabio Lodato ",
+ "Andrea Cuccaro ",
"Donatella Soldi ",
"Afnan Imtiaz ",
"Cristian Di Sclafani ",
"Marco Giraldi ",
"Giulia Trombin ",
- "Cristopher Fasolin ",
- "Marco Messina ",
- "Vito Macchia ",
- "Marco Lecce "
+ "Cristopher Fasolin ",
+ "Marco Messina ",
+ "Vito Macchia ",
+ "Marco Lecce ",
+ "Rodolfo Bevione "
],
"private": true,
"license": "EULA",
@@ -61,6 +62,7 @@
"express-winston": "2.6.0",
"extract-zip": "1.7.0",
"fast-json-patch": "1.2.2",
+ "fs-extra": "1.0.0",
"google-tts-api": "github:xmdevelop/google-tts",
"grpc": "1.24.6",
"html-to-pdfmake": "^2.1.7",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 65f0b83..c880747 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 _0xa3fb=['STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x4fb789,_0x6b8092){var _0x49b5e4=function(_0x256537){while(--_0x256537){_0x4fb789['push'](_0x4fb789['shift']());}};_0x49b5e4(++_0x6b8092);}(_0xa3fb,0xb7));var _0xba3f=function(_0x5ac95d,_0x4526db){_0x5ac95d=_0x5ac95d-0x0;var _0x17005b=_0xa3fb[_0x5ac95d];return _0x17005b;};'use strict';var Sequelize=require(_0xba3f('0x0'));module[_0xba3f('0x1')]={'name':{'type':Sequelize[_0xba3f('0x2')],'get':function(_0x7b1667){return this[_0xba3f('0x3')]('action');}},'action':{'type':Sequelize[_0xba3f('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xba3f('0x5'),_0xba3f('0x6'),_0xba3f('0x7'),_0xba3f('0x8'),_0xba3f('0x9'),_0xba3f('0xa'),_0xba3f('0xb'),_0xba3f('0xc')]],'msg':_0xba3f('0xd')}},'comment':_0xba3f('0xd')},'data1':{'type':Sequelize[_0xba3f('0x4')](0x1000),'comment':_0xba3f('0xe')},'data2':{'type':Sequelize[_0xba3f('0x4')](0x1000),'comment':_0xba3f('0xf')},'data3':{'type':Sequelize[_0xba3f('0x4')](0x1000),'comment':_0xba3f('0x10')},'data4':{'type':Sequelize[_0xba3f('0x4')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xba3f('0x4')]},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xeeef=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','integration','motionbar','jscripty','urlForward','browser'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xeeef,0x1d4));var _0xfeee=function(_0x43ba33,_0x1fa01d){_0x43ba33=_0x43ba33-0x0;var _0x4b8c7b=_0xeeef[_0x43ba33];return _0x4b8c7b;};'use strict';var Sequelize=require(_0xfeee('0x0'));module[_0xfeee('0x1')]={'name':{'type':Sequelize[_0xfeee('0x2')],'get':function(_0x153c30){return this['getDataValue']('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xfeee('0x3'),_0xfeee('0x4'),_0xfeee('0x5'),_0xfeee('0x6'),_0xfeee('0x7'),'bot',_0xfeee('0x8')]],'msg':_0xfeee('0x9')}},'comment':_0xfeee('0x9')},'data1':{'type':Sequelize[_0xfeee('0xa')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xfeee('0xb')},'data3':{'type':Sequelize[_0xfeee('0xa')](0x1000),'comment':_0xfeee('0xc')},'data4':{'type':Sequelize[_0xfeee('0xa')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xfeee('0xa')]},'data7':{'type':Sequelize[_0xfeee('0xd')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 9706c05..237a2b3 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 _0x5ae0=['reject','update','destroy','then','sendStatus','error','stack','name','body','Action','find','params','catch','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set','apply'];(function(_0x2fe319,_0x5b32c9){var _0xaf1ab2=function(_0x24db69){while(--_0x24db69){_0x2fe319['push'](_0x2fe319['shift']());}};_0xaf1ab2(++_0x5b32c9);}(_0x5ae0,0xf8));var _0x05ae=function(_0x3d4842,_0xc92a24){_0x3d4842=_0x3d4842-0x0;var _0x2d3c6d=_0x5ae0[_0x3d4842];return _0x2d3c6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05ae('0x0'));var zipdir=require(_0x05ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05ae('0x2'));var moment=require(_0x05ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x05ae('0x4'));var util=require(_0x05ae('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x05ae('0x6'));var ejs=require(_0x05ae('0x7'));var fs=require('fs');var fs_extra=require(_0x05ae('0x8'));var _=require('lodash');var squel=require(_0x05ae('0x9'));var crypto=require(_0x05ae('0xa'));var jsforce=require(_0x05ae('0xb'));var deskjs=require(_0x05ae('0xc'));var toCsv=require(_0x05ae('0x6'));var querystring=require(_0x05ae('0xd'));var Papa=require(_0x05ae('0xe'));var Redis=require(_0x05ae('0xf'));var authService=require(_0x05ae('0x10'));var qs=require(_0x05ae('0x11'));var as=require(_0x05ae('0x12'));var hardwareService=require(_0x05ae('0x13'));var logger=require(_0x05ae('0x14'))(_0x05ae('0x15'));var utils=require(_0x05ae('0x16'));var config=require(_0x05ae('0x17'));var licenseUtil=require(_0x05ae('0x18'));var db=require(_0x05ae('0x19'))['db'];function respondWithStatusCode(_0x38c11e,_0x5b0218){_0x5b0218=_0x5b0218||0xcc;return function(_0x48e02c){if(_0x48e02c){return _0x38c11e['sendStatus'](_0x5b0218);}return _0x38c11e['status'](_0x5b0218)[_0x05ae('0x1a')]();};}function respondWithResult(_0x22fd17,_0x59e280){_0x59e280=_0x59e280||0xc8;return function(_0xd86c16){if(_0xd86c16){return _0x22fd17[_0x05ae('0x1b')](_0x59e280)[_0x05ae('0x1c')](_0xd86c16);}};}function respondWithFilteredResult(_0x329796,_0x3de84b){return function(_0xf8a649){if(_0xf8a649){var _0x566f4d=_0xf8a649[_0x05ae('0x1d')],_0x237a99=_0x3de84b[_0x05ae('0x1e')],_0x38edee=_0x3de84b[_0x05ae('0x1e')]+_0x3de84b[_0x05ae('0x1f')],_0xc1eb63;if(_0x38edee>=_0x566f4d){_0x38edee=_0x566f4d;_0xc1eb63=0xc8;}else{_0xc1eb63=0xce;}_0x329796[_0x05ae('0x1b')](_0xc1eb63);return _0x329796[_0x05ae('0x20')]('Content-Range',_0x237a99+'-'+_0x38edee+'/'+_0x566f4d)[_0x05ae('0x1c')](_0xf8a649);}return null;};}function patchUpdates(_0x17ee83){return function(_0x5a6fe6){try{jsonpatch[_0x05ae('0x21')](_0x5a6fe6,_0x17ee83,!![]);}catch(_0x39f0ce){return BPromise[_0x05ae('0x22')](_0x39f0ce);}return _0x5a6fe6['save']();};}function saveUpdates(_0x37c018,_0x3c23f9){return function(_0x4a2a42){if(_0x4a2a42){return _0x4a2a42[_0x05ae('0x23')](_0x37c018)['then'](function(_0x1e58e3){return _0x1e58e3;});}return null;};}function removeEntity(_0x1241da,_0x2051c0){return function(_0x48de5a){if(_0x48de5a){return _0x48de5a[_0x05ae('0x24')]()[_0x05ae('0x25')](function(){_0x1241da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39d71c,_0x5ddaab){return function(_0x20df1e){if(!_0x20df1e){_0x39d71c[_0x05ae('0x26')](0x194);}return _0x20df1e;};}function handleError(_0x80e099,_0x5b78f3){_0x5b78f3=_0x5b78f3||0x1f4;return function(_0x5604fd){logger[_0x05ae('0x27')](_0x5604fd[_0x05ae('0x28')]);if(_0x5604fd[_0x05ae('0x29')]){delete _0x5604fd[_0x05ae('0x29')];}_0x80e099[_0x05ae('0x1b')](_0x5b78f3)['send'](_0x5604fd);};}exports[_0x05ae('0x23')]=function(_0x547253,_0xa1bc99){if(_0x547253[_0x05ae('0x2a')]['id']){delete _0x547253['body']['id'];}return db[_0x05ae('0x2b')][_0x05ae('0x2c')]({'where':{'id':_0x547253[_0x05ae('0x2d')]['id']}})[_0x05ae('0x25')](handleEntityNotFound(_0xa1bc99,null))['then'](saveUpdates(_0x547253[_0x05ae('0x2a')],null))[_0x05ae('0x25')](respondWithResult(_0xa1bc99,null))[_0x05ae('0x2e')](handleError(_0xa1bc99,null));};exports['destroy']=function(_0x108bd8,_0x42a645){return db[_0x05ae('0x2b')][_0x05ae('0x2c')]({'where':{'id':_0x108bd8[_0x05ae('0x2d')]['id']}})[_0x05ae('0x25')](handleEntityNotFound(_0x42a645,null))[_0x05ae('0x25')](removeEntity(_0x42a645,null))[_0x05ae('0x2e')](handleError(_0x42a645,null));};
\ No newline at end of file
+var _0xcaaf=['offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','find','params','body','catch','Action','eml-format','zip-dir','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcaaf,0x66));var _0xfcaa=function(_0x71e9d9,_0x4a1711){_0x71e9d9=_0x71e9d9-0x0;var _0x4d59f0=_0xcaaf[_0x71e9d9];return _0x4d59f0;};'use strict';var emlformat=require(_0xfcaa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfcaa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfcaa('0x2'));var BPromise=require(_0xfcaa('0x3'));var Mustache=require('mustache');var util=require(_0xfcaa('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xfcaa('0x5'));var ejs=require(_0xfcaa('0x6'));var fs=require('fs');var fs_extra=require(_0xfcaa('0x7'));var _=require(_0xfcaa('0x8'));var squel=require(_0xfcaa('0x9'));var crypto=require(_0xfcaa('0xa'));var jsforce=require(_0xfcaa('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfcaa('0x5'));var querystring=require('querystring');var Papa=require(_0xfcaa('0xc'));var Redis=require('ioredis');var authService=require(_0xfcaa('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcaa('0xe'));var logger=require('../../config/logger')(_0xfcaa('0xf'));var utils=require(_0xfcaa('0x10'));var config=require(_0xfcaa('0x11'));var licenseUtil=require(_0xfcaa('0x12'));var db=require(_0xfcaa('0x13'))['db'];function respondWithStatusCode(_0x33664f,_0x1f26e3){_0x1f26e3=_0x1f26e3||0xcc;return function(_0xc03e64){if(_0xc03e64){return _0x33664f['sendStatus'](_0x1f26e3);}return _0x33664f[_0xfcaa('0x14')](_0x1f26e3)[_0xfcaa('0x15')]();};}function respondWithResult(_0x129b69,_0x46181e){_0x46181e=_0x46181e||0xc8;return function(_0x521fff){if(_0x521fff){return _0x129b69[_0xfcaa('0x14')](_0x46181e)[_0xfcaa('0x16')](_0x521fff);}};}function respondWithFilteredResult(_0x27ab5c,_0xf49a9b){return function(_0x54f7f5){if(_0x54f7f5){var _0x10e7e7=_0x54f7f5[_0xfcaa('0x17')],_0x2dbc14=_0xf49a9b[_0xfcaa('0x18')],_0x218c64=_0xf49a9b['offset']+_0xf49a9b[_0xfcaa('0x19')],_0x580335;if(_0x218c64>=_0x10e7e7){_0x218c64=_0x10e7e7;_0x580335=0xc8;}else{_0x580335=0xce;}_0x27ab5c['status'](_0x580335);return _0x27ab5c['set'](_0xfcaa('0x1a'),_0x2dbc14+'-'+_0x218c64+'/'+_0x10e7e7)[_0xfcaa('0x16')](_0x54f7f5);}return null;};}function patchUpdates(_0x416132){return function(_0xa4df1){try{jsonpatch[_0xfcaa('0x1b')](_0xa4df1,_0x416132,!![]);}catch(_0x4566e1){return BPromise[_0xfcaa('0x1c')](_0x4566e1);}return _0xa4df1[_0xfcaa('0x1d')]();};}function saveUpdates(_0x1a975f,_0x7aa3eb){return function(_0x55ec08){if(_0x55ec08){return _0x55ec08[_0xfcaa('0x1e')](_0x1a975f)[_0xfcaa('0x1f')](function(_0x233a73){return _0x233a73;});}return null;};}function removeEntity(_0xc7622,_0xcc1c83){return function(_0x4416ed){if(_0x4416ed){return _0x4416ed[_0xfcaa('0x20')]()[_0xfcaa('0x1f')](function(){_0xc7622[_0xfcaa('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415bce,_0x1526d9){return function(_0x43da7f){if(!_0x43da7f){_0x415bce['sendStatus'](0x194);}return _0x43da7f;};}function handleError(_0x1d8e09,_0x59c206){_0x59c206=_0x59c206||0x1f4;return function(_0x4642bb){logger[_0xfcaa('0x21')](_0x4642bb[_0xfcaa('0x22')]);if(_0x4642bb[_0xfcaa('0x23')]){delete _0x4642bb[_0xfcaa('0x23')];}_0x1d8e09[_0xfcaa('0x14')](_0x59c206)[_0xfcaa('0x24')](_0x4642bb);};}exports[_0xfcaa('0x1e')]=function(_0x3ba17e,_0x55e09a){if(_0x3ba17e['body']['id']){delete _0x3ba17e['body']['id'];}return db['Action'][_0xfcaa('0x25')]({'where':{'id':_0x3ba17e[_0xfcaa('0x26')]['id']}})['then'](handleEntityNotFound(_0x55e09a,null))[_0xfcaa('0x1f')](saveUpdates(_0x3ba17e[_0xfcaa('0x27')],null))['then'](respondWithResult(_0x55e09a,null))[_0xfcaa('0x28')](handleError(_0x55e09a,null));};exports['destroy']=function(_0x4e135a,_0x137877){return db[_0xfcaa('0x29')][_0xfcaa('0x25')]({'where':{'id':_0x4e135a[_0xfcaa('0x26')]['id']}})['then'](handleEntityNotFound(_0x137877,null))[_0xfcaa('0x1f')](removeEntity(_0x137877,null))[_0xfcaa('0x28')](handleError(_0x137877,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 915452c..0e28af0 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 _0xa1ee=['define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','path','rimraf','./action.attributes','exports'];(function(_0x349635,_0x1d4f03){var _0x3f8a08=function(_0x46be12){while(--_0x46be12){_0x349635['push'](_0x349635['shift']());}};_0x3f8a08(++_0x1d4f03);}(_0xa1ee,0x1ef));var _0xea1e=function(_0x3a16d4,_0x23ecda){_0x3a16d4=_0x3a16d4-0x0;var _0x31ea9c=_0xa1ee[_0x3a16d4];return _0x31ea9c;};'use strict';var _=require('lodash');var util=require(_0xea1e('0x0'));var logger=require(_0xea1e('0x1'))(_0xea1e('0x2'));var moment=require(_0xea1e('0x3'));var BPromise=require(_0xea1e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea1e('0x5'));var rimraf=require(_0xea1e('0x6'));var config=require('../../config/environment');var attributes=require(_0xea1e('0x7'));module[_0xea1e('0x8')]=function(_0x5f018b,_0x184344){return _0x5f018b[_0xea1e('0x9')](_0xea1e('0xa'),attributes,{'tableName':_0xea1e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1abe=['path','../../config/environment','exports','define','Action','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1abe,0x1b2));var _0xe1ab=function(_0x399c5a,_0x2a50a7){_0x399c5a=_0x399c5a-0x0;var _0x2d2aaa=_0x1abe[_0x399c5a];return _0x2d2aaa;};'use strict';var _=require(_0xe1ab('0x0'));var util=require(_0xe1ab('0x1'));var logger=require('../../config/logger')(_0xe1ab('0x2'));var moment=require(_0xe1ab('0x3'));var BPromise=require(_0xe1ab('0x4'));var rp=require(_0xe1ab('0x5'));var fs=require('fs');var path=require(_0xe1ab('0x6'));var rimraf=require('rimraf');var config=require(_0xe1ab('0x7'));var attributes=require('./action.attributes');module[_0xe1ab('0x8')]=function(_0x5c2400,_0x588ea3){return _0x5c2400[_0xe1ab('0x9')](_0xe1ab('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 8d963e1..786887f 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 _0x0713=['Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1ee592,_0x7050c4){var _0x5999f7=function(_0x1d5d3d){while(--_0x1d5d3d){_0x1ee592['push'](_0x1ee592['shift']());}};_0x5999f7(++_0x7050c4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index faeb108..30d95fb 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 _0x6817=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','util','path','connect-timeout','express'];(function(_0x338ce5,_0x122094){var _0x195189=function(_0x41f00b){while(--_0x41f00b){_0x338ce5['push'](_0x338ce5['shift']());}};_0x195189(++_0x122094);}(_0x6817,0xf8));var _0x7681=function(_0x189077,_0x5d9f45){_0x189077=_0x189077-0x0;var _0x190aea=_0x6817[_0x189077];return _0x190aea;};'use strict';var multer=require('multer');var util=require(_0x7681('0x0'));var path=require(_0x7681('0x1'));var timeout=require(_0x7681('0x2'));var express=require(_0x7681('0x3'));var router=express[_0x7681('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7681('0x5'));var interaction=require(_0x7681('0x6'));var config=require(_0x7681('0x7'));var controller=require(_0x7681('0x8'));router[_0x7681('0x9')](_0x7681('0xa'),auth[_0x7681('0xb')](),controller[_0x7681('0xc')]);router[_0x7681('0xd')](_0x7681('0xa'),auth[_0x7681('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf7a8=['../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x83986d,_0x8749f8){var _0x24f41b=function(_0xc93079){while(--_0xc93079){_0x83986d['push'](_0x83986d['shift']());}};_0x24f41b(++_0x8749f8);}(_0xf7a8,0x157));var _0x8f7a=function(_0x20142a,_0x10fb3c){_0x20142a=_0x20142a-0x0;var _0x2026e1=_0xf7a8[_0x20142a];return _0x2026e1;};'use strict';var multer=require(_0x8f7a('0x0'));var util=require(_0x8f7a('0x1'));var path=require(_0x8f7a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8f7a('0x3'));var router=express[_0x8f7a('0x4')]();var fs_extra=require(_0x8f7a('0x5'));var auth=require(_0x8f7a('0x6'));var interaction=require(_0x8f7a('0x7'));var config=require(_0x8f7a('0x8'));var controller=require(_0x8f7a('0x9'));router['put']('/:id',auth[_0x8f7a('0xa')](),controller[_0x8f7a('0xb')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8f7a('0xc')]);module[_0x8f7a('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 2637027..936773b 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 _0xbabb=['TEXT','exports','STRING'];(function(_0x4e7aa9,_0x10406e){var _0x202fa7=function(_0x42c6cf){while(--_0x42c6cf){_0x4e7aa9['push'](_0x4e7aa9['shift']());}};_0x202fa7(++_0x10406e);}(_0xbabb,0x1a2));var _0xbbab=function(_0x39039b,_0x5e0a86){_0x39039b=_0x39039b-0x0;var _0x260d03=_0xbabb[_0x39039b];return _0x260d03;};'use strict';var Sequelize=require('sequelize');module[_0xbbab('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xbbab('0x1')]},'parent':{'type':Sequelize[_0xbbab('0x1')]},'table':{'type':Sequelize[_0xbbab('0x1')]},'conditions':{'type':Sequelize[_0xbbab('0x2')]},'joins':{'type':Sequelize[_0xbbab('0x2')]}};
\ No newline at end of file
+var _0x5b10=['exports','STRING','TEXT','sequelize'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x5b10,0x87));var _0x05b1=function(_0x521555,_0x2a40ab){_0x521555=_0x521555-0x0;var _0x2134b6=_0x5b10[_0x521555];return _0x2134b6;};'use strict';var Sequelize=require(_0x05b1('0x0'));module[_0x05b1('0x1')]={'name':{'type':Sequelize[_0x05b1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x05b1('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x05b1('0x2')]},'conditions':{'type':Sequelize[_0x05b1('0x3')]},'joins':{'type':Sequelize[_0x05b1('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f063713..1bba3dd 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 _0x5a54=['AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','cross_join','SUM(%s)','DATE(%s)','Sequelize','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','../../files/reports','savename','countTable','COUNT(*)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','stack','name','send','AnalyticCustomReport','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x5a54,0xd9));var _0x45a5=function(_0x45c81f,_0x25461f){_0x45c81f=_0x45c81f-0x0;var _0x544b41=_0x5a54[_0x45c81f];return _0x544b41;};'use strict';var emlformat=require(_0x45a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45a5('0x1'));var jsonpatch=require(_0x45a5('0x2'));var rp=require(_0x45a5('0x3'));var moment=require(_0x45a5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x45a5('0x5'));var sox=require(_0x45a5('0x6'));var csv=require('to-csv');var ejs=require(_0x45a5('0x7'));var fs=require('fs');var fs_extra=require(_0x45a5('0x8'));var _=require(_0x45a5('0x9'));var squel=require(_0x45a5('0xa'));var crypto=require(_0x45a5('0xb'));var jsforce=require(_0x45a5('0xc'));var deskjs=require(_0x45a5('0xd'));var toCsv=require(_0x45a5('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x45a5('0xf'));var authService=require(_0x45a5('0x10'));var qs=require(_0x45a5('0x11'));var as=require(_0x45a5('0x12'));var hardwareService=require(_0x45a5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x45a5('0x14'));var config=require(_0x45a5('0x15'));var licenseUtil=require(_0x45a5('0x16'));var db=require(_0x45a5('0x17'))['db'];var dbH=require(_0x45a5('0x17'))[_0x45a5('0x18')];function respondWithStatusCode(_0x4b64b3,_0x3ee3e3){_0x3ee3e3=_0x3ee3e3||0xcc;return function(_0x24c05c){if(_0x24c05c){return _0x4b64b3[_0x45a5('0x19')](_0x3ee3e3);}return _0x4b64b3[_0x45a5('0x1a')](_0x3ee3e3)['end']();};}function respondWithResult(_0x308798,_0x2f8b5c){_0x2f8b5c=_0x2f8b5c||0xc8;return function(_0x106a65){if(_0x106a65){return _0x308798['status'](_0x2f8b5c)['json'](_0x106a65);}};}function respondWithFilteredResult(_0x4d159d,_0x30ba48){return function(_0x26057e){if(_0x26057e){var _0x5dbe94=_0x26057e[_0x45a5('0x1b')],_0x406e87=_0x30ba48[_0x45a5('0x1c')],_0x15c08a=_0x30ba48[_0x45a5('0x1c')]+_0x30ba48[_0x45a5('0x1d')],_0x30d422;if(_0x15c08a>=_0x5dbe94){_0x15c08a=_0x5dbe94;_0x30d422=0xc8;}else{_0x30d422=0xce;}_0x4d159d[_0x45a5('0x1a')](_0x30d422);return _0x4d159d['set'](_0x45a5('0x1e'),_0x406e87+'-'+_0x15c08a+'/'+_0x5dbe94)['json'](_0x26057e);}return null;};}function patchUpdates(_0x117eaf){return function(_0xd43c48){try{jsonpatch[_0x45a5('0x1f')](_0xd43c48,_0x117eaf,!![]);}catch(_0x3a2929){return BPromise[_0x45a5('0x20')](_0x3a2929);}return _0xd43c48[_0x45a5('0x21')]();};}function saveUpdates(_0x5c2dbe,_0xbaa0aa){return function(_0x2e4000){if(_0x2e4000){return _0x2e4000[_0x45a5('0x22')](_0x5c2dbe)[_0x45a5('0x23')](function(_0x41e741){return _0x41e741;});}return null;};}function removeEntity(_0x185fa7,_0x5e4c9d){return function(_0x5a94d3){if(_0x5a94d3){return _0x5a94d3[_0x45a5('0x24')]()[_0x45a5('0x23')](function(){var _0x518ab3=_0x5a94d3[_0x45a5('0x25')]({'plain':!![]});var _0x16d4d0=_0x45a5('0x26');return db[_0x45a5('0x27')][_0x45a5('0x24')]({'where':{'type':_0x16d4d0,'resourceId':_0x518ab3['id']}})[_0x45a5('0x23')](function(){return _0x5a94d3;});})['then'](function(){_0x185fa7[_0x45a5('0x1a')](0xcc)[_0x45a5('0x28')]();});}};}function handleEntityNotFound(_0x41d266,_0x52dc6e){return function(_0x4946c9){if(!_0x4946c9){_0x41d266[_0x45a5('0x19')](0x194);}return _0x4946c9;};}function handleError(_0x1350bc,_0x270fa5){_0x270fa5=_0x270fa5||0x1f4;return function(_0x5d9752){logger['error'](_0x5d9752[_0x45a5('0x29')]);if(_0x5d9752[_0x45a5('0x2a')]){delete _0x5d9752[_0x45a5('0x2a')];}_0x1350bc['status'](_0x270fa5)[_0x45a5('0x2b')](_0x5d9752);};}exports['index']=function(_0x201754,_0x3dbab9){var _0xd8a2b9={},_0x5b7682={},_0x53b30b={'count':0x0,'rows':[]};var _0xb2b1b4=_['map'](db[_0x45a5('0x2c')]['rawAttributes'],function(_0x1b322b){return{'name':_0x1b322b['fieldName'],'type':_0x1b322b['type'][_0x45a5('0x2d')]};});_0x5b7682['model']=_['map'](_0xb2b1b4,'name');_0x5b7682[_0x45a5('0x2e')]=_[_0x45a5('0x2f')](_0x201754['query']);_0x5b7682[_0x45a5('0x30')]=_[_0x45a5('0x31')](_0x5b7682[_0x45a5('0x32')],_0x5b7682[_0x45a5('0x2e')]);_0xd8a2b9[_0x45a5('0x33')]=_[_0x45a5('0x31')](_0x5b7682[_0x45a5('0x32')],qs[_0x45a5('0x34')](_0x201754[_0x45a5('0x2e')]['fields']));_0xd8a2b9[_0x45a5('0x33')]=_0xd8a2b9[_0x45a5('0x33')][_0x45a5('0x35')]?_0xd8a2b9['attributes']:_0x5b7682['model'];if(!_0x201754[_0x45a5('0x2e')][_0x45a5('0x36')]('nolimit')){_0xd8a2b9['limit']=qs[_0x45a5('0x1d')](_0x201754[_0x45a5('0x2e')][_0x45a5('0x1d')]);_0xd8a2b9[_0x45a5('0x1c')]=qs['offset'](_0x201754['query']['offset']);}_0xd8a2b9['order']=qs[_0x45a5('0x37')](_0x201754[_0x45a5('0x2e')][_0x45a5('0x37')]);_0xd8a2b9[_0x45a5('0x38')]=qs[_0x45a5('0x30')](_[_0x45a5('0x39')](_0x201754['query'],_0x5b7682[_0x45a5('0x30')]),_0xb2b1b4);if(_0x201754[_0x45a5('0x2e')][_0x45a5('0x3a')]){_0xd8a2b9[_0x45a5('0x38')]=_[_0x45a5('0x3b')](_0xd8a2b9[_0x45a5('0x38')],{'$or':_[_0x45a5('0x3c')](_0xb2b1b4,function(_0x29491e){if(_0x29491e[_0x45a5('0x3d')]!==_0x45a5('0x3e')){var _0x510982={};_0x510982[_0x29491e[_0x45a5('0x2a')]]={'$like':'%'+_0x201754[_0x45a5('0x2e')][_0x45a5('0x3a')]+'%'};return _0x510982;}})});}_0xd8a2b9=_[_0x45a5('0x3b')]({},_0xd8a2b9,_0x201754[_0x45a5('0x3f')]);var _0x577ca8={'where':_0xd8a2b9[_0x45a5('0x38')]};return db[_0x45a5('0x2c')]['count'](_0x577ca8)[_0x45a5('0x23')](function(_0x15045b){_0x53b30b[_0x45a5('0x1b')]=_0x15045b;if(_0x201754[_0x45a5('0x2e')][_0x45a5('0x40')]){_0xd8a2b9[_0x45a5('0x41')]=[{'all':!![]}];}return db[_0x45a5('0x2c')][_0x45a5('0x42')](_0xd8a2b9);})[_0x45a5('0x23')](function(_0x3bd8c2){_0x53b30b[_0x45a5('0x43')]=_0x3bd8c2;return _0x53b30b;})['then'](respondWithFilteredResult(_0x3dbab9,_0xd8a2b9))[_0x45a5('0x44')](handleError(_0x3dbab9,null));};exports[_0x45a5('0x45')]=function(_0x3d6410,_0x4b879f){var _0x4b5a13={'raw':![],'where':{'id':_0x3d6410[_0x45a5('0x46')]['id']}},_0x64bd53={};_0x64bd53[_0x45a5('0x32')]=_[_0x45a5('0x2f')](db[_0x45a5('0x2c')][_0x45a5('0x47')]);_0x64bd53[_0x45a5('0x2e')]=_[_0x45a5('0x2f')](_0x3d6410['query']);_0x64bd53[_0x45a5('0x30')]=_[_0x45a5('0x31')](_0x64bd53[_0x45a5('0x32')],_0x64bd53[_0x45a5('0x2e')]);_0x4b5a13[_0x45a5('0x33')]=_[_0x45a5('0x31')](_0x64bd53[_0x45a5('0x32')],qs[_0x45a5('0x34')](_0x3d6410[_0x45a5('0x2e')][_0x45a5('0x34')]));_0x4b5a13[_0x45a5('0x33')]=_0x4b5a13[_0x45a5('0x33')]['length']?_0x4b5a13[_0x45a5('0x33')]:_0x64bd53[_0x45a5('0x32')];if(_0x3d6410['query'][_0x45a5('0x40')]){_0x4b5a13['include']=[{'all':!![]}];}_0x4b5a13=_[_0x45a5('0x3b')]({},_0x4b5a13,_0x3d6410[_0x45a5('0x3f')]);return db['AnalyticCustomReport']['find'](_0x4b5a13)['then'](handleEntityNotFound(_0x4b879f,null))[_0x45a5('0x23')](respondWithResult(_0x4b879f,null))[_0x45a5('0x44')](handleError(_0x4b879f,null));};exports[_0x45a5('0x48')]=function(_0x453bde,_0x176712){return db['AnalyticCustomReport']['create'](_0x453bde['body'],{})[_0x45a5('0x23')](function(_0x7e6caa){var _0x2729d4=_0x453bde[_0x45a5('0x49')][_0x45a5('0x25')]({'plain':!![]});if(!_0x2729d4)throw new Error(_0x45a5('0x4a'));if(_0x2729d4[_0x45a5('0x4b')]===_0x45a5('0x49')){var _0x2feb52=_0x7e6caa[_0x45a5('0x25')]({'plain':!![]});var _0x3ff055=_0x45a5('0x4c');return db[_0x45a5('0x4d')]['find']({'where':{'name':_0x3ff055,'userProfileId':_0x2729d4[_0x45a5('0x4e')]},'raw':!![]})[_0x45a5('0x23')](function(_0x51f31e){if(_0x51f31e&&_0x51f31e[_0x45a5('0x4f')]===0x0){return db[_0x45a5('0x27')][_0x45a5('0x48')]({'name':_0x2feb52[_0x45a5('0x2a')],'resourceId':_0x2feb52['id'],'type':_0x45a5('0x26'),'sectionId':_0x51f31e['id']},{})[_0x45a5('0x23')](function(){return _0x7e6caa;});}else{return _0x7e6caa;}})[_0x45a5('0x44')](function(_0x1b2af9){logger['error'](_0x45a5('0x50'),_0x1b2af9);throw _0x1b2af9;});}return _0x7e6caa;})[_0x45a5('0x23')](respondWithResult(_0x176712,0xc9))[_0x45a5('0x44')](handleError(_0x176712,null));};exports[_0x45a5('0x22')]=function(_0x1b8ebf,_0xb7ea14){if(_0x1b8ebf[_0x45a5('0x51')]['id']){delete _0x1b8ebf[_0x45a5('0x51')]['id'];}return db[_0x45a5('0x2c')][_0x45a5('0x52')]({'where':{'id':_0x1b8ebf[_0x45a5('0x46')]['id']}})[_0x45a5('0x23')](handleEntityNotFound(_0xb7ea14,null))['then'](saveUpdates(_0x1b8ebf[_0x45a5('0x51')],null))[_0x45a5('0x23')](respondWithResult(_0xb7ea14,null))[_0x45a5('0x44')](handleError(_0xb7ea14,null));};exports[_0x45a5('0x24')]=function(_0x2efb7a,_0x40f503){return db['AnalyticCustomReport'][_0x45a5('0x52')]({'where':{'id':_0x2efb7a[_0x45a5('0x46')]['id']}})[_0x45a5('0x23')](handleEntityNotFound(_0x40f503,null))[_0x45a5('0x23')](removeEntity(_0x40f503,null))['catch'](handleError(_0x40f503,null));};exports['preview']=function(_0x4fe190,_0x167428){var _0x1339c3=0xa;var _0x429f4c=[_0x45a5('0x53'),'left_join',_0x45a5('0x54'),'cross_join'];var _0x50ca7e={'SUM':'SUM(%s)','COUNT':_0x45a5('0x55'),'COUNT DISTINCT':_0x45a5('0x56'),'MAX':_0x45a5('0x57'),'MIN':_0x45a5('0x58'),'AVG':_0x45a5('0x59'),'GROUP_CONCAT':_0x45a5('0x5a'),'GROUP_CONCAT ASC':_0x45a5('0x5b'),'GROUP_CONCAT DESC':_0x45a5('0x5c')};var _0x358859={'SEC_TO_TIME':_0x45a5('0x5d'),'DATE':'DATE(%s)','HOUR':_0x45a5('0x5e'),'ROUND':_0x45a5('0x5f'),'UNIX_TIMESTAMP':_0x45a5('0x60')};var _0x2dc233=function(_0x594639){return!_[_0x45a5('0x61')]([_0x45a5('0x62'),_0x45a5('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x594639);};var _0x6fde26=function(_0x3a8e8f){if(!_0x3a8e8f||!_0x3a8e8f[_0x45a5('0x64')][_0x45a5('0x35')]){return'';}for(var _0x1c6633='(',_0x4b68ce=0x0;_0x4b68ce<_0x3a8e8f[_0x45a5('0x64')][_0x45a5('0x35')];_0x4b68ce+=0x1){_0x4b68ce>0x0&&(_0x1c6633+='\x20'+_0x3a8e8f[_0x45a5('0x65')]+'\x20');_0x1c6633+=_0x3a8e8f[_0x45a5('0x64')][_0x4b68ce][_0x45a5('0x66')]?_0x6fde26(_0x3a8e8f['rules'][_0x4b68ce][_0x45a5('0x66')]):_0x3a8e8f['rules'][_0x4b68ce][_0x45a5('0x67')]+'\x20'+_0x3a8e8f['rules'][_0x4b68ce][_0x45a5('0x68')]+(_0x2dc233(_0x3a8e8f['rules'][_0x4b68ce][_0x45a5('0x68')])?'\x20'+_0x3a8e8f['rules'][_0x4b68ce][_0x45a5('0x69')]:'');}return _0x1c6633+')';};var _0x380bad={'where':{'id':_0x4fe190[_0x45a5('0x46')]['id']}},_0x4d9d02,_0xcee4f2,_0x14f353,_0x1d6a6e,_0x2d6831;_0x380bad=_[_0x45a5('0x3b')]({},_0x380bad,_0x4fe190[_0x45a5('0x3f')]);return db[_0x45a5('0x2c')][_0x45a5('0x52')](_0x380bad)[_0x45a5('0x23')](function(_0xbafa56){if(_0xbafa56){_0x4d9d02=_0xbafa56;return _0xbafa56[_0x45a5('0x6a')]();}return null;})[_0x45a5('0x23')](function(_0x36cecf){if(_0x36cecf){if(!_0x36cecf[_0x45a5('0x35')]){throw new db['Sequelize'][(_0x45a5('0x6b'))](_0x45a5('0x6c'),0x193);}_0xcee4f2=_0x36cecf;return db[_0x45a5('0x6d')][_0x45a5('0x42')]({'raw':!![]});}return null;})['then'](function(_0x3d12c2){if(_0x3d12c2){_0x14f353=_[_0x45a5('0x6e')](_0x3d12c2,'id');var _0x2e1cf8;var _0x1e9c1b=squel[_0x45a5('0x6f')]();_0x1e9c1b[_0x45a5('0x70')](_0x4d9d02[_0x45a5('0x71')]);for(var _0x22ca15=0x0;_0x22ca15<_0xcee4f2[_0x45a5('0x35')];_0x22ca15+=0x1){_0x2e1cf8=_0xcee4f2[_0x22ca15][_0x45a5('0x72')]?_0x14f353[_0xcee4f2[_0x22ca15][_0x45a5('0x72')]][_0x45a5('0x73')]:_0xcee4f2[_0x22ca15][_0x45a5('0x67')];_0x2e1cf8=_0xcee4f2[_0x22ca15]['function']?_[_0x45a5('0x74')](_0x50ca7e[_0xcee4f2[_0x22ca15][_0x45a5('0x75')]],'%s',_0x2e1cf8):_0x2e1cf8;_0x2e1cf8=_0xcee4f2[_0x22ca15]['format']?_[_0x45a5('0x74')](_0x358859[_0xcee4f2[_0x22ca15][_0x45a5('0x76')]],'%s',_0x2e1cf8):_0x2e1cf8;if(_0xcee4f2[_0x22ca15][_0x45a5('0x77')]){_0x1e9c1b[_0x45a5('0x66')](_0x2e1cf8);}_0xcee4f2[_0x22ca15][_0x45a5('0x78')]&&_0x1e9c1b[_0x45a5('0x79')](_0x2e1cf8,_0xcee4f2[_0x22ca15][_0x45a5('0x78')]===_0x45a5('0x7a')?![]:!![]);_0x1e9c1b['field'](_0x2e1cf8,_0xcee4f2[_0x22ca15][_0x45a5('0x7b')]||_0x2e1cf8);}if(_0x4d9d02['joins']){_0x4d9d02[_0x45a5('0x7c')]=JSON['parse'](_0x4d9d02[_0x45a5('0x7c')]);for(var _0x1731a8=0x0;_0x1731a8<_0x4d9d02[_0x45a5('0x7c')]['length'];_0x1731a8+=0x1){if(_0x4d9d02[_0x45a5('0x7c')][_0x1731a8][_0x45a5('0x3d')]&&_[_0x45a5('0x61')](_0x429f4c,_0x4d9d02['joins'][_0x1731a8]['type'])&&_0x4d9d02['joins'][_0x1731a8][_0x45a5('0x7d')]&&_0x4d9d02[_0x45a5('0x7c')][_0x1731a8][_0x45a5('0x7e')]&&_0x4d9d02[_0x45a5('0x7c')][_0x1731a8][_0x45a5('0x7f')]){_0x1e9c1b[_0x4d9d02[_0x45a5('0x7c')][_0x1731a8]['type']](_0x4d9d02[_0x45a5('0x7c')][_0x1731a8][_0x45a5('0x7e')],null,util['format'](_0x45a5('0x80'),_0x4d9d02[_0x45a5('0x71')],_0x4d9d02[_0x45a5('0x7c')][_0x1731a8][_0x45a5('0x7d')],_0x4d9d02[_0x45a5('0x7c')][_0x1731a8][_0x45a5('0x7e')],_0x4d9d02[_0x45a5('0x7c')][_0x1731a8]['foreignKey']));}}}if(_0x4d9d02[_0x45a5('0x81')]){_0x4d9d02[_0x45a5('0x81')]=JSON[_0x45a5('0x82')](_0x4d9d02['conditions']);_0x1e9c1b[_0x45a5('0x38')](_0x6fde26(_0x4d9d02[_0x45a5('0x81')][_0x45a5('0x66')]));}_0x2d6831=_0x1e9c1b[_0x45a5('0x83')]();_0x1e9c1b[_0x45a5('0x1d')](_0x1339c3);_0x1e9c1b[_0x45a5('0x1c')](0x0);logger[_0x45a5('0x84')](_0x45a5('0x85'),_0x1e9c1b[_0x45a5('0x86')]());return dbH[_0x45a5('0x87')][_0x45a5('0x2e')](_0x1e9c1b[_0x45a5('0x86')](),{'type':dbH[_0x45a5('0x87')][_0x45a5('0x88')][_0x45a5('0x89')]});}})['then'](respondWithResult(_0x167428,null))['catch'](handleError(_0x167428,null));};function runReport(_0xec59e2,_0x1533b0,_0x17d8df){var _0x2bd895=_0x1533b0['name'];var _0x17f088=0xa;var _0xfc2b71=[_0x45a5('0x53'),_0x45a5('0x8a'),_0x45a5('0x54'),_0x45a5('0x8b')];var _0xa0cd9d={'SUM':_0x45a5('0x8c'),'COUNT':_0x45a5('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x45a5('0x57'),'MIN':_0x45a5('0x58'),'AVG':_0x45a5('0x59'),'GROUP_CONCAT':_0x45a5('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x45a5('0x5c')};var _0x4e83dd={'SEC_TO_TIME':_0x45a5('0x5d'),'DATE':_0x45a5('0x8d'),'HOUR':_0x45a5('0x5e'),'ROUND':_0x45a5('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1ccfd6=function(_0xe05883){return!_['includes'](['IS\x20NULL',_0x45a5('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xe05883);};var _0x28a7ef=function(_0x5e4069){if(!_0x5e4069||!_0x5e4069[_0x45a5('0x64')][_0x45a5('0x35')]){return'';}for(var _0x5aa395='(',_0x1e523b=0x0;_0x1e523b<_0x5e4069['rules'][_0x45a5('0x35')];_0x1e523b+=0x1){_0x1e523b>0x0&&(_0x5aa395+='\x20'+_0x5e4069[_0x45a5('0x65')]+'\x20');_0x5aa395+=_0x5e4069[_0x45a5('0x64')][_0x1e523b][_0x45a5('0x66')]?_0x28a7ef(_0x5e4069[_0x45a5('0x64')][_0x1e523b][_0x45a5('0x66')]):_0x5e4069[_0x45a5('0x64')][_0x1e523b][_0x45a5('0x67')]+'\x20'+_0x5e4069[_0x45a5('0x64')][_0x1e523b][_0x45a5('0x68')]+(_0x1ccfd6(_0x5e4069[_0x45a5('0x64')][_0x1e523b][_0x45a5('0x68')])?'\x20'+_0x5e4069['rules'][_0x1e523b]['value']:'');}return _0x5aa395+')';};var _0x1b4c1a={'where':{'id':_0xec59e2['id']}},_0x5f52d5,_0x178c9a,_0x1d4fa6,_0x153221,_0x189893;_0x1b4c1a=_[_0x45a5('0x3b')]({},_0x1b4c1a,_0x17d8df);return db['AnalyticCustomReport']['find'](_0x1b4c1a)[_0x45a5('0x23')](function(_0x3132f5){if(_0x3132f5){_0x5f52d5=_0x3132f5;return _0x3132f5[_0x45a5('0x6a')]();}return null;})[_0x45a5('0x23')](function(_0x34651c){if(_0x34651c){if(!_0x34651c[_0x45a5('0x35')]){throw new db[(_0x45a5('0x8e'))][(_0x45a5('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x178c9a=_0x34651c;return db[_0x45a5('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x45a5('0x23')](function(_0x34050f){if(_0x34050f){_0x1d4fa6=_[_0x45a5('0x6e')](_0x34050f,'id');var _0x3922ec;var _0x3d8ea6=squel[_0x45a5('0x6f')]();_0x3d8ea6[_0x45a5('0x70')](_0x5f52d5['table']);for(var _0x5cb1c1=0x0;_0x5cb1c1<_0x178c9a[_0x45a5('0x35')];_0x5cb1c1+=0x1){_0x3922ec=_0x178c9a[_0x5cb1c1]['MetricId']?_0x1d4fa6[_0x178c9a[_0x5cb1c1]['MetricId']][_0x45a5('0x73')]:_0x178c9a[_0x5cb1c1][_0x45a5('0x67')];_0x3922ec=_0x178c9a[_0x5cb1c1][_0x45a5('0x75')]?_[_0x45a5('0x74')](_0xa0cd9d[_0x178c9a[_0x5cb1c1][_0x45a5('0x75')]],'%s',_0x3922ec):_0x3922ec;_0x3922ec=_0x178c9a[_0x5cb1c1][_0x45a5('0x76')]?_['replace'](_0x4e83dd[_0x178c9a[_0x5cb1c1][_0x45a5('0x76')]],'%s',_0x3922ec):_0x3922ec;if(_0x178c9a[_0x5cb1c1][_0x45a5('0x77')]){_0x3d8ea6[_0x45a5('0x66')](_0x3922ec);}_0x178c9a[_0x5cb1c1][_0x45a5('0x78')]&&_0x3d8ea6[_0x45a5('0x79')](_0x3922ec,_0x178c9a[_0x5cb1c1][_0x45a5('0x78')]===_0x45a5('0x7a')?![]:!![]);_0x3d8ea6['field'](_0x3922ec,_0x178c9a[_0x5cb1c1][_0x45a5('0x7b')]||_0x3922ec);}if(_0x5f52d5[_0x45a5('0x7c')]){_0x5f52d5['joins']=JSON[_0x45a5('0x82')](_0x5f52d5[_0x45a5('0x7c')]);for(var _0x2c44c5=0x0;_0x2c44c5<_0x5f52d5[_0x45a5('0x7c')][_0x45a5('0x35')];_0x2c44c5+=0x1){if(_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x3d')]&&_[_0x45a5('0x61')](_0xfc2b71,_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x3d')])&&_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5]['parentKey']&&_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x7e')]&&_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x7f')]){_0x3d8ea6[_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x3d')]](_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x7e')],null,util[_0x45a5('0x76')]('%s.%s\x20=\x20%s.%s',_0x5f52d5[_0x45a5('0x71')],_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x7d')],_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x7e')],_0x5f52d5[_0x45a5('0x7c')][_0x2c44c5][_0x45a5('0x7f')]));}}}if(_0x5f52d5[_0x45a5('0x81')]){_0x5f52d5['conditions']=JSON['parse'](_0x5f52d5[_0x45a5('0x81')]);_0x3d8ea6[_0x45a5('0x38')](_0x28a7ef(_0x5f52d5[_0x45a5('0x81')][_0x45a5('0x66')]));}_0x189893=_0x3d8ea6[_0x45a5('0x83')]();_0x3d8ea6[_0x45a5('0x1d')](_0x17f088);_0x3d8ea6[_0x45a5('0x1c')](0x0);return;}})['then'](function(){if(_0x1533b0[_0x45a5('0x8f')]===_0x45a5('0x90')){return null;}var _0x2b8976=_[_0x45a5('0x3b')](_0x1533b0,{'name':_0x1533b0[_0x45a5('0x91')]||_0x1533b0[_0x45a5('0x2a')]||_0x5f52d5['name'],'basename':_0x2bd895,'savename':util[_0x45a5('0x76')](_0x45a5('0x92'),_0x1533b0['name']||_0x5f52d5[_0x45a5('0x2a')],require(_0x45a5('0x93'))[_0x45a5('0x94')](0x4),_0x1533b0['output']||'csv'),'reportId':_0x5f52d5['id'],'reportType':_0x45a5('0x95')});return db[_0x45a5('0x96')][_0x45a5('0x48')](_0x2b8976,{'raw':!![]});})[_0x45a5('0x23')](function(_0x4800b3){if(_0x5f52d5['table']===_0x45a5('0x97')){_0x189893[_0x45a5('0x38')](_0x5f52d5[_0x45a5('0x71')]+_0x45a5('0x98'),_0x1533b0[_0x45a5('0x99')],_0x1533b0['endDate']);}else{_0x189893[_0x45a5('0x38')](_0x5f52d5['table']+_0x45a5('0x9a'),_0x1533b0[_0x45a5('0x99')],_0x1533b0[_0x45a5('0x9b')]);}if(_0x4800b3){logger['info'](_0x45a5('0x9c'),_0x189893[_0x45a5('0x86')]());require('child_process')['fork'](path[_0x45a5('0x53')](__dirname,'../../components/export/',_0x4800b3[_0x45a5('0x8f')]),[_0x4800b3['id'],_0x189893[_0x45a5('0x86')](),path[_0x45a5('0x53')](__dirname,_0x45a5('0x9d'),_0x4800b3[_0x45a5('0x9e')]),_0x2bd895]);return _0x4800b3;}else{var _0x5ae384=squel[_0x45a5('0x6f')]();_0x5ae384['from']('('+_0x189893[_0x45a5('0x86')]()+')',_0x45a5('0x9f'));_0x5ae384[_0x45a5('0x67')](_0x45a5('0xa0'),'count');_0x189893[_0x45a5('0x1d')](_0x1533b0['limit']||_0x17f088);_0x189893[_0x45a5('0x1c')](_0x1533b0[_0x45a5('0x1c')]||0x0);return dbH[_0x45a5('0x87')]['query'](_0x5ae384[_0x45a5('0x86')](),{'type':dbH[_0x45a5('0x87')]['QueryTypes'][_0x45a5('0x89')]})[_0x45a5('0x23')](function(_0x4e5a2e){if(!_0x4e5a2e[_0x45a5('0x35')]){_0x153221=0x0;}else{_0x153221=_0x4e5a2e[0x0][_0x45a5('0x1b')]||0x0;}return dbH[_0x45a5('0x87')][_0x45a5('0x2e')](_0x189893[_0x45a5('0x86')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x45a5('0x23')](function(_0x5bf5e9){return{'rows':_0x5bf5e9||[],'count':_0x153221};});}});}exports['run']=function(_0x199070,_0x4b461c){return runReport(_0x199070[_0x45a5('0x46')],_0x199070['query'],_0x199070['options'])[_0x45a5('0x23')](respondWithResult(_0x4b461c,null))[_0x45a5('0x44')](handleError(_0x4b461c,null));};exports['runReport']=runReport;exports[_0x45a5('0x2e')]=function(_0x29e899,_0x4e630a){var _0x3060d1=0xa;var _0x2ac664=['join','left_join',_0x45a5('0x54'),'cross_join'];var _0x56c2d1={'SUM':_0x45a5('0x8c'),'COUNT':_0x45a5('0x55'),'COUNT DISTINCT':_0x45a5('0x56'),'MAX':_0x45a5('0x57'),'MIN':'MIN(%s)','AVG':_0x45a5('0x59'),'GROUP_CONCAT':_0x45a5('0x5a'),'GROUP_CONCAT ASC':_0x45a5('0x5b'),'GROUP_CONCAT DESC':_0x45a5('0x5c')};var _0x3b5394={'SEC_TO_TIME':_0x45a5('0x5d'),'DATE':_0x45a5('0x8d'),'HOUR':_0x45a5('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x45a5('0x60')};var _0x42aa2c=function(_0x5696c0){return!_[_0x45a5('0x61')]([_0x45a5('0x62'),'IS\x20NOT\x20NULL',_0x45a5('0xa1'),_0x45a5('0xa2')],_0x5696c0);};var _0x356561=function(_0x1bc2dc){if(!_0x1bc2dc||!_0x1bc2dc[_0x45a5('0x64')][_0x45a5('0x35')]){return'';}for(var _0x337272='(',_0x335a66=0x0;_0x335a66<_0x1bc2dc[_0x45a5('0x64')][_0x45a5('0x35')];_0x335a66+=0x1){_0x335a66>0x0&&(_0x337272+='\x20'+_0x1bc2dc[_0x45a5('0x65')]+'\x20');_0x337272+=_0x1bc2dc[_0x45a5('0x64')][_0x335a66][_0x45a5('0x66')]?_0x356561(_0x1bc2dc[_0x45a5('0x64')][_0x335a66][_0x45a5('0x66')]):_0x1bc2dc['rules'][_0x335a66]['field']+'\x20'+_0x1bc2dc['rules'][_0x335a66]['condition']+(_0x42aa2c(_0x1bc2dc[_0x45a5('0x64')][_0x335a66][_0x45a5('0x68')])?'\x20'+_0x1bc2dc[_0x45a5('0x64')][_0x335a66][_0x45a5('0x69')]:'');}return _0x337272+')';};var _0x1c7fbe={'where':{'id':_0x29e899[_0x45a5('0x46')]['id']}},_0x2e5651,_0x808186,_0x481085,_0x54dc5a,_0x585785;_0x1c7fbe=_['merge']({},_0x1c7fbe,_0x29e899[_0x45a5('0x3f')]);return db['AnalyticCustomReport'][_0x45a5('0x52')](_0x1c7fbe)[_0x45a5('0x23')](function(_0x44b5a9){if(_0x44b5a9){_0x2e5651=_0x44b5a9;return _0x44b5a9[_0x45a5('0x6a')]();}return null;})[_0x45a5('0x23')](function(_0x1a1fbf){if(_0x1a1fbf){if(!_0x1a1fbf[_0x45a5('0x35')]){throw new db[(_0x45a5('0x8e'))][(_0x45a5('0x6b'))](_0x45a5('0x6c'),0x193);}_0x808186=_0x1a1fbf;return db[_0x45a5('0x6d')][_0x45a5('0x42')]({'raw':!![]});}return null;})[_0x45a5('0x23')](function(_0x4e398a){if(_0x4e398a){_0x481085=_[_0x45a5('0x6e')](_0x4e398a,'id');var _0xbae0a2;var _0xbde6e=squel['select']();_0xbde6e['from'](_0x2e5651[_0x45a5('0x71')]);for(var _0x4576fc=0x0;_0x4576fc<_0x808186[_0x45a5('0x35')];_0x4576fc+=0x1){_0xbae0a2=_0x808186[_0x4576fc][_0x45a5('0x72')]?_0x481085[_0x808186[_0x4576fc][_0x45a5('0x72')]][_0x45a5('0x73')]:_0x808186[_0x4576fc]['field'];_0xbae0a2=_0x808186[_0x4576fc][_0x45a5('0x75')]?_['replace'](_0x56c2d1[_0x808186[_0x4576fc]['function']],'%s',_0xbae0a2):_0xbae0a2;_0xbae0a2=_0x808186[_0x4576fc][_0x45a5('0x76')]?_[_0x45a5('0x74')](_0x3b5394[_0x808186[_0x4576fc][_0x45a5('0x76')]],'%s',_0xbae0a2):_0xbae0a2;if(_0x808186[_0x4576fc][_0x45a5('0x77')]){_0xbde6e['group'](_0xbae0a2);}_0x808186[_0x4576fc]['orderBy']&&_0xbde6e[_0x45a5('0x79')](_0xbae0a2,_0x808186[_0x4576fc][_0x45a5('0x78')]===_0x45a5('0x7a')?![]:!![]);_0xbde6e['field'](_0xbae0a2,_0x808186[_0x4576fc][_0x45a5('0x7b')]||_0xbae0a2);}if(_0x2e5651[_0x45a5('0x7c')]){_0x2e5651[_0x45a5('0x7c')]=JSON['parse'](_0x2e5651[_0x45a5('0x7c')]);for(var _0x4bfeb4=0x0;_0x4bfeb4<_0x2e5651[_0x45a5('0x7c')][_0x45a5('0x35')];_0x4bfeb4+=0x1){if(_0x2e5651[_0x45a5('0x7c')][_0x4bfeb4]['type']&&_['includes'](_0x2ac664,_0x2e5651['joins'][_0x4bfeb4][_0x45a5('0x3d')])&&_0x2e5651[_0x45a5('0x7c')][_0x4bfeb4][_0x45a5('0x7d')]&&_0x2e5651[_0x45a5('0x7c')][_0x4bfeb4][_0x45a5('0x7e')]&&_0x2e5651['joins'][_0x4bfeb4]['foreignKey']){_0xbde6e[_0x2e5651['joins'][_0x4bfeb4]['type']](_0x2e5651[_0x45a5('0x7c')][_0x4bfeb4]['foreignTable'],null,util[_0x45a5('0x76')](_0x45a5('0x80'),_0x2e5651[_0x45a5('0x71')],_0x2e5651[_0x45a5('0x7c')][_0x4bfeb4]['parentKey'],_0x2e5651['joins'][_0x4bfeb4][_0x45a5('0x7e')],_0x2e5651['joins'][_0x4bfeb4]['foreignKey']));}}}if(_0x2e5651[_0x45a5('0x81')]){_0x2e5651['conditions']=JSON['parse'](_0x2e5651[_0x45a5('0x81')]);_0xbde6e[_0x45a5('0x38')](_0x356561(_0x2e5651[_0x45a5('0x81')][_0x45a5('0x66')]));}_0x585785=_0xbde6e[_0x45a5('0x83')]();_0xbde6e[_0x45a5('0x1d')](_0x3060d1);_0xbde6e['offset'](0x0);logger[_0x45a5('0x84')](_0x45a5('0x85'),_0xbde6e['toString']());return dbH[_0x45a5('0x87')][_0x45a5('0x2e')](_0xbde6e[_0x45a5('0x86')](),{'type':dbH['sequelize'][_0x45a5('0x88')][_0x45a5('0x89')]});}})[_0x45a5('0x23')](function(){return{'sql':_0x585785[_0x45a5('0x86')]()};})[_0x45a5('0x23')](respondWithResult(_0x4e630a,null))['catch'](handleError(_0x4e630a,null));};
\ No newline at end of file
+var _0xf809=['offset','set','Content-Range','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','function','format','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','sequelize','toString','QueryTypes','SELECT','left_join','cross_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','IS\x20NULL','IS\x20EMPTY','groupBy','alias','clone','output','randomstring','generate','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','from','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','replace','debug','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status'];(function(_0x11adfa,_0x36ea57){var _0x1e68a9=function(_0x165ca8){while(--_0x165ca8){_0x11adfa['push'](_0x11adfa['shift']());}};_0x1e68a9(++_0x36ea57);}(_0xf809,0x87));var _0x9f80=function(_0x267c3c,_0x278e46){_0x267c3c=_0x267c3c-0x0;var _0x1f9cad=_0xf809[_0x267c3c];return _0x1f9cad;};'use strict';var emlformat=require(_0x9f80('0x0'));var rimraf=require(_0x9f80('0x1'));var zipdir=require(_0x9f80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f80('0x3'));var moment=require('moment');var BPromise=require(_0x9f80('0x4'));var Mustache=require(_0x9f80('0x5'));var util=require(_0x9f80('0x6'));var path=require(_0x9f80('0x7'));var sox=require(_0x9f80('0x8'));var csv=require(_0x9f80('0x9'));var ejs=require(_0x9f80('0xa'));var fs=require('fs');var fs_extra=require(_0x9f80('0xb'));var _=require(_0x9f80('0xc'));var squel=require(_0x9f80('0xd'));var crypto=require('crypto');var jsforce=require(_0x9f80('0xe'));var deskjs=require(_0x9f80('0xf'));var toCsv=require(_0x9f80('0x9'));var querystring=require(_0x9f80('0x10'));var Papa=require(_0x9f80('0x11'));var Redis=require(_0x9f80('0x12'));var authService=require(_0x9f80('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9f80('0x14'));var hardwareService=require(_0x9f80('0x15'));var logger=require(_0x9f80('0x16'))(_0x9f80('0x17'));var utils=require('../../config/utils');var config=require(_0x9f80('0x18'));var licenseUtil=require(_0x9f80('0x19'));var db=require(_0x9f80('0x1a'))['db'];var dbH=require(_0x9f80('0x1a'))[_0x9f80('0x1b')];function respondWithStatusCode(_0x261190,_0x1885c1){_0x1885c1=_0x1885c1||0xcc;return function(_0x569b01){if(_0x569b01){return _0x261190[_0x9f80('0x1c')](_0x1885c1);}return _0x261190[_0x9f80('0x1d')](_0x1885c1)['end']();};}function respondWithResult(_0x142bf8,_0x43f5d0){_0x43f5d0=_0x43f5d0||0xc8;return function(_0x59c994){if(_0x59c994){return _0x142bf8[_0x9f80('0x1d')](_0x43f5d0)['json'](_0x59c994);}};}function respondWithFilteredResult(_0x58c15f,_0x3a010e){return function(_0x1075da){if(_0x1075da){var _0x39deae=_0x1075da['count'],_0x39de75=_0x3a010e[_0x9f80('0x1e')],_0x671af0=_0x3a010e[_0x9f80('0x1e')]+_0x3a010e['limit'],_0x3877fb;if(_0x671af0>=_0x39deae){_0x671af0=_0x39deae;_0x3877fb=0xc8;}else{_0x3877fb=0xce;}_0x58c15f[_0x9f80('0x1d')](_0x3877fb);return _0x58c15f[_0x9f80('0x1f')](_0x9f80('0x20'),_0x39de75+'-'+_0x671af0+'/'+_0x39deae)['json'](_0x1075da);}return null;};}function patchUpdates(_0x496f45){return function(_0x159900){try{jsonpatch[_0x9f80('0x21')](_0x159900,_0x496f45,!![]);}catch(_0x1de27d){return BPromise[_0x9f80('0x22')](_0x1de27d);}return _0x159900[_0x9f80('0x23')]();};}function saveUpdates(_0x572701,_0x2f9de5){return function(_0x3bfdd0){if(_0x3bfdd0){return _0x3bfdd0[_0x9f80('0x24')](_0x572701)[_0x9f80('0x25')](function(_0x3d5381){return _0x3d5381;});}return null;};}function removeEntity(_0x50555b,_0x2bedbc){return function(_0x37244c){if(_0x37244c){return _0x37244c['destroy']()['then'](function(){var _0x301492=_0x37244c[_0x9f80('0x26')]({'plain':!![]});var _0x44640c=_0x9f80('0x27');return db[_0x9f80('0x28')][_0x9f80('0x29')]({'where':{'type':_0x44640c,'resourceId':_0x301492['id']}})['then'](function(){return _0x37244c;});})['then'](function(){_0x50555b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3925de,_0x3c98ca){return function(_0x45559c){if(!_0x45559c){_0x3925de[_0x9f80('0x1c')](0x194);}return _0x45559c;};}function handleError(_0x310688,_0x29c1a0){_0x29c1a0=_0x29c1a0||0x1f4;return function(_0x2a3c9e){logger['error'](_0x2a3c9e[_0x9f80('0x2a')]);if(_0x2a3c9e[_0x9f80('0x2b')]){delete _0x2a3c9e[_0x9f80('0x2b')];}_0x310688[_0x9f80('0x1d')](_0x29c1a0)[_0x9f80('0x2c')](_0x2a3c9e);};}exports[_0x9f80('0x2d')]=function(_0x3d8718,_0x172a36){var _0x412a07={},_0x44f041={},_0x38daa3={'count':0x0,'rows':[]};var _0x2f81c6=_[_0x9f80('0x2e')](db[_0x9f80('0x2f')][_0x9f80('0x30')],function(_0x43cff6){return{'name':_0x43cff6[_0x9f80('0x31')],'type':_0x43cff6[_0x9f80('0x32')][_0x9f80('0x33')]};});_0x44f041[_0x9f80('0x34')]=_[_0x9f80('0x2e')](_0x2f81c6,_0x9f80('0x2b'));_0x44f041[_0x9f80('0x35')]=_[_0x9f80('0x36')](_0x3d8718[_0x9f80('0x35')]);_0x44f041['filters']=_[_0x9f80('0x37')](_0x44f041[_0x9f80('0x34')],_0x44f041['query']);_0x412a07[_0x9f80('0x38')]=_[_0x9f80('0x37')](_0x44f041['model'],qs[_0x9f80('0x39')](_0x3d8718[_0x9f80('0x35')][_0x9f80('0x39')]));_0x412a07[_0x9f80('0x38')]=_0x412a07[_0x9f80('0x38')]['length']?_0x412a07[_0x9f80('0x38')]:_0x44f041[_0x9f80('0x34')];if(!_0x3d8718[_0x9f80('0x35')][_0x9f80('0x3a')](_0x9f80('0x3b'))){_0x412a07[_0x9f80('0x3c')]=qs['limit'](_0x3d8718['query'][_0x9f80('0x3c')]);_0x412a07[_0x9f80('0x1e')]=qs[_0x9f80('0x1e')](_0x3d8718['query'][_0x9f80('0x1e')]);}_0x412a07[_0x9f80('0x3d')]=qs[_0x9f80('0x3e')](_0x3d8718[_0x9f80('0x35')]['sort']);_0x412a07[_0x9f80('0x3f')]=qs[_0x9f80('0x40')](_[_0x9f80('0x41')](_0x3d8718[_0x9f80('0x35')],_0x44f041['filters']),_0x2f81c6);if(_0x3d8718[_0x9f80('0x35')]['filter']){_0x412a07[_0x9f80('0x3f')]=_[_0x9f80('0x42')](_0x412a07[_0x9f80('0x3f')],{'$or':_[_0x9f80('0x2e')](_0x2f81c6,function(_0x497d9f){if(_0x497d9f[_0x9f80('0x32')]!==_0x9f80('0x43')){var _0x591b8c={};_0x591b8c[_0x497d9f[_0x9f80('0x2b')]]={'$like':'%'+_0x3d8718[_0x9f80('0x35')][_0x9f80('0x44')]+'%'};return _0x591b8c;}})});}_0x412a07=_[_0x9f80('0x42')]({},_0x412a07,_0x3d8718[_0x9f80('0x45')]);var _0x543fd4={'where':_0x412a07['where']};return db[_0x9f80('0x2f')]['count'](_0x543fd4)['then'](function(_0x52cc7a){_0x38daa3[_0x9f80('0x46')]=_0x52cc7a;if(_0x3d8718[_0x9f80('0x35')][_0x9f80('0x47')]){_0x412a07[_0x9f80('0x48')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x9f80('0x49')](_0x412a07);})[_0x9f80('0x25')](function(_0x3ff5ab){_0x38daa3['rows']=_0x3ff5ab;return _0x38daa3;})[_0x9f80('0x25')](respondWithFilteredResult(_0x172a36,_0x412a07))[_0x9f80('0x4a')](handleError(_0x172a36,null));};exports[_0x9f80('0x4b')]=function(_0x1505ac,_0x1ccbbe){var _0x222209={'raw':![],'where':{'id':_0x1505ac[_0x9f80('0x4c')]['id']}},_0x3b2bb9={};_0x3b2bb9[_0x9f80('0x34')]=_[_0x9f80('0x36')](db[_0x9f80('0x2f')][_0x9f80('0x30')]);_0x3b2bb9['query']=_[_0x9f80('0x36')](_0x1505ac[_0x9f80('0x35')]);_0x3b2bb9[_0x9f80('0x40')]=_[_0x9f80('0x37')](_0x3b2bb9[_0x9f80('0x34')],_0x3b2bb9[_0x9f80('0x35')]);_0x222209[_0x9f80('0x38')]=_[_0x9f80('0x37')](_0x3b2bb9[_0x9f80('0x34')],qs[_0x9f80('0x39')](_0x1505ac[_0x9f80('0x35')][_0x9f80('0x39')]));_0x222209[_0x9f80('0x38')]=_0x222209[_0x9f80('0x38')][_0x9f80('0x4d')]?_0x222209[_0x9f80('0x38')]:_0x3b2bb9[_0x9f80('0x34')];if(_0x1505ac[_0x9f80('0x35')][_0x9f80('0x47')]){_0x222209[_0x9f80('0x48')]=[{'all':!![]}];}_0x222209=_[_0x9f80('0x42')]({},_0x222209,_0x1505ac['options']);return db[_0x9f80('0x2f')][_0x9f80('0x4e')](_0x222209)[_0x9f80('0x25')](handleEntityNotFound(_0x1ccbbe,null))['then'](respondWithResult(_0x1ccbbe,null))[_0x9f80('0x4a')](handleError(_0x1ccbbe,null));};exports[_0x9f80('0x4f')]=function(_0x549811,_0x52f1dc){return db[_0x9f80('0x2f')][_0x9f80('0x4f')](_0x549811['body'],{})[_0x9f80('0x25')](function(_0x1c9383){var _0x1fb4d8=_0x549811['user'][_0x9f80('0x26')]({'plain':!![]});if(!_0x1fb4d8)throw new Error(_0x9f80('0x50'));if(_0x1fb4d8[_0x9f80('0x51')]==='user'){var _0x6c32d1=_0x1c9383[_0x9f80('0x26')]({'plain':!![]});var _0x168951=_0x9f80('0x52');return db[_0x9f80('0x53')][_0x9f80('0x4e')]({'where':{'name':_0x168951,'userProfileId':_0x1fb4d8[_0x9f80('0x54')]},'raw':!![]})[_0x9f80('0x25')](function(_0x49472a){if(_0x49472a&&_0x49472a[_0x9f80('0x55')]===0x0){return db[_0x9f80('0x28')][_0x9f80('0x4f')]({'name':_0x6c32d1[_0x9f80('0x2b')],'resourceId':_0x6c32d1['id'],'type':_0x9f80('0x27'),'sectionId':_0x49472a['id']},{})[_0x9f80('0x25')](function(){return _0x1c9383;});}else{return _0x1c9383;}})[_0x9f80('0x4a')](function(_0x234c88){logger[_0x9f80('0x56')](_0x9f80('0x57'),_0x234c88);throw _0x234c88;});}return _0x1c9383;})[_0x9f80('0x25')](respondWithResult(_0x52f1dc,0xc9))[_0x9f80('0x4a')](handleError(_0x52f1dc,null));};exports[_0x9f80('0x24')]=function(_0x14abb0,_0x29d07b){if(_0x14abb0[_0x9f80('0x58')]['id']){delete _0x14abb0['body']['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x14abb0['params']['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x29d07b,null))['then'](saveUpdates(_0x14abb0[_0x9f80('0x58')],null))[_0x9f80('0x25')](respondWithResult(_0x29d07b,null))['catch'](handleError(_0x29d07b,null));};exports[_0x9f80('0x29')]=function(_0x2a9640,_0x59ba33){return db['AnalyticCustomReport'][_0x9f80('0x4e')]({'where':{'id':_0x2a9640[_0x9f80('0x4c')]['id']}})[_0x9f80('0x25')](handleEntityNotFound(_0x59ba33,null))[_0x9f80('0x25')](removeEntity(_0x59ba33,null))[_0x9f80('0x4a')](handleError(_0x59ba33,null));};exports['preview']=function(_0x17e599,_0x3f1958){var _0x5c1b94=0xa;var _0x23ca1a=[_0x9f80('0x59'),'left_join',_0x9f80('0x5a'),'cross_join'];var _0x39dfc3={'SUM':_0x9f80('0x5b'),'COUNT':_0x9f80('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9f80('0x5d'),'MIN':_0x9f80('0x5e'),'AVG':_0x9f80('0x5f'),'GROUP_CONCAT':_0x9f80('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2b8b1f={'SEC_TO_TIME':_0x9f80('0x61'),'DATE':_0x9f80('0x62'),'HOUR':'HOUR(%s)','ROUND':_0x9f80('0x63'),'UNIX_TIMESTAMP':_0x9f80('0x64')};var _0x16e07c=function(_0x2a2d0d){return!_[_0x9f80('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x9f80('0x66')],_0x2a2d0d);};var _0x55731f=function(_0x24a3c2){if(!_0x24a3c2||!_0x24a3c2[_0x9f80('0x67')][_0x9f80('0x4d')]){return'';}for(var _0x4659c8='(',_0x534286=0x0;_0x534286<_0x24a3c2['rules'][_0x9f80('0x4d')];_0x534286+=0x1){_0x534286>0x0&&(_0x4659c8+='\x20'+_0x24a3c2[_0x9f80('0x68')]+'\x20');_0x4659c8+=_0x24a3c2['rules'][_0x534286][_0x9f80('0x69')]?_0x55731f(_0x24a3c2[_0x9f80('0x67')][_0x534286]['group']):_0x24a3c2[_0x9f80('0x67')][_0x534286][_0x9f80('0x6a')]+'\x20'+_0x24a3c2[_0x9f80('0x67')][_0x534286][_0x9f80('0x6b')]+(_0x16e07c(_0x24a3c2[_0x9f80('0x67')][_0x534286]['condition'])?'\x20'+_0x24a3c2['rules'][_0x534286][_0x9f80('0x6c')]:'');}return _0x4659c8+')';};var _0x447c0a={'where':{'id':_0x17e599[_0x9f80('0x4c')]['id']}},_0x4c899e,_0x3b34bc,_0x3a6f47,_0x659e8a,_0x5d7723;_0x447c0a=_[_0x9f80('0x42')]({},_0x447c0a,_0x17e599[_0x9f80('0x45')]);return db['AnalyticCustomReport'][_0x9f80('0x4e')](_0x447c0a)['then'](function(_0x18c7e7){if(_0x18c7e7){_0x4c899e=_0x18c7e7;return _0x18c7e7[_0x9f80('0x6d')]();}return null;})[_0x9f80('0x25')](function(_0x1ced07){if(_0x1ced07){if(!_0x1ced07[_0x9f80('0x4d')]){throw new db[(_0x9f80('0x6e'))]['ValidationErrorItem'](_0x9f80('0x6f'),0x193);}_0x3b34bc=_0x1ced07;return db[_0x9f80('0x70')][_0x9f80('0x49')]({'raw':!![]});}return null;})[_0x9f80('0x25')](function(_0xa2c3dd){if(_0xa2c3dd){_0x3a6f47=_[_0x9f80('0x71')](_0xa2c3dd,'id');var _0x148d16;var _0x1d5fcd=squel[_0x9f80('0x72')]();_0x1d5fcd['from'](_0x4c899e['table']);for(var _0x4767a3=0x0;_0x4767a3<_0x3b34bc[_0x9f80('0x4d')];_0x4767a3+=0x1){_0x148d16=_0x3b34bc[_0x4767a3][_0x9f80('0x73')]?_0x3a6f47[_0x3b34bc[_0x4767a3][_0x9f80('0x73')]][_0x9f80('0x74')]:_0x3b34bc[_0x4767a3]['field'];_0x148d16=_0x3b34bc[_0x4767a3][_0x9f80('0x75')]?_['replace'](_0x39dfc3[_0x3b34bc[_0x4767a3]['function']],'%s',_0x148d16):_0x148d16;_0x148d16=_0x3b34bc[_0x4767a3][_0x9f80('0x76')]?_['replace'](_0x2b8b1f[_0x3b34bc[_0x4767a3][_0x9f80('0x76')]],'%s',_0x148d16):_0x148d16;if(_0x3b34bc[_0x4767a3]['groupBy']){_0x1d5fcd[_0x9f80('0x69')](_0x148d16);}_0x3b34bc[_0x4767a3][_0x9f80('0x77')]&&_0x1d5fcd[_0x9f80('0x3d')](_0x148d16,_0x3b34bc[_0x4767a3][_0x9f80('0x77')]===_0x9f80('0x78')?![]:!![]);_0x1d5fcd[_0x9f80('0x6a')](_0x148d16,_0x3b34bc[_0x4767a3]['alias']||_0x148d16);}if(_0x4c899e[_0x9f80('0x79')]){_0x4c899e[_0x9f80('0x79')]=JSON[_0x9f80('0x7a')](_0x4c899e['joins']);for(var _0x16280f=0x0;_0x16280f<_0x4c899e[_0x9f80('0x79')]['length'];_0x16280f+=0x1){if(_0x4c899e['joins'][_0x16280f][_0x9f80('0x32')]&&_['includes'](_0x23ca1a,_0x4c899e[_0x9f80('0x79')][_0x16280f][_0x9f80('0x32')])&&_0x4c899e[_0x9f80('0x79')][_0x16280f][_0x9f80('0x7b')]&&_0x4c899e[_0x9f80('0x79')][_0x16280f][_0x9f80('0x7c')]&&_0x4c899e[_0x9f80('0x79')][_0x16280f][_0x9f80('0x7d')]){_0x1d5fcd[_0x4c899e[_0x9f80('0x79')][_0x16280f]['type']](_0x4c899e[_0x9f80('0x79')][_0x16280f][_0x9f80('0x7c')],null,util['format'](_0x9f80('0x7e'),_0x4c899e[_0x9f80('0x7f')],_0x4c899e[_0x9f80('0x79')][_0x16280f]['parentKey'],_0x4c899e[_0x9f80('0x79')][_0x16280f]['foreignTable'],_0x4c899e[_0x9f80('0x79')][_0x16280f][_0x9f80('0x7d')]));}}}if(_0x4c899e[_0x9f80('0x80')]){_0x4c899e['conditions']=JSON[_0x9f80('0x7a')](_0x4c899e['conditions']);_0x1d5fcd['where'](_0x55731f(_0x4c899e[_0x9f80('0x80')]['group']));}_0x5d7723=_0x1d5fcd['clone']();_0x1d5fcd[_0x9f80('0x3c')](_0x5c1b94);_0x1d5fcd[_0x9f80('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x1d5fcd['toString']());return dbH[_0x9f80('0x81')][_0x9f80('0x35')](_0x1d5fcd[_0x9f80('0x82')](),{'type':dbH[_0x9f80('0x81')][_0x9f80('0x83')][_0x9f80('0x84')]});}})[_0x9f80('0x25')](respondWithResult(_0x3f1958,null))[_0x9f80('0x4a')](handleError(_0x3f1958,null));};function runReport(_0x2f0180,_0x4a1da6,_0xa3f131){var _0x2b4a4f=_0x4a1da6[_0x9f80('0x2b')];var _0x4e30b3=0xa;var _0x31d70d=['join',_0x9f80('0x85'),_0x9f80('0x5a'),_0x9f80('0x86')];var _0x4d6273={'SUM':_0x9f80('0x5b'),'COUNT':_0x9f80('0x5c'),'COUNT DISTINCT':_0x9f80('0x87'),'MAX':'MAX(%s)','MIN':_0x9f80('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9f80('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9f80('0x88')};var _0x3cf1d6={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9f80('0x62'),'HOUR':_0x9f80('0x89'),'ROUND':_0x9f80('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4cb224=function(_0x20bc30){return!_[_0x9f80('0x65')]([_0x9f80('0x8a'),'IS\x20NOT\x20NULL',_0x9f80('0x8b'),_0x9f80('0x66')],_0x20bc30);};var _0x5bc272=function(_0x70ba94){if(!_0x70ba94||!_0x70ba94[_0x9f80('0x67')][_0x9f80('0x4d')]){return'';}for(var _0x317734='(',_0x4af875=0x0;_0x4af875<_0x70ba94['rules']['length'];_0x4af875+=0x1){_0x4af875>0x0&&(_0x317734+='\x20'+_0x70ba94[_0x9f80('0x68')]+'\x20');_0x317734+=_0x70ba94['rules'][_0x4af875][_0x9f80('0x69')]?_0x5bc272(_0x70ba94[_0x9f80('0x67')][_0x4af875][_0x9f80('0x69')]):_0x70ba94[_0x9f80('0x67')][_0x4af875][_0x9f80('0x6a')]+'\x20'+_0x70ba94[_0x9f80('0x67')][_0x4af875][_0x9f80('0x6b')]+(_0x4cb224(_0x70ba94['rules'][_0x4af875][_0x9f80('0x6b')])?'\x20'+_0x70ba94['rules'][_0x4af875][_0x9f80('0x6c')]:'');}return _0x317734+')';};var _0x46ba0f={'where':{'id':_0x2f0180['id']}},_0x2e2979,_0xd65266,_0x2ea330,_0x4a10af,_0x3ffc1a;_0x46ba0f=_[_0x9f80('0x42')]({},_0x46ba0f,_0xa3f131);return db[_0x9f80('0x2f')]['find'](_0x46ba0f)[_0x9f80('0x25')](function(_0x14fcb7){if(_0x14fcb7){_0x2e2979=_0x14fcb7;return _0x14fcb7[_0x9f80('0x6d')]();}return null;})[_0x9f80('0x25')](function(_0x3f09db){if(_0x3f09db){if(!_0x3f09db[_0x9f80('0x4d')]){throw new db[(_0x9f80('0x6e'))]['ValidationErrorItem'](_0x9f80('0x6f'),0x193);}_0xd65266=_0x3f09db;return db[_0x9f80('0x70')][_0x9f80('0x49')]({'raw':!![]});}return null;})[_0x9f80('0x25')](function(_0x26920e){if(_0x26920e){_0x2ea330=_[_0x9f80('0x71')](_0x26920e,'id');var _0x3a563d;var _0x5aaa24=squel[_0x9f80('0x72')]();_0x5aaa24['from'](_0x2e2979[_0x9f80('0x7f')]);for(var _0x287d75=0x0;_0x287d75<_0xd65266['length'];_0x287d75+=0x1){_0x3a563d=_0xd65266[_0x287d75][_0x9f80('0x73')]?_0x2ea330[_0xd65266[_0x287d75][_0x9f80('0x73')]][_0x9f80('0x74')]:_0xd65266[_0x287d75]['field'];_0x3a563d=_0xd65266[_0x287d75]['function']?_['replace'](_0x4d6273[_0xd65266[_0x287d75][_0x9f80('0x75')]],'%s',_0x3a563d):_0x3a563d;_0x3a563d=_0xd65266[_0x287d75]['format']?_['replace'](_0x3cf1d6[_0xd65266[_0x287d75][_0x9f80('0x76')]],'%s',_0x3a563d):_0x3a563d;if(_0xd65266[_0x287d75][_0x9f80('0x8c')]){_0x5aaa24[_0x9f80('0x69')](_0x3a563d);}_0xd65266[_0x287d75][_0x9f80('0x77')]&&_0x5aaa24[_0x9f80('0x3d')](_0x3a563d,_0xd65266[_0x287d75][_0x9f80('0x77')]===_0x9f80('0x78')?![]:!![]);_0x5aaa24[_0x9f80('0x6a')](_0x3a563d,_0xd65266[_0x287d75][_0x9f80('0x8d')]||_0x3a563d);}if(_0x2e2979[_0x9f80('0x79')]){_0x2e2979['joins']=JSON[_0x9f80('0x7a')](_0x2e2979[_0x9f80('0x79')]);for(var _0x3bf481=0x0;_0x3bf481<_0x2e2979[_0x9f80('0x79')][_0x9f80('0x4d')];_0x3bf481+=0x1){if(_0x2e2979[_0x9f80('0x79')][_0x3bf481][_0x9f80('0x32')]&&_[_0x9f80('0x65')](_0x31d70d,_0x2e2979['joins'][_0x3bf481][_0x9f80('0x32')])&&_0x2e2979[_0x9f80('0x79')][_0x3bf481][_0x9f80('0x7b')]&&_0x2e2979[_0x9f80('0x79')][_0x3bf481]['foreignTable']&&_0x2e2979['joins'][_0x3bf481][_0x9f80('0x7d')]){_0x5aaa24[_0x2e2979[_0x9f80('0x79')][_0x3bf481]['type']](_0x2e2979[_0x9f80('0x79')][_0x3bf481][_0x9f80('0x7c')],null,util[_0x9f80('0x76')]('%s.%s\x20=\x20%s.%s',_0x2e2979[_0x9f80('0x7f')],_0x2e2979[_0x9f80('0x79')][_0x3bf481][_0x9f80('0x7b')],_0x2e2979[_0x9f80('0x79')][_0x3bf481][_0x9f80('0x7c')],_0x2e2979['joins'][_0x3bf481]['foreignKey']));}}}if(_0x2e2979[_0x9f80('0x80')]){_0x2e2979['conditions']=JSON['parse'](_0x2e2979[_0x9f80('0x80')]);_0x5aaa24[_0x9f80('0x3f')](_0x5bc272(_0x2e2979[_0x9f80('0x80')][_0x9f80('0x69')]));}_0x3ffc1a=_0x5aaa24[_0x9f80('0x8e')]();_0x5aaa24[_0x9f80('0x3c')](_0x4e30b3);_0x5aaa24['offset'](0x0);return;}})[_0x9f80('0x25')](function(){if(_0x4a1da6[_0x9f80('0x8f')]==='web'){return null;}var _0x1a5da2=_[_0x9f80('0x42')](_0x4a1da6,{'name':_0x4a1da6['fullPath']||_0x4a1da6[_0x9f80('0x2b')]||_0x2e2979[_0x9f80('0x2b')],'basename':_0x2b4a4f,'savename':util['format']('%s-%s.%s',_0x4a1da6[_0x9f80('0x2b')]||_0x2e2979[_0x9f80('0x2b')],require(_0x9f80('0x90'))[_0x9f80('0x91')](0x4),_0x4a1da6[_0x9f80('0x8f')]||_0x9f80('0x92')),'reportId':_0x2e2979['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x9f80('0x4f')](_0x1a5da2,{'raw':!![]});})[_0x9f80('0x25')](function(_0x116d3b){if(_0x2e2979['table']===_0x9f80('0x93')){_0x3ffc1a['where'](_0x2e2979['table']+_0x9f80('0x94'),_0x4a1da6['startDate'],_0x4a1da6[_0x9f80('0x95')]);}else{_0x3ffc1a['where'](_0x2e2979[_0x9f80('0x7f')]+_0x9f80('0x96'),_0x4a1da6['startDate'],_0x4a1da6['endDate']);}if(_0x116d3b){logger[_0x9f80('0x97')](_0x9f80('0x98'),_0x3ffc1a[_0x9f80('0x82')]());require(_0x9f80('0x99'))[_0x9f80('0x9a')](path[_0x9f80('0x59')](__dirname,'../../components/export/',_0x116d3b[_0x9f80('0x8f')]),[_0x116d3b['id'],_0x3ffc1a[_0x9f80('0x82')](),path[_0x9f80('0x59')](__dirname,_0x9f80('0x9b'),_0x116d3b['savename']),_0x2b4a4f]);return _0x116d3b;}else{var _0x1ee93f=squel[_0x9f80('0x72')]();_0x1ee93f[_0x9f80('0x9c')]('('+_0x3ffc1a[_0x9f80('0x82')]()+')',_0x9f80('0x9d'));_0x1ee93f['field'](_0x9f80('0x9e'),_0x9f80('0x46'));_0x3ffc1a[_0x9f80('0x3c')](_0x4a1da6[_0x9f80('0x3c')]||_0x4e30b3);_0x3ffc1a['offset'](_0x4a1da6[_0x9f80('0x1e')]||0x0);return dbH['sequelize'][_0x9f80('0x35')](_0x1ee93f['toString'](),{'type':dbH[_0x9f80('0x81')]['QueryTypes']['SELECT']})['then'](function(_0x40572b){if(!_0x40572b['length']){_0x4a10af=0x0;}else{_0x4a10af=_0x40572b[0x0][_0x9f80('0x46')]||0x0;}return dbH[_0x9f80('0x81')][_0x9f80('0x35')](_0x3ffc1a[_0x9f80('0x82')](),{'type':dbH['sequelize'][_0x9f80('0x83')][_0x9f80('0x84')]});})[_0x9f80('0x25')](function(_0x349f83){return{'rows':_0x349f83||[],'count':_0x4a10af};});}});}exports[_0x9f80('0x9f')]=function(_0x3d30f0,_0x2f5f13){return runReport(_0x3d30f0[_0x9f80('0x4c')],_0x3d30f0['query'],_0x3d30f0[_0x9f80('0x45')])[_0x9f80('0x25')](respondWithResult(_0x2f5f13,null))[_0x9f80('0x4a')](handleError(_0x2f5f13,null));};exports[_0x9f80('0xa0')]=runReport;exports['query']=function(_0x3d6d8c,_0x2f27bb){var _0x20602f=0xa;var _0x198334=['join',_0x9f80('0x85'),'right_join','cross_join'];var _0x31c803={'SUM':_0x9f80('0x5b'),'COUNT':_0x9f80('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9f80('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9f80('0x60'),'GROUP_CONCAT ASC':_0x9f80('0xa1'),'GROUP_CONCAT DESC':_0x9f80('0x88')};var _0x43af07={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x9f80('0x89'),'ROUND':_0x9f80('0x63'),'UNIX_TIMESTAMP':_0x9f80('0x64')};var _0x41e54a=function(_0x36abea){return!_[_0x9f80('0x65')]([_0x9f80('0x8a'),'IS\x20NOT\x20NULL',_0x9f80('0x8b'),_0x9f80('0x66')],_0x36abea);};var _0x573710=function(_0x420267){if(!_0x420267||!_0x420267[_0x9f80('0x67')][_0x9f80('0x4d')]){return'';}for(var _0x510aa7='(',_0xbc2851=0x0;_0xbc2851<_0x420267[_0x9f80('0x67')][_0x9f80('0x4d')];_0xbc2851+=0x1){_0xbc2851>0x0&&(_0x510aa7+='\x20'+_0x420267[_0x9f80('0x68')]+'\x20');_0x510aa7+=_0x420267[_0x9f80('0x67')][_0xbc2851]['group']?_0x573710(_0x420267[_0x9f80('0x67')][_0xbc2851][_0x9f80('0x69')]):_0x420267[_0x9f80('0x67')][_0xbc2851][_0x9f80('0x6a')]+'\x20'+_0x420267[_0x9f80('0x67')][_0xbc2851]['condition']+(_0x41e54a(_0x420267[_0x9f80('0x67')][_0xbc2851][_0x9f80('0x6b')])?'\x20'+_0x420267[_0x9f80('0x67')][_0xbc2851]['value']:'');}return _0x510aa7+')';};var _0x475392={'where':{'id':_0x3d6d8c[_0x9f80('0x4c')]['id']}},_0x2d5c17,_0x3c0830,_0x23eb4e,_0x28f56e,_0x2060dd;_0x475392=_['merge']({},_0x475392,_0x3d6d8c[_0x9f80('0x45')]);return db['AnalyticCustomReport'][_0x9f80('0x4e')](_0x475392)[_0x9f80('0x25')](function(_0x99393a){if(_0x99393a){_0x2d5c17=_0x99393a;return _0x99393a[_0x9f80('0x6d')]();}return null;})[_0x9f80('0x25')](function(_0x349707){if(_0x349707){if(!_0x349707[_0x9f80('0x4d')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3c0830=_0x349707;return db[_0x9f80('0x70')]['findAll']({'raw':!![]});}return null;})[_0x9f80('0x25')](function(_0x206e9e){if(_0x206e9e){_0x23eb4e=_[_0x9f80('0x71')](_0x206e9e,'id');var _0x12c181;var _0x1d8c4c=squel[_0x9f80('0x72')]();_0x1d8c4c['from'](_0x2d5c17[_0x9f80('0x7f')]);for(var _0x485441=0x0;_0x485441<_0x3c0830[_0x9f80('0x4d')];_0x485441+=0x1){_0x12c181=_0x3c0830[_0x485441]['MetricId']?_0x23eb4e[_0x3c0830[_0x485441]['MetricId']][_0x9f80('0x74')]:_0x3c0830[_0x485441][_0x9f80('0x6a')];_0x12c181=_0x3c0830[_0x485441][_0x9f80('0x75')]?_['replace'](_0x31c803[_0x3c0830[_0x485441][_0x9f80('0x75')]],'%s',_0x12c181):_0x12c181;_0x12c181=_0x3c0830[_0x485441]['format']?_[_0x9f80('0xa2')](_0x43af07[_0x3c0830[_0x485441]['format']],'%s',_0x12c181):_0x12c181;if(_0x3c0830[_0x485441][_0x9f80('0x8c')]){_0x1d8c4c[_0x9f80('0x69')](_0x12c181);}_0x3c0830[_0x485441][_0x9f80('0x77')]&&_0x1d8c4c[_0x9f80('0x3d')](_0x12c181,_0x3c0830[_0x485441][_0x9f80('0x77')]==='DESC'?![]:!![]);_0x1d8c4c[_0x9f80('0x6a')](_0x12c181,_0x3c0830[_0x485441]['alias']||_0x12c181);}if(_0x2d5c17[_0x9f80('0x79')]){_0x2d5c17[_0x9f80('0x79')]=JSON['parse'](_0x2d5c17[_0x9f80('0x79')]);for(var _0x1fbf8a=0x0;_0x1fbf8a<_0x2d5c17['joins']['length'];_0x1fbf8a+=0x1){if(_0x2d5c17[_0x9f80('0x79')][_0x1fbf8a][_0x9f80('0x32')]&&_['includes'](_0x198334,_0x2d5c17['joins'][_0x1fbf8a][_0x9f80('0x32')])&&_0x2d5c17['joins'][_0x1fbf8a][_0x9f80('0x7b')]&&_0x2d5c17[_0x9f80('0x79')][_0x1fbf8a][_0x9f80('0x7c')]&&_0x2d5c17[_0x9f80('0x79')][_0x1fbf8a][_0x9f80('0x7d')]){_0x1d8c4c[_0x2d5c17[_0x9f80('0x79')][_0x1fbf8a][_0x9f80('0x32')]](_0x2d5c17[_0x9f80('0x79')][_0x1fbf8a]['foreignTable'],null,util['format'](_0x9f80('0x7e'),_0x2d5c17[_0x9f80('0x7f')],_0x2d5c17['joins'][_0x1fbf8a][_0x9f80('0x7b')],_0x2d5c17[_0x9f80('0x79')][_0x1fbf8a][_0x9f80('0x7c')],_0x2d5c17[_0x9f80('0x79')][_0x1fbf8a]['foreignKey']));}}}if(_0x2d5c17[_0x9f80('0x80')]){_0x2d5c17[_0x9f80('0x80')]=JSON['parse'](_0x2d5c17[_0x9f80('0x80')]);_0x1d8c4c[_0x9f80('0x3f')](_0x573710(_0x2d5c17['conditions']['group']));}_0x2060dd=_0x1d8c4c[_0x9f80('0x8e')]();_0x1d8c4c[_0x9f80('0x3c')](_0x20602f);_0x1d8c4c[_0x9f80('0x1e')](0x0);logger[_0x9f80('0xa3')](_0x9f80('0xa4'),_0x1d8c4c[_0x9f80('0x82')]());return dbH['sequelize']['query'](_0x1d8c4c[_0x9f80('0x82')](),{'type':dbH['sequelize'][_0x9f80('0x83')]['SELECT']});}})[_0x9f80('0x25')](function(){return{'sql':_0x2060dd[_0x9f80('0x82')]()};})['then'](respondWithResult(_0x2f27bb,null))[_0x9f80('0x4a')](handleError(_0x2f27bb,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index ddad665..0c533a1 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 _0xb282=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x29f941,_0x2d3ec6){var _0x44ddd7=function(_0x3efcaf){while(--_0x3efcaf){_0x29f941['push'](_0x29f941['shift']());}};_0x44ddd7(++_0x2d3ec6);}(_0xb282,0xa2));var _0x2b28=function(_0x1937c8,_0x5a1f28){_0x1937c8=_0x1937c8-0x0;var _0x48bedf=_0xb282[_0x1937c8];return _0x48bedf;};'use strict';var _=require(_0x2b28('0x0'));var util=require(_0x2b28('0x1'));var logger=require(_0x2b28('0x2'))(_0x2b28('0x3'));var moment=require(_0x2b28('0x4'));var BPromise=require(_0x2b28('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2b28('0x6'));var config=require(_0x2b28('0x7'));var attributes=require(_0x2b28('0x8'));module[_0x2b28('0x9')]=function(_0x470002,_0x513b81){return _0x470002[_0x2b28('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x2b28('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0cb8=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','lodash','../../config/logger','api','moment'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x0cb8,0x1e8));var _0x80cb=function(_0x2c6b2e,_0x48c4b7){_0x2c6b2e=_0x2c6b2e-0x0;var _0x13334b=_0x0cb8[_0x2c6b2e];return _0x13334b;};'use strict';var _=require(_0x80cb('0x0'));var util=require('util');var logger=require(_0x80cb('0x1'))(_0x80cb('0x2'));var moment=require(_0x80cb('0x3'));var BPromise=require(_0x80cb('0x4'));var rp=require(_0x80cb('0x5'));var fs=require('fs');var path=require(_0x80cb('0x6'));var rimraf=require(_0x80cb('0x7'));var config=require(_0x80cb('0x8'));var attributes=require(_0x80cb('0x9'));module['exports']=function(_0x5b7ebb,_0x22cc46){return _0x5b7ebb[_0x80cb('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x80cb('0xb'),'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 9517fc5..e1cb394 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 _0x2218=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x2218,0xd5));var _0x8221=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x2218[_0x4a93bb];return _0x208468;};'use strict';var _=require(_0x8221('0x0'));var util=require(_0x8221('0x1'));var moment=require(_0x8221('0x2'));var BPromise=require('bluebird');var rs=require(_0x8221('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8221('0x4'))['db'];var utils=require(_0x8221('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8221('0x6'));var jayson=require(_0x8221('0x7'));var client=jayson['client'][_0x8221('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8c2f,_0x1e55e9,_0x868b3d){return new BPromise(function(_0x580d88,_0x16f9f8){return client[_0x8221('0x9')](_0x2a8c2f,_0x868b3d)['then'](function(_0x59fe00){logger[_0x8221('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1e55e9,_0x8221('0xb'));logger[_0x8221('0xc')](_0x8221('0xd'),_0x1e55e9,_0x8221('0xb'),JSON[_0x8221('0xe')](_0x59fe00));if(_0x59fe00['error']){if(_0x59fe00[_0x8221('0xf')][_0x8221('0x10')]===0x1f4){logger[_0x8221('0xf')](_0x8221('0x11'),_0x1e55e9,_0x59fe00[_0x8221('0xf')][_0x8221('0x12')]);return _0x16f9f8(_0x59fe00['error'][_0x8221('0x12')]);}logger[_0x8221('0xf')](_0x8221('0x11'),_0x1e55e9,_0x59fe00['error'][_0x8221('0x12')]);return _0x580d88(_0x59fe00[_0x8221('0xf')][_0x8221('0x12')]);}else{logger[_0x8221('0xa')](_0x8221('0x11'),_0x1e55e9,_0x8221('0xb'));_0x580d88(_0x59fe00[_0x8221('0x13')][_0x8221('0x12')]);}})[_0x8221('0x14')](function(_0x27b7bc){logger[_0x8221('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1e55e9,_0x27b7bc);_0x16f9f8(_0x27b7bc);});});}
\ No newline at end of file
+var _0xabe3=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x50fc35,_0x82b3c6){var _0x4e7e3b=function(_0x4853f9){while(--_0x4853f9){_0x50fc35['push'](_0x50fc35['shift']());}};_0x4e7e3b(++_0x82b3c6);}(_0xabe3,0x179));var _0x3abe=function(_0x50e35a,_0x411d04){_0x50e35a=_0x50e35a-0x0;var _0x11f81c=_0xabe3[_0x50e35a];return _0x11f81c;};'use strict';var _=require(_0x3abe('0x0'));var util=require('util');var moment=require(_0x3abe('0x1'));var BPromise=require(_0x3abe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3abe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3abe('0x4'));var logger=require(_0x3abe('0x5'))(_0x3abe('0x6'));var config=require('../../config/environment');var jayson=require(_0x3abe('0x7'));var client=jayson[_0x3abe('0x8')][_0x3abe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5353e7,_0x1fa945,_0x27d115){return new BPromise(function(_0x48d11f,_0x57cd7a){return client[_0x3abe('0xa')](_0x5353e7,_0x27d115)[_0x3abe('0xb')](function(_0x33a5b0){logger[_0x3abe('0xc')](_0x3abe('0xd'),_0x1fa945,_0x3abe('0xe'));logger[_0x3abe('0xf')](_0x3abe('0x10'),_0x1fa945,_0x3abe('0xe'),JSON['stringify'](_0x33a5b0));if(_0x33a5b0['error']){if(_0x33a5b0[_0x3abe('0x11')]['code']===0x1f4){logger['error'](_0x3abe('0xd'),_0x1fa945,_0x33a5b0['error'][_0x3abe('0x12')]);return _0x57cd7a(_0x33a5b0[_0x3abe('0x11')][_0x3abe('0x12')]);}logger['error'](_0x3abe('0xd'),_0x1fa945,_0x33a5b0[_0x3abe('0x11')][_0x3abe('0x12')]);return _0x48d11f(_0x33a5b0['error']['message']);}else{logger[_0x3abe('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1fa945,_0x3abe('0xe'));_0x48d11f(_0x33a5b0[_0x3abe('0x13')][_0x3abe('0x12')]);}})[_0x3abe('0x14')](function(_0x47fa6d){logger[_0x3abe('0x11')](_0x3abe('0xd'),_0x1fa945,_0x47fa6d);_0x57cd7a(_0x47fa6d);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 8caf7b5..81452f5 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 _0xa8e2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','exports','multer','path'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0xa8e2,0x14e));var _0x2a8e=function(_0x149c38,_0x500868){_0x149c38=_0x149c38-0x0;var _0x698e2b=_0xa8e2[_0x149c38];return _0x698e2b;};'use strict';var multer=require(_0x2a8e('0x0'));var util=require('util');var path=require(_0x2a8e('0x1'));var timeout=require(_0x2a8e('0x2'));var express=require(_0x2a8e('0x3'));var router=express[_0x2a8e('0x4')]();var fs_extra=require(_0x2a8e('0x5'));var auth=require(_0x2a8e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a8e('0x7'));var controller=require(_0x2a8e('0x8'));router[_0x2a8e('0x9')]('/',auth[_0x2a8e('0xa')](),controller[_0x2a8e('0xb')]);router[_0x2a8e('0x9')](_0x2a8e('0xc'),auth[_0x2a8e('0xa')](),controller[_0x2a8e('0xd')]);router['get'](_0x2a8e('0xe'),auth['isAuthenticated'](),controller[_0x2a8e('0xf')]);router[_0x2a8e('0x9')](_0x2a8e('0x10'),auth['isAuthenticated'](),controller[_0x2a8e('0x11')]);router['get'](_0x2a8e('0x12'),auth['isAuthenticated'](),controller[_0x2a8e('0x13')]);router[_0x2a8e('0x14')]('/',auth[_0x2a8e('0xa')](),controller[_0x2a8e('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2a8e('0x16')]);router['delete'](_0x2a8e('0xc'),auth[_0x2a8e('0xa')](),controller['destroy']);module[_0x2a8e('0x17')]=router;
\ No newline at end of file
+var _0xd2fd=['create','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','post'];(function(_0x423c1f,_0x4c42ee){var _0x28350f=function(_0x92ea1f){while(--_0x92ea1f){_0x423c1f['push'](_0x423c1f['shift']());}};_0x28350f(++_0x4c42ee);}(_0xd2fd,0x145));var _0xdd2f=function(_0x52b43b,_0x54c708){_0x52b43b=_0x52b43b-0x0;var _0x4e2b86=_0xd2fd[_0x52b43b];return _0x4e2b86;};'use strict';var multer=require(_0xdd2f('0x0'));var util=require('util');var path=require(_0xdd2f('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd2f('0x2'));var router=express[_0xdd2f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdd2f('0x4'));var interaction=require(_0xdd2f('0x5'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xdd2f('0x6')]('/',auth[_0xdd2f('0x7')](),controller[_0xdd2f('0x8')]);router['get'](_0xdd2f('0x9'),auth[_0xdd2f('0x7')](),controller[_0xdd2f('0xa')]);router['get'](_0xdd2f('0xb'),auth[_0xdd2f('0x7')](),controller['preview']);router[_0xdd2f('0x6')](_0xdd2f('0xc'),auth[_0xdd2f('0x7')](),controller['run']);router[_0xdd2f('0x6')](_0xdd2f('0xd'),auth['isAuthenticated'](),controller['query']);router[_0xdd2f('0xe')]('/',auth[_0xdd2f('0x7')](),controller[_0xdd2f('0xf')]);router[_0xdd2f('0x10')](_0xdd2f('0x9'),auth[_0xdd2f('0x7')](),controller[_0xdd2f('0x11')]);router['delete'](_0xdd2f('0x9'),auth['isAuthenticated'](),controller[_0xdd2f('0x12')]);module[_0xdd2f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index be1a58c..ea6f018 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 _0xda74=['exports','STRING','TEXT','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xda74,0x10f));var _0x4da7=function(_0x1b054b,_0x7b351c){_0x1b054b=_0x1b054b-0x0;var _0x12d3fd=_0xda74[_0x1b054b];return _0x12d3fd;};'use strict';var Sequelize=require(_0x4da7('0x0'));module[_0x4da7('0x1')]={'name':{'type':Sequelize[_0x4da7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4da7('0x2')]},'parent':{'type':Sequelize[_0x4da7('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x4da7('0x3')]},'joins':{'type':Sequelize[_0x4da7('0x3')]}};
\ No newline at end of file
+var _0x3541=['sequelize','exports','STRING','TEXT'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x3541,0x148));var _0x1354=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x3541[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x1354('0x0'));module[_0x1354('0x1')]={'name':{'type':Sequelize[_0x1354('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1354('0x2')]},'parent':{'type':Sequelize[_0x1354('0x2')]},'table':{'type':Sequelize[_0x1354('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x1354('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 6db54cb..b664c77 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 _0x3e69=['error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','left_join','right_join','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','order','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','AnalyticMetric','metric','alias','output','web','%s-%s.%s','randomstring','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','COUNT(DISTINCT\x20%s)','IS\x20EMPTY','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource'];(function(_0x30caf2,_0x2a3393){var _0x41be98=function(_0x1abc7f){while(--_0x1abc7f){_0x30caf2['push'](_0x30caf2['shift']());}};_0x41be98(++_0x2a3393);}(_0x3e69,0x127));var _0x93e6=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x3e69[_0x26b80e];return _0x84a8a8;};'use strict';var emlformat=require(_0x93e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93e6('0x1'));var jsonpatch=require(_0x93e6('0x2'));var rp=require(_0x93e6('0x3'));var moment=require(_0x93e6('0x4'));var BPromise=require(_0x93e6('0x5'));var Mustache=require(_0x93e6('0x6'));var util=require(_0x93e6('0x7'));var path=require(_0x93e6('0x8'));var sox=require(_0x93e6('0x9'));var csv=require(_0x93e6('0xa'));var ejs=require(_0x93e6('0xb'));var fs=require('fs');var fs_extra=require(_0x93e6('0xc'));var _=require(_0x93e6('0xd'));var squel=require(_0x93e6('0xe'));var crypto=require(_0x93e6('0xf'));var jsforce=require(_0x93e6('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x93e6('0xa'));var querystring=require(_0x93e6('0x11'));var Papa=require('papaparse');var Redis=require(_0x93e6('0x12'));var authService=require(_0x93e6('0x13'));var qs=require(_0x93e6('0x14'));var as=require(_0x93e6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93e6('0x16'))(_0x93e6('0x17'));var utils=require('../../config/utils');var config=require(_0x93e6('0x18'));var licenseUtil=require(_0x93e6('0x19'));var db=require(_0x93e6('0x1a'))['db'];var dbH=require('../../mysqldb')[_0x93e6('0x1b')];function respondWithStatusCode(_0x28547e,_0x4131d5){_0x4131d5=_0x4131d5||0xcc;return function(_0x307026){if(_0x307026){return _0x28547e[_0x93e6('0x1c')](_0x4131d5);}return _0x28547e[_0x93e6('0x1d')](_0x4131d5)[_0x93e6('0x1e')]();};}function respondWithResult(_0x37bd5c,_0x312713){_0x312713=_0x312713||0xc8;return function(_0x106f67){if(_0x106f67){return _0x37bd5c[_0x93e6('0x1d')](_0x312713)[_0x93e6('0x1f')](_0x106f67);}};}function respondWithFilteredResult(_0xdec86d,_0x170ae1){return function(_0x519a70){if(_0x519a70){var _0x99da14=_0x519a70[_0x93e6('0x20')],_0x1d4dac=_0x170ae1[_0x93e6('0x21')],_0x17cf34=_0x170ae1[_0x93e6('0x21')]+_0x170ae1[_0x93e6('0x22')],_0x4db659;if(_0x17cf34>=_0x99da14){_0x17cf34=_0x99da14;_0x4db659=0xc8;}else{_0x4db659=0xce;}_0xdec86d['status'](_0x4db659);return _0xdec86d[_0x93e6('0x23')](_0x93e6('0x24'),_0x1d4dac+'-'+_0x17cf34+'/'+_0x99da14)['json'](_0x519a70);}return null;};}function patchUpdates(_0x5444ff){return function(_0x15524c){try{jsonpatch[_0x93e6('0x25')](_0x15524c,_0x5444ff,!![]);}catch(_0xf41ade){return BPromise[_0x93e6('0x26')](_0xf41ade);}return _0x15524c['save']();};}function saveUpdates(_0x137e5a,_0x26556b){return function(_0x507390){if(_0x507390){return _0x507390[_0x93e6('0x27')](_0x137e5a)[_0x93e6('0x28')](function(_0x4e8c2a){return _0x4e8c2a;});}return null;};}function removeEntity(_0x498175,_0x3e8311){return function(_0x39648f){if(_0x39648f){return _0x39648f[_0x93e6('0x29')]()['then'](function(){var _0x37cfe1=_0x39648f['get']({'plain':!![]});var _0x1ebc21='DefaultReports';return db[_0x93e6('0x2a')][_0x93e6('0x29')]({'where':{'type':_0x1ebc21,'resourceId':_0x37cfe1['id']}})[_0x93e6('0x28')](function(){return _0x39648f;});})[_0x93e6('0x28')](function(){_0x498175[_0x93e6('0x1d')](0xcc)[_0x93e6('0x1e')]();});}};}function handleEntityNotFound(_0x26b9ef,_0x3032b9){return function(_0x4d0618){if(!_0x4d0618){_0x26b9ef[_0x93e6('0x1c')](0x194);}return _0x4d0618;};}function handleError(_0x478f72,_0x4b3278){_0x4b3278=_0x4b3278||0x1f4;return function(_0x2fa744){logger[_0x93e6('0x2b')](_0x2fa744[_0x93e6('0x2c')]);if(_0x2fa744[_0x93e6('0x2d')]){delete _0x2fa744[_0x93e6('0x2d')];}_0x478f72[_0x93e6('0x1d')](_0x4b3278)[_0x93e6('0x2e')](_0x2fa744);};}exports[_0x93e6('0x2f')]=function(_0x135bc5,_0x7deeca){var _0x44fa26={},_0x148a0c={},_0x4af489={'count':0x0,'rows':[]};var _0x2a0f7a=_[_0x93e6('0x30')](db[_0x93e6('0x31')][_0x93e6('0x32')],function(_0x445c74){return{'name':_0x445c74[_0x93e6('0x33')],'type':_0x445c74[_0x93e6('0x34')][_0x93e6('0x35')]};});_0x148a0c['model']=_[_0x93e6('0x30')](_0x2a0f7a,_0x93e6('0x2d'));_0x148a0c[_0x93e6('0x36')]=_[_0x93e6('0x37')](_0x135bc5[_0x93e6('0x36')]);_0x148a0c['filters']=_['intersection'](_0x148a0c[_0x93e6('0x38')],_0x148a0c['query']);_0x44fa26['attributes']=_[_0x93e6('0x39')](_0x148a0c[_0x93e6('0x38')],qs[_0x93e6('0x3a')](_0x135bc5[_0x93e6('0x36')]['fields']));_0x44fa26[_0x93e6('0x3b')]=_0x44fa26[_0x93e6('0x3b')][_0x93e6('0x3c')]?_0x44fa26['attributes']:_0x148a0c[_0x93e6('0x38')];if(!_0x135bc5[_0x93e6('0x36')][_0x93e6('0x3d')](_0x93e6('0x3e'))){_0x44fa26[_0x93e6('0x22')]=qs[_0x93e6('0x22')](_0x135bc5['query'][_0x93e6('0x22')]);_0x44fa26[_0x93e6('0x21')]=qs[_0x93e6('0x21')](_0x135bc5[_0x93e6('0x36')]['offset']);}_0x44fa26['order']=qs[_0x93e6('0x3f')](_0x135bc5[_0x93e6('0x36')]['sort']);_0x44fa26[_0x93e6('0x40')]=qs[_0x93e6('0x41')](_[_0x93e6('0x42')](_0x135bc5[_0x93e6('0x36')],_0x148a0c['filters']),_0x2a0f7a);if(_0x135bc5[_0x93e6('0x36')][_0x93e6('0x43')]){_0x44fa26[_0x93e6('0x40')]=_[_0x93e6('0x44')](_0x44fa26[_0x93e6('0x40')],{'$or':_['map'](_0x2a0f7a,function(_0x17ca19){if(_0x17ca19['type']!==_0x93e6('0x45')){var _0x384d1a={};_0x384d1a[_0x17ca19[_0x93e6('0x2d')]]={'$like':'%'+_0x135bc5[_0x93e6('0x36')][_0x93e6('0x43')]+'%'};return _0x384d1a;}})});}_0x44fa26=_['merge']({},_0x44fa26,_0x135bc5[_0x93e6('0x46')]);var _0xb908b0={'where':_0x44fa26['where']};return db[_0x93e6('0x31')][_0x93e6('0x20')](_0xb908b0)[_0x93e6('0x28')](function(_0x376c21){_0x4af489[_0x93e6('0x20')]=_0x376c21;if(_0x135bc5[_0x93e6('0x36')][_0x93e6('0x47')]){_0x44fa26['include']=[{'all':!![]}];}return db[_0x93e6('0x31')][_0x93e6('0x48')](_0x44fa26);})[_0x93e6('0x28')](function(_0x4c88f7){_0x4af489['rows']=_0x4c88f7;return _0x4af489;})[_0x93e6('0x28')](respondWithFilteredResult(_0x7deeca,_0x44fa26))['catch'](handleError(_0x7deeca,null));};exports[_0x93e6('0x49')]=function(_0x11422a,_0x3f90f2){var _0x3047ba={'raw':!![],'where':{'id':_0x11422a[_0x93e6('0x4a')]['id']}},_0x3d121b={};_0x3d121b['model']=_[_0x93e6('0x37')](db[_0x93e6('0x31')][_0x93e6('0x32')]);_0x3d121b['query']=_[_0x93e6('0x37')](_0x11422a[_0x93e6('0x36')]);_0x3d121b[_0x93e6('0x41')]=_[_0x93e6('0x39')](_0x3d121b[_0x93e6('0x38')],_0x3d121b[_0x93e6('0x36')]);_0x3047ba['attributes']=_[_0x93e6('0x39')](_0x3d121b['model'],qs[_0x93e6('0x3a')](_0x11422a['query'][_0x93e6('0x3a')]));_0x3047ba[_0x93e6('0x3b')]=_0x3047ba[_0x93e6('0x3b')][_0x93e6('0x3c')]?_0x3047ba[_0x93e6('0x3b')]:_0x3d121b[_0x93e6('0x38')];if(_0x11422a[_0x93e6('0x36')]['includeAll']){_0x3047ba[_0x93e6('0x4b')]=[{'all':!![]}];}_0x3047ba=_[_0x93e6('0x44')]({},_0x3047ba,_0x11422a[_0x93e6('0x46')]);return db[_0x93e6('0x31')]['find'](_0x3047ba)[_0x93e6('0x28')](handleEntityNotFound(_0x3f90f2,null))[_0x93e6('0x28')](respondWithResult(_0x3f90f2,null))['catch'](handleError(_0x3f90f2,null));};exports[_0x93e6('0x4c')]=function(_0x61416b,_0x536060){return db[_0x93e6('0x31')][_0x93e6('0x4c')](_0x61416b[_0x93e6('0x4d')],{})['then'](function(_0x59e716){var _0x2fbc9a=_0x61416b['user']['get']({'plain':!![]});if(!_0x2fbc9a)throw new Error(_0x93e6('0x4e'));if(_0x2fbc9a[_0x93e6('0x4f')]==='user'){var _0x446ec8=_0x59e716[_0x93e6('0x50')]({'plain':!![]});var _0x1eb90a=_0x93e6('0x51');return db[_0x93e6('0x52')][_0x93e6('0x53')]({'where':{'name':_0x1eb90a,'userProfileId':_0x2fbc9a[_0x93e6('0x54')]},'raw':!![]})[_0x93e6('0x28')](function(_0x5a633a){if(_0x5a633a&&_0x5a633a['autoAssociation']===0x0){return db[_0x93e6('0x2a')][_0x93e6('0x4c')]({'name':_0x446ec8[_0x93e6('0x2d')],'resourceId':_0x446ec8['id'],'type':'DefaultReports','sectionId':_0x5a633a['id']},{})[_0x93e6('0x28')](function(){return _0x59e716;});}else{return _0x59e716;}})['catch'](function(_0x5547da){logger['error'](_0x93e6('0x55'),_0x5547da);throw _0x5547da;});}return _0x59e716;})[_0x93e6('0x28')](respondWithResult(_0x536060,0xc9))[_0x93e6('0x56')](handleError(_0x536060,null));};exports[_0x93e6('0x27')]=function(_0x5b9ee0,_0x55ecda){if(_0x5b9ee0[_0x93e6('0x4d')]['id']){delete _0x5b9ee0[_0x93e6('0x4d')]['id'];}return db['AnalyticDefaultReport'][_0x93e6('0x53')]({'where':{'id':_0x5b9ee0[_0x93e6('0x4a')]['id']}})[_0x93e6('0x28')](handleEntityNotFound(_0x55ecda,null))[_0x93e6('0x28')](saveUpdates(_0x5b9ee0[_0x93e6('0x4d')],null))[_0x93e6('0x28')](respondWithResult(_0x55ecda,null))[_0x93e6('0x56')](handleError(_0x55ecda,null));};exports[_0x93e6('0x29')]=function(_0x58ac5f,_0x17dcc7){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ac5f[_0x93e6('0x4a')]['id']}})[_0x93e6('0x28')](handleEntityNotFound(_0x17dcc7,null))[_0x93e6('0x28')](removeEntity(_0x17dcc7,null))['catch'](handleError(_0x17dcc7,null));};exports['preview']=function(_0x365a17,_0x2c0ab6){var _0x3d4802=0xa;var _0x12b252=['join',_0x93e6('0x57'),_0x93e6('0x58'),'cross_join'];var _0x459ad1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x93e6('0x59'),'MIN':_0x93e6('0x5a'),'AVG':_0x93e6('0x5b'),'GROUP_CONCAT':_0x93e6('0x5c'),'GROUP_CONCAT ASC':_0x93e6('0x5d'),'GROUP_CONCAT DESC':_0x93e6('0x5e')};var _0x1101e3={'SEC_TO_TIME':_0x93e6('0x5f'),'DATE':_0x93e6('0x60'),'HOUR':_0x93e6('0x61'),'ROUND':_0x93e6('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2bee2d=function(_0x28d42e){return!_[_0x93e6('0x63')]([_0x93e6('0x64'),_0x93e6('0x65'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x28d42e);};var _0xbc21d2=function(_0x497730){if(!_0x497730||!_0x497730[_0x93e6('0x66')][_0x93e6('0x3c')]){return'';}for(var _0x25b67c='(',_0x47f6c7=0x0;_0x47f6c7<_0x497730[_0x93e6('0x66')]['length'];_0x47f6c7+=0x1){_0x47f6c7>0x0&&(_0x25b67c+='\x20'+_0x497730[_0x93e6('0x67')]+'\x20');_0x25b67c+=_0x497730[_0x93e6('0x66')][_0x47f6c7][_0x93e6('0x68')]?_0xbc21d2(_0x497730[_0x93e6('0x66')][_0x47f6c7]['group']):_0x497730[_0x93e6('0x66')][_0x47f6c7][_0x93e6('0x69')]+'\x20'+_0x497730[_0x93e6('0x66')][_0x47f6c7][_0x93e6('0x6a')]+(_0x2bee2d(_0x497730[_0x93e6('0x66')][_0x47f6c7][_0x93e6('0x6a')])?'\x20'+_0x497730['rules'][_0x47f6c7][_0x93e6('0x6b')]:'');}return _0x25b67c+')';};var _0x2cb581={'where':{'id':_0x365a17[_0x93e6('0x4a')]['id']}},_0x2e547b,_0x299d5c,_0x19ee80,_0x2cbe47,_0x160782;_0x2cb581=_[_0x93e6('0x44')]({},_0x2cb581,_0x365a17[_0x93e6('0x46')]);return db[_0x93e6('0x31')]['find'](_0x2cb581)[_0x93e6('0x28')](function(_0x1f9609){if(_0x1f9609){_0x2e547b=_0x1f9609;return _0x1f9609[_0x93e6('0x6c')]();}return null;})['then'](function(_0xd59d2c){if(_0xd59d2c){if(!_0xd59d2c[_0x93e6('0x3c')]){throw new db[(_0x93e6('0x6d'))][(_0x93e6('0x6e'))](_0x93e6('0x6f'),0x193);}_0x299d5c=_0xd59d2c;return db['AnalyticMetric'][_0x93e6('0x48')]({'raw':!![]});}return null;})[_0x93e6('0x28')](function(_0x3fd632){if(_0x3fd632){_0x19ee80=_[_0x93e6('0x70')](_0x3fd632,'id');var _0x5235c0;var _0x3bd064=squel[_0x93e6('0x71')]();_0x3bd064[_0x93e6('0x72')](_0x2e547b[_0x93e6('0x73')]);for(var _0xa8b018=0x0;_0xa8b018<_0x299d5c[_0x93e6('0x3c')];_0xa8b018+=0x1){_0x5235c0=_0x299d5c[_0xa8b018][_0x93e6('0x74')]?_0x19ee80[_0x299d5c[_0xa8b018][_0x93e6('0x74')]]['metric']:_0x299d5c[_0xa8b018][_0x93e6('0x69')];_0x5235c0=_0x299d5c[_0xa8b018][_0x93e6('0x75')]?_[_0x93e6('0x76')](_0x459ad1[_0x299d5c[_0xa8b018][_0x93e6('0x75')]],'%s',_0x5235c0):_0x5235c0;_0x5235c0=_0x299d5c[_0xa8b018][_0x93e6('0x77')]?_[_0x93e6('0x76')](_0x1101e3[_0x299d5c[_0xa8b018][_0x93e6('0x77')]],'%s',_0x5235c0):_0x5235c0;if(_0x299d5c[_0xa8b018][_0x93e6('0x78')]){_0x3bd064[_0x93e6('0x68')](_0x5235c0);}_0x299d5c[_0xa8b018][_0x93e6('0x79')]&&_0x3bd064[_0x93e6('0x7a')](_0x5235c0,_0x299d5c[_0xa8b018][_0x93e6('0x79')]===_0x93e6('0x7b')?![]:!![]);_0x3bd064[_0x93e6('0x69')](_0x5235c0,_0x299d5c[_0xa8b018]['alias']||_0x5235c0);}if(_0x2e547b[_0x93e6('0x7c')]){_0x2e547b[_0x93e6('0x7c')]=JSON['parse'](_0x2e547b[_0x93e6('0x7c')]);for(var _0x1c6546=0x0;_0x1c6546<_0x2e547b[_0x93e6('0x7c')][_0x93e6('0x3c')];_0x1c6546+=0x1){if(_0x2e547b['joins'][_0x1c6546]['type']&&_['includes'](_0x12b252,_0x2e547b[_0x93e6('0x7c')][_0x1c6546][_0x93e6('0x34')])&&_0x2e547b[_0x93e6('0x7c')][_0x1c6546][_0x93e6('0x7d')]&&_0x2e547b[_0x93e6('0x7c')][_0x1c6546][_0x93e6('0x7e')]&&_0x2e547b['joins'][_0x1c6546][_0x93e6('0x7f')]){_0x3bd064[_0x2e547b[_0x93e6('0x7c')][_0x1c6546][_0x93e6('0x34')]](_0x2e547b['joins'][_0x1c6546]['foreignTable'],null,util['format'](_0x93e6('0x80'),_0x2e547b['table'],_0x2e547b['joins'][_0x1c6546][_0x93e6('0x7d')],_0x2e547b[_0x93e6('0x7c')][_0x1c6546]['foreignTable'],_0x2e547b['joins'][_0x1c6546][_0x93e6('0x7f')]));}}}if(_0x2e547b[_0x93e6('0x81')]){_0x2e547b[_0x93e6('0x81')]=JSON[_0x93e6('0x82')](_0x2e547b[_0x93e6('0x81')]);_0x3bd064[_0x93e6('0x40')](_0xbc21d2(_0x2e547b[_0x93e6('0x81')]['group']));}_0x160782=_0x3bd064[_0x93e6('0x83')]();_0x3bd064[_0x93e6('0x22')](_0x3d4802);_0x3bd064[_0x93e6('0x21')](0x0);logger['debug'](_0x93e6('0x84'),_0x3bd064[_0x93e6('0x85')]());return dbH['sequelize']['query'](_0x3bd064[_0x93e6('0x85')](),{'type':dbH[_0x93e6('0x86')][_0x93e6('0x87')][_0x93e6('0x88')]});}})[_0x93e6('0x28')](respondWithResult(_0x2c0ab6,null))[_0x93e6('0x56')](handleError(_0x2c0ab6,null));};function runReport(_0x3cdf9f,_0x4f6048,_0x5741a3){var _0x4e9e92=_0x4f6048[_0x93e6('0x2d')];var _0x1cf807=0xa;var _0x1de0c9=[_0x93e6('0x89'),'left_join',_0x93e6('0x58'),'cross_join'];var _0x4eded6={'SUM':_0x93e6('0x8a'),'COUNT':_0x93e6('0x8b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x93e6('0x59'),'MIN':_0x93e6('0x5a'),'AVG':_0x93e6('0x5b'),'GROUP_CONCAT':_0x93e6('0x5c'),'GROUP_CONCAT ASC':_0x93e6('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x529642={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x93e6('0x61'),'ROUND':_0x93e6('0x62'),'UNIX_TIMESTAMP':_0x93e6('0x8c')};var _0x4e220c=function(_0xb5f88e){return!_[_0x93e6('0x63')]([_0x93e6('0x64'),_0x93e6('0x65'),'IS\x20EMPTY',_0x93e6('0x8d')],_0xb5f88e);};var _0x439c93=function(_0x36ed2c){if(!_0x36ed2c||!_0x36ed2c[_0x93e6('0x66')][_0x93e6('0x3c')]){return'';}for(var _0x4fa751='(',_0x47bd0c=0x0;_0x47bd0c<_0x36ed2c[_0x93e6('0x66')]['length'];_0x47bd0c+=0x1){_0x47bd0c>0x0&&(_0x4fa751+='\x20'+_0x36ed2c[_0x93e6('0x67')]+'\x20');_0x4fa751+=_0x36ed2c['rules'][_0x47bd0c]['group']?_0x439c93(_0x36ed2c[_0x93e6('0x66')][_0x47bd0c][_0x93e6('0x68')]):_0x36ed2c[_0x93e6('0x66')][_0x47bd0c][_0x93e6('0x69')]+'\x20'+_0x36ed2c[_0x93e6('0x66')][_0x47bd0c][_0x93e6('0x6a')]+(_0x4e220c(_0x36ed2c[_0x93e6('0x66')][_0x47bd0c]['condition'])?'\x20'+_0x36ed2c[_0x93e6('0x66')][_0x47bd0c]['value']:'');}return _0x4fa751+')';};var _0x27a61e={'where':{'id':_0x3cdf9f['id']}},_0xcdbf83,_0x21c957,_0x19cf63,_0x107b35,_0x3a0aba;_0x27a61e=_[_0x93e6('0x44')]({},_0x27a61e,_0x5741a3);return db['AnalyticDefaultReport'][_0x93e6('0x53')](_0x27a61e)[_0x93e6('0x28')](function(_0x59f931){if(_0x59f931){_0xcdbf83=_0x59f931;return _0x59f931['getFields']();}return null;})[_0x93e6('0x28')](function(_0x94393e){if(_0x94393e){if(!_0x94393e[_0x93e6('0x3c')]){throw new db[(_0x93e6('0x6d'))][(_0x93e6('0x6e'))](_0x93e6('0x6f'),0x193);}_0x21c957=_0x94393e;return db[_0x93e6('0x8e')][_0x93e6('0x48')]({'raw':!![]});}return null;})['then'](function(_0x258fc0){if(_0x258fc0){_0x19cf63=_[_0x93e6('0x70')](_0x258fc0,'id');var _0x45c7a3;var _0x41ec13=squel[_0x93e6('0x71')]();_0x41ec13[_0x93e6('0x72')](_0xcdbf83[_0x93e6('0x73')]);for(var _0x75fb1d=0x0;_0x75fb1d<_0x21c957[_0x93e6('0x3c')];_0x75fb1d+=0x1){_0x45c7a3=_0x21c957[_0x75fb1d]['MetricId']?_0x19cf63[_0x21c957[_0x75fb1d][_0x93e6('0x74')]][_0x93e6('0x8f')]:_0x21c957[_0x75fb1d][_0x93e6('0x69')];_0x45c7a3=_0x21c957[_0x75fb1d][_0x93e6('0x75')]?_[_0x93e6('0x76')](_0x4eded6[_0x21c957[_0x75fb1d]['function']],'%s',_0x45c7a3):_0x45c7a3;_0x45c7a3=_0x21c957[_0x75fb1d][_0x93e6('0x77')]?_[_0x93e6('0x76')](_0x529642[_0x21c957[_0x75fb1d][_0x93e6('0x77')]],'%s',_0x45c7a3):_0x45c7a3;if(_0x21c957[_0x75fb1d][_0x93e6('0x78')]){_0x41ec13[_0x93e6('0x68')](_0x45c7a3);}_0x21c957[_0x75fb1d][_0x93e6('0x79')]&&_0x41ec13[_0x93e6('0x7a')](_0x45c7a3,_0x21c957[_0x75fb1d]['orderBy']===_0x93e6('0x7b')?![]:!![]);_0x41ec13[_0x93e6('0x69')](_0x45c7a3,_0x21c957[_0x75fb1d][_0x93e6('0x90')]||_0x45c7a3);}if(_0xcdbf83[_0x93e6('0x7c')]){_0xcdbf83[_0x93e6('0x7c')]=JSON[_0x93e6('0x82')](_0xcdbf83[_0x93e6('0x7c')]);for(var _0x3b1ba3=0x0;_0x3b1ba3<_0xcdbf83[_0x93e6('0x7c')][_0x93e6('0x3c')];_0x3b1ba3+=0x1){if(_0xcdbf83[_0x93e6('0x7c')][_0x3b1ba3][_0x93e6('0x34')]&&_['includes'](_0x1de0c9,_0xcdbf83[_0x93e6('0x7c')][_0x3b1ba3][_0x93e6('0x34')])&&_0xcdbf83['joins'][_0x3b1ba3][_0x93e6('0x7d')]&&_0xcdbf83['joins'][_0x3b1ba3]['foreignTable']&&_0xcdbf83['joins'][_0x3b1ba3][_0x93e6('0x7f')]){_0x41ec13[_0xcdbf83['joins'][_0x3b1ba3]['type']](_0xcdbf83['joins'][_0x3b1ba3][_0x93e6('0x7e')],null,util[_0x93e6('0x77')]('%s.%s\x20=\x20%s.%s',_0xcdbf83['table'],_0xcdbf83[_0x93e6('0x7c')][_0x3b1ba3]['parentKey'],_0xcdbf83[_0x93e6('0x7c')][_0x3b1ba3][_0x93e6('0x7e')],_0xcdbf83[_0x93e6('0x7c')][_0x3b1ba3][_0x93e6('0x7f')]));}}}if(_0xcdbf83[_0x93e6('0x81')]){_0xcdbf83[_0x93e6('0x81')]=JSON[_0x93e6('0x82')](_0xcdbf83[_0x93e6('0x81')]);_0x41ec13[_0x93e6('0x40')](_0x439c93(_0xcdbf83[_0x93e6('0x81')][_0x93e6('0x68')]));}_0x3a0aba=_0x41ec13[_0x93e6('0x83')]();_0x41ec13[_0x93e6('0x22')](_0x1cf807);_0x41ec13[_0x93e6('0x21')](0x0);return;}})[_0x93e6('0x28')](function(){if(_0x4f6048[_0x93e6('0x91')]===_0x93e6('0x92')){return null;}var _0x509332=_['merge'](_0x4f6048,{'name':_0x4f6048['fullPath']||_0x4f6048[_0x93e6('0x2d')]||_0xcdbf83[_0x93e6('0x2d')],'basename':_0x4e9e92,'savename':util[_0x93e6('0x77')](_0x93e6('0x93'),_0x4f6048[_0x93e6('0x2d')]||_0xcdbf83['name'],require(_0x93e6('0x94'))['generate'](0x4),_0x4f6048[_0x93e6('0x91')]||'csv'),'reportId':_0xcdbf83['id'],'reportType':_0x93e6('0x95')});return db[_0x93e6('0x96')][_0x93e6('0x4c')](_0x509332,{'raw':!![]});})['then'](function(_0x38b8a0){if(_0xcdbf83[_0x93e6('0x73')]===_0x93e6('0x97')){_0x3a0aba[_0x93e6('0x40')](_0xcdbf83[_0x93e6('0x73')]+_0x93e6('0x98'),_0x4f6048['startDate'],_0x4f6048[_0x93e6('0x99')]);}else{_0x3a0aba[_0x93e6('0x40')](_0xcdbf83[_0x93e6('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f6048[_0x93e6('0x9a')],_0x4f6048[_0x93e6('0x99')]);}if(_0x38b8a0){logger[_0x93e6('0x9b')](_0x93e6('0x9c'),_0x3a0aba['toString']());require(_0x93e6('0x9d'))[_0x93e6('0x9e')](path[_0x93e6('0x89')](__dirname,_0x93e6('0x9f'),_0x38b8a0[_0x93e6('0x91')]),[_0x38b8a0['id'],_0x3a0aba[_0x93e6('0x85')](),path[_0x93e6('0x89')](__dirname,_0x93e6('0xa0'),_0x38b8a0[_0x93e6('0xa1')]),_0x4e9e92]);return _0x38b8a0;}else{var _0xfe05b3=squel[_0x93e6('0x71')]();_0xfe05b3[_0x93e6('0x72')]('('+_0x3a0aba['toString']()+')',_0x93e6('0xa2'));_0xfe05b3['field'](_0x93e6('0xa3'),'count');_0x3a0aba[_0x93e6('0x22')](_0x4f6048['limit']||_0x1cf807);_0x3a0aba[_0x93e6('0x21')](_0x4f6048[_0x93e6('0x21')]||0x0);return dbH[_0x93e6('0x86')][_0x93e6('0x36')](_0xfe05b3[_0x93e6('0x85')](),{'type':dbH['sequelize'][_0x93e6('0x87')][_0x93e6('0x88')]})[_0x93e6('0x28')](function(_0x27f1c9){if(!_0x27f1c9['length']){_0x107b35=0x0;}else{_0x107b35=_0x27f1c9[0x0][_0x93e6('0x20')]||0x0;}return dbH[_0x93e6('0x86')][_0x93e6('0x36')](_0x3a0aba[_0x93e6('0x85')](),{'type':dbH['sequelize'][_0x93e6('0x87')][_0x93e6('0x88')]});})[_0x93e6('0x28')](function(_0x384160){return{'rows':_0x384160||[],'count':_0x107b35};});}});}exports[_0x93e6('0xa4')]=function(_0x3d9fc9,_0x15d4d4){return runReport(_0x3d9fc9[_0x93e6('0x4a')],_0x3d9fc9['query'],_0x3d9fc9[_0x93e6('0x46')])[_0x93e6('0x28')](respondWithResult(_0x15d4d4,null))[_0x93e6('0x56')](handleError(_0x15d4d4,null));};exports[_0x93e6('0xa5')]=runReport;exports[_0x93e6('0x36')]=function(_0xa2c319,_0x387a9d){var _0x10c026=0xa;var _0x5dfb83=[_0x93e6('0x89'),_0x93e6('0x57'),_0x93e6('0x58'),'cross_join'];var _0x210213={'SUM':_0x93e6('0x8a'),'COUNT':_0x93e6('0x8b'),'COUNT DISTINCT':_0x93e6('0xa6'),'MAX':_0x93e6('0x59'),'MIN':_0x93e6('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x93e6('0x5d'),'GROUP_CONCAT DESC':_0x93e6('0x5e')};var _0x1b5f66={'SEC_TO_TIME':_0x93e6('0x5f'),'DATE':_0x93e6('0x60'),'HOUR':_0x93e6('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x93e6('0x8c')};var _0x5c96b8=function(_0x11665c){return!_['includes']([_0x93e6('0x64'),_0x93e6('0x65'),_0x93e6('0xa7'),_0x93e6('0x8d')],_0x11665c);};var _0x2997e8=function(_0x220734){if(!_0x220734||!_0x220734['rules']['length']){return'';}for(var _0x4e0e46='(',_0x3e2574=0x0;_0x3e2574<_0x220734[_0x93e6('0x66')][_0x93e6('0x3c')];_0x3e2574+=0x1){_0x3e2574>0x0&&(_0x4e0e46+='\x20'+_0x220734[_0x93e6('0x67')]+'\x20');_0x4e0e46+=_0x220734['rules'][_0x3e2574][_0x93e6('0x68')]?_0x2997e8(_0x220734['rules'][_0x3e2574][_0x93e6('0x68')]):_0x220734[_0x93e6('0x66')][_0x3e2574][_0x93e6('0x69')]+'\x20'+_0x220734[_0x93e6('0x66')][_0x3e2574][_0x93e6('0x6a')]+(_0x5c96b8(_0x220734[_0x93e6('0x66')][_0x3e2574][_0x93e6('0x6a')])?'\x20'+_0x220734[_0x93e6('0x66')][_0x3e2574][_0x93e6('0x6b')]:'');}return _0x4e0e46+')';};var _0x3f4aee={'where':{'id':_0xa2c319['params']['id']}},_0x2bd635,_0x15cf9e,_0x1e8265,_0x1d4f72,_0x231d29;_0x3f4aee=_[_0x93e6('0x44')]({},_0x3f4aee,_0xa2c319['options']);return db[_0x93e6('0x31')]['find'](_0x3f4aee)[_0x93e6('0x28')](function(_0x357216){if(_0x357216){_0x2bd635=_0x357216;return _0x357216[_0x93e6('0x6c')]();}return null;})[_0x93e6('0x28')](function(_0x87b04f){if(_0x87b04f){if(!_0x87b04f[_0x93e6('0x3c')]){throw new db[(_0x93e6('0x6d'))][(_0x93e6('0x6e'))](_0x93e6('0x6f'),0x193);}_0x15cf9e=_0x87b04f;return db[_0x93e6('0x8e')]['findAll']({'raw':!![]});}return null;})[_0x93e6('0x28')](function(_0x21a926){if(_0x21a926){_0x1e8265=_[_0x93e6('0x70')](_0x21a926,'id');var _0x559545;var _0x16ba37=squel[_0x93e6('0x71')]();_0x16ba37[_0x93e6('0x72')](_0x2bd635[_0x93e6('0x73')]);for(var _0x5035a5=0x0;_0x5035a5<_0x15cf9e['length'];_0x5035a5+=0x1){_0x559545=_0x15cf9e[_0x5035a5][_0x93e6('0x74')]?_0x1e8265[_0x15cf9e[_0x5035a5][_0x93e6('0x74')]][_0x93e6('0x8f')]:_0x15cf9e[_0x5035a5][_0x93e6('0x69')];_0x559545=_0x15cf9e[_0x5035a5][_0x93e6('0x75')]?_['replace'](_0x210213[_0x15cf9e[_0x5035a5][_0x93e6('0x75')]],'%s',_0x559545):_0x559545;_0x559545=_0x15cf9e[_0x5035a5][_0x93e6('0x77')]?_[_0x93e6('0x76')](_0x1b5f66[_0x15cf9e[_0x5035a5]['format']],'%s',_0x559545):_0x559545;if(_0x15cf9e[_0x5035a5][_0x93e6('0x78')]){_0x16ba37[_0x93e6('0x68')](_0x559545);}_0x15cf9e[_0x5035a5]['orderBy']&&_0x16ba37[_0x93e6('0x7a')](_0x559545,_0x15cf9e[_0x5035a5][_0x93e6('0x79')]===_0x93e6('0x7b')?![]:!![]);_0x16ba37[_0x93e6('0x69')](_0x559545,_0x15cf9e[_0x5035a5][_0x93e6('0x90')]||_0x559545);}if(_0x2bd635[_0x93e6('0x7c')]){_0x2bd635[_0x93e6('0x7c')]=JSON['parse'](_0x2bd635[_0x93e6('0x7c')]);for(var _0x2cda3b=0x0;_0x2cda3b<_0x2bd635[_0x93e6('0x7c')]['length'];_0x2cda3b+=0x1){if(_0x2bd635[_0x93e6('0x7c')][_0x2cda3b][_0x93e6('0x34')]&&_[_0x93e6('0x63')](_0x5dfb83,_0x2bd635['joins'][_0x2cda3b][_0x93e6('0x34')])&&_0x2bd635[_0x93e6('0x7c')][_0x2cda3b]['parentKey']&&_0x2bd635[_0x93e6('0x7c')][_0x2cda3b]['foreignTable']&&_0x2bd635['joins'][_0x2cda3b][_0x93e6('0x7f')]){_0x16ba37[_0x2bd635['joins'][_0x2cda3b][_0x93e6('0x34')]](_0x2bd635[_0x93e6('0x7c')][_0x2cda3b][_0x93e6('0x7e')],null,util[_0x93e6('0x77')]('%s.%s\x20=\x20%s.%s',_0x2bd635[_0x93e6('0x73')],_0x2bd635[_0x93e6('0x7c')][_0x2cda3b][_0x93e6('0x7d')],_0x2bd635['joins'][_0x2cda3b][_0x93e6('0x7e')],_0x2bd635['joins'][_0x2cda3b][_0x93e6('0x7f')]));}}}if(_0x2bd635['conditions']){_0x2bd635['conditions']=JSON[_0x93e6('0x82')](_0x2bd635[_0x93e6('0x81')]);_0x16ba37[_0x93e6('0x40')](_0x2997e8(_0x2bd635['conditions'][_0x93e6('0x68')]));}_0x231d29=_0x16ba37[_0x93e6('0x83')]();_0x16ba37['limit'](_0x10c026);_0x16ba37['offset'](0x0);logger[_0x93e6('0xa8')](_0x93e6('0x84'),_0x16ba37[_0x93e6('0x85')]());return dbH['sequelize']['query'](_0x16ba37[_0x93e6('0x85')](),{'type':dbH[_0x93e6('0x86')]['QueryTypes'][_0x93e6('0x88')]});}})[_0x93e6('0x28')](function(){return{'sql':_0x231d29['toString']()};})[_0x93e6('0x28')](respondWithResult(_0x387a9d,null))[_0x93e6('0x56')](handleError(_0x387a9d,null));};
\ No newline at end of file
+var _0x71b0=['destroy','get','UserProfileResource','error','stack','name','send','AnalyticDefaultReport','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','user','role','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','MetricId','function','replace','groupBy','orderBy','DESC','alias','joins','parse','includes','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','IS\x20NOT\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','from','format','foreignKey','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','right_join','UNIX_TIMESTAMP(%s)','metric','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','then'];(function(_0x55d4cc,_0x32ba7c){var _0x2ed472=function(_0x2ffdac){while(--_0x2ffdac){_0x55d4cc['push'](_0x55d4cc['shift']());}};_0x2ed472(++_0x32ba7c);}(_0x71b0,0x1c2));var _0x071b=function(_0x515de7,_0x3338af){_0x515de7=_0x515de7-0x0;var _0x47ff49=_0x71b0[_0x515de7];return _0x47ff49;};'use strict';var emlformat=require(_0x071b('0x0'));var rimraf=require(_0x071b('0x1'));var zipdir=require(_0x071b('0x2'));var jsonpatch=require(_0x071b('0x3'));var rp=require('request-promise');var moment=require(_0x071b('0x4'));var BPromise=require(_0x071b('0x5'));var Mustache=require(_0x071b('0x6'));var util=require(_0x071b('0x7'));var path=require('path');var sox=require(_0x071b('0x8'));var csv=require('to-csv');var ejs=require(_0x071b('0x9'));var fs=require('fs');var fs_extra=require(_0x071b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x071b('0xb'));var jsforce=require(_0x071b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x071b('0xd'));var Papa=require('papaparse');var Redis=require(_0x071b('0xe'));var authService=require(_0x071b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x071b('0x10'));var hardwareService=require(_0x071b('0x11'));var logger=require('../../config/logger')(_0x071b('0x12'));var utils=require(_0x071b('0x13'));var config=require(_0x071b('0x14'));var licenseUtil=require(_0x071b('0x15'));var db=require(_0x071b('0x16'))['db'];var dbH=require('../../mysqldb')[_0x071b('0x17')];function respondWithStatusCode(_0x29dfec,_0x5e303f){_0x5e303f=_0x5e303f||0xcc;return function(_0x3951d4){if(_0x3951d4){return _0x29dfec[_0x071b('0x18')](_0x5e303f);}return _0x29dfec[_0x071b('0x19')](_0x5e303f)[_0x071b('0x1a')]();};}function respondWithResult(_0x593cc5,_0x416eea){_0x416eea=_0x416eea||0xc8;return function(_0x4ff057){if(_0x4ff057){return _0x593cc5[_0x071b('0x19')](_0x416eea)['json'](_0x4ff057);}};}function respondWithFilteredResult(_0x1ed56f,_0x228d84){return function(_0x20b663){if(_0x20b663){var _0x1e26ba=_0x20b663[_0x071b('0x1b')],_0x18ee17=_0x228d84['offset'],_0x10f3bb=_0x228d84[_0x071b('0x1c')]+_0x228d84['limit'],_0x3634c1;if(_0x10f3bb>=_0x1e26ba){_0x10f3bb=_0x1e26ba;_0x3634c1=0xc8;}else{_0x3634c1=0xce;}_0x1ed56f[_0x071b('0x19')](_0x3634c1);return _0x1ed56f[_0x071b('0x1d')](_0x071b('0x1e'),_0x18ee17+'-'+_0x10f3bb+'/'+_0x1e26ba)[_0x071b('0x1f')](_0x20b663);}return null;};}function patchUpdates(_0x3d3601){return function(_0x5d725b){try{jsonpatch['apply'](_0x5d725b,_0x3d3601,!![]);}catch(_0x118c77){return BPromise[_0x071b('0x20')](_0x118c77);}return _0x5d725b[_0x071b('0x21')]();};}function saveUpdates(_0x581e9b,_0x229cf1){return function(_0x37cfb5){if(_0x37cfb5){return _0x37cfb5[_0x071b('0x22')](_0x581e9b)[_0x071b('0x23')](function(_0x26288a){return _0x26288a;});}return null;};}function removeEntity(_0xc8948d,_0xb6d48b){return function(_0x5c5ecb){if(_0x5c5ecb){return _0x5c5ecb[_0x071b('0x24')]()['then'](function(){var _0x4dcb5e=_0x5c5ecb[_0x071b('0x25')]({'plain':!![]});var _0x22bf99='DefaultReports';return db[_0x071b('0x26')][_0x071b('0x24')]({'where':{'type':_0x22bf99,'resourceId':_0x4dcb5e['id']}})['then'](function(){return _0x5c5ecb;});})[_0x071b('0x23')](function(){_0xc8948d[_0x071b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf0da98,_0x143f51){return function(_0x4db3a7){if(!_0x4db3a7){_0xf0da98[_0x071b('0x18')](0x194);}return _0x4db3a7;};}function handleError(_0x460847,_0x31bf56){_0x31bf56=_0x31bf56||0x1f4;return function(_0x11b493){logger[_0x071b('0x27')](_0x11b493[_0x071b('0x28')]);if(_0x11b493[_0x071b('0x29')]){delete _0x11b493[_0x071b('0x29')];}_0x460847[_0x071b('0x19')](_0x31bf56)[_0x071b('0x2a')](_0x11b493);};}exports['index']=function(_0x1f3aaf,_0x60d361){var _0xc0b397={},_0x4fe4cf={},_0x26ed49={'count':0x0,'rows':[]};var _0x5c1d7e=_['map'](db[_0x071b('0x2b')]['rawAttributes'],function(_0x4dde0d){return{'name':_0x4dde0d['fieldName'],'type':_0x4dde0d[_0x071b('0x2c')][_0x071b('0x2d')]};});_0x4fe4cf['model']=_[_0x071b('0x2e')](_0x5c1d7e,_0x071b('0x29'));_0x4fe4cf[_0x071b('0x2f')]=_['keys'](_0x1f3aaf['query']);_0x4fe4cf[_0x071b('0x30')]=_[_0x071b('0x31')](_0x4fe4cf['model'],_0x4fe4cf[_0x071b('0x2f')]);_0xc0b397[_0x071b('0x32')]=_[_0x071b('0x31')](_0x4fe4cf[_0x071b('0x33')],qs['fields'](_0x1f3aaf[_0x071b('0x2f')][_0x071b('0x34')]));_0xc0b397[_0x071b('0x32')]=_0xc0b397[_0x071b('0x32')][_0x071b('0x35')]?_0xc0b397['attributes']:_0x4fe4cf[_0x071b('0x33')];if(!_0x1f3aaf[_0x071b('0x2f')][_0x071b('0x36')](_0x071b('0x37'))){_0xc0b397[_0x071b('0x38')]=qs[_0x071b('0x38')](_0x1f3aaf[_0x071b('0x2f')][_0x071b('0x38')]);_0xc0b397[_0x071b('0x1c')]=qs['offset'](_0x1f3aaf[_0x071b('0x2f')][_0x071b('0x1c')]);}_0xc0b397[_0x071b('0x39')]=qs[_0x071b('0x3a')](_0x1f3aaf['query'][_0x071b('0x3a')]);_0xc0b397[_0x071b('0x3b')]=qs[_0x071b('0x30')](_[_0x071b('0x3c')](_0x1f3aaf[_0x071b('0x2f')],_0x4fe4cf[_0x071b('0x30')]),_0x5c1d7e);if(_0x1f3aaf[_0x071b('0x2f')][_0x071b('0x3d')]){_0xc0b397[_0x071b('0x3b')]=_[_0x071b('0x3e')](_0xc0b397['where'],{'$or':_['map'](_0x5c1d7e,function(_0x5234c5){if(_0x5234c5['type']!==_0x071b('0x3f')){var _0x4b3026={};_0x4b3026[_0x5234c5['name']]={'$like':'%'+_0x1f3aaf[_0x071b('0x2f')][_0x071b('0x3d')]+'%'};return _0x4b3026;}})});}_0xc0b397=_['merge']({},_0xc0b397,_0x1f3aaf[_0x071b('0x40')]);var _0x1d56db={'where':_0xc0b397[_0x071b('0x3b')]};return db[_0x071b('0x2b')][_0x071b('0x1b')](_0x1d56db)[_0x071b('0x23')](function(_0x1cc669){_0x26ed49['count']=_0x1cc669;if(_0x1f3aaf['query']['includeAll']){_0xc0b397[_0x071b('0x41')]=[{'all':!![]}];}return db[_0x071b('0x2b')][_0x071b('0x42')](_0xc0b397);})[_0x071b('0x23')](function(_0x568f80){_0x26ed49['rows']=_0x568f80;return _0x26ed49;})['then'](respondWithFilteredResult(_0x60d361,_0xc0b397))[_0x071b('0x43')](handleError(_0x60d361,null));};exports[_0x071b('0x44')]=function(_0x4c4169,_0x173a2d){var _0x219373={'raw':!![],'where':{'id':_0x4c4169[_0x071b('0x45')]['id']}},_0x4985f9={};_0x4985f9[_0x071b('0x33')]=_[_0x071b('0x46')](db[_0x071b('0x2b')]['rawAttributes']);_0x4985f9[_0x071b('0x2f')]=_['keys'](_0x4c4169[_0x071b('0x2f')]);_0x4985f9[_0x071b('0x30')]=_[_0x071b('0x31')](_0x4985f9[_0x071b('0x33')],_0x4985f9[_0x071b('0x2f')]);_0x219373[_0x071b('0x32')]=_[_0x071b('0x31')](_0x4985f9['model'],qs[_0x071b('0x34')](_0x4c4169['query'][_0x071b('0x34')]));_0x219373['attributes']=_0x219373[_0x071b('0x32')][_0x071b('0x35')]?_0x219373[_0x071b('0x32')]:_0x4985f9['model'];if(_0x4c4169[_0x071b('0x2f')][_0x071b('0x47')]){_0x219373[_0x071b('0x41')]=[{'all':!![]}];}_0x219373=_['merge']({},_0x219373,_0x4c4169[_0x071b('0x40')]);return db['AnalyticDefaultReport'][_0x071b('0x48')](_0x219373)[_0x071b('0x23')](handleEntityNotFound(_0x173a2d,null))[_0x071b('0x23')](respondWithResult(_0x173a2d,null))['catch'](handleError(_0x173a2d,null));};exports[_0x071b('0x49')]=function(_0x58bc24,_0x141433){return db[_0x071b('0x2b')][_0x071b('0x49')](_0x58bc24[_0x071b('0x4a')],{})[_0x071b('0x23')](function(_0x510c77){var _0x189a2b=_0x58bc24[_0x071b('0x4b')][_0x071b('0x25')]({'plain':!![]});if(!_0x189a2b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x189a2b[_0x071b('0x4c')]===_0x071b('0x4b')){var _0x598d4a=_0x510c77[_0x071b('0x25')]({'plain':!![]});var _0x2081f9='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x2081f9,'userProfileId':_0x189a2b['userProfileId']},'raw':!![]})[_0x071b('0x23')](function(_0x7390c1){if(_0x7390c1&&_0x7390c1[_0x071b('0x4d')]===0x0){return db['UserProfileResource'][_0x071b('0x49')]({'name':_0x598d4a[_0x071b('0x29')],'resourceId':_0x598d4a['id'],'type':_0x071b('0x4e'),'sectionId':_0x7390c1['id']},{})[_0x071b('0x23')](function(){return _0x510c77;});}else{return _0x510c77;}})[_0x071b('0x43')](function(_0x4a2462){logger['error'](_0x071b('0x4f'),_0x4a2462);throw _0x4a2462;});}return _0x510c77;})[_0x071b('0x23')](respondWithResult(_0x141433,0xc9))[_0x071b('0x43')](handleError(_0x141433,null));};exports[_0x071b('0x22')]=function(_0x519d3f,_0x227bfa){if(_0x519d3f[_0x071b('0x4a')]['id']){delete _0x519d3f[_0x071b('0x4a')]['id'];}return db['AnalyticDefaultReport'][_0x071b('0x48')]({'where':{'id':_0x519d3f[_0x071b('0x45')]['id']}})['then'](handleEntityNotFound(_0x227bfa,null))['then'](saveUpdates(_0x519d3f[_0x071b('0x4a')],null))[_0x071b('0x23')](respondWithResult(_0x227bfa,null))[_0x071b('0x43')](handleError(_0x227bfa,null));};exports[_0x071b('0x24')]=function(_0x3d890f,_0x56d022){return db[_0x071b('0x2b')][_0x071b('0x48')]({'where':{'id':_0x3d890f['params']['id']}})[_0x071b('0x23')](handleEntityNotFound(_0x56d022,null))[_0x071b('0x23')](removeEntity(_0x56d022,null))[_0x071b('0x43')](handleError(_0x56d022,null));};exports[_0x071b('0x50')]=function(_0x4aab0a,_0x582fc6){var _0x5c3b4f=0xa;var _0x14fcc3=[_0x071b('0x51'),_0x071b('0x52'),'right_join','cross_join'];var _0x19804a={'SUM':'SUM(%s)','COUNT':_0x071b('0x53'),'COUNT DISTINCT':_0x071b('0x54'),'MAX':_0x071b('0x55'),'MIN':_0x071b('0x56'),'AVG':_0x071b('0x57'),'GROUP_CONCAT':_0x071b('0x58'),'GROUP_CONCAT ASC':_0x071b('0x59'),'GROUP_CONCAT DESC':_0x071b('0x5a')};var _0xbf2dc7={'SEC_TO_TIME':_0x071b('0x5b'),'DATE':_0x071b('0x5c'),'HOUR':_0x071b('0x5d'),'ROUND':_0x071b('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x324049=function(_0xa79531){return!_['includes']([_0x071b('0x5f'),_0x071b('0x60'),_0x071b('0x61'),'IS\x20NOT\x20EMPTY'],_0xa79531);};var _0x460e9c=function(_0x597715){if(!_0x597715||!_0x597715['rules']['length']){return'';}for(var _0x462b77='(',_0x343624=0x0;_0x343624<_0x597715[_0x071b('0x62')][_0x071b('0x35')];_0x343624+=0x1){_0x343624>0x0&&(_0x462b77+='\x20'+_0x597715[_0x071b('0x63')]+'\x20');_0x462b77+=_0x597715[_0x071b('0x62')][_0x343624][_0x071b('0x64')]?_0x460e9c(_0x597715[_0x071b('0x62')][_0x343624][_0x071b('0x64')]):_0x597715[_0x071b('0x62')][_0x343624][_0x071b('0x65')]+'\x20'+_0x597715[_0x071b('0x62')][_0x343624]['condition']+(_0x324049(_0x597715['rules'][_0x343624][_0x071b('0x66')])?'\x20'+_0x597715['rules'][_0x343624][_0x071b('0x67')]:'');}return _0x462b77+')';};var _0x4893b4={'where':{'id':_0x4aab0a['params']['id']}},_0x1f8b51,_0x48e0b8,_0x168e6b,_0x2c6f04,_0x46d63f;_0x4893b4=_[_0x071b('0x3e')]({},_0x4893b4,_0x4aab0a[_0x071b('0x40')]);return db[_0x071b('0x2b')][_0x071b('0x48')](_0x4893b4)['then'](function(_0x4d31ff){if(_0x4d31ff){_0x1f8b51=_0x4d31ff;return _0x4d31ff[_0x071b('0x68')]();}return null;})['then'](function(_0x3736cb){if(_0x3736cb){if(!_0x3736cb[_0x071b('0x35')]){throw new db[(_0x071b('0x69'))][(_0x071b('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x48e0b8=_0x3736cb;return db[_0x071b('0x6b')][_0x071b('0x42')]({'raw':!![]});}return null;})['then'](function(_0x45a31){if(_0x45a31){_0x168e6b=_[_0x071b('0x6c')](_0x45a31,'id');var _0x4a6c33;var _0x1bb917=squel[_0x071b('0x6d')]();_0x1bb917['from'](_0x1f8b51['table']);for(var _0x41844a=0x0;_0x41844a<_0x48e0b8[_0x071b('0x35')];_0x41844a+=0x1){_0x4a6c33=_0x48e0b8[_0x41844a]['MetricId']?_0x168e6b[_0x48e0b8[_0x41844a][_0x071b('0x6e')]]['metric']:_0x48e0b8[_0x41844a][_0x071b('0x65')];_0x4a6c33=_0x48e0b8[_0x41844a][_0x071b('0x6f')]?_[_0x071b('0x70')](_0x19804a[_0x48e0b8[_0x41844a][_0x071b('0x6f')]],'%s',_0x4a6c33):_0x4a6c33;_0x4a6c33=_0x48e0b8[_0x41844a]['format']?_[_0x071b('0x70')](_0xbf2dc7[_0x48e0b8[_0x41844a]['format']],'%s',_0x4a6c33):_0x4a6c33;if(_0x48e0b8[_0x41844a][_0x071b('0x71')]){_0x1bb917[_0x071b('0x64')](_0x4a6c33);}_0x48e0b8[_0x41844a][_0x071b('0x72')]&&_0x1bb917['order'](_0x4a6c33,_0x48e0b8[_0x41844a][_0x071b('0x72')]===_0x071b('0x73')?![]:!![]);_0x1bb917['field'](_0x4a6c33,_0x48e0b8[_0x41844a][_0x071b('0x74')]||_0x4a6c33);}if(_0x1f8b51[_0x071b('0x75')]){_0x1f8b51[_0x071b('0x75')]=JSON[_0x071b('0x76')](_0x1f8b51['joins']);for(var _0x7b017b=0x0;_0x7b017b<_0x1f8b51[_0x071b('0x75')][_0x071b('0x35')];_0x7b017b+=0x1){if(_0x1f8b51[_0x071b('0x75')][_0x7b017b]['type']&&_[_0x071b('0x77')](_0x14fcc3,_0x1f8b51[_0x071b('0x75')][_0x7b017b]['type'])&&_0x1f8b51[_0x071b('0x75')][_0x7b017b]['parentKey']&&_0x1f8b51['joins'][_0x7b017b][_0x071b('0x78')]&&_0x1f8b51[_0x071b('0x75')][_0x7b017b]['foreignKey']){_0x1bb917[_0x1f8b51['joins'][_0x7b017b][_0x071b('0x2c')]](_0x1f8b51['joins'][_0x7b017b][_0x071b('0x78')],null,util['format'](_0x071b('0x79'),_0x1f8b51[_0x071b('0x7a')],_0x1f8b51[_0x071b('0x75')][_0x7b017b][_0x071b('0x7b')],_0x1f8b51[_0x071b('0x75')][_0x7b017b][_0x071b('0x78')],_0x1f8b51[_0x071b('0x75')][_0x7b017b]['foreignKey']));}}}if(_0x1f8b51['conditions']){_0x1f8b51[_0x071b('0x7c')]=JSON[_0x071b('0x76')](_0x1f8b51['conditions']);_0x1bb917[_0x071b('0x3b')](_0x460e9c(_0x1f8b51[_0x071b('0x7c')][_0x071b('0x64')]));}_0x46d63f=_0x1bb917[_0x071b('0x7d')]();_0x1bb917[_0x071b('0x38')](_0x5c3b4f);_0x1bb917[_0x071b('0x1c')](0x0);logger[_0x071b('0x7e')](_0x071b('0x7f'),_0x1bb917[_0x071b('0x80')]());return dbH[_0x071b('0x81')][_0x071b('0x2f')](_0x1bb917[_0x071b('0x80')](),{'type':dbH[_0x071b('0x81')]['QueryTypes'][_0x071b('0x82')]});}})[_0x071b('0x23')](respondWithResult(_0x582fc6,null))[_0x071b('0x43')](handleError(_0x582fc6,null));};function runReport(_0x470ace,_0x219592,_0x29123c){var _0x49ae4d=_0x219592[_0x071b('0x29')];var _0x220d62=0xa;var _0x3e36c3=['join',_0x071b('0x52'),'right_join',_0x071b('0x83')];var _0x486e61={'SUM':'SUM(%s)','COUNT':_0x071b('0x53'),'COUNT DISTINCT':_0x071b('0x54'),'MAX':_0x071b('0x55'),'MIN':_0x071b('0x56'),'AVG':_0x071b('0x57'),'GROUP_CONCAT':_0x071b('0x58'),'GROUP_CONCAT ASC':_0x071b('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x209be4={'SEC_TO_TIME':_0x071b('0x5b'),'DATE':_0x071b('0x5c'),'HOUR':_0x071b('0x5d'),'ROUND':_0x071b('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd3c6d0=function(_0xca1b69){return!_[_0x071b('0x77')]([_0x071b('0x5f'),_0x071b('0x60'),_0x071b('0x61'),_0x071b('0x84')],_0xca1b69);};var _0x2448ea=function(_0x6a5e3f){if(!_0x6a5e3f||!_0x6a5e3f['rules']['length']){return'';}for(var _0x1ad17d='(',_0x4e4235=0x0;_0x4e4235<_0x6a5e3f[_0x071b('0x62')][_0x071b('0x35')];_0x4e4235+=0x1){_0x4e4235>0x0&&(_0x1ad17d+='\x20'+_0x6a5e3f[_0x071b('0x63')]+'\x20');_0x1ad17d+=_0x6a5e3f[_0x071b('0x62')][_0x4e4235][_0x071b('0x64')]?_0x2448ea(_0x6a5e3f['rules'][_0x4e4235][_0x071b('0x64')]):_0x6a5e3f[_0x071b('0x62')][_0x4e4235][_0x071b('0x65')]+'\x20'+_0x6a5e3f[_0x071b('0x62')][_0x4e4235][_0x071b('0x66')]+(_0xd3c6d0(_0x6a5e3f[_0x071b('0x62')][_0x4e4235][_0x071b('0x66')])?'\x20'+_0x6a5e3f[_0x071b('0x62')][_0x4e4235][_0x071b('0x67')]:'');}return _0x1ad17d+')';};var _0x1f7f78={'where':{'id':_0x470ace['id']}},_0x4acc6a,_0x529e96,_0x25f9af,_0x3efae7,_0x49938f;_0x1f7f78=_[_0x071b('0x3e')]({},_0x1f7f78,_0x29123c);return db['AnalyticDefaultReport']['find'](_0x1f7f78)[_0x071b('0x23')](function(_0x233731){if(_0x233731){_0x4acc6a=_0x233731;return _0x233731[_0x071b('0x68')]();}return null;})['then'](function(_0x3648c7){if(_0x3648c7){if(!_0x3648c7['length']){throw new db[(_0x071b('0x69'))]['ValidationErrorItem'](_0x071b('0x85'),0x193);}_0x529e96=_0x3648c7;return db[_0x071b('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x071b('0x23')](function(_0x53eecb){if(_0x53eecb){_0x25f9af=_[_0x071b('0x6c')](_0x53eecb,'id');var _0x59828f;var _0x3a6d31=squel[_0x071b('0x6d')]();_0x3a6d31[_0x071b('0x86')](_0x4acc6a[_0x071b('0x7a')]);for(var _0x570ccb=0x0;_0x570ccb<_0x529e96[_0x071b('0x35')];_0x570ccb+=0x1){_0x59828f=_0x529e96[_0x570ccb][_0x071b('0x6e')]?_0x25f9af[_0x529e96[_0x570ccb]['MetricId']]['metric']:_0x529e96[_0x570ccb][_0x071b('0x65')];_0x59828f=_0x529e96[_0x570ccb]['function']?_[_0x071b('0x70')](_0x486e61[_0x529e96[_0x570ccb][_0x071b('0x6f')]],'%s',_0x59828f):_0x59828f;_0x59828f=_0x529e96[_0x570ccb]['format']?_[_0x071b('0x70')](_0x209be4[_0x529e96[_0x570ccb][_0x071b('0x87')]],'%s',_0x59828f):_0x59828f;if(_0x529e96[_0x570ccb][_0x071b('0x71')]){_0x3a6d31[_0x071b('0x64')](_0x59828f);}_0x529e96[_0x570ccb][_0x071b('0x72')]&&_0x3a6d31['order'](_0x59828f,_0x529e96[_0x570ccb][_0x071b('0x72')]===_0x071b('0x73')?![]:!![]);_0x3a6d31[_0x071b('0x65')](_0x59828f,_0x529e96[_0x570ccb][_0x071b('0x74')]||_0x59828f);}if(_0x4acc6a[_0x071b('0x75')]){_0x4acc6a[_0x071b('0x75')]=JSON[_0x071b('0x76')](_0x4acc6a[_0x071b('0x75')]);for(var _0x18ce79=0x0;_0x18ce79<_0x4acc6a['joins'][_0x071b('0x35')];_0x18ce79+=0x1){if(_0x4acc6a['joins'][_0x18ce79][_0x071b('0x2c')]&&_[_0x071b('0x77')](_0x3e36c3,_0x4acc6a[_0x071b('0x75')][_0x18ce79]['type'])&&_0x4acc6a[_0x071b('0x75')][_0x18ce79][_0x071b('0x7b')]&&_0x4acc6a['joins'][_0x18ce79][_0x071b('0x78')]&&_0x4acc6a[_0x071b('0x75')][_0x18ce79][_0x071b('0x88')]){_0x3a6d31[_0x4acc6a[_0x071b('0x75')][_0x18ce79][_0x071b('0x2c')]](_0x4acc6a['joins'][_0x18ce79][_0x071b('0x78')],null,util[_0x071b('0x87')](_0x071b('0x79'),_0x4acc6a[_0x071b('0x7a')],_0x4acc6a[_0x071b('0x75')][_0x18ce79][_0x071b('0x7b')],_0x4acc6a[_0x071b('0x75')][_0x18ce79][_0x071b('0x78')],_0x4acc6a[_0x071b('0x75')][_0x18ce79][_0x071b('0x88')]));}}}if(_0x4acc6a['conditions']){_0x4acc6a[_0x071b('0x7c')]=JSON['parse'](_0x4acc6a['conditions']);_0x3a6d31[_0x071b('0x3b')](_0x2448ea(_0x4acc6a[_0x071b('0x7c')][_0x071b('0x64')]));}_0x49938f=_0x3a6d31[_0x071b('0x7d')]();_0x3a6d31[_0x071b('0x38')](_0x220d62);_0x3a6d31[_0x071b('0x1c')](0x0);return;}})['then'](function(){if(_0x219592[_0x071b('0x89')]===_0x071b('0x8a')){return null;}var _0x57cc63=_[_0x071b('0x3e')](_0x219592,{'name':_0x219592[_0x071b('0x8b')]||_0x219592[_0x071b('0x29')]||_0x4acc6a[_0x071b('0x29')],'basename':_0x49ae4d,'savename':util[_0x071b('0x87')](_0x071b('0x8c'),_0x219592[_0x071b('0x29')]||_0x4acc6a[_0x071b('0x29')],require('randomstring')[_0x071b('0x8d')](0x4),_0x219592[_0x071b('0x89')]||'csv'),'reportId':_0x4acc6a['id'],'reportType':_0x071b('0x8e')});return db[_0x071b('0x8f')][_0x071b('0x49')](_0x57cc63,{'raw':!![]});})[_0x071b('0x23')](function(_0x29f7e2){if(_0x4acc6a[_0x071b('0x7a')]===_0x071b('0x90')){_0x49938f['where'](_0x4acc6a[_0x071b('0x7a')]+_0x071b('0x91'),_0x219592['startDate'],_0x219592[_0x071b('0x92')]);}else{_0x49938f[_0x071b('0x3b')](_0x4acc6a[_0x071b('0x7a')]+_0x071b('0x93'),_0x219592['startDate'],_0x219592[_0x071b('0x92')]);}if(_0x29f7e2){logger[_0x071b('0x94')](_0x071b('0x95'),_0x49938f[_0x071b('0x80')]());require(_0x071b('0x96'))[_0x071b('0x97')](path['join'](__dirname,'../../components/export/',_0x29f7e2[_0x071b('0x89')]),[_0x29f7e2['id'],_0x49938f[_0x071b('0x80')](),path[_0x071b('0x51')](__dirname,_0x071b('0x98'),_0x29f7e2[_0x071b('0x99')]),_0x49ae4d]);return _0x29f7e2;}else{var _0x597f7e=squel[_0x071b('0x6d')]();_0x597f7e[_0x071b('0x86')]('('+_0x49938f[_0x071b('0x80')]()+')',_0x071b('0x9a'));_0x597f7e[_0x071b('0x65')](_0x071b('0x9b'),_0x071b('0x1b'));_0x49938f[_0x071b('0x38')](_0x219592[_0x071b('0x38')]||_0x220d62);_0x49938f[_0x071b('0x1c')](_0x219592[_0x071b('0x1c')]||0x0);return dbH[_0x071b('0x81')][_0x071b('0x2f')](_0x597f7e[_0x071b('0x80')](),{'type':dbH[_0x071b('0x81')][_0x071b('0x9c')][_0x071b('0x82')]})[_0x071b('0x23')](function(_0x2a62f1){if(!_0x2a62f1[_0x071b('0x35')]){_0x3efae7=0x0;}else{_0x3efae7=_0x2a62f1[0x0][_0x071b('0x1b')]||0x0;}return dbH['sequelize']['query'](_0x49938f[_0x071b('0x80')](),{'type':dbH[_0x071b('0x81')]['QueryTypes'][_0x071b('0x82')]});})[_0x071b('0x23')](function(_0x4db412){return{'rows':_0x4db412||[],'count':_0x3efae7};});}});}exports[_0x071b('0x9d')]=function(_0x44f376,_0x251939){return runReport(_0x44f376[_0x071b('0x45')],_0x44f376[_0x071b('0x2f')],_0x44f376[_0x071b('0x40')])[_0x071b('0x23')](respondWithResult(_0x251939,null))['catch'](handleError(_0x251939,null));};exports[_0x071b('0x9e')]=runReport;exports[_0x071b('0x2f')]=function(_0x27aa5b,_0x1893a2){var _0x32cea3=0xa;var _0x315f18=[_0x071b('0x51'),'left_join',_0x071b('0x9f'),_0x071b('0x83')];var _0x20af17={'SUM':'SUM(%s)','COUNT':_0x071b('0x53'),'COUNT DISTINCT':_0x071b('0x54'),'MAX':_0x071b('0x55'),'MIN':_0x071b('0x56'),'AVG':_0x071b('0x57'),'GROUP_CONCAT':_0x071b('0x58'),'GROUP_CONCAT ASC':_0x071b('0x59'),'GROUP_CONCAT DESC':_0x071b('0x5a')};var _0x334a70={'SEC_TO_TIME':_0x071b('0x5b'),'DATE':_0x071b('0x5c'),'HOUR':_0x071b('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x071b('0xa0')};var _0x45363f=function(_0x469e88){return!_[_0x071b('0x77')]([_0x071b('0x5f'),'IS\x20NOT\x20NULL',_0x071b('0x61'),_0x071b('0x84')],_0x469e88);};var _0x5810c1=function(_0x1cc475){if(!_0x1cc475||!_0x1cc475['rules'][_0x071b('0x35')]){return'';}for(var _0x24a893='(',_0x6a9be9=0x0;_0x6a9be9<_0x1cc475['rules']['length'];_0x6a9be9+=0x1){_0x6a9be9>0x0&&(_0x24a893+='\x20'+_0x1cc475[_0x071b('0x63')]+'\x20');_0x24a893+=_0x1cc475[_0x071b('0x62')][_0x6a9be9][_0x071b('0x64')]?_0x5810c1(_0x1cc475[_0x071b('0x62')][_0x6a9be9][_0x071b('0x64')]):_0x1cc475['rules'][_0x6a9be9][_0x071b('0x65')]+'\x20'+_0x1cc475[_0x071b('0x62')][_0x6a9be9][_0x071b('0x66')]+(_0x45363f(_0x1cc475['rules'][_0x6a9be9][_0x071b('0x66')])?'\x20'+_0x1cc475[_0x071b('0x62')][_0x6a9be9][_0x071b('0x67')]:'');}return _0x24a893+')';};var _0x2020e7={'where':{'id':_0x27aa5b[_0x071b('0x45')]['id']}},_0x1a3c10,_0x2c3e18,_0x2c601e,_0x1c3b10,_0xbc8451;_0x2020e7=_[_0x071b('0x3e')]({},_0x2020e7,_0x27aa5b[_0x071b('0x40')]);return db[_0x071b('0x2b')][_0x071b('0x48')](_0x2020e7)[_0x071b('0x23')](function(_0x2d42a1){if(_0x2d42a1){_0x1a3c10=_0x2d42a1;return _0x2d42a1['getFields']();}return null;})[_0x071b('0x23')](function(_0x210b19){if(_0x210b19){if(!_0x210b19['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x071b('0x85'),0x193);}_0x2c3e18=_0x210b19;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x17a8fe){if(_0x17a8fe){_0x2c601e=_['keyBy'](_0x17a8fe,'id');var _0x2feda5;var _0x1afe79=squel[_0x071b('0x6d')]();_0x1afe79['from'](_0x1a3c10['table']);for(var _0xd3414b=0x0;_0xd3414b<_0x2c3e18[_0x071b('0x35')];_0xd3414b+=0x1){_0x2feda5=_0x2c3e18[_0xd3414b][_0x071b('0x6e')]?_0x2c601e[_0x2c3e18[_0xd3414b][_0x071b('0x6e')]][_0x071b('0xa1')]:_0x2c3e18[_0xd3414b]['field'];_0x2feda5=_0x2c3e18[_0xd3414b]['function']?_[_0x071b('0x70')](_0x20af17[_0x2c3e18[_0xd3414b][_0x071b('0x6f')]],'%s',_0x2feda5):_0x2feda5;_0x2feda5=_0x2c3e18[_0xd3414b][_0x071b('0x87')]?_[_0x071b('0x70')](_0x334a70[_0x2c3e18[_0xd3414b]['format']],'%s',_0x2feda5):_0x2feda5;if(_0x2c3e18[_0xd3414b][_0x071b('0x71')]){_0x1afe79['group'](_0x2feda5);}_0x2c3e18[_0xd3414b]['orderBy']&&_0x1afe79[_0x071b('0x39')](_0x2feda5,_0x2c3e18[_0xd3414b]['orderBy']===_0x071b('0x73')?![]:!![]);_0x1afe79['field'](_0x2feda5,_0x2c3e18[_0xd3414b][_0x071b('0x74')]||_0x2feda5);}if(_0x1a3c10[_0x071b('0x75')]){_0x1a3c10[_0x071b('0x75')]=JSON[_0x071b('0x76')](_0x1a3c10[_0x071b('0x75')]);for(var _0x42b2f2=0x0;_0x42b2f2<_0x1a3c10[_0x071b('0x75')][_0x071b('0x35')];_0x42b2f2+=0x1){if(_0x1a3c10[_0x071b('0x75')][_0x42b2f2]['type']&&_[_0x071b('0x77')](_0x315f18,_0x1a3c10['joins'][_0x42b2f2][_0x071b('0x2c')])&&_0x1a3c10['joins'][_0x42b2f2][_0x071b('0x7b')]&&_0x1a3c10[_0x071b('0x75')][_0x42b2f2]['foreignTable']&&_0x1a3c10[_0x071b('0x75')][_0x42b2f2]['foreignKey']){_0x1afe79[_0x1a3c10['joins'][_0x42b2f2][_0x071b('0x2c')]](_0x1a3c10[_0x071b('0x75')][_0x42b2f2][_0x071b('0x78')],null,util[_0x071b('0x87')]('%s.%s\x20=\x20%s.%s',_0x1a3c10[_0x071b('0x7a')],_0x1a3c10[_0x071b('0x75')][_0x42b2f2][_0x071b('0x7b')],_0x1a3c10[_0x071b('0x75')][_0x42b2f2][_0x071b('0x78')],_0x1a3c10[_0x071b('0x75')][_0x42b2f2][_0x071b('0x88')]));}}}if(_0x1a3c10[_0x071b('0x7c')]){_0x1a3c10[_0x071b('0x7c')]=JSON[_0x071b('0x76')](_0x1a3c10[_0x071b('0x7c')]);_0x1afe79['where'](_0x5810c1(_0x1a3c10[_0x071b('0x7c')]['group']));}_0xbc8451=_0x1afe79[_0x071b('0x7d')]();_0x1afe79['limit'](_0x32cea3);_0x1afe79[_0x071b('0x1c')](0x0);logger[_0x071b('0x7e')]('Limited\x20Query:',_0x1afe79[_0x071b('0x80')]());return dbH[_0x071b('0x81')][_0x071b('0x2f')](_0x1afe79[_0x071b('0x80')](),{'type':dbH[_0x071b('0x81')][_0x071b('0x9c')][_0x071b('0x82')]});}})['then'](function(){return{'sql':_0xbc8451[_0x071b('0x80')]()};})[_0x071b('0x23')](respondWithResult(_0x1893a2,null))['catch'](handleError(_0x1893a2,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 5cd0460..5c02cf3 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 _0x7290=['../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x422711,_0x378994){var _0x34da3f=function(_0x18ee13){while(--_0x18ee13){_0x422711['push'](_0x422711['shift']());}};_0x34da3f(++_0x378994);}(_0x7290,0x184));var _0x0729=function(_0x28e5ef,_0x4e406f){_0x28e5ef=_0x28e5ef-0x0;var _0x128683=_0x7290[_0x28e5ef];return _0x128683;};'use strict';var _=require(_0x0729('0x0'));var util=require(_0x0729('0x1'));var logger=require(_0x0729('0x2'))(_0x0729('0x3'));var moment=require(_0x0729('0x4'));var BPromise=require(_0x0729('0x5'));var rp=require(_0x0729('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0729('0x7'));var config=require(_0x0729('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x452cdc,_0x1cdf1f){return _0x452cdc[_0x0729('0x9')](_0x0729('0xa'),attributes,{'tableName':_0x0729('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf675=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports'];(function(_0x2a4c87,_0x6a425e){var _0x2933f2=function(_0x26a4f0){while(--_0x26a4f0){_0x2a4c87['push'](_0x2a4c87['shift']());}};_0x2933f2(++_0x6a425e);}(_0xf675,0x199));var _0x5f67=function(_0x367995,_0x129ae2){_0x367995=_0x367995-0x0;var _0x22daa8=_0xf675[_0x367995];return _0x22daa8;};'use strict';var _=require(_0x5f67('0x0'));var util=require(_0x5f67('0x1'));var logger=require(_0x5f67('0x2'))('api');var moment=require(_0x5f67('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f67('0x4'));var fs=require('fs');var path=require(_0x5f67('0x5'));var rimraf=require(_0x5f67('0x6'));var config=require('../../config/environment');var attributes=require(_0x5f67('0x7'));module[_0x5f67('0x8')]=function(_0x2919cc,_0xd4b727){return _0x2919cc['define'](_0x5f67('0x9'),attributes,{'tableName':_0x5f67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index e39350e..d658d38 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 _0x8109=['result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x8109,0xa9));var _0x9810=function(_0x223428,_0x2cc00a){_0x223428=_0x223428-0x0;var _0x4cd557=_0x8109[_0x223428];return _0x4cd557;};'use strict';var _=require(_0x9810('0x0'));var util=require('util');var moment=require(_0x9810('0x1'));var BPromise=require(_0x9810('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9810('0x3'));var db=require(_0x9810('0x4'))['db'];var utils=require(_0x9810('0x5'));var logger=require(_0x9810('0x6'))(_0x9810('0x7'));var config=require(_0x9810('0x8'));var jayson=require(_0x9810('0x9'));var client=jayson[_0x9810('0xa')][_0x9810('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x150e3f,_0x3f65e3,_0x5e367b){return new BPromise(function(_0x3b0e0d,_0xafe932){return client[_0x9810('0xc')](_0x150e3f,_0x5e367b)[_0x9810('0xd')](function(_0xd9e6d){logger['info'](_0x9810('0xe'),_0x3f65e3,_0x9810('0xf'));logger[_0x9810('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3f65e3,_0x9810('0xf'),JSON['stringify'](_0xd9e6d));if(_0xd9e6d['error']){if(_0xd9e6d[_0x9810('0x11')][_0x9810('0x12')]===0x1f4){logger[_0x9810('0x11')](_0x9810('0xe'),_0x3f65e3,_0xd9e6d[_0x9810('0x11')][_0x9810('0x13')]);return _0xafe932(_0xd9e6d['error'][_0x9810('0x13')]);}logger[_0x9810('0x11')](_0x9810('0xe'),_0x3f65e3,_0xd9e6d[_0x9810('0x11')][_0x9810('0x13')]);return _0x3b0e0d(_0xd9e6d[_0x9810('0x11')][_0x9810('0x13')]);}else{logger['info'](_0x9810('0xe'),_0x3f65e3,_0x9810('0xf'));_0x3b0e0d(_0xd9e6d[_0x9810('0x14')][_0x9810('0x13')]);}})['catch'](function(_0x549cd8){logger[_0x9810('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f65e3,_0x549cd8);_0xafe932(_0x549cd8);});});}
\ No newline at end of file
+var _0x05e3=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x167010,_0x5c8129){var _0xa943=function(_0x402050){while(--_0x402050){_0x167010['push'](_0x167010['shift']());}};_0xa943(++_0x5c8129);}(_0x05e3,0x86));var _0x305e=function(_0x77a0c1,_0x400923){_0x77a0c1=_0x77a0c1-0x0;var _0x1db8b8=_0x05e3[_0x77a0c1];return _0x1db8b8;};'use strict';var _=require(_0x305e('0x0'));var util=require(_0x305e('0x1'));var moment=require(_0x305e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x305e('0x3'));var db=require(_0x305e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x305e('0x5'))(_0x305e('0x6'));var config=require('../../config/environment');var jayson=require(_0x305e('0x7'));var client=jayson[_0x305e('0x8')][_0x305e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143428,_0x72ac4b,_0x22b00b){return new BPromise(function(_0x86ade0,_0x952a5e){return client['request'](_0x143428,_0x22b00b)[_0x305e('0xa')](function(_0x4a66fd){logger[_0x305e('0xb')](_0x305e('0xc'),_0x72ac4b,'request\x20sent');logger[_0x305e('0xd')](_0x305e('0xe'),_0x72ac4b,_0x305e('0xf'),JSON[_0x305e('0x10')](_0x4a66fd));if(_0x4a66fd[_0x305e('0x11')]){if(_0x4a66fd[_0x305e('0x11')][_0x305e('0x12')]===0x1f4){logger[_0x305e('0x11')](_0x305e('0xc'),_0x72ac4b,_0x4a66fd[_0x305e('0x11')][_0x305e('0x13')]);return _0x952a5e(_0x4a66fd[_0x305e('0x11')]['message']);}logger[_0x305e('0x11')](_0x305e('0xc'),_0x72ac4b,_0x4a66fd['error'][_0x305e('0x13')]);return _0x86ade0(_0x4a66fd[_0x305e('0x11')][_0x305e('0x13')]);}else{logger[_0x305e('0xb')](_0x305e('0xc'),_0x72ac4b,_0x305e('0xf'));_0x86ade0(_0x4a66fd[_0x305e('0x14')]['message']);}})[_0x305e('0x15')](function(_0x455e78){logger['error'](_0x305e('0xc'),_0x72ac4b,_0x455e78);_0x952a5e(_0x455e78);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 87f6e9c..e9f1397 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 _0x73df=['./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1dcadb,_0x32f369){var _0x3b1cdc=function(_0x2e5d4d){while(--_0x2e5d4d){_0x1dcadb['push'](_0x1dcadb['shift']());}};_0x3b1cdc(++_0x32f369);}(_0x73df,0x9b));var _0xf73d=function(_0x4a471e,_0x3c45d0){_0x4a471e=_0x4a471e-0x0;var _0x5d3508=_0x73df[_0x4a471e];return _0x5d3508;};'use strict';var multer=require('multer');var util=require(_0xf73d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf73d('0x1')]();var fs_extra=require(_0xf73d('0x2'));var auth=require(_0xf73d('0x3'));var interaction=require(_0xf73d('0x4'));var config=require('../../config/environment');var controller=require(_0xf73d('0x5'));router[_0xf73d('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf73d('0x7'),auth[_0xf73d('0x8')](),controller[_0xf73d('0x9')]);router[_0xf73d('0x6')]('/:id/preview',auth[_0xf73d('0x8')](),controller[_0xf73d('0xa')]);router[_0xf73d('0x6')](_0xf73d('0xb'),auth['isAuthenticated'](),controller[_0xf73d('0xc')]);router[_0xf73d('0x6')](_0xf73d('0xd'),auth[_0xf73d('0x8')](),controller[_0xf73d('0xe')]);router[_0xf73d('0xf')]('/',auth[_0xf73d('0x8')](),controller[_0xf73d('0x10')]);router[_0xf73d('0x11')](_0xf73d('0x7'),auth[_0xf73d('0x8')](),controller['update']);router[_0xf73d('0x12')](_0xf73d('0x7'),auth[_0xf73d('0x8')](),controller['destroy']);module[_0xf73d('0x13')]=router;
\ No newline at end of file
+var _0x9a95=['/:id/query','query','post','put','update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/preview','preview'];(function(_0x53707c,_0x314341){var _0x5b1796=function(_0x49c726){while(--_0x49c726){_0x53707c['push'](_0x53707c['shift']());}};_0x5b1796(++_0x314341);}(_0x9a95,0x1bf));var _0x59a9=function(_0x2dbb6f,_0x4b8197){_0x2dbb6f=_0x2dbb6f-0x0;var _0x1cc1be=_0x9a95[_0x2dbb6f];return _0x1cc1be;};'use strict';var multer=require(_0x59a9('0x0'));var util=require('util');var path=require(_0x59a9('0x1'));var timeout=require(_0x59a9('0x2'));var express=require(_0x59a9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x59a9('0x4'));var interaction=require(_0x59a9('0x5'));var config=require(_0x59a9('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x59a9('0x7')]('/',auth[_0x59a9('0x8')](),controller[_0x59a9('0x9')]);router[_0x59a9('0x7')](_0x59a9('0xa'),auth[_0x59a9('0x8')](),controller['show']);router[_0x59a9('0x7')](_0x59a9('0xb'),auth['isAuthenticated'](),controller[_0x59a9('0xc')]);router['get']('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x59a9('0x7')](_0x59a9('0xd'),auth['isAuthenticated'](),controller[_0x59a9('0xe')]);router[_0x59a9('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x59a9('0x10')]('/:id',auth[_0x59a9('0x8')](),controller[_0x59a9('0x11')]);router[_0x59a9('0x12')](_0x59a9('0xa'),auth['isAuthenticated'](),controller[_0x59a9('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 4890adc..e762280 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 _0x98f6=['DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','csv'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x98f6,0x94));var _0x698f=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0x98f6[_0x59710f];return _0xaae66a;};'use strict';var Sequelize=require(_0x698f('0x0'));var moment=require(_0x698f('0x1'));module[_0x698f('0x2')]={'name':{'type':Sequelize[_0x698f('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x698f('0x4')]('csv',_0x698f('0x5'),_0x698f('0x6')),'allowNull':![],'defaultValue':_0x698f('0x7')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x698f('0x8')]},'endDate':{'type':Sequelize[_0x698f('0x8')]},'status':{'type':Sequelize[_0x698f('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x698f('0x4')](_0x698f('0x9'),_0x698f('0xa')),'allowNull':![],'defaultValue':_0x698f('0x9')},'reportId':{'type':Sequelize[_0x698f('0xb')](0xb)[_0x698f('0xc')]},'reportType':{'type':Sequelize[_0x698f('0x3')]}};
\ No newline at end of file
+var _0x9c10=['pdf','xlsx','DATE','Loading','manual','scheduled','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x163a52,_0x512f07){var _0x275a0c=function(_0x2fb6df){while(--_0x2fb6df){_0x163a52['push'](_0x163a52['shift']());}};_0x275a0c(++_0x512f07);}(_0x9c10,0x162));var _0x09c1=function(_0x17b9e2,_0x3921fa){_0x17b9e2=_0x17b9e2-0x0;var _0x4335d2=_0x9c10[_0x17b9e2];return _0x4335d2;};'use strict';var Sequelize=require(_0x09c1('0x0'));var moment=require(_0x09c1('0x1'));module[_0x09c1('0x2')]={'name':{'type':Sequelize[_0x09c1('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x09c1('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x09c1('0x4')](_0x09c1('0x5'),_0x09c1('0x6'),_0x09c1('0x7')),'allowNull':![],'defaultValue':_0x09c1('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x09c1('0x8')]},'endDate':{'type':Sequelize[_0x09c1('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x09c1('0x9')},'type':{'type':Sequelize[_0x09c1('0x4')](_0x09c1('0xa'),_0x09c1('0xb')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](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 1efe82f..c5b10b5 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 _0xb9a7=['rows','catch','show','length','create','body','user','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','savename','output','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','basename','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','sendStatus','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll'];(function(_0xa3d8b6,_0x10dc1e){var _0x4d3101=function(_0x2ed16c){while(--_0x2ed16c){_0xa3d8b6['push'](_0xa3d8b6['shift']());}};_0x4d3101(++_0x10dc1e);}(_0xb9a7,0x112));var _0x7b9a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb9a7[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=_0x22a7e4['count'],_0x2f1899=_0x346daa[_0x7b9a('0x17')],_0x4996f1=_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')],_0x34a82d;if(_0x4996f1>=_0x35e602){_0x4996f1=_0x35e602;_0x34a82d=0xc8;}else{_0x34a82d=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x34a82d);return _0x344fa7[_0x7b9a('0x19')](_0x7b9a('0x1a'),_0x2f1899+'-'+_0x4996f1+'/'+_0x35e602)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x283cc3){return function(_0x2064a0){try{jsonpatch[_0x7b9a('0x1b')](_0x2064a0,_0x283cc3,!![]);}catch(_0x39a5a9){return BPromise[_0x7b9a('0x1c')](_0x39a5a9);}return _0x2064a0[_0x7b9a('0x1d')]();};}function saveUpdates(_0x58aed7,_0x993048){return function(_0x59a64d){if(_0x59a64d){return _0x59a64d[_0x7b9a('0x1e')](_0x58aed7)['then'](function(_0x744887){return _0x744887;});}return null;};}function removeEntity(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1f')]()[_0x7b9a('0x20')](function(){var _0x5705b2=_0x54fda7[_0x7b9a('0x21')]({'plain':!![]});var _0x374dca=_0x7b9a('0x22');return db[_0x7b9a('0x23')][_0x7b9a('0x1f')]({'where':{'type':_0x374dca,'resourceId':_0x5705b2['id']}})['then'](function(){return _0x54fda7;});})[_0x7b9a('0x20')](function(){_0x331ae6[_0x7b9a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39b7ec,_0x4fa111){return function(_0x31eb67){if(!_0x31eb67){_0x39b7ec[_0x7b9a('0x24')](0x194);}return _0x31eb67;};}function handleError(_0x4c2271,_0x55d01c){_0x55d01c=_0x55d01c||0x1f4;return function(_0x24d886){logger['error'](_0x24d886['stack']);if(_0x24d886[_0x7b9a('0x25')]){delete _0x24d886['name'];}_0x4c2271['status'](_0x55d01c)[_0x7b9a('0x26')](_0x24d886);};}exports['index']=function(_0x5c89b6,_0x314b6d){var _0x4fee38={},_0x1553ae={},_0x2e6144={'count':0x0,'rows':[]};var _0xd35ce7=_['map'](db[_0x7b9a('0x27')][_0x7b9a('0x28')],function(_0x181e9c){return{'name':_0x181e9c[_0x7b9a('0x29')],'type':_0x181e9c[_0x7b9a('0x2a')][_0x7b9a('0x2b')]};});_0x1553ae['model']=_['map'](_0xd35ce7,_0x7b9a('0x25'));_0x1553ae[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x5c89b6['query']);_0x1553ae[_0x7b9a('0x2e')]=_[_0x7b9a('0x2f')](_0x1553ae['model'],_0x1553ae['query']);_0x4fee38[_0x7b9a('0x30')]=_[_0x7b9a('0x2f')](_0x1553ae['model'],qs[_0x7b9a('0x31')](_0x5c89b6[_0x7b9a('0x2c')][_0x7b9a('0x31')]));_0x4fee38[_0x7b9a('0x30')]=_0x4fee38[_0x7b9a('0x30')]['length']?_0x4fee38[_0x7b9a('0x30')]:_0x1553ae[_0x7b9a('0x32')];if(!_0x5c89b6[_0x7b9a('0x2c')][_0x7b9a('0x33')](_0x7b9a('0x34'))){_0x4fee38[_0x7b9a('0x18')]=qs['limit'](_0x5c89b6['query'][_0x7b9a('0x18')]);_0x4fee38[_0x7b9a('0x17')]=qs['offset'](_0x5c89b6[_0x7b9a('0x2c')][_0x7b9a('0x17')]);}_0x4fee38[_0x7b9a('0x35')]=qs['sort'](_0x5c89b6[_0x7b9a('0x2c')][_0x7b9a('0x36')]);_0x4fee38['where']=qs['filters'](_[_0x7b9a('0x37')](_0x5c89b6[_0x7b9a('0x2c')],_0x1553ae[_0x7b9a('0x2e')]),_0xd35ce7);if(_0x5c89b6[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x4fee38[_0x7b9a('0x39')]=_[_0x7b9a('0x3a')](_0x4fee38[_0x7b9a('0x39')],{'$or':_['map'](_0xd35ce7,function(_0x366b62){if(_0x366b62['type']!==_0x7b9a('0x3b')){var _0x157ca8={};_0x157ca8[_0x366b62[_0x7b9a('0x25')]]={'$like':'%'+_0x5c89b6[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x157ca8;}})});}_0x4fee38=_[_0x7b9a('0x3a')]({},_0x4fee38,_0x5c89b6['options']);var _0x34eebe={'where':_0x4fee38[_0x7b9a('0x39')]};return db[_0x7b9a('0x27')][_0x7b9a('0x3c')](_0x34eebe)['then'](function(_0x44e18e){_0x2e6144[_0x7b9a('0x3c')]=_0x44e18e;if(_0x5c89b6[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x4fee38['include']=[{'all':!![]}];}return db[_0x7b9a('0x27')]['findAll'](_0x4fee38);})[_0x7b9a('0x20')](function(_0x230c97){_0x2e6144[_0x7b9a('0x3e')]=_0x230c97;return _0x2e6144;})[_0x7b9a('0x20')](respondWithFilteredResult(_0x314b6d,_0x4fee38))[_0x7b9a('0x3f')](handleError(_0x314b6d,null));};exports[_0x7b9a('0x40')]=function(_0x56e274,_0x33edc6){var _0x85770={'raw':!![],'where':{'id':_0x56e274['params']['id']}},_0x34fb57={};_0x34fb57['model']=_[_0x7b9a('0x2d')](db[_0x7b9a('0x27')][_0x7b9a('0x28')]);_0x34fb57[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x56e274[_0x7b9a('0x2c')]);_0x34fb57['filters']=_['intersection'](_0x34fb57['model'],_0x34fb57[_0x7b9a('0x2c')]);_0x85770[_0x7b9a('0x30')]=_['intersection'](_0x34fb57[_0x7b9a('0x32')],qs[_0x7b9a('0x31')](_0x56e274[_0x7b9a('0x2c')]['fields']));_0x85770[_0x7b9a('0x30')]=_0x85770['attributes'][_0x7b9a('0x41')]?_0x85770[_0x7b9a('0x30')]:_0x34fb57[_0x7b9a('0x32')];if(_0x56e274[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x85770['include']=[{'all':!![]}];}_0x85770=_[_0x7b9a('0x3a')]({},_0x85770,_0x56e274['options']);return db[_0x7b9a('0x27')]['find'](_0x85770)['then'](handleEntityNotFound(_0x33edc6,null))[_0x7b9a('0x20')](respondWithResult(_0x33edc6,null))[_0x7b9a('0x3f')](handleError(_0x33edc6,null));};exports[_0x7b9a('0x42')]=function(_0x43cba,_0x1cbd5a){return db[_0x7b9a('0x27')][_0x7b9a('0x42')](_0x43cba[_0x7b9a('0x43')],{})[_0x7b9a('0x20')](function(_0x5088c7){var _0x1d7957=_0x43cba[_0x7b9a('0x44')]['get']({'plain':!![]});if(!_0x1d7957)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d7957['role']===_0x7b9a('0x44')){var _0x30296e=_0x5088c7[_0x7b9a('0x21')]({'plain':!![]});var _0x17f84d='ExtractedReports';return db[_0x7b9a('0x45')][_0x7b9a('0x46')]({'where':{'name':_0x17f84d,'userProfileId':_0x1d7957[_0x7b9a('0x47')]},'raw':!![]})[_0x7b9a('0x20')](function(_0x2d083b){if(_0x2d083b&&_0x2d083b['autoAssociation']===0x0){return db[_0x7b9a('0x23')]['create']({'name':_0x30296e[_0x7b9a('0x25')],'resourceId':_0x30296e['id'],'type':_0x2d083b[_0x7b9a('0x25')],'sectionId':_0x2d083b['id']},{})[_0x7b9a('0x20')](function(){return _0x5088c7;});}else{return _0x5088c7;}})[_0x7b9a('0x3f')](function(_0x52f2ca){logger[_0x7b9a('0x48')](_0x7b9a('0x49'),_0x52f2ca);throw _0x52f2ca;});}return _0x5088c7;})[_0x7b9a('0x20')](respondWithResult(_0x1cbd5a,0xc9))[_0x7b9a('0x3f')](handleError(_0x1cbd5a,null));};exports[_0x7b9a('0x1e')]=function(_0x3e2f1b,_0x41a002){if(_0x3e2f1b['body']['id']){delete _0x3e2f1b['body']['id'];}return db['AnalyticExtractedReport'][_0x7b9a('0x46')]({'where':{'id':_0x3e2f1b[_0x7b9a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x41a002,null))['then'](saveUpdates(_0x3e2f1b['body'],null))['then'](respondWithResult(_0x41a002,null))[_0x7b9a('0x3f')](handleError(_0x41a002,null));};exports[_0x7b9a('0x1f')]=function(_0x18bfb6,_0x957418){return db[_0x7b9a('0x27')][_0x7b9a('0x46')]({'where':{'id':_0x18bfb6[_0x7b9a('0x4a')]['id']}})[_0x7b9a('0x20')](handleEntityNotFound(_0x957418,null))['then'](removeEntity(_0x957418,null))[_0x7b9a('0x3f')](handleError(_0x957418,null));};exports['download']=function(_0x23a0cb,_0xe97e8b,_0x3c40ad){return db[_0x7b9a('0x27')][_0x7b9a('0x46')]({'where':{'id':_0x23a0cb['params']['id']},'attributes':[_0x7b9a('0x25'),'basename',_0x7b9a('0x4b'),_0x7b9a('0x4c')],'raw':!![]})[_0x7b9a('0x20')](handleEntityNotFound(_0xe97e8b,null))['then'](function(_0x50c289){if(_0x50c289){if(!fs['existsSync'](path['join'](config[_0x7b9a('0x4d')],_0x7b9a('0x4e'),_0x50c289[_0x7b9a('0x4b')]))){throw new db['Sequelize'][(_0x7b9a('0x4f'))](_0x7b9a('0x50'));}if(_0x23a0cb[_0x7b9a('0x2c')][_0x7b9a('0x51')]){return _0xe97e8b[_0x7b9a('0x24')](0xc8);}return _0xe97e8b['download'](path[_0x7b9a('0x52')](config[_0x7b9a('0x4d')],_0x7b9a('0x4e'),_0x50c289['savename']),util['format']('%s.%s',_0x50c289[_0x7b9a('0x53')]||_0x50c289[_0x7b9a('0x25')],_0x50c289[_0x7b9a('0x4c')]['toLowerCase']()));}})[_0x7b9a('0x3f')](handleError(_0xe97e8b,null));};
\ No newline at end of file
+var _0x44a3=['update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','download','basename','savename','output','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','join','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x44a3,0x1a9));var _0x344a=function(_0x505088,_0x23a321){_0x505088=_0x505088-0x0;var _0x3eb2c9=_0x44a3[_0x505088];return _0x3eb2c9;};'use strict';var emlformat=require(_0x344a('0x0'));var rimraf=require(_0x344a('0x1'));var zipdir=require(_0x344a('0x2'));var jsonpatch=require(_0x344a('0x3'));var rp=require(_0x344a('0x4'));var moment=require(_0x344a('0x5'));var BPromise=require(_0x344a('0x6'));var Mustache=require(_0x344a('0x7'));var util=require('util');var path=require(_0x344a('0x8'));var sox=require(_0x344a('0x9'));var csv=require(_0x344a('0xa'));var ejs=require(_0x344a('0xb'));var fs=require('fs');var fs_extra=require(_0x344a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xa'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344a('0x15'));var db=require(_0x344a('0x16'))['db'];function respondWithStatusCode(_0x57e42e,_0x4a69ea){_0x4a69ea=_0x4a69ea||0xcc;return function(_0x304b70){if(_0x304b70){return _0x57e42e[_0x344a('0x17')](_0x4a69ea);}return _0x57e42e[_0x344a('0x18')](_0x4a69ea)[_0x344a('0x19')]();};}function respondWithResult(_0x5a0df6,_0x133ad4){_0x133ad4=_0x133ad4||0xc8;return function(_0x4ee562){if(_0x4ee562){return _0x5a0df6[_0x344a('0x18')](_0x133ad4)[_0x344a('0x1a')](_0x4ee562);}};}function respondWithFilteredResult(_0xce0f65,_0x6e1639){return function(_0x58c8cd){if(_0x58c8cd){var _0x54a643=_0x58c8cd[_0x344a('0x1b')],_0x3609ce=_0x6e1639['offset'],_0x1aad46=_0x6e1639[_0x344a('0x1c')]+_0x6e1639[_0x344a('0x1d')],_0x36227e;if(_0x1aad46>=_0x54a643){_0x1aad46=_0x54a643;_0x36227e=0xc8;}else{_0x36227e=0xce;}_0xce0f65['status'](_0x36227e);return _0xce0f65[_0x344a('0x1e')](_0x344a('0x1f'),_0x3609ce+'-'+_0x1aad46+'/'+_0x54a643)[_0x344a('0x1a')](_0x58c8cd);}return null;};}function patchUpdates(_0x45a827){return function(_0x13b382){try{jsonpatch[_0x344a('0x20')](_0x13b382,_0x45a827,!![]);}catch(_0x36e332){return BPromise[_0x344a('0x21')](_0x36e332);}return _0x13b382[_0x344a('0x22')]();};}function saveUpdates(_0x450922,_0x4b3552){return function(_0x16c0fe){if(_0x16c0fe){return _0x16c0fe[_0x344a('0x23')](_0x450922)[_0x344a('0x24')](function(_0x21216d){return _0x21216d;});}return null;};}function removeEntity(_0x240be3,_0x80ae12){return function(_0x185303){if(_0x185303){return _0x185303[_0x344a('0x25')]()[_0x344a('0x24')](function(){var _0x27f527=_0x185303[_0x344a('0x26')]({'plain':!![]});var _0x3b2ab9=_0x344a('0x27');return db[_0x344a('0x28')]['destroy']({'where':{'type':_0x3b2ab9,'resourceId':_0x27f527['id']}})[_0x344a('0x24')](function(){return _0x185303;});})['then'](function(){_0x240be3[_0x344a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c920,_0x8bf0b0){return function(_0x2ebae9){if(!_0x2ebae9){_0x36c920[_0x344a('0x17')](0x194);}return _0x2ebae9;};}function handleError(_0x26f059,_0x28749b){_0x28749b=_0x28749b||0x1f4;return function(_0x229ccd){logger[_0x344a('0x29')](_0x229ccd['stack']);if(_0x229ccd[_0x344a('0x2a')]){delete _0x229ccd[_0x344a('0x2a')];}_0x26f059[_0x344a('0x18')](_0x28749b)[_0x344a('0x2b')](_0x229ccd);};}exports[_0x344a('0x2c')]=function(_0x2d72c9,_0x5b877d){var _0x3d25fe={},_0x49bbf8={},_0x593cf6={'count':0x0,'rows':[]};var _0x24965d=_[_0x344a('0x2d')](db[_0x344a('0x2e')]['rawAttributes'],function(_0x5cd9c6){return{'name':_0x5cd9c6['fieldName'],'type':_0x5cd9c6[_0x344a('0x2f')][_0x344a('0x30')]};});_0x49bbf8[_0x344a('0x31')]=_['map'](_0x24965d,_0x344a('0x2a'));_0x49bbf8[_0x344a('0x32')]=_[_0x344a('0x33')](_0x2d72c9[_0x344a('0x32')]);_0x49bbf8[_0x344a('0x34')]=_[_0x344a('0x35')](_0x49bbf8[_0x344a('0x31')],_0x49bbf8['query']);_0x3d25fe[_0x344a('0x36')]=_['intersection'](_0x49bbf8['model'],qs['fields'](_0x2d72c9[_0x344a('0x32')][_0x344a('0x37')]));_0x3d25fe[_0x344a('0x36')]=_0x3d25fe[_0x344a('0x36')][_0x344a('0x38')]?_0x3d25fe[_0x344a('0x36')]:_0x49bbf8['model'];if(!_0x2d72c9[_0x344a('0x32')][_0x344a('0x39')](_0x344a('0x3a'))){_0x3d25fe['limit']=qs[_0x344a('0x1d')](_0x2d72c9[_0x344a('0x32')][_0x344a('0x1d')]);_0x3d25fe[_0x344a('0x1c')]=qs[_0x344a('0x1c')](_0x2d72c9['query'][_0x344a('0x1c')]);}_0x3d25fe[_0x344a('0x3b')]=qs[_0x344a('0x3c')](_0x2d72c9[_0x344a('0x32')][_0x344a('0x3c')]);_0x3d25fe['where']=qs[_0x344a('0x34')](_[_0x344a('0x3d')](_0x2d72c9[_0x344a('0x32')],_0x49bbf8[_0x344a('0x34')]),_0x24965d);if(_0x2d72c9[_0x344a('0x32')]['filter']){_0x3d25fe[_0x344a('0x3e')]=_[_0x344a('0x3f')](_0x3d25fe[_0x344a('0x3e')],{'$or':_[_0x344a('0x2d')](_0x24965d,function(_0x13bf76){if(_0x13bf76[_0x344a('0x2f')]!==_0x344a('0x40')){var _0x339fcc={};_0x339fcc[_0x13bf76['name']]={'$like':'%'+_0x2d72c9[_0x344a('0x32')][_0x344a('0x41')]+'%'};return _0x339fcc;}})});}_0x3d25fe=_[_0x344a('0x3f')]({},_0x3d25fe,_0x2d72c9[_0x344a('0x42')]);var _0x2fc05f={'where':_0x3d25fe['where']};return db[_0x344a('0x2e')][_0x344a('0x1b')](_0x2fc05f)[_0x344a('0x24')](function(_0x1fb4f5){_0x593cf6[_0x344a('0x1b')]=_0x1fb4f5;if(_0x2d72c9[_0x344a('0x32')][_0x344a('0x43')]){_0x3d25fe[_0x344a('0x44')]=[{'all':!![]}];}return db[_0x344a('0x2e')]['findAll'](_0x3d25fe);})[_0x344a('0x24')](function(_0x1bad44){_0x593cf6[_0x344a('0x45')]=_0x1bad44;return _0x593cf6;})[_0x344a('0x24')](respondWithFilteredResult(_0x5b877d,_0x3d25fe))['catch'](handleError(_0x5b877d,null));};exports[_0x344a('0x46')]=function(_0x3069ca,_0x2b0ee9){var _0x41f25b={'raw':!![],'where':{'id':_0x3069ca[_0x344a('0x47')]['id']}},_0x1513d5={};_0x1513d5[_0x344a('0x31')]=_[_0x344a('0x33')](db[_0x344a('0x2e')][_0x344a('0x48')]);_0x1513d5[_0x344a('0x32')]=_['keys'](_0x3069ca[_0x344a('0x32')]);_0x1513d5[_0x344a('0x34')]=_['intersection'](_0x1513d5[_0x344a('0x31')],_0x1513d5[_0x344a('0x32')]);_0x41f25b['attributes']=_[_0x344a('0x35')](_0x1513d5[_0x344a('0x31')],qs['fields'](_0x3069ca[_0x344a('0x32')][_0x344a('0x37')]));_0x41f25b[_0x344a('0x36')]=_0x41f25b['attributes'][_0x344a('0x38')]?_0x41f25b['attributes']:_0x1513d5[_0x344a('0x31')];if(_0x3069ca[_0x344a('0x32')][_0x344a('0x43')]){_0x41f25b[_0x344a('0x44')]=[{'all':!![]}];}_0x41f25b=_['merge']({},_0x41f25b,_0x3069ca['options']);return db[_0x344a('0x2e')][_0x344a('0x49')](_0x41f25b)[_0x344a('0x24')](handleEntityNotFound(_0x2b0ee9,null))[_0x344a('0x24')](respondWithResult(_0x2b0ee9,null))[_0x344a('0x4a')](handleError(_0x2b0ee9,null));};exports[_0x344a('0x4b')]=function(_0x44962b,_0x23c214){return db[_0x344a('0x2e')][_0x344a('0x4b')](_0x44962b['body'],{})[_0x344a('0x24')](function(_0x2d9858){var _0x6fad37=_0x44962b[_0x344a('0x4c')]['get']({'plain':!![]});if(!_0x6fad37)throw new Error(_0x344a('0x4d'));if(_0x6fad37['role']==='user'){var _0xa6b6b5=_0x2d9858[_0x344a('0x26')]({'plain':!![]});var _0x5917cc=_0x344a('0x27');return db[_0x344a('0x4e')][_0x344a('0x49')]({'where':{'name':_0x5917cc,'userProfileId':_0x6fad37[_0x344a('0x4f')]},'raw':!![]})['then'](function(_0x225fce){if(_0x225fce&&_0x225fce[_0x344a('0x50')]===0x0){return db[_0x344a('0x28')][_0x344a('0x4b')]({'name':_0xa6b6b5[_0x344a('0x2a')],'resourceId':_0xa6b6b5['id'],'type':_0x225fce[_0x344a('0x2a')],'sectionId':_0x225fce['id']},{})[_0x344a('0x24')](function(){return _0x2d9858;});}else{return _0x2d9858;}})[_0x344a('0x4a')](function(_0x292357){logger[_0x344a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x292357);throw _0x292357;});}return _0x2d9858;})[_0x344a('0x24')](respondWithResult(_0x23c214,0xc9))['catch'](handleError(_0x23c214,null));};exports[_0x344a('0x23')]=function(_0xb744c6,_0x1d2f7a){if(_0xb744c6['body']['id']){delete _0xb744c6[_0x344a('0x51')]['id'];}return db[_0x344a('0x2e')][_0x344a('0x49')]({'where':{'id':_0xb744c6[_0x344a('0x47')]['id']}})[_0x344a('0x24')](handleEntityNotFound(_0x1d2f7a,null))[_0x344a('0x24')](saveUpdates(_0xb744c6[_0x344a('0x51')],null))[_0x344a('0x24')](respondWithResult(_0x1d2f7a,null))[_0x344a('0x4a')](handleError(_0x1d2f7a,null));};exports['destroy']=function(_0x2f828e,_0x311a39){return db[_0x344a('0x2e')][_0x344a('0x49')]({'where':{'id':_0x2f828e[_0x344a('0x47')]['id']}})['then'](handleEntityNotFound(_0x311a39,null))[_0x344a('0x24')](removeEntity(_0x311a39,null))[_0x344a('0x4a')](handleError(_0x311a39,null));};exports[_0x344a('0x52')]=function(_0x34d8c7,_0x493926,_0x1b981f){return db[_0x344a('0x2e')]['find']({'where':{'id':_0x34d8c7[_0x344a('0x47')]['id']},'attributes':[_0x344a('0x2a'),_0x344a('0x53'),_0x344a('0x54'),_0x344a('0x55')],'raw':!![]})[_0x344a('0x24')](handleEntityNotFound(_0x493926,null))[_0x344a('0x24')](function(_0x4b6eb2){if(_0x4b6eb2){if(!fs['existsSync'](path['join'](config[_0x344a('0x56')],_0x344a('0x57'),_0x4b6eb2[_0x344a('0x54')]))){throw new db[(_0x344a('0x58'))]['ValidationError'](_0x344a('0x59'));}if(_0x34d8c7['query']['exists']){return _0x493926['sendStatus'](0xc8);}return _0x493926['download'](path[_0x344a('0x5a')](config[_0x344a('0x56')],_0x344a('0x57'),_0x4b6eb2[_0x344a('0x54')]),util['format']('%s.%s',_0x4b6eb2['basename']||_0x4b6eb2[_0x344a('0x2a')],_0x4b6eb2[_0x344a('0x55')][_0x344a('0x5b')]()));}})[_0x344a('0x4a')](handleError(_0x493926,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 25e0093..9787979 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 _0xbc56=['rimraf','../../config/environment','exports','define','AnalyticExtractedReport','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x413d74,_0x5bab1b){var _0x177f90=function(_0x15e9de){while(--_0x15e9de){_0x413d74['push'](_0x413d74['shift']());}};_0x177f90(++_0x5bab1b);}(_0xbc56,0x185));var _0x6bc5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbc56[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x6bc5('0x0'));var logger=require(_0x6bc5('0x1'))(_0x6bc5('0x2'));var moment=require(_0x6bc5('0x3'));var BPromise=require(_0x6bc5('0x4'));var rp=require(_0x6bc5('0x5'));var fs=require('fs');var path=require(_0x6bc5('0x6'));var rimraf=require(_0x6bc5('0x7'));var config=require(_0x6bc5('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0x6bc5('0x9')]=function(_0x27fc40,_0x56a049){return _0x27fc40[_0x6bc5('0xa')](_0x6bc5('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd540=['./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xe229ca,_0xd415b9){var _0x3f6157=function(_0x2b1542){while(--_0x2b1542){_0xe229ca['push'](_0xe229ca['shift']());}};_0x3f6157(++_0xd415b9);}(_0xd540,0x1a3));var _0x0d54=function(_0x38941a,_0x390672){_0x38941a=_0x38941a-0x0;var _0x468c42=_0xd540[_0x38941a];return _0x468c42;};'use strict';var _=require(_0x0d54('0x0'));var util=require(_0x0d54('0x1'));var logger=require(_0x0d54('0x2'))(_0x0d54('0x3'));var moment=require(_0x0d54('0x4'));var BPromise=require(_0x0d54('0x5'));var rp=require(_0x0d54('0x6'));var fs=require('fs');var path=require(_0x0d54('0x7'));var rimraf=require(_0x0d54('0x8'));var config=require(_0x0d54('0x9'));var attributes=require(_0x0d54('0xa'));module[_0x0d54('0xb')]=function(_0x55a9c3,_0x148190){return _0x55a9c3['define'](_0x0d54('0xc'),attributes,{'tableName':'analytics_extracted_reports','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 dc91cb1..e029392 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 _0xa24e=['code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2c0c66,_0x400cb4){var _0x26a228=function(_0x1c1f79){while(--_0x1c1f79){_0x2c0c66['push'](_0x2c0c66['shift']());}};_0x26a228(++_0x400cb4);}(_0xa24e,0x154));var _0xea24=function(_0x5023cb,_0x5ae9a6){_0x5023cb=_0x5023cb-0x0;var _0x52c5d6=_0xa24e[_0x5023cb];return _0x52c5d6;};'use strict';var _=require('lodash');var util=require(_0xea24('0x0'));var moment=require(_0xea24('0x1'));var BPromise=require(_0xea24('0x2'));var rs=require(_0xea24('0x3'));var fs=require('fs');var Redis=require(_0xea24('0x4'));var db=require(_0xea24('0x5'))['db'];var utils=require(_0xea24('0x6'));var logger=require(_0xea24('0x7'))(_0xea24('0x8'));var config=require(_0xea24('0x9'));var jayson=require(_0xea24('0xa'));var client=jayson[_0xea24('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d7ea8,_0x8f6e51,_0x379871){return new BPromise(function(_0x3af3e9,_0x2d8882){return client[_0xea24('0xc')](_0x4d7ea8,_0x379871)[_0xea24('0xd')](function(_0x3d58bc){logger[_0xea24('0xe')](_0xea24('0xf'),_0x8f6e51,_0xea24('0x10'));logger[_0xea24('0x11')](_0xea24('0x12'),_0x8f6e51,_0xea24('0x10'),JSON[_0xea24('0x13')](_0x3d58bc));if(_0x3d58bc['error']){if(_0x3d58bc['error'][_0xea24('0x14')]===0x1f4){logger[_0xea24('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x8f6e51,_0x3d58bc['error'][_0xea24('0x16')]);return _0x2d8882(_0x3d58bc[_0xea24('0x15')][_0xea24('0x16')]);}logger[_0xea24('0x15')](_0xea24('0xf'),_0x8f6e51,_0x3d58bc[_0xea24('0x15')][_0xea24('0x16')]);return _0x3af3e9(_0x3d58bc[_0xea24('0x15')]['message']);}else{logger[_0xea24('0xe')](_0xea24('0xf'),_0x8f6e51,_0xea24('0x10'));_0x3af3e9(_0x3d58bc[_0xea24('0x17')][_0xea24('0x16')]);}})['catch'](function(_0x3e0f05){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x8f6e51,_0x3e0f05);_0x2d8882(_0x3e0f05);});});}
\ No newline at end of file
+var _0x6fce=['AnalyticExtractedReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info'];(function(_0xf428f2,_0x409ca6){var _0x3a9541=function(_0x1433bc){while(--_0x1433bc){_0xf428f2['push'](_0xf428f2['shift']());}};_0x3a9541(++_0x409ca6);}(_0x6fce,0x67));var _0xe6fc=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x6fce[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xe6fc('0x0'));var util=require(_0xe6fc('0x1'));var moment=require('moment');var BPromise=require(_0xe6fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6fc('0x3'));var db=require(_0xe6fc('0x4'))['db'];var utils=require(_0xe6fc('0x5'));var logger=require('../../config/logger')(_0xe6fc('0x6'));var config=require(_0xe6fc('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1cce09,_0x4686ee,_0x5e5c8c){return new BPromise(function(_0x2d7c51,_0x1d7bd6){return client[_0xe6fc('0x8')](_0x1cce09,_0x5e5c8c)[_0xe6fc('0x9')](function(_0x25858d){logger[_0xe6fc('0xa')](_0xe6fc('0xb'),_0x4686ee,'request\x20sent');logger[_0xe6fc('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4686ee,'request\x20sent',JSON['stringify'](_0x25858d));if(_0x25858d['error']){if(_0x25858d[_0xe6fc('0xd')][_0xe6fc('0xe')]===0x1f4){logger['error'](_0xe6fc('0xb'),_0x4686ee,_0x25858d[_0xe6fc('0xd')][_0xe6fc('0xf')]);return _0x1d7bd6(_0x25858d['error'][_0xe6fc('0xf')]);}logger[_0xe6fc('0xd')](_0xe6fc('0xb'),_0x4686ee,_0x25858d[_0xe6fc('0xd')]['message']);return _0x2d7c51(_0x25858d[_0xe6fc('0xd')]['message']);}else{logger[_0xe6fc('0xa')](_0xe6fc('0xb'),_0x4686ee,_0xe6fc('0x10'));_0x2d7c51(_0x25858d[_0xe6fc('0x11')][_0xe6fc('0xf')]);}})[_0xe6fc('0x12')](function(_0x1e1e0b){logger[_0xe6fc('0xd')](_0xe6fc('0xb'),_0x4686ee,_0x1e1e0b);_0x1d7bd6(_0x1e1e0b);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 56c883a..9165379 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 _0xb37f=['Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0xb37f,0x199));var _0xfb37=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xb37f[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0xfb37('0x0'));var util=require(_0xfb37('0x1'));var path=require(_0xfb37('0x2'));var timeout=require(_0xfb37('0x3'));var express=require(_0xfb37('0x4'));var router=express[_0xfb37('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfb37('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb37('0x7'));var controller=require(_0xfb37('0x8'));router[_0xfb37('0x9')]('/',auth[_0xfb37('0xa')](),controller[_0xfb37('0xb')]);router[_0xfb37('0x9')](_0xfb37('0xc'),auth[_0xfb37('0xa')](),controller[_0xfb37('0xd')]);router[_0xfb37('0x9')](_0xfb37('0xe'),auth['isAuthenticated'](),controller[_0xfb37('0xf')]);router[_0xfb37('0x10')]('/',auth[_0xfb37('0xa')](),controller[_0xfb37('0x11')]);router[_0xfb37('0x12')](_0xfb37('0xc'),auth[_0xfb37('0xa')](),controller[_0xfb37('0x13')]);router[_0xfb37('0x14')](_0xfb37('0xc'),auth[_0xfb37('0xa')](),controller[_0xfb37('0x15')]);module[_0xfb37('0x16')]=router;
\ No newline at end of file
+var _0x12f1=['index','/:id/download','create','put','/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x481560,_0x511c60){var _0x52c8aa=function(_0x547f28){while(--_0x547f28){_0x481560['push'](_0x481560['shift']());}};_0x52c8aa(++_0x511c60);}(_0x12f1,0xec));var _0x112f=function(_0x54e374,_0x5d5cd9){_0x54e374=_0x54e374-0x0;var _0x23f522=_0x12f1[_0x54e374];return _0x23f522;};'use strict';var multer=require(_0x112f('0x0'));var util=require(_0x112f('0x1'));var path=require(_0x112f('0x2'));var timeout=require('connect-timeout');var express=require(_0x112f('0x3'));var router=express[_0x112f('0x4')]();var fs_extra=require(_0x112f('0x5'));var auth=require(_0x112f('0x6'));var interaction=require(_0x112f('0x7'));var config=require('../../config/environment');var controller=require(_0x112f('0x8'));router[_0x112f('0x9')]('/',auth[_0x112f('0xa')](),controller[_0x112f('0xb')]);router['get']('/:id',auth[_0x112f('0xa')](),controller['show']);router[_0x112f('0x9')](_0x112f('0xc'),auth[_0x112f('0xa')](),controller['download']);router['post']('/',auth[_0x112f('0xa')](),controller[_0x112f('0xd')]);router[_0x112f('0xe')](_0x112f('0xf'),auth[_0x112f('0xa')](),controller[_0x112f('0x10')]);router['delete'](_0x112f('0xf'),auth['isAuthenticated'](),controller[_0x112f('0x11')]);module[_0x112f('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e8d9303..0e2e54c 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 _0x326f=['STRING','BOOLEAN','sequelize'];(function(_0x3afc75,_0x32dc5b){var _0x16f415=function(_0x405862){while(--_0x405862){_0x3afc75['push'](_0x3afc75['shift']());}};_0x16f415(++_0x32dc5b);}(_0x326f,0xd1));var _0xf326=function(_0x4255d5,_0x5b9e5f){_0x4255d5=_0x4255d5-0x0;var _0x46064=_0x326f[_0x4255d5];return _0x46064;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xf326('0x1')]},'function':{'type':Sequelize[_0xf326('0x1')]},'format':{'type':Sequelize[_0xf326('0x1')]},'groupBy':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf326('0x1')]},'custom':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x3671d7,_0x586bbc){var _0xf9f6e6=function(_0x80d81){while(--_0x80d81){_0x3671d7['push'](_0x3671d7['shift']());}};_0xf9f6e6(++_0x586bbc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index fc1304c..7455eb9 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 _0x4483=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','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','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','create','bulkCreate','body','find','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x4483,0x1a3));var _0x3448=function(_0x2f551b,_0x232bf8){_0x2f551b=_0x2f551b-0x0;var _0x3ee6f9=_0x4483[_0x2f551b];return _0x3ee6f9;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x298ae6,_0x38fbb1){_0x38fbb1=_0x38fbb1||0xcc;return function(_0x5f52bd){if(_0x5f52bd){return _0x298ae6[_0x3448('0x1b')](_0x38fbb1);}return _0x298ae6[_0x3448('0x1c')](_0x38fbb1)[_0x3448('0x1d')]();};}function respondWithResult(_0x549306,_0x14104c){_0x14104c=_0x14104c||0xc8;return function(_0x2952a6){if(_0x2952a6){return _0x549306['status'](_0x14104c)[_0x3448('0x1e')](_0x2952a6);}};}function respondWithFilteredResult(_0x2c2da6,_0x46784f){return function(_0x4fc70f){if(_0x4fc70f){var _0x472518=_0x4fc70f[_0x3448('0x1f')],_0x28f5b9=_0x46784f[_0x3448('0x20')],_0x13610a=_0x46784f[_0x3448('0x20')]+_0x46784f[_0x3448('0x21')],_0x30f8dd;if(_0x13610a>=_0x472518){_0x13610a=_0x472518;_0x30f8dd=0xc8;}else{_0x30f8dd=0xce;}_0x2c2da6['status'](_0x30f8dd);return _0x2c2da6[_0x3448('0x22')]('Content-Range',_0x28f5b9+'-'+_0x13610a+'/'+_0x472518)['json'](_0x4fc70f);}return null;};}function patchUpdates(_0x53f8e7){return function(_0x1e9774){try{jsonpatch[_0x3448('0x23')](_0x1e9774,_0x53f8e7,!![]);}catch(_0xda4040){return BPromise['reject'](_0xda4040);}return _0x1e9774[_0x3448('0x24')]();};}function saveUpdates(_0x392c8d,_0x317de6){return function(_0x18608e){if(_0x18608e){return _0x18608e[_0x3448('0x25')](_0x392c8d)[_0x3448('0x26')](function(_0x5db78f){return _0x5db78f;});}return null;};}function removeEntity(_0x54c7ee,_0x4e6716){return function(_0x1b3d5a){if(_0x1b3d5a){return _0x1b3d5a[_0x3448('0x27')]()['then'](function(){_0x54c7ee['status'](0xcc)[_0x3448('0x1d')]();});}};}function handleEntityNotFound(_0x4371d6,_0x22ad5c){return function(_0x4368c7){if(!_0x4368c7){_0x4371d6[_0x3448('0x1b')](0x194);}return _0x4368c7;};}function handleError(_0x566ff5,_0x229ce7){_0x229ce7=_0x229ce7||0x1f4;return function(_0x1b5c49){logger[_0x3448('0x28')](_0x1b5c49[_0x3448('0x29')]);if(_0x1b5c49[_0x3448('0x2a')]){delete _0x1b5c49['name'];}_0x566ff5[_0x3448('0x1c')](_0x229ce7)[_0x3448('0x2b')](_0x1b5c49);};}exports['index']=function(_0x19a479,_0x12c22d){var _0x310912={},_0x1bd34c={},_0x38fab2={'count':0x0,'rows':[]};var _0x35f026=_[_0x3448('0x2c')](db[_0x3448('0x2d')]['rawAttributes'],function(_0x3307dc){return{'name':_0x3307dc[_0x3448('0x2e')],'type':_0x3307dc[_0x3448('0x2f')]['key']};});_0x1bd34c[_0x3448('0x30')]=_['map'](_0x35f026,'name');_0x1bd34c['query']=_[_0x3448('0x31')](_0x19a479[_0x3448('0x32')]);_0x1bd34c['filters']=_['intersection'](_0x1bd34c[_0x3448('0x30')],_0x1bd34c[_0x3448('0x32')]);_0x310912[_0x3448('0x33')]=_[_0x3448('0x34')](_0x1bd34c['model'],qs[_0x3448('0x35')](_0x19a479[_0x3448('0x32')][_0x3448('0x35')]));_0x310912['attributes']=_0x310912[_0x3448('0x33')][_0x3448('0x36')]?_0x310912['attributes']:_0x1bd34c['model'];if(!_0x19a479[_0x3448('0x32')][_0x3448('0x37')](_0x3448('0x38'))){_0x310912[_0x3448('0x21')]=qs['limit'](_0x19a479[_0x3448('0x32')][_0x3448('0x21')]);_0x310912[_0x3448('0x20')]=qs[_0x3448('0x20')](_0x19a479['query'][_0x3448('0x20')]);}_0x310912[_0x3448('0x39')]=qs['sort'](_0x19a479[_0x3448('0x32')][_0x3448('0x3a')]);_0x310912[_0x3448('0x3b')]=qs[_0x3448('0x3c')](_[_0x3448('0x3d')](_0x19a479[_0x3448('0x32')],_0x1bd34c[_0x3448('0x3c')]),_0x35f026);if(_0x19a479[_0x3448('0x32')][_0x3448('0x3e')]){_0x310912['where']=_['merge'](_0x310912[_0x3448('0x3b')],{'$or':_['map'](_0x35f026,function(_0x22bb31){if(_0x22bb31[_0x3448('0x2f')]!==_0x3448('0x3f')){var _0xf26d4e={};_0xf26d4e[_0x22bb31['name']]={'$like':'%'+_0x19a479[_0x3448('0x32')][_0x3448('0x3e')]+'%'};return _0xf26d4e;}})});}_0x310912=_[_0x3448('0x40')]({},_0x310912,_0x19a479[_0x3448('0x41')]);var _0x2e83c6={'where':_0x310912[_0x3448('0x3b')]};return db[_0x3448('0x2d')][_0x3448('0x1f')](_0x2e83c6)[_0x3448('0x26')](function(_0x5a58c5){_0x38fab2[_0x3448('0x1f')]=_0x5a58c5;if(_0x19a479[_0x3448('0x32')][_0x3448('0x42')]){_0x310912[_0x3448('0x43')]=[{'all':!![]}];}return db[_0x3448('0x2d')]['findAll'](_0x310912);})[_0x3448('0x26')](function(_0x1b7284){_0x38fab2[_0x3448('0x44')]=_0x1b7284;return _0x38fab2;})[_0x3448('0x26')](respondWithFilteredResult(_0x12c22d,_0x310912))[_0x3448('0x45')](handleError(_0x12c22d,null));};exports[_0x3448('0x46')]=function(_0x415985,_0x3db5f1){var _0x4a8f80={'raw':![],'where':{'id':_0x415985[_0x3448('0x47')]['id']}},_0x399246={};_0x399246[_0x3448('0x30')]=_['keys'](db[_0x3448('0x2d')][_0x3448('0x48')]);_0x399246[_0x3448('0x32')]=_[_0x3448('0x31')](_0x415985[_0x3448('0x32')]);_0x399246[_0x3448('0x3c')]=_[_0x3448('0x34')](_0x399246['model'],_0x399246[_0x3448('0x32')]);_0x4a8f80[_0x3448('0x33')]=_[_0x3448('0x34')](_0x399246[_0x3448('0x30')],qs[_0x3448('0x35')](_0x415985[_0x3448('0x32')]['fields']));_0x4a8f80[_0x3448('0x33')]=_0x4a8f80['attributes']['length']?_0x4a8f80[_0x3448('0x33')]:_0x399246[_0x3448('0x30')];if(_0x415985['query'][_0x3448('0x42')]){_0x4a8f80[_0x3448('0x43')]=[{'all':!![]}];}_0x4a8f80=_['merge']({},_0x4a8f80,_0x415985[_0x3448('0x41')]);return db[_0x3448('0x2d')]['find'](_0x4a8f80)[_0x3448('0x26')](handleEntityNotFound(_0x3db5f1,null))[_0x3448('0x26')](respondWithResult(_0x3db5f1,null))[_0x3448('0x45')](handleError(_0x3db5f1,null));};exports[_0x3448('0x49')]=function(_0x34d19e,_0x3e3208){return db[_0x3448('0x2d')]['create'](_0x34d19e['body'],{})[_0x3448('0x26')](respondWithResult(_0x3e3208,0xc9))[_0x3448('0x45')](handleError(_0x3e3208,null));};exports[_0x3448('0x4a')]=function(_0x3f48e3,_0x527259){return db[_0x3448('0x2d')][_0x3448('0x4a')](_0x3f48e3[_0x3448('0x4b')],{'raw':![],'individualHooks':!![]})[_0x3448('0x26')](respondWithResult(_0x527259,0xc9))[_0x3448('0x45')](handleError(_0x527259,null));};exports['update']=function(_0x3edd60,_0x5636ab){if(_0x3edd60[_0x3448('0x4b')]['id']){delete _0x3edd60[_0x3448('0x4b')]['id'];}return db['AnalyticFieldReport'][_0x3448('0x4c')]({'where':{'id':_0x3edd60[_0x3448('0x47')]['id']}})[_0x3448('0x26')](handleEntityNotFound(_0x5636ab,null))[_0x3448('0x26')](saveUpdates(_0x3edd60[_0x3448('0x4b')],null))[_0x3448('0x26')](respondWithResult(_0x5636ab,null))[_0x3448('0x45')](handleError(_0x5636ab,null));};exports['destroy']=function(_0x23dbda,_0x9fbee8){return db['AnalyticFieldReport']['find']({'where':{'id':_0x23dbda[_0x3448('0x47')]['id']}})[_0x3448('0x26')](handleEntityNotFound(_0x9fbee8,null))['then'](removeEntity(_0x9fbee8,null))['catch'](handleError(_0x9fbee8,null));};exports[_0x3448('0x4d')]=function(_0xb6c293,_0x2f795d){return db[_0x3448('0x2d')][_0x3448('0x27')]({'where':{'id':_0xb6c293[_0x3448('0x32')][_0x3448('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2f795d,0xcc))['catch'](handleError(_0x2f795d,null));};exports['addFields']=function(_0xab2c58,_0x3c734a,_0x5cf3fe){return db[_0x3448('0x4f')][_0x3448('0x50')]({'where':{'id':_0xab2c58['params']['id']}})[_0x3448('0x26')](handleEntityNotFound(_0x3c734a,null))[_0x3448('0x26')](function(_0x492713){if(_0x492713){return db[_0x3448('0x51')][_0x3448('0x52')](function(_0x1bfa93){return db[_0x3448('0x2d')][_0x3448('0x27')]({'where':{'CustomReportId':_0xab2c58[_0x3448('0x47')]['id']},'transaction':_0x1bfa93})[_0x3448('0x26')](function(_0x1b7d87){var _0x4520a1=_['map'](_0xab2c58[_0x3448('0x4b')],function(_0x5f358e){delete _0x5f358e['id'];_0x5f358e[_0x3448('0x53')]=_0xab2c58[_0x3448('0x47')]['id'];return _0x5f358e;});return db[_0x3448('0x2d')][_0x3448('0x4a')](_0x4520a1,{'transaction':_0x1bfa93});});})[_0x3448('0x26')](function(){return db[_0x3448('0x2d')]['findAll']({'where':{'CustomReportId':_0xab2c58[_0x3448('0x47')]['id']}});});}})['then'](respondWithResult(_0x3c734a,null))[_0x3448('0x45')](handleError(_0x3c734a,null));};
\ No newline at end of file
+var _0xcb91=['reject','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','fields','find','catch','create','body','bulkCreate','bulkDestroy','addFields','findOne','sequelize','CustomReportId','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply'];(function(_0x4d9403,_0x33c5f0){var _0x5eef11=function(_0x50bb5c){while(--_0x50bb5c){_0x4d9403['push'](_0x4d9403['shift']());}};_0x5eef11(++_0x33c5f0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xcb91[_0x57474e];return _0xfaae8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=_0x5806d8[_0x1cb9('0x1a')],_0xd446a3=_0x3e2d11[_0x1cb9('0x1b')],_0x3cc765=_0x3e2d11[_0x1cb9('0x1b')]+_0x3e2d11[_0x1cb9('0x1c')],_0x3904b7;if(_0x3cc765>=_0x5572cb){_0x3cc765=_0x5572cb;_0x3904b7=0xc8;}else{_0x3904b7=0xce;}_0x8dfa55['status'](_0x3904b7);return _0x8dfa55['set'](_0x1cb9('0x1d'),_0xd446a3+'-'+_0x3cc765+'/'+_0x5572cb)[_0x1cb9('0x19')](_0x5806d8);}return null;};}function patchUpdates(_0x2b2669){return function(_0x31481a){try{jsonpatch[_0x1cb9('0x1e')](_0x31481a,_0x2b2669,!![]);}catch(_0x4014de){return BPromise[_0x1cb9('0x1f')](_0x4014de);}return _0x31481a['save']();};}function saveUpdates(_0x559bcc,_0x1a5a72){return function(_0x5dbfae){if(_0x5dbfae){return _0x5dbfae[_0x1cb9('0x20')](_0x559bcc)[_0x1cb9('0x21')](function(_0x523b26){return _0x523b26;});}return null;};}function removeEntity(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x22')]()[_0x1cb9('0x21')](function(){_0x599275[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x59ebea,_0x55b232){return function(_0x6c6f61){if(!_0x6c6f61){_0x59ebea['sendStatus'](0x194);}return _0x6c6f61;};}function handleError(_0x10a419,_0x2b1275){_0x2b1275=_0x2b1275||0x1f4;return function(_0x69b4c8){logger[_0x1cb9('0x23')](_0x69b4c8[_0x1cb9('0x24')]);if(_0x69b4c8['name']){delete _0x69b4c8[_0x1cb9('0x25')];}_0x10a419[_0x1cb9('0x17')](_0x2b1275)['send'](_0x69b4c8);};}exports[_0x1cb9('0x26')]=function(_0x21effa,_0x41a9a0){var _0x1804fd={},_0x406821={},_0x21d6f5={'count':0x0,'rows':[]};var _0x2e28fe=_[_0x1cb9('0x27')](db[_0x1cb9('0x28')][_0x1cb9('0x29')],function(_0x48888d){return{'name':_0x48888d[_0x1cb9('0x2a')],'type':_0x48888d['type'][_0x1cb9('0x2b')]};});_0x406821['model']=_[_0x1cb9('0x27')](_0x2e28fe,_0x1cb9('0x25'));_0x406821[_0x1cb9('0x2c')]=_[_0x1cb9('0x2d')](_0x21effa['query']);_0x406821[_0x1cb9('0x2e')]=_['intersection'](_0x406821[_0x1cb9('0x2f')],_0x406821[_0x1cb9('0x2c')]);_0x1804fd[_0x1cb9('0x30')]=_['intersection'](_0x406821[_0x1cb9('0x2f')],qs['fields'](_0x21effa[_0x1cb9('0x2c')]['fields']));_0x1804fd[_0x1cb9('0x30')]=_0x1804fd[_0x1cb9('0x30')][_0x1cb9('0x31')]?_0x1804fd[_0x1cb9('0x30')]:_0x406821['model'];if(!_0x21effa[_0x1cb9('0x2c')][_0x1cb9('0x32')](_0x1cb9('0x33'))){_0x1804fd[_0x1cb9('0x1c')]=qs[_0x1cb9('0x1c')](_0x21effa[_0x1cb9('0x2c')][_0x1cb9('0x1c')]);_0x1804fd[_0x1cb9('0x1b')]=qs[_0x1cb9('0x1b')](_0x21effa[_0x1cb9('0x2c')][_0x1cb9('0x1b')]);}_0x1804fd[_0x1cb9('0x34')]=qs[_0x1cb9('0x35')](_0x21effa['query']['sort']);_0x1804fd[_0x1cb9('0x36')]=qs[_0x1cb9('0x2e')](_[_0x1cb9('0x37')](_0x21effa[_0x1cb9('0x2c')],_0x406821[_0x1cb9('0x2e')]),_0x2e28fe);if(_0x21effa[_0x1cb9('0x2c')][_0x1cb9('0x38')]){_0x1804fd[_0x1cb9('0x36')]=_['merge'](_0x1804fd[_0x1cb9('0x36')],{'$or':_[_0x1cb9('0x27')](_0x2e28fe,function(_0xefe136){if(_0xefe136['type']!==_0x1cb9('0x39')){var _0x5c7cd0={};_0x5c7cd0[_0xefe136[_0x1cb9('0x25')]]={'$like':'%'+_0x21effa['query'][_0x1cb9('0x38')]+'%'};return _0x5c7cd0;}})});}_0x1804fd=_[_0x1cb9('0x3a')]({},_0x1804fd,_0x21effa[_0x1cb9('0x3b')]);var _0x2bcacd={'where':_0x1804fd[_0x1cb9('0x36')]};return db[_0x1cb9('0x28')][_0x1cb9('0x1a')](_0x2bcacd)['then'](function(_0x4ca19e){_0x21d6f5[_0x1cb9('0x1a')]=_0x4ca19e;if(_0x21effa[_0x1cb9('0x2c')][_0x1cb9('0x3c')]){_0x1804fd[_0x1cb9('0x3d')]=[{'all':!![]}];}return db[_0x1cb9('0x28')][_0x1cb9('0x3e')](_0x1804fd);})[_0x1cb9('0x21')](function(_0x4a670c){_0x21d6f5[_0x1cb9('0x3f')]=_0x4a670c;return _0x21d6f5;})['then'](respondWithFilteredResult(_0x41a9a0,_0x1804fd))['catch'](handleError(_0x41a9a0,null));};exports['show']=function(_0x409c62,_0x397ff9){var _0x1bf51c={'raw':![],'where':{'id':_0x409c62[_0x1cb9('0x40')]['id']}},_0x2e3cf3={};_0x2e3cf3['model']=_[_0x1cb9('0x2d')](db['AnalyticFieldReport'][_0x1cb9('0x29')]);_0x2e3cf3[_0x1cb9('0x2c')]=_[_0x1cb9('0x2d')](_0x409c62['query']);_0x2e3cf3[_0x1cb9('0x2e')]=_['intersection'](_0x2e3cf3[_0x1cb9('0x2f')],_0x2e3cf3[_0x1cb9('0x2c')]);_0x1bf51c['attributes']=_['intersection'](_0x2e3cf3[_0x1cb9('0x2f')],qs[_0x1cb9('0x41')](_0x409c62[_0x1cb9('0x2c')][_0x1cb9('0x41')]));_0x1bf51c[_0x1cb9('0x30')]=_0x1bf51c['attributes'][_0x1cb9('0x31')]?_0x1bf51c['attributes']:_0x2e3cf3['model'];if(_0x409c62['query'][_0x1cb9('0x3c')]){_0x1bf51c[_0x1cb9('0x3d')]=[{'all':!![]}];}_0x1bf51c=_[_0x1cb9('0x3a')]({},_0x1bf51c,_0x409c62[_0x1cb9('0x3b')]);return db[_0x1cb9('0x28')][_0x1cb9('0x42')](_0x1bf51c)[_0x1cb9('0x21')](handleEntityNotFound(_0x397ff9,null))[_0x1cb9('0x21')](respondWithResult(_0x397ff9,null))[_0x1cb9('0x43')](handleError(_0x397ff9,null));};exports[_0x1cb9('0x44')]=function(_0x3ea88c,_0x4ce899){return db[_0x1cb9('0x28')][_0x1cb9('0x44')](_0x3ea88c[_0x1cb9('0x45')],{})['then'](respondWithResult(_0x4ce899,0xc9))[_0x1cb9('0x43')](handleError(_0x4ce899,null));};exports[_0x1cb9('0x46')]=function(_0x3c6044,_0x2efdbb){return db[_0x1cb9('0x28')]['bulkCreate'](_0x3c6044[_0x1cb9('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2efdbb,0xc9))[_0x1cb9('0x43')](handleError(_0x2efdbb,null));};exports['update']=function(_0x1cf2ee,_0x3aed49){if(_0x1cf2ee[_0x1cb9('0x45')]['id']){delete _0x1cf2ee[_0x1cb9('0x45')]['id'];}return db['AnalyticFieldReport'][_0x1cb9('0x42')]({'where':{'id':_0x1cf2ee[_0x1cb9('0x40')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x3aed49,null))[_0x1cb9('0x21')](saveUpdates(_0x1cf2ee[_0x1cb9('0x45')],null))[_0x1cb9('0x21')](respondWithResult(_0x3aed49,null))[_0x1cb9('0x43')](handleError(_0x3aed49,null));};exports[_0x1cb9('0x22')]=function(_0xbb500e,_0x17f10e){return db['AnalyticFieldReport']['find']({'where':{'id':_0xbb500e[_0x1cb9('0x40')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x17f10e,null))[_0x1cb9('0x21')](removeEntity(_0x17f10e,null))[_0x1cb9('0x43')](handleError(_0x17f10e,null));};exports[_0x1cb9('0x47')]=function(_0x2d076b,_0x367dd7){return db[_0x1cb9('0x28')][_0x1cb9('0x22')]({'where':{'id':_0x2d076b[_0x1cb9('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x1cb9('0x21')](respondWithResult(_0x367dd7,0xcc))['catch'](handleError(_0x367dd7,null));};exports[_0x1cb9('0x48')]=function(_0x5201e8,_0x135795,_0x53c002){return db['AnalyticCustomReport'][_0x1cb9('0x49')]({'where':{'id':_0x5201e8[_0x1cb9('0x40')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x135795,null))['then'](function(_0x3c157f){if(_0x3c157f){return db[_0x1cb9('0x4a')]['transaction'](function(_0x571b33){return db[_0x1cb9('0x28')][_0x1cb9('0x22')]({'where':{'CustomReportId':_0x5201e8[_0x1cb9('0x40')]['id']},'transaction':_0x571b33})[_0x1cb9('0x21')](function(_0x3de325){var _0x310d6d=_[_0x1cb9('0x27')](_0x5201e8['body'],function(_0x345ddd){delete _0x345ddd['id'];_0x345ddd[_0x1cb9('0x4b')]=_0x5201e8[_0x1cb9('0x40')]['id'];return _0x345ddd;});return db['AnalyticFieldReport'][_0x1cb9('0x46')](_0x310d6d,{'transaction':_0x571b33});});})[_0x1cb9('0x21')](function(){return db[_0x1cb9('0x28')][_0x1cb9('0x3e')]({'where':{'CustomReportId':_0x5201e8[_0x1cb9('0x40')]['id']}});});}})[_0x1cb9('0x21')](respondWithResult(_0x135795,null))['catch'](handleError(_0x135795,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index ef3df7c..eb27643 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 _0x3995=['util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3995,0x178));var _0x5399=function(_0x20e75e,_0x421a74){_0x20e75e=_0x20e75e-0x0;var _0x549de7=_0x3995[_0x20e75e];return _0x549de7;};'use strict';var _=require(_0x5399('0x0'));var util=require(_0x5399('0x1'));var logger=require('../../config/logger')(_0x5399('0x2'));var moment=require(_0x5399('0x3'));var BPromise=require(_0x5399('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5399('0x5'));var rimraf=require(_0x5399('0x6'));var config=require(_0x5399('0x7'));var attributes=require(_0x5399('0x8'));module[_0x5399('0x9')]=function(_0x4b411f,_0x11fe3d){return _0x4b411f[_0x5399('0xa')](_0x5399('0xb'),attributes,{'tableName':_0x5399('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x669a=['AnalyticFieldReport','analytics_report_fields','util','../../config/logger','bluebird','path','../../config/environment','exports','define'];(function(_0x471fcd,_0x153a44){var _0x4b716b=function(_0xddc14e){while(--_0xddc14e){_0x471fcd['push'](_0x471fcd['shift']());}};_0x4b716b(++_0x153a44);}(_0x669a,0x173));var _0xa669=function(_0x1ad948,_0x510b3f){_0x1ad948=_0x1ad948-0x0;var _0x20174b=_0x669a[_0x1ad948];return _0x20174b;};'use strict';var _=require('lodash');var util=require(_0xa669('0x0'));var logger=require(_0xa669('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa669('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa669('0x3'));var rimraf=require('rimraf');var config=require(_0xa669('0x4'));var attributes=require('./analyticFieldReport.attributes');module[_0xa669('0x5')]=function(_0x149a0c,_0x3e7afa){return _0x149a0c[_0xa669('0x6')](_0xa669('0x7'),attributes,{'tableName':_0xa669('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 152a020..2343bf1 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 _0xae7b=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3c8499,_0x1e052e){var _0x51d346=function(_0x311729){while(--_0x311729){_0x3c8499['push'](_0x3c8499['shift']());}};_0x51d346(++_0x1e052e);}(_0xae7b,0x13c));var _0xbae7=function(_0x5cd70a,_0x51f70a){_0x5cd70a=_0x5cd70a-0x0;var _0x28d47e=_0xae7b[_0x5cd70a];return _0x28d47e;};'use strict';var _=require(_0xbae7('0x0'));var util=require(_0xbae7('0x1'));var moment=require(_0xbae7('0x2'));var BPromise=require(_0xbae7('0x3'));var rs=require(_0xbae7('0x4'));var fs=require('fs');var Redis=require(_0xbae7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbae7('0x6'));var logger=require('../../config/logger')(_0xbae7('0x7'));var config=require(_0xbae7('0x8'));var jayson=require(_0xbae7('0x9'));var client=jayson[_0xbae7('0xa')][_0xbae7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d63a9,_0x590ce0,_0x3117e9){return new BPromise(function(_0x4b4358,_0x4614d4){return client[_0xbae7('0xc')](_0x3d63a9,_0x3117e9)[_0xbae7('0xd')](function(_0x40652a){logger['info'](_0xbae7('0xe'),_0x590ce0,_0xbae7('0xf'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x590ce0,_0xbae7('0xf'),JSON[_0xbae7('0x10')](_0x40652a));if(_0x40652a[_0xbae7('0x11')]){if(_0x40652a[_0xbae7('0x11')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x590ce0,_0x40652a['error'][_0xbae7('0x12')]);return _0x4614d4(_0x40652a[_0xbae7('0x11')]['message']);}logger[_0xbae7('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x590ce0,_0x40652a[_0xbae7('0x11')][_0xbae7('0x12')]);return _0x4b4358(_0x40652a[_0xbae7('0x11')]['message']);}else{logger[_0xbae7('0x13')](_0xbae7('0xe'),_0x590ce0,'request\x20sent');_0x4b4358(_0x40652a[_0xbae7('0x14')][_0xbae7('0x12')]);}})[_0xbae7('0x15')](function(_0x3af6ef){logger[_0xbae7('0x11')](_0xbae7('0xe'),_0x590ce0,_0x3af6ef);_0x4614d4(_0x3af6ef);});});}
\ No newline at end of file
+var _0x1f64=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x1f64,0x15c));var _0x41f6=function(_0x47c83c,_0x19f3f7){_0x47c83c=_0x47c83c-0x0;var _0xeed78c=_0x1f64[_0x47c83c];return _0xeed78c;};'use strict';var _=require(_0x41f6('0x0'));var util=require(_0x41f6('0x1'));var moment=require(_0x41f6('0x2'));var BPromise=require('bluebird');var rs=require(_0x41f6('0x3'));var fs=require('fs');var Redis=require(_0x41f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x41f6('0x5'));var logger=require(_0x41f6('0x6'))(_0x41f6('0x7'));var config=require(_0x41f6('0x8'));var jayson=require(_0x41f6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39e757,_0x265043,_0x3e5f9b){return new BPromise(function(_0x2e655a,_0x136032){return client[_0x41f6('0xa')](_0x39e757,_0x3e5f9b)['then'](function(_0xb3c367){logger['info'](_0x41f6('0xb'),_0x265043,'request\x20sent');logger[_0x41f6('0xc')](_0x41f6('0xd'),_0x265043,'request\x20sent',JSON[_0x41f6('0xe')](_0xb3c367));if(_0xb3c367[_0x41f6('0xf')]){if(_0xb3c367[_0x41f6('0xf')][_0x41f6('0x10')]===0x1f4){logger[_0x41f6('0xf')](_0x41f6('0xb'),_0x265043,_0xb3c367[_0x41f6('0xf')][_0x41f6('0x11')]);return _0x136032(_0xb3c367['error']['message']);}logger[_0x41f6('0xf')](_0x41f6('0xb'),_0x265043,_0xb3c367[_0x41f6('0xf')][_0x41f6('0x11')]);return _0x2e655a(_0xb3c367[_0x41f6('0xf')]['message']);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x265043,_0x41f6('0x12'));_0x2e655a(_0xb3c367['result'][_0x41f6('0x11')]);}})[_0x41f6('0x13')](function(_0x2f2959){logger['error'](_0x41f6('0xb'),_0x265043,_0x2f2959);_0x136032(_0x2f2959);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index fd85218..2b0cb28 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 _0x47ed=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','show','post','isAuthenticated','create','/create_many','bulkCreate','/:id/create_many','addFields','put','/:id','update','/destroy_many','bulkDestroy','delete','multer','util','connect-timeout','express'];(function(_0x3776b4,_0xbf61f4){var _0x2bd258=function(_0x15215c){while(--_0x15215c){_0x3776b4['push'](_0x3776b4['shift']());}};_0x2bd258(++_0xbf61f4);}(_0x47ed,0x1be));var _0xd47e=function(_0x425036,_0x39bebc){_0x425036=_0x425036-0x0;var _0x7fc880=_0x47ed[_0x425036];return _0x7fc880;};'use strict';var multer=require(_0xd47e('0x0'));var util=require(_0xd47e('0x1'));var path=require('path');var timeout=require(_0xd47e('0x2'));var express=require(_0xd47e('0x3'));var router=express[_0xd47e('0x4')]();var fs_extra=require(_0xd47e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd47e('0x6'));var config=require(_0xd47e('0x7'));var controller=require(_0xd47e('0x8'));router[_0xd47e('0x9')]('/',auth['isAuthenticated'](),controller[_0xd47e('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd47e('0xb')]);router[_0xd47e('0xc')]('/',auth[_0xd47e('0xd')](),controller[_0xd47e('0xe')]);router[_0xd47e('0xc')](_0xd47e('0xf'),auth['isAuthenticated'](),controller[_0xd47e('0x10')]);router['post'](_0xd47e('0x11'),auth[_0xd47e('0xd')](),controller[_0xd47e('0x12')]);router[_0xd47e('0x13')](_0xd47e('0x14'),auth[_0xd47e('0xd')](),controller[_0xd47e('0x15')]);router['delete'](_0xd47e('0x16'),auth[_0xd47e('0xd')](),controller[_0xd47e('0x17')]);router[_0xd47e('0x18')](_0xd47e('0x14'),auth[_0xd47e('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa042=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','isAuthenticated','index','get','/:id','show','post','create','/create_many','bulkCreate','addFields','put','update','delete','/destroy_many','bulkDestroy','exports','multer','util'];(function(_0xa4f636,_0xaca1b6){var _0x37e02a=function(_0x49bd47){while(--_0x49bd47){_0xa4f636['push'](_0xa4f636['shift']());}};_0x37e02a(++_0xaca1b6);}(_0xa042,0x7b));var _0x2a04=function(_0x921c13,_0x22719e){_0x921c13=_0x921c13-0x0;var _0x18d1a0=_0xa042[_0x921c13];return _0x18d1a0;};'use strict';var multer=require(_0x2a04('0x0'));var util=require(_0x2a04('0x1'));var path=require(_0x2a04('0x2'));var timeout=require(_0x2a04('0x3'));var express=require(_0x2a04('0x4'));var router=express['Router']();var fs_extra=require(_0x2a04('0x5'));var auth=require(_0x2a04('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a04('0x7'));var controller=require(_0x2a04('0x8'));router['get']('/',auth[_0x2a04('0x9')](),controller[_0x2a04('0xa')]);router[_0x2a04('0xb')](_0x2a04('0xc'),auth['isAuthenticated'](),controller[_0x2a04('0xd')]);router[_0x2a04('0xe')]('/',auth[_0x2a04('0x9')](),controller[_0x2a04('0xf')]);router['post'](_0x2a04('0x10'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x11')]);router[_0x2a04('0xe')]('/:id/create_many',auth['isAuthenticated'](),controller[_0x2a04('0x12')]);router[_0x2a04('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2a04('0x14')]);router[_0x2a04('0x15')](_0x2a04('0x16'),auth[_0x2a04('0x9')](),controller[_0x2a04('0x17')]);router['delete'](_0x2a04('0xc'),auth[_0x2a04('0x9')](),controller['destroy']);module[_0x2a04('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index ce6f050..955ec5c 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 _0x5881=['name','TEXT','exports','STRING'];(function(_0x211cdd,_0x4f0a49){var _0x59e0a9=function(_0x272b75){while(--_0x272b75){_0x211cdd['push'](_0x211cdd['shift']());}};_0x59e0a9(++_0x4f0a49);}(_0x5881,0x1f2));var _0x1588=function(_0x138de6,_0x5d0c19){_0x138de6=_0x138de6-0x0;var _0x35f7fe=_0x5881[_0x138de6];return _0x35f7fe;};'use strict';var Sequelize=require('sequelize');module[_0x1588('0x0')]={'name':{'type':Sequelize[_0x1588('0x1')],'allowNull':![],'unique':_0x1588('0x2')},'table':{'type':Sequelize[_0x1588('0x1')]},'metric':{'type':Sequelize[_0x1588('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x49db=['name','sequelize','exports','STRING'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x49db,0xc5));var _0xb49d=function(_0x2fce93,_0x1d4d2e){_0x2fce93=_0x2fce93-0x0;var _0x4b3380=_0x49db[_0x2fce93];return _0x4b3380;};'use strict';var Sequelize=require(_0xb49d('0x0'));module[_0xb49d('0x1')]={'name':{'type':Sequelize[_0xb49d('0x2')],'allowNull':![],'unique':_0xb49d('0x3')},'table':{'type':Sequelize[_0xb49d('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xb49d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 25e955c..9d62753 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 _0x7e80=['crypto','jsforce','desk.js','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','../../mysqldb','sendStatus','end','count','offset','limit','status','set','json','reject','save','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','include','rows','catch','params','keys','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','util','path','ejs','fs-extra','lodash','squel'];(function(_0x422e1f,_0x27dae5){var _0x55f806=function(_0x272920){while(--_0x272920){_0x422e1f['push'](_0x422e1f['shift']());}};_0x55f806(++_0x27dae5);}(_0x7e80,0x9b));var _0x07e8=function(_0x27d0ad,_0x3f8bef){_0x27d0ad=_0x27d0ad-0x0;var _0x4eec43=_0x7e80[_0x27d0ad];return _0x4eec43;};'use strict';var emlformat=require(_0x07e8('0x0'));var rimraf=require(_0x07e8('0x1'));var zipdir=require(_0x07e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x07e8('0x3'));var path=require(_0x07e8('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x07e8('0x5'));var fs=require('fs');var fs_extra=require(_0x07e8('0x6'));var _=require(_0x07e8('0x7'));var squel=require(_0x07e8('0x8'));var crypto=require(_0x07e8('0x9'));var jsforce=require(_0x07e8('0xa'));var deskjs=require(_0x07e8('0xb'));var toCsv=require(_0x07e8('0xc'));var querystring=require(_0x07e8('0xd'));var Papa=require(_0x07e8('0xe'));var Redis=require(_0x07e8('0xf'));var authService=require(_0x07e8('0x10'));var qs=require(_0x07e8('0x11'));var as=require(_0x07e8('0x12'));var hardwareService=require(_0x07e8('0x13'));var logger=require(_0x07e8('0x14'))(_0x07e8('0x15'));var utils=require(_0x07e8('0x16'));var config=require(_0x07e8('0x17'));var licenseUtil=require(_0x07e8('0x18'));var db=require(_0x07e8('0x19'))['db'];function respondWithStatusCode(_0x281436,_0x2bdcbb){_0x2bdcbb=_0x2bdcbb||0xcc;return function(_0x52e76d){if(_0x52e76d){return _0x281436[_0x07e8('0x1a')](_0x2bdcbb);}return _0x281436['status'](_0x2bdcbb)[_0x07e8('0x1b')]();};}function respondWithResult(_0x56f009,_0x229b32){_0x229b32=_0x229b32||0xc8;return function(_0x2ef955){if(_0x2ef955){return _0x56f009['status'](_0x229b32)['json'](_0x2ef955);}};}function respondWithFilteredResult(_0xc008a1,_0x54a507){return function(_0x3bbcc5){if(_0x3bbcc5){var _0x5ab106=_0x3bbcc5[_0x07e8('0x1c')],_0x57cf6a=_0x54a507[_0x07e8('0x1d')],_0x341040=_0x54a507['offset']+_0x54a507[_0x07e8('0x1e')],_0xef6c4;if(_0x341040>=_0x5ab106){_0x341040=_0x5ab106;_0xef6c4=0xc8;}else{_0xef6c4=0xce;}_0xc008a1[_0x07e8('0x1f')](_0xef6c4);return _0xc008a1[_0x07e8('0x20')]('Content-Range',_0x57cf6a+'-'+_0x341040+'/'+_0x5ab106)[_0x07e8('0x21')](_0x3bbcc5);}return null;};}function patchUpdates(_0x559c10){return function(_0x56bad3){try{jsonpatch['apply'](_0x56bad3,_0x559c10,!![]);}catch(_0x28f299){return BPromise[_0x07e8('0x22')](_0x28f299);}return _0x56bad3[_0x07e8('0x23')]();};}function saveUpdates(_0x42c779,_0x2c7666){return function(_0x3e2b73){if(_0x3e2b73){return _0x3e2b73[_0x07e8('0x24')](_0x42c779)[_0x07e8('0x25')](function(_0x514dd3){return _0x514dd3;});}return null;};}function removeEntity(_0x47ac7e,_0x2081ac){return function(_0x3bb201){if(_0x3bb201){return _0x3bb201[_0x07e8('0x26')]()[_0x07e8('0x25')](function(){var _0x3a13a8=_0x3bb201[_0x07e8('0x27')]({'plain':!![]});var _0x176c10=_0x07e8('0x28');return db[_0x07e8('0x29')][_0x07e8('0x26')]({'where':{'type':_0x176c10,'resourceId':_0x3a13a8['id']}})[_0x07e8('0x25')](function(){return _0x3bb201;});})[_0x07e8('0x25')](function(){_0x47ac7e[_0x07e8('0x1f')](0xcc)[_0x07e8('0x1b')]();});}};}function handleEntityNotFound(_0x1ce826,_0x2b03af){return function(_0x3d4c06){if(!_0x3d4c06){_0x1ce826['sendStatus'](0x194);}return _0x3d4c06;};}function handleError(_0x392eeb,_0x4ef8b5){_0x4ef8b5=_0x4ef8b5||0x1f4;return function(_0x5794cb){logger[_0x07e8('0x2a')](_0x5794cb[_0x07e8('0x2b')]);if(_0x5794cb['name']){delete _0x5794cb[_0x07e8('0x2c')];}_0x392eeb[_0x07e8('0x1f')](_0x4ef8b5)[_0x07e8('0x2d')](_0x5794cb);};}exports['index']=function(_0x261b44,_0x3efbe9){var _0x58084a={},_0x853250={},_0xdeb66d={'count':0x0,'rows':[]};var _0x5e474c=_[_0x07e8('0x2e')](db[_0x07e8('0x2f')][_0x07e8('0x30')],function(_0x1d94a5){return{'name':_0x1d94a5[_0x07e8('0x31')],'type':_0x1d94a5[_0x07e8('0x32')][_0x07e8('0x33')]};});_0x853250[_0x07e8('0x34')]=_[_0x07e8('0x2e')](_0x5e474c,_0x07e8('0x2c'));_0x853250[_0x07e8('0x35')]=_['keys'](_0x261b44[_0x07e8('0x35')]);_0x853250[_0x07e8('0x36')]=_[_0x07e8('0x37')](_0x853250[_0x07e8('0x34')],_0x853250[_0x07e8('0x35')]);_0x58084a[_0x07e8('0x38')]=_[_0x07e8('0x37')](_0x853250[_0x07e8('0x34')],qs[_0x07e8('0x39')](_0x261b44[_0x07e8('0x35')][_0x07e8('0x39')]));_0x58084a[_0x07e8('0x38')]=_0x58084a[_0x07e8('0x38')][_0x07e8('0x3a')]?_0x58084a[_0x07e8('0x38')]:_0x853250[_0x07e8('0x34')];if(!_0x261b44[_0x07e8('0x35')][_0x07e8('0x3b')](_0x07e8('0x3c'))){_0x58084a[_0x07e8('0x1e')]=qs['limit'](_0x261b44[_0x07e8('0x35')][_0x07e8('0x1e')]);_0x58084a[_0x07e8('0x1d')]=qs['offset'](_0x261b44[_0x07e8('0x35')][_0x07e8('0x1d')]);}_0x58084a[_0x07e8('0x3d')]=qs[_0x07e8('0x3e')](_0x261b44[_0x07e8('0x35')][_0x07e8('0x3e')]);_0x58084a['where']=qs[_0x07e8('0x36')](_['pick'](_0x261b44[_0x07e8('0x35')],_0x853250[_0x07e8('0x36')]),_0x5e474c);if(_0x261b44[_0x07e8('0x35')][_0x07e8('0x3f')]){_0x58084a['where']=_['merge'](_0x58084a[_0x07e8('0x40')],{'$or':_[_0x07e8('0x2e')](_0x5e474c,function(_0x2e5a58){if(_0x2e5a58['type']!=='VIRTUAL'){var _0x41ef8e={};_0x41ef8e[_0x2e5a58[_0x07e8('0x2c')]]={'$like':'%'+_0x261b44[_0x07e8('0x35')][_0x07e8('0x3f')]+'%'};return _0x41ef8e;}})});}_0x58084a=_[_0x07e8('0x41')]({},_0x58084a,_0x261b44['options']);var _0x22049f={'where':_0x58084a[_0x07e8('0x40')]};return db[_0x07e8('0x2f')][_0x07e8('0x1c')](_0x22049f)[_0x07e8('0x25')](function(_0x160f56){_0xdeb66d[_0x07e8('0x1c')]=_0x160f56;if(_0x261b44[_0x07e8('0x35')]['includeAll']){_0x58084a[_0x07e8('0x42')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x58084a);})[_0x07e8('0x25')](function(_0xb48230){_0xdeb66d[_0x07e8('0x43')]=_0xb48230;return _0xdeb66d;})[_0x07e8('0x25')](respondWithFilteredResult(_0x3efbe9,_0x58084a))[_0x07e8('0x44')](handleError(_0x3efbe9,null));};exports['show']=function(_0x4edaf6,_0xe92455){var _0x38bb58={'raw':!![],'where':{'id':_0x4edaf6[_0x07e8('0x45')]['id']}},_0x590987={};_0x590987[_0x07e8('0x34')]=_[_0x07e8('0x46')](db[_0x07e8('0x2f')][_0x07e8('0x30')]);_0x590987[_0x07e8('0x35')]=_['keys'](_0x4edaf6[_0x07e8('0x35')]);_0x590987['filters']=_[_0x07e8('0x37')](_0x590987[_0x07e8('0x34')],_0x590987[_0x07e8('0x35')]);_0x38bb58[_0x07e8('0x38')]=_[_0x07e8('0x37')](_0x590987[_0x07e8('0x34')],qs[_0x07e8('0x39')](_0x4edaf6[_0x07e8('0x35')][_0x07e8('0x39')]));_0x38bb58[_0x07e8('0x38')]=_0x38bb58[_0x07e8('0x38')][_0x07e8('0x3a')]?_0x38bb58[_0x07e8('0x38')]:_0x590987['model'];if(_0x4edaf6[_0x07e8('0x35')][_0x07e8('0x47')]){_0x38bb58['include']=[{'all':!![]}];}_0x38bb58=_[_0x07e8('0x41')]({},_0x38bb58,_0x4edaf6[_0x07e8('0x48')]);return db[_0x07e8('0x2f')][_0x07e8('0x49')](_0x38bb58)[_0x07e8('0x25')](handleEntityNotFound(_0xe92455,null))[_0x07e8('0x25')](respondWithResult(_0xe92455,null))[_0x07e8('0x44')](handleError(_0xe92455,null));};exports[_0x07e8('0x4a')]=function(_0x23ab19,_0x2d530d){return db[_0x07e8('0x2f')][_0x07e8('0x4a')](_0x23ab19[_0x07e8('0x4b')],{})[_0x07e8('0x25')](function(_0x104c0c){var _0x1a09f2=_0x23ab19['user'][_0x07e8('0x27')]({'plain':!![]});if(!_0x1a09f2)throw new Error(_0x07e8('0x4c'));if(_0x1a09f2[_0x07e8('0x4d')]===_0x07e8('0x4e')){var _0x2dc0a8=_0x104c0c[_0x07e8('0x27')]({'plain':!![]});var _0x54c37f=_0x07e8('0x28');return db[_0x07e8('0x4f')]['find']({'where':{'name':_0x54c37f,'userProfileId':_0x1a09f2[_0x07e8('0x50')]},'raw':!![]})[_0x07e8('0x25')](function(_0x7db79e){if(_0x7db79e&&_0x7db79e[_0x07e8('0x51')]===0x0){return db[_0x07e8('0x29')][_0x07e8('0x4a')]({'name':_0x2dc0a8['name'],'resourceId':_0x2dc0a8['id'],'type':_0x7db79e[_0x07e8('0x2c')],'sectionId':_0x7db79e['id']},{})['then'](function(){return _0x104c0c;});}else{return _0x104c0c;}})[_0x07e8('0x44')](function(_0x381a11){logger[_0x07e8('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x381a11);throw _0x381a11;});}return _0x104c0c;})[_0x07e8('0x25')](respondWithResult(_0x2d530d,0xc9))[_0x07e8('0x44')](handleError(_0x2d530d,null));};exports[_0x07e8('0x24')]=function(_0x402b80,_0x2b9a8a){if(_0x402b80[_0x07e8('0x4b')]['id']){delete _0x402b80[_0x07e8('0x4b')]['id'];}return db[_0x07e8('0x2f')][_0x07e8('0x49')]({'where':{'id':_0x402b80[_0x07e8('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b9a8a,null))['then'](saveUpdates(_0x402b80['body'],null))[_0x07e8('0x25')](respondWithResult(_0x2b9a8a,null))['catch'](handleError(_0x2b9a8a,null));};exports['destroy']=function(_0x5d2903,_0x47e3a1){return db['AnalyticMetric'][_0x07e8('0x49')]({'where':{'id':_0x5d2903[_0x07e8('0x45')]['id']}})[_0x07e8('0x25')](handleEntityNotFound(_0x47e3a1,null))['then'](removeEntity(_0x47e3a1,null))[_0x07e8('0x44')](handleError(_0x47e3a1,null));};
\ No newline at end of file
+var _0xd015=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','user'];(function(_0x369b02,_0x39f4b2){var _0x1a252b=function(_0x59e1f1){while(--_0x59e1f1){_0x369b02['push'](_0x369b02['shift']());}};_0x1a252b(++_0x39f4b2);}(_0xd015,0x1e1));var _0x5d01=function(_0x3358f1,_0x5d740){_0x3358f1=_0x3358f1-0x0;var _0x15bfd5=_0xd015[_0x3358f1];return _0x15bfd5;};'use strict';var emlformat=require(_0x5d01('0x0'));var rimraf=require(_0x5d01('0x1'));var zipdir=require(_0x5d01('0x2'));var jsonpatch=require(_0x5d01('0x3'));var rp=require('request-promise');var moment=require(_0x5d01('0x4'));var BPromise=require(_0x5d01('0x5'));var Mustache=require(_0x5d01('0x6'));var util=require(_0x5d01('0x7'));var path=require(_0x5d01('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5d01('0x9'));var fs=require('fs');var fs_extra=require(_0x5d01('0xa'));var _=require(_0x5d01('0xb'));var squel=require('squel');var crypto=require(_0x5d01('0xc'));var jsforce=require(_0x5d01('0xd'));var deskjs=require(_0x5d01('0xe'));var toCsv=require(_0x5d01('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5d01('0x10'));var qs=require(_0x5d01('0x11'));var as=require(_0x5d01('0x12'));var hardwareService=require(_0x5d01('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5d01('0x14'));var config=require(_0x5d01('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1334f3,_0x14bb70){_0x14bb70=_0x14bb70||0xcc;return function(_0x38a258){if(_0x38a258){return _0x1334f3[_0x5d01('0x16')](_0x14bb70);}return _0x1334f3[_0x5d01('0x17')](_0x14bb70)[_0x5d01('0x18')]();};}function respondWithResult(_0x1c2fb4,_0x2575fb){_0x2575fb=_0x2575fb||0xc8;return function(_0x380bbb){if(_0x380bbb){return _0x1c2fb4['status'](_0x2575fb)[_0x5d01('0x19')](_0x380bbb);}};}function respondWithFilteredResult(_0x37bcaf,_0xe12429){return function(_0x24efd9){if(_0x24efd9){var _0x1e9231=_0x24efd9[_0x5d01('0x1a')],_0x4a7a81=_0xe12429[_0x5d01('0x1b')],_0x237965=_0xe12429[_0x5d01('0x1b')]+_0xe12429['limit'],_0x43c597;if(_0x237965>=_0x1e9231){_0x237965=_0x1e9231;_0x43c597=0xc8;}else{_0x43c597=0xce;}_0x37bcaf['status'](_0x43c597);return _0x37bcaf['set']('Content-Range',_0x4a7a81+'-'+_0x237965+'/'+_0x1e9231)[_0x5d01('0x19')](_0x24efd9);}return null;};}function patchUpdates(_0x20375b){return function(_0x491295){try{jsonpatch[_0x5d01('0x1c')](_0x491295,_0x20375b,!![]);}catch(_0x3aff00){return BPromise[_0x5d01('0x1d')](_0x3aff00);}return _0x491295[_0x5d01('0x1e')]();};}function saveUpdates(_0x593bb2,_0x1b1e11){return function(_0x259f2a){if(_0x259f2a){return _0x259f2a[_0x5d01('0x1f')](_0x593bb2)[_0x5d01('0x20')](function(_0x586325){return _0x586325;});}return null;};}function removeEntity(_0x1c4750,_0x2c52dd){return function(_0x4bd1ce){if(_0x4bd1ce){return _0x4bd1ce[_0x5d01('0x21')]()[_0x5d01('0x20')](function(){var _0x1da87e=_0x4bd1ce[_0x5d01('0x22')]({'plain':!![]});var _0x27a953=_0x5d01('0x23');return db['UserProfileResource'][_0x5d01('0x21')]({'where':{'type':_0x27a953,'resourceId':_0x1da87e['id']}})[_0x5d01('0x20')](function(){return _0x4bd1ce;});})[_0x5d01('0x20')](function(){_0x1c4750[_0x5d01('0x17')](0xcc)[_0x5d01('0x18')]();});}};}function handleEntityNotFound(_0x3237b6,_0x300b13){return function(_0x4ced2f){if(!_0x4ced2f){_0x3237b6[_0x5d01('0x16')](0x194);}return _0x4ced2f;};}function handleError(_0xc8c180,_0x59c768){_0x59c768=_0x59c768||0x1f4;return function(_0x35554c){logger[_0x5d01('0x24')](_0x35554c[_0x5d01('0x25')]);if(_0x35554c[_0x5d01('0x26')]){delete _0x35554c[_0x5d01('0x26')];}_0xc8c180[_0x5d01('0x17')](_0x59c768)['send'](_0x35554c);};}exports[_0x5d01('0x27')]=function(_0x5e4c10,_0x12a71d){var _0x3e99e2={},_0x3aff6e={},_0x4d6934={'count':0x0,'rows':[]};var _0x148417=_[_0x5d01('0x28')](db[_0x5d01('0x29')]['rawAttributes'],function(_0x3d1a9b){return{'name':_0x3d1a9b[_0x5d01('0x2a')],'type':_0x3d1a9b[_0x5d01('0x2b')][_0x5d01('0x2c')]};});_0x3aff6e[_0x5d01('0x2d')]=_[_0x5d01('0x28')](_0x148417,_0x5d01('0x26'));_0x3aff6e[_0x5d01('0x2e')]=_[_0x5d01('0x2f')](_0x5e4c10[_0x5d01('0x2e')]);_0x3aff6e[_0x5d01('0x30')]=_[_0x5d01('0x31')](_0x3aff6e[_0x5d01('0x2d')],_0x3aff6e[_0x5d01('0x2e')]);_0x3e99e2[_0x5d01('0x32')]=_[_0x5d01('0x31')](_0x3aff6e['model'],qs[_0x5d01('0x33')](_0x5e4c10[_0x5d01('0x2e')]['fields']));_0x3e99e2[_0x5d01('0x32')]=_0x3e99e2[_0x5d01('0x32')][_0x5d01('0x34')]?_0x3e99e2[_0x5d01('0x32')]:_0x3aff6e[_0x5d01('0x2d')];if(!_0x5e4c10[_0x5d01('0x2e')][_0x5d01('0x35')](_0x5d01('0x36'))){_0x3e99e2[_0x5d01('0x37')]=qs[_0x5d01('0x37')](_0x5e4c10[_0x5d01('0x2e')][_0x5d01('0x37')]);_0x3e99e2['offset']=qs[_0x5d01('0x1b')](_0x5e4c10[_0x5d01('0x2e')]['offset']);}_0x3e99e2[_0x5d01('0x38')]=qs['sort'](_0x5e4c10[_0x5d01('0x2e')][_0x5d01('0x39')]);_0x3e99e2[_0x5d01('0x3a')]=qs[_0x5d01('0x30')](_[_0x5d01('0x3b')](_0x5e4c10['query'],_0x3aff6e[_0x5d01('0x30')]),_0x148417);if(_0x5e4c10['query'][_0x5d01('0x3c')]){_0x3e99e2[_0x5d01('0x3a')]=_[_0x5d01('0x3d')](_0x3e99e2[_0x5d01('0x3a')],{'$or':_['map'](_0x148417,function(_0x54358b){if(_0x54358b['type']!==_0x5d01('0x3e')){var _0x1f9b04={};_0x1f9b04[_0x54358b[_0x5d01('0x26')]]={'$like':'%'+_0x5e4c10[_0x5d01('0x2e')]['filter']+'%'};return _0x1f9b04;}})});}_0x3e99e2=_[_0x5d01('0x3d')]({},_0x3e99e2,_0x5e4c10[_0x5d01('0x3f')]);var _0x2434ec={'where':_0x3e99e2['where']};return db['AnalyticMetric'][_0x5d01('0x1a')](_0x2434ec)[_0x5d01('0x20')](function(_0x3cd441){_0x4d6934[_0x5d01('0x1a')]=_0x3cd441;if(_0x5e4c10['query'][_0x5d01('0x40')]){_0x3e99e2[_0x5d01('0x41')]=[{'all':!![]}];}return db[_0x5d01('0x29')][_0x5d01('0x42')](_0x3e99e2);})[_0x5d01('0x20')](function(_0x5e6f26){_0x4d6934['rows']=_0x5e6f26;return _0x4d6934;})['then'](respondWithFilteredResult(_0x12a71d,_0x3e99e2))[_0x5d01('0x43')](handleError(_0x12a71d,null));};exports[_0x5d01('0x44')]=function(_0x35993d,_0xd85986){var _0x202b3d={'raw':!![],'where':{'id':_0x35993d['params']['id']}},_0x511736={};_0x511736[_0x5d01('0x2d')]=_[_0x5d01('0x2f')](db['AnalyticMetric']['rawAttributes']);_0x511736[_0x5d01('0x2e')]=_[_0x5d01('0x2f')](_0x35993d[_0x5d01('0x2e')]);_0x511736[_0x5d01('0x30')]=_[_0x5d01('0x31')](_0x511736[_0x5d01('0x2d')],_0x511736[_0x5d01('0x2e')]);_0x202b3d[_0x5d01('0x32')]=_[_0x5d01('0x31')](_0x511736[_0x5d01('0x2d')],qs[_0x5d01('0x33')](_0x35993d[_0x5d01('0x2e')]['fields']));_0x202b3d[_0x5d01('0x32')]=_0x202b3d[_0x5d01('0x32')][_0x5d01('0x34')]?_0x202b3d['attributes']:_0x511736[_0x5d01('0x2d')];if(_0x35993d[_0x5d01('0x2e')]['includeAll']){_0x202b3d[_0x5d01('0x41')]=[{'all':!![]}];}_0x202b3d=_['merge']({},_0x202b3d,_0x35993d[_0x5d01('0x3f')]);return db['AnalyticMetric'][_0x5d01('0x45')](_0x202b3d)['then'](handleEntityNotFound(_0xd85986,null))[_0x5d01('0x20')](respondWithResult(_0xd85986,null))[_0x5d01('0x43')](handleError(_0xd85986,null));};exports['create']=function(_0x5c8999,_0x114285){return db[_0x5d01('0x29')][_0x5d01('0x46')](_0x5c8999['body'],{})['then'](function(_0x4cb0fe){var _0xad674d=_0x5c8999[_0x5d01('0x47')][_0x5d01('0x22')]({'plain':!![]});if(!_0xad674d)throw new Error(_0x5d01('0x48'));if(_0xad674d[_0x5d01('0x49')]==='user'){var _0x3c6d84=_0x4cb0fe[_0x5d01('0x22')]({'plain':!![]});var _0x1f340f='Metrics';return db[_0x5d01('0x4a')]['find']({'where':{'name':_0x1f340f,'userProfileId':_0xad674d[_0x5d01('0x4b')]},'raw':!![]})[_0x5d01('0x20')](function(_0x2497f2){if(_0x2497f2&&_0x2497f2[_0x5d01('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x3c6d84['name'],'resourceId':_0x3c6d84['id'],'type':_0x2497f2[_0x5d01('0x26')],'sectionId':_0x2497f2['id']},{})[_0x5d01('0x20')](function(){return _0x4cb0fe;});}else{return _0x4cb0fe;}})[_0x5d01('0x43')](function(_0x2a44cd){logger[_0x5d01('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a44cd);throw _0x2a44cd;});}return _0x4cb0fe;})['then'](respondWithResult(_0x114285,0xc9))[_0x5d01('0x43')](handleError(_0x114285,null));};exports[_0x5d01('0x1f')]=function(_0x2d2e3a,_0x1ef98f){if(_0x2d2e3a[_0x5d01('0x4d')]['id']){delete _0x2d2e3a['body']['id'];}return db[_0x5d01('0x29')][_0x5d01('0x45')]({'where':{'id':_0x2d2e3a[_0x5d01('0x4e')]['id']}})[_0x5d01('0x20')](handleEntityNotFound(_0x1ef98f,null))['then'](saveUpdates(_0x2d2e3a[_0x5d01('0x4d')],null))[_0x5d01('0x20')](respondWithResult(_0x1ef98f,null))[_0x5d01('0x43')](handleError(_0x1ef98f,null));};exports['destroy']=function(_0x5763f4,_0x78849){return db[_0x5d01('0x29')][_0x5d01('0x45')]({'where':{'id':_0x5763f4[_0x5d01('0x4e')]['id']}})[_0x5d01('0x20')](handleEntityNotFound(_0x78849,null))[_0x5d01('0x20')](removeEntity(_0x78849,null))['catch'](handleError(_0x78849,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index ce3c539..ff016a7 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 _0x95a4=['path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x14662f,_0x141b70){var _0x28bee7=function(_0x32e5db){while(--_0x32e5db){_0x14662f['push'](_0x14662f['shift']());}};_0x28bee7(++_0x141b70);}(_0x95a4,0x10b));var _0x495a=function(_0xf6021,_0x10c394){_0xf6021=_0xf6021-0x0;var _0x41662d=_0x95a4[_0xf6021];return _0x41662d;};'use strict';var _=require(_0x495a('0x0'));var util=require(_0x495a('0x1'));var logger=require(_0x495a('0x2'))(_0x495a('0x3'));var moment=require(_0x495a('0x4'));var BPromise=require('bluebird');var rp=require(_0x495a('0x5'));var fs=require('fs');var path=require(_0x495a('0x6'));var rimraf=require(_0x495a('0x7'));var config=require(_0x495a('0x8'));var attributes=require(_0x495a('0x9'));module['exports']=function(_0x2089cb,_0x115824){return _0x2089cb[_0x495a('0xa')](_0x495a('0xb'),attributes,{'tableName':_0x495a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x090b=['lodash','api','request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x1ce3f0,_0x4bcfa8){var _0x31b9dd=function(_0x44fa7c){while(--_0x44fa7c){_0x1ce3f0['push'](_0x1ce3f0['shift']());}};_0x31b9dd(++_0x4bcfa8);}(_0x090b,0x120));var _0xb090=function(_0x15b887,_0x544016){_0x15b887=_0x15b887-0x0;var _0x29de2a=_0x090b[_0x15b887];return _0x29de2a;};'use strict';var _=require(_0xb090('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb090('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb090('0x2'));var fs=require('fs');var path=require(_0xb090('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb090('0x4'));module[_0xb090('0x5')]=function(_0x49126d,_0x2957a2){return _0x49126d[_0xb090('0x6')](_0xb090('0x7'),attributes,{'tableName':_0xb090('0x8'),'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 439da41..48a848c 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 _0xbd28=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbd28,0xa6));var _0x8bd2=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xbd28[_0x474bc0];return _0x4b24cf;};'use strict';var _=require('lodash');var util=require(_0x8bd2('0x0'));var moment=require(_0x8bd2('0x1'));var BPromise=require(_0x8bd2('0x2'));var rs=require(_0x8bd2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bd2('0x4'))['db'];var utils=require(_0x8bd2('0x5'));var logger=require('../../config/logger')(_0x8bd2('0x6'));var config=require(_0x8bd2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8bd2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x363665,_0x993128,_0x54d617){return new BPromise(function(_0x1d2b04,_0x139ba9){return client[_0x8bd2('0x9')](_0x363665,_0x54d617)[_0x8bd2('0xa')](function(_0x5ab7f3){logger[_0x8bd2('0xb')](_0x8bd2('0xc'),_0x993128,_0x8bd2('0xd'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x993128,'request\x20sent',JSON[_0x8bd2('0xe')](_0x5ab7f3));if(_0x5ab7f3[_0x8bd2('0xf')]){if(_0x5ab7f3[_0x8bd2('0xf')][_0x8bd2('0x10')]===0x1f4){logger['error'](_0x8bd2('0xc'),_0x993128,_0x5ab7f3['error']['message']);return _0x139ba9(_0x5ab7f3[_0x8bd2('0xf')]['message']);}logger[_0x8bd2('0xf')](_0x8bd2('0xc'),_0x993128,_0x5ab7f3[_0x8bd2('0xf')][_0x8bd2('0x11')]);return _0x1d2b04(_0x5ab7f3[_0x8bd2('0xf')]['message']);}else{logger['info'](_0x8bd2('0xc'),_0x993128,_0x8bd2('0xd'));_0x1d2b04(_0x5ab7f3[_0x8bd2('0x12')]['message']);}})[_0x8bd2('0x13')](function(_0x2cfaf9){logger['error'](_0x8bd2('0xc'),_0x993128,_0x2cfaf9);_0x139ba9(_0x2cfaf9);});});}
\ No newline at end of file
+var _0xcc8d=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5dd879,_0x5e049b){var _0x475efa=function(_0x53d1a7){while(--_0x53d1a7){_0x5dd879['push'](_0x5dd879['shift']());}};_0x475efa(++_0x5e049b);}(_0xcc8d,0x74));var _0xdcc8=function(_0x456a84,_0x46bc0b){_0x456a84=_0x456a84-0x0;var _0x1117d6=_0xcc8d[_0x456a84];return _0x1117d6;};'use strict';var _=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var moment=require(_0xdcc8('0x2'));var BPromise=require(_0xdcc8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcc8('0x4'));var db=require(_0xdcc8('0x5'))['db'];var utils=require(_0xdcc8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xdcc8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdcc8('0x8')][_0xdcc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e0dda,_0x1c4470,_0x273c84){return new BPromise(function(_0x451b33,_0x5efcfd){return client['request'](_0x5e0dda,_0x273c84)[_0xdcc8('0xa')](function(_0x3b423f){logger[_0xdcc8('0xb')](_0xdcc8('0xc'),_0x1c4470,_0xdcc8('0xd'));logger[_0xdcc8('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1c4470,_0xdcc8('0xd'),JSON[_0xdcc8('0xf')](_0x3b423f));if(_0x3b423f[_0xdcc8('0x10')]){if(_0x3b423f[_0xdcc8('0x10')]['code']===0x1f4){logger[_0xdcc8('0x10')](_0xdcc8('0xc'),_0x1c4470,_0x3b423f[_0xdcc8('0x10')][_0xdcc8('0x11')]);return _0x5efcfd(_0x3b423f['error']['message']);}logger[_0xdcc8('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x1c4470,_0x3b423f['error'][_0xdcc8('0x11')]);return _0x451b33(_0x3b423f[_0xdcc8('0x10')][_0xdcc8('0x11')]);}else{logger[_0xdcc8('0xb')](_0xdcc8('0xc'),_0x1c4470,_0xdcc8('0xd'));_0x451b33(_0x3b423f[_0xdcc8('0x12')][_0xdcc8('0x11')]);}})[_0xdcc8('0x13')](function(_0xb679b8){logger[_0xdcc8('0x10')](_0xdcc8('0xc'),_0x1c4470,_0xb679b8);_0x5efcfd(_0xb679b8);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 7e37c9a..fc1197e 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 _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0xb006a,_0x658f){var _0x3b8a14=function(_0x354d36){while(--_0x354d36){_0xb006a['push'](_0xb006a['shift']());}};_0x3b8a14(++_0x658f);}(_0x5c00,0x17e));var _0x05c0=function(_0x13c19c,_0x1d4a84){_0x13c19c=_0x13c19c-0x0;var _0x594ee4=_0x5c00[_0x13c19c];return _0x594ee4;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./analyticMetric.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xb688,0xcf));var _0x8b68=function(_0x12126e,_0x2e2c1f){_0x12126e=_0x12126e-0x0;var _0x14ad8d=_0xb688[_0x12126e];return _0x14ad8d;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 1aca01f..fd53fe4 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 _0x92a8=['sequelize','exports','TEXT'];(function(_0x563407,_0x5c3e62){var _0x22bbf4=function(_0x96750c){while(--_0x96750c){_0x563407['push'](_0x563407['shift']());}};_0x22bbf4(++_0x5c3e62);}(_0x92a8,0x13e));var _0x892a=function(_0xed9fea,_0x5ed774){_0xed9fea=_0xed9fea-0x0;var _0x198f12=_0x92a8[_0xed9fea];return _0x198f12;};'use strict';var Sequelize=require(_0x892a('0x0'));module[_0x892a('0x1')]={'tree':{'type':Sequelize[_0x892a('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x212f=['exports','TEXT','sequelize'];(function(_0x58993c,_0x8c3e9d){var _0x264f6c=function(_0xd23b3f){while(--_0xd23b3f){_0x58993c['push'](_0x58993c['shift']());}};_0x264f6c(++_0x8c3e9d);}(_0x212f,0x1f1));var _0xf212=function(_0xd06e3c,_0x4c804c){_0xd06e3c=_0xd06e3c-0x0;var _0x404683=_0x212f[_0xd06e3c];return _0x404683;};'use strict';var Sequelize=require(_0xf212('0x0'));module[_0xf212('0x1')]={'tree':{'type':Sequelize[_0xf212('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 f3faa99..b63eec2 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 _0xb0eb=['offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','key','model','map','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','count','include','findAll','catch','params','keys','intersection','includeAll','options','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x388c3e,_0x3cc690){var _0x551759=function(_0x28ca95){while(--_0x28ca95){_0x388c3e['push'](_0x388c3e['shift']());}};_0x551759(++_0x3cc690);}(_0xb0eb,0x151));var _0xbb0e=function(_0x440940,_0x712729){_0x440940=_0x440940-0x0;var _0x20f3b8=_0xb0eb[_0x440940];return _0x20f3b8;};'use strict';var emlformat=require(_0xbb0e('0x0'));var rimraf=require(_0xbb0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb0e('0x2'));var moment=require(_0xbb0e('0x3'));var BPromise=require(_0xbb0e('0x4'));var Mustache=require(_0xbb0e('0x5'));var util=require('util');var path=require(_0xbb0e('0x6'));var sox=require(_0xbb0e('0x7'));var csv=require(_0xbb0e('0x8'));var ejs=require(_0xbb0e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbb0e('0xa'));var crypto=require(_0xbb0e('0xb'));var jsforce=require(_0xbb0e('0xc'));var deskjs=require(_0xbb0e('0xd'));var toCsv=require(_0xbb0e('0x8'));var querystring=require(_0xbb0e('0xe'));var Papa=require(_0xbb0e('0xf'));var Redis=require(_0xbb0e('0x10'));var authService=require(_0xbb0e('0x11'));var qs=require(_0xbb0e('0x12'));var as=require(_0xbb0e('0x13'));var hardwareService=require(_0xbb0e('0x14'));var logger=require(_0xbb0e('0x15'))('api');var utils=require(_0xbb0e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb0e('0x17'));var db=require(_0xbb0e('0x18'))['db'];function respondWithStatusCode(_0x405b1e,_0x5ba309){_0x5ba309=_0x5ba309||0xcc;return function(_0x316413){if(_0x316413){return _0x405b1e[_0xbb0e('0x19')](_0x5ba309);}return _0x405b1e[_0xbb0e('0x1a')](_0x5ba309)['end']();};}function respondWithResult(_0x3070ec,_0x19e87e){_0x19e87e=_0x19e87e||0xc8;return function(_0x24a044){if(_0x24a044){return _0x3070ec[_0xbb0e('0x1a')](_0x19e87e)[_0xbb0e('0x1b')](_0x24a044);}};}function respondWithFilteredResult(_0x5eecec,_0x3a2601){return function(_0x1d879f){if(_0x1d879f){var _0xa37db3=_0x1d879f['count'],_0x18ae2c=_0x3a2601[_0xbb0e('0x1c')],_0x1ce961=_0x3a2601['offset']+_0x3a2601[_0xbb0e('0x1d')],_0x254e1f;if(_0x1ce961>=_0xa37db3){_0x1ce961=_0xa37db3;_0x254e1f=0xc8;}else{_0x254e1f=0xce;}_0x5eecec[_0xbb0e('0x1a')](_0x254e1f);return _0x5eecec[_0xbb0e('0x1e')](_0xbb0e('0x1f'),_0x18ae2c+'-'+_0x1ce961+'/'+_0xa37db3)[_0xbb0e('0x1b')](_0x1d879f);}return null;};}function patchUpdates(_0x2db819){return function(_0x5bdeeb){try{jsonpatch[_0xbb0e('0x20')](_0x5bdeeb,_0x2db819,!![]);}catch(_0x45e2f3){return BPromise['reject'](_0x45e2f3);}return _0x5bdeeb['save']();};}function saveUpdates(_0x5728ee,_0x37cb2e){return function(_0xbde36b){if(_0xbde36b){return _0xbde36b[_0xbb0e('0x21')](_0x5728ee)[_0xbb0e('0x22')](function(_0x534344){return _0x534344;});}return null;};}function removeEntity(_0x61537d,_0x154617){return function(_0x833d9a){if(_0x833d9a){return _0x833d9a[_0xbb0e('0x23')]()[_0xbb0e('0x22')](function(){_0x61537d[_0xbb0e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520b65,_0x42aa37){return function(_0x3453d1){if(!_0x3453d1){_0x520b65[_0xbb0e('0x19')](0x194);}return _0x3453d1;};}function handleError(_0x51bde4,_0x1d0189){_0x1d0189=_0x1d0189||0x1f4;return function(_0x598f88){logger[_0xbb0e('0x24')](_0x598f88[_0xbb0e('0x25')]);if(_0x598f88[_0xbb0e('0x26')]){delete _0x598f88[_0xbb0e('0x26')];}_0x51bde4[_0xbb0e('0x1a')](_0x1d0189)[_0xbb0e('0x27')](_0x598f88);};}exports[_0xbb0e('0x28')]=function(_0x352969,_0x3b0dff){var _0x2b71c6={},_0x106b47={},_0x458db2={'count':0x0,'rows':[]};var _0x1bfce6=_['map'](db[_0xbb0e('0x29')][_0xbb0e('0x2a')],function(_0x4d2430){return{'name':_0x4d2430[_0xbb0e('0x2b')],'type':_0x4d2430['type'][_0xbb0e('0x2c')]};});_0x106b47[_0xbb0e('0x2d')]=_[_0xbb0e('0x2e')](_0x1bfce6,_0xbb0e('0x26'));_0x106b47[_0xbb0e('0x2f')]=_['keys'](_0x352969[_0xbb0e('0x2f')]);_0x106b47['filters']=_['intersection'](_0x106b47[_0xbb0e('0x2d')],_0x106b47[_0xbb0e('0x2f')]);_0x2b71c6[_0xbb0e('0x30')]=_['intersection'](_0x106b47[_0xbb0e('0x2d')],qs[_0xbb0e('0x31')](_0x352969['query'][_0xbb0e('0x31')]));_0x2b71c6[_0xbb0e('0x30')]=_0x2b71c6['attributes'][_0xbb0e('0x32')]?_0x2b71c6[_0xbb0e('0x30')]:_0x106b47[_0xbb0e('0x2d')];if(!_0x352969[_0xbb0e('0x2f')][_0xbb0e('0x33')](_0xbb0e('0x34'))){_0x2b71c6['limit']=qs[_0xbb0e('0x1d')](_0x352969[_0xbb0e('0x2f')][_0xbb0e('0x1d')]);_0x2b71c6['offset']=qs[_0xbb0e('0x1c')](_0x352969[_0xbb0e('0x2f')][_0xbb0e('0x1c')]);}_0x2b71c6[_0xbb0e('0x35')]=qs[_0xbb0e('0x36')](_0x352969[_0xbb0e('0x2f')][_0xbb0e('0x36')]);_0x2b71c6[_0xbb0e('0x37')]=qs[_0xbb0e('0x38')](_['pick'](_0x352969[_0xbb0e('0x2f')],_0x106b47[_0xbb0e('0x38')]),_0x1bfce6);if(_0x352969[_0xbb0e('0x2f')][_0xbb0e('0x39')]){_0x2b71c6[_0xbb0e('0x37')]=_['merge'](_0x2b71c6[_0xbb0e('0x37')],{'$or':_[_0xbb0e('0x2e')](_0x1bfce6,function(_0x30166d){if(_0x30166d[_0xbb0e('0x3a')]!==_0xbb0e('0x3b')){var _0x53fc5d={};_0x53fc5d[_0x30166d[_0xbb0e('0x26')]]={'$like':'%'+_0x352969[_0xbb0e('0x2f')][_0xbb0e('0x39')]+'%'};return _0x53fc5d;}})});}_0x2b71c6=_[_0xbb0e('0x3c')]({},_0x2b71c6,_0x352969['options']);var _0x547fb4={'where':_0x2b71c6[_0xbb0e('0x37')]};return db['AnalyticTreeReport'][_0xbb0e('0x3d')](_0x547fb4)[_0xbb0e('0x22')](function(_0x5ad32e){_0x458db2['count']=_0x5ad32e;if(_0x352969[_0xbb0e('0x2f')]['includeAll']){_0x2b71c6[_0xbb0e('0x3e')]=[{'all':!![]}];}return db[_0xbb0e('0x29')][_0xbb0e('0x3f')](_0x2b71c6);})[_0xbb0e('0x22')](function(_0x35cddf){_0x458db2['rows']=_0x35cddf;return _0x458db2;})[_0xbb0e('0x22')](respondWithFilteredResult(_0x3b0dff,_0x2b71c6))[_0xbb0e('0x40')](handleError(_0x3b0dff,null));};exports['show']=function(_0x329024,_0x573d0e){var _0xfcc67f={'raw':!![],'where':{'id':_0x329024[_0xbb0e('0x41')]['id']}},_0x5ae679={};_0x5ae679[_0xbb0e('0x2d')]=_[_0xbb0e('0x42')](db[_0xbb0e('0x29')][_0xbb0e('0x2a')]);_0x5ae679['query']=_['keys'](_0x329024[_0xbb0e('0x2f')]);_0x5ae679['filters']=_[_0xbb0e('0x43')](_0x5ae679[_0xbb0e('0x2d')],_0x5ae679['query']);_0xfcc67f[_0xbb0e('0x30')]=_[_0xbb0e('0x43')](_0x5ae679[_0xbb0e('0x2d')],qs[_0xbb0e('0x31')](_0x329024[_0xbb0e('0x2f')][_0xbb0e('0x31')]));_0xfcc67f[_0xbb0e('0x30')]=_0xfcc67f['attributes']['length']?_0xfcc67f[_0xbb0e('0x30')]:_0x5ae679[_0xbb0e('0x2d')];if(_0x329024[_0xbb0e('0x2f')][_0xbb0e('0x44')]){_0xfcc67f[_0xbb0e('0x3e')]=[{'all':!![]}];}_0xfcc67f=_[_0xbb0e('0x3c')]({},_0xfcc67f,_0x329024[_0xbb0e('0x45')]);return db[_0xbb0e('0x29')][_0xbb0e('0x46')](_0xfcc67f)['then'](handleEntityNotFound(_0x573d0e,null))[_0xbb0e('0x22')](respondWithResult(_0x573d0e,null))[_0xbb0e('0x40')](handleError(_0x573d0e,null));};exports[_0xbb0e('0x47')]=function(_0x43372a,_0x54a022){return db[_0xbb0e('0x29')][_0xbb0e('0x47')](_0x43372a['body'],{})[_0xbb0e('0x22')](respondWithResult(_0x54a022,0xc9))[_0xbb0e('0x40')](handleError(_0x54a022,null));};exports[_0xbb0e('0x21')]=function(_0x5472d5,_0xc3a4f7){if(_0x5472d5['body']['id']){delete _0x5472d5[_0xbb0e('0x48')]['id'];}return db['AnalyticTreeReport'][_0xbb0e('0x46')]({'where':{'id':_0x5472d5['params']['id']}})[_0xbb0e('0x22')](handleEntityNotFound(_0xc3a4f7,null))[_0xbb0e('0x22')](saveUpdates(_0x5472d5[_0xbb0e('0x48')],null))[_0xbb0e('0x22')](respondWithResult(_0xc3a4f7,null))[_0xbb0e('0x40')](handleError(_0xc3a4f7,null));};exports[_0xbb0e('0x23')]=function(_0x3f28a0,_0xf8d81f){return db[_0xbb0e('0x29')]['find']({'where':{'id':_0x3f28a0[_0xbb0e('0x41')]['id']}})['then'](handleEntityNotFound(_0xf8d81f,null))['then'](removeEntity(_0xf8d81f,null))[_0xbb0e('0x40')](handleError(_0xf8d81f,null));};
\ No newline at end of file
+var _0x80e9=['../../mysqldb','end','status','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x201d1c,_0xde9337){var _0x45434e=function(_0x9640d5){while(--_0x9640d5){_0x201d1c['push'](_0x201d1c['shift']());}};_0x45434e(++_0xde9337);}(_0x80e9,0x7c));var _0x980e=function(_0x556aa5,_0x184887){_0x556aa5=_0x556aa5-0x0;var _0x2a5813=_0x80e9[_0x556aa5];return _0x2a5813;};'use strict';var emlformat=require(_0x980e('0x0'));var rimraf=require(_0x980e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x980e('0x2'));var rp=require(_0x980e('0x3'));var moment=require(_0x980e('0x4'));var BPromise=require(_0x980e('0x5'));var Mustache=require('mustache');var util=require(_0x980e('0x6'));var path=require(_0x980e('0x7'));var sox=require(_0x980e('0x8'));var csv=require(_0x980e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x980e('0xa'));var _=require('lodash');var squel=require(_0x980e('0xb'));var crypto=require(_0x980e('0xc'));var jsforce=require(_0x980e('0xd'));var deskjs=require(_0x980e('0xe'));var toCsv=require(_0x980e('0x9'));var querystring=require(_0x980e('0xf'));var Papa=require('papaparse');var Redis=require(_0x980e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x980e('0x11'));var as=require(_0x980e('0x12'));var hardwareService=require(_0x980e('0x13'));var logger=require(_0x980e('0x14'))(_0x980e('0x15'));var utils=require('../../config/utils');var config=require(_0x980e('0x16'));var licenseUtil=require(_0x980e('0x17'));var db=require(_0x980e('0x18'))['db'];function respondWithStatusCode(_0x53e7,_0x581063){_0x581063=_0x581063||0xcc;return function(_0x38c9fc){if(_0x38c9fc){return _0x53e7['sendStatus'](_0x581063);}return _0x53e7['status'](_0x581063)[_0x980e('0x19')]();};}function respondWithResult(_0x2c24bb,_0xd0cb8e){_0xd0cb8e=_0xd0cb8e||0xc8;return function(_0x3c03e5){if(_0x3c03e5){return _0x2c24bb[_0x980e('0x1a')](_0xd0cb8e)['json'](_0x3c03e5);}};}function respondWithFilteredResult(_0x1d2681,_0x250bae){return function(_0x2ee416){if(_0x2ee416){var _0x5bb956=_0x2ee416[_0x980e('0x1b')],_0x91bfbc=_0x250bae[_0x980e('0x1c')],_0x2cf3d2=_0x250bae['offset']+_0x250bae[_0x980e('0x1d')],_0x263248;if(_0x2cf3d2>=_0x5bb956){_0x2cf3d2=_0x5bb956;_0x263248=0xc8;}else{_0x263248=0xce;}_0x1d2681[_0x980e('0x1a')](_0x263248);return _0x1d2681[_0x980e('0x1e')](_0x980e('0x1f'),_0x91bfbc+'-'+_0x2cf3d2+'/'+_0x5bb956)['json'](_0x2ee416);}return null;};}function patchUpdates(_0x36db81){return function(_0x53d88c){try{jsonpatch[_0x980e('0x20')](_0x53d88c,_0x36db81,!![]);}catch(_0x3ed9c7){return BPromise[_0x980e('0x21')](_0x3ed9c7);}return _0x53d88c['save']();};}function saveUpdates(_0x568ac0,_0x475d9b){return function(_0xad4f73){if(_0xad4f73){return _0xad4f73[_0x980e('0x22')](_0x568ac0)[_0x980e('0x23')](function(_0x127c7a){return _0x127c7a;});}return null;};}function removeEntity(_0x9cd930,_0x255c1d){return function(_0x628d11){if(_0x628d11){return _0x628d11[_0x980e('0x24')]()[_0x980e('0x23')](function(){_0x9cd930['status'](0xcc)[_0x980e('0x19')]();});}};}function handleEntityNotFound(_0x4b1c0e,_0x134f52){return function(_0x1137ec){if(!_0x1137ec){_0x4b1c0e[_0x980e('0x25')](0x194);}return _0x1137ec;};}function handleError(_0x4cec26,_0x57b262){_0x57b262=_0x57b262||0x1f4;return function(_0x5abc5e){logger[_0x980e('0x26')](_0x5abc5e[_0x980e('0x27')]);if(_0x5abc5e[_0x980e('0x28')]){delete _0x5abc5e[_0x980e('0x28')];}_0x4cec26[_0x980e('0x1a')](_0x57b262)['send'](_0x5abc5e);};}exports[_0x980e('0x29')]=function(_0x5795c9,_0x352ae3){var _0x2a7a83={},_0x5a1ce0={},_0x5d9038={'count':0x0,'rows':[]};var _0x4745ed=_[_0x980e('0x2a')](db[_0x980e('0x2b')][_0x980e('0x2c')],function(_0x2d7634){return{'name':_0x2d7634[_0x980e('0x2d')],'type':_0x2d7634[_0x980e('0x2e')]['key']};});_0x5a1ce0['model']=_[_0x980e('0x2a')](_0x4745ed,_0x980e('0x28'));_0x5a1ce0['query']=_['keys'](_0x5795c9[_0x980e('0x2f')]);_0x5a1ce0[_0x980e('0x30')]=_[_0x980e('0x31')](_0x5a1ce0[_0x980e('0x32')],_0x5a1ce0[_0x980e('0x2f')]);_0x2a7a83[_0x980e('0x33')]=_[_0x980e('0x31')](_0x5a1ce0['model'],qs[_0x980e('0x34')](_0x5795c9['query'][_0x980e('0x34')]));_0x2a7a83[_0x980e('0x33')]=_0x2a7a83[_0x980e('0x33')][_0x980e('0x35')]?_0x2a7a83[_0x980e('0x33')]:_0x5a1ce0[_0x980e('0x32')];if(!_0x5795c9[_0x980e('0x2f')][_0x980e('0x36')](_0x980e('0x37'))){_0x2a7a83[_0x980e('0x1d')]=qs[_0x980e('0x1d')](_0x5795c9[_0x980e('0x2f')][_0x980e('0x1d')]);_0x2a7a83['offset']=qs[_0x980e('0x1c')](_0x5795c9[_0x980e('0x2f')][_0x980e('0x1c')]);}_0x2a7a83[_0x980e('0x38')]=qs[_0x980e('0x39')](_0x5795c9[_0x980e('0x2f')][_0x980e('0x39')]);_0x2a7a83[_0x980e('0x3a')]=qs[_0x980e('0x30')](_[_0x980e('0x3b')](_0x5795c9[_0x980e('0x2f')],_0x5a1ce0['filters']),_0x4745ed);if(_0x5795c9[_0x980e('0x2f')][_0x980e('0x3c')]){_0x2a7a83[_0x980e('0x3a')]=_[_0x980e('0x3d')](_0x2a7a83[_0x980e('0x3a')],{'$or':_[_0x980e('0x2a')](_0x4745ed,function(_0x217a5f){if(_0x217a5f[_0x980e('0x2e')]!==_0x980e('0x3e')){var _0x5cd285={};_0x5cd285[_0x217a5f[_0x980e('0x28')]]={'$like':'%'+_0x5795c9[_0x980e('0x2f')][_0x980e('0x3c')]+'%'};return _0x5cd285;}})});}_0x2a7a83=_[_0x980e('0x3d')]({},_0x2a7a83,_0x5795c9[_0x980e('0x3f')]);var _0x3d1397={'where':_0x2a7a83[_0x980e('0x3a')]};return db[_0x980e('0x2b')][_0x980e('0x1b')](_0x3d1397)['then'](function(_0x35f0ae){_0x5d9038[_0x980e('0x1b')]=_0x35f0ae;if(_0x5795c9[_0x980e('0x2f')][_0x980e('0x40')]){_0x2a7a83[_0x980e('0x41')]=[{'all':!![]}];}return db[_0x980e('0x2b')][_0x980e('0x42')](_0x2a7a83);})[_0x980e('0x23')](function(_0x6718cb){_0x5d9038['rows']=_0x6718cb;return _0x5d9038;})['then'](respondWithFilteredResult(_0x352ae3,_0x2a7a83))[_0x980e('0x43')](handleError(_0x352ae3,null));};exports[_0x980e('0x44')]=function(_0x47d72f,_0x3f7191){var _0x5e7665={'raw':!![],'where':{'id':_0x47d72f[_0x980e('0x45')]['id']}},_0x3ade6b={};_0x3ade6b[_0x980e('0x32')]=_['keys'](db['AnalyticTreeReport'][_0x980e('0x2c')]);_0x3ade6b['query']=_[_0x980e('0x46')](_0x47d72f['query']);_0x3ade6b[_0x980e('0x30')]=_[_0x980e('0x31')](_0x3ade6b[_0x980e('0x32')],_0x3ade6b[_0x980e('0x2f')]);_0x5e7665[_0x980e('0x33')]=_[_0x980e('0x31')](_0x3ade6b[_0x980e('0x32')],qs['fields'](_0x47d72f[_0x980e('0x2f')][_0x980e('0x34')]));_0x5e7665[_0x980e('0x33')]=_0x5e7665[_0x980e('0x33')][_0x980e('0x35')]?_0x5e7665['attributes']:_0x3ade6b[_0x980e('0x32')];if(_0x47d72f[_0x980e('0x2f')]['includeAll']){_0x5e7665['include']=[{'all':!![]}];}_0x5e7665=_['merge']({},_0x5e7665,_0x47d72f[_0x980e('0x3f')]);return db['AnalyticTreeReport'][_0x980e('0x47')](_0x5e7665)['then'](handleEntityNotFound(_0x3f7191,null))[_0x980e('0x23')](respondWithResult(_0x3f7191,null))[_0x980e('0x43')](handleError(_0x3f7191,null));};exports[_0x980e('0x48')]=function(_0x2b6cb0,_0x1120ef){return db['AnalyticTreeReport'][_0x980e('0x48')](_0x2b6cb0[_0x980e('0x49')],{})['then'](respondWithResult(_0x1120ef,0xc9))[_0x980e('0x43')](handleError(_0x1120ef,null));};exports[_0x980e('0x22')]=function(_0x33272e,_0x2291cb){if(_0x33272e[_0x980e('0x49')]['id']){delete _0x33272e[_0x980e('0x49')]['id'];}return db[_0x980e('0x2b')][_0x980e('0x47')]({'where':{'id':_0x33272e[_0x980e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2291cb,null))[_0x980e('0x23')](saveUpdates(_0x33272e['body'],null))['then'](respondWithResult(_0x2291cb,null))[_0x980e('0x43')](handleError(_0x2291cb,null));};exports[_0x980e('0x24')]=function(_0x587974,_0x3878e8){return db[_0x980e('0x2b')][_0x980e('0x47')]({'where':{'id':_0x587974[_0x980e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3878e8,null))[_0x980e('0x23')](removeEntity(_0x3878e8,null))[_0x980e('0x43')](handleError(_0x3878e8,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 1a3ce90..115b98b 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 _0xf562=['moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x32c587,_0x55b37b){var _0x47ba0a=function(_0x45a31f){while(--_0x45a31f){_0x32c587['push'](_0x32c587['shift']());}};_0x47ba0a(++_0x55b37b);}(_0xf562,0x100));var _0x2f56=function(_0x3b4804,_0x3b8d95){_0x3b4804=_0x3b4804-0x0;var _0x18721b=_0xf562[_0x3b4804];return _0x18721b;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));var logger=require(_0x2f56('0x2'))(_0x2f56('0x3'));var moment=require(_0x2f56('0x4'));var BPromise=require(_0x2f56('0x5'));var rp=require(_0x2f56('0x6'));var fs=require('fs');var path=require(_0x2f56('0x7'));var rimraf=require(_0x2f56('0x8'));var config=require('../../config/environment');var attributes=require(_0x2f56('0x9'));module['exports']=function(_0x14436b,_0x5b3784){return _0x14436b[_0x2f56('0xa')](_0x2f56('0xb'),attributes,{'tableName':_0x2f56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd0a=['analytics_report_trees','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x3a109e,_0x350ec5){_0x3a109e=_0x3a109e-0x0;var _0x552059=_0xbd0a[_0x3a109e];return _0x552059;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var logger=require(_0xabd0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xabd0('0x2'));var fs=require('fs');var path=require(_0xabd0('0x3'));var rimraf=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var attributes=require(_0xabd0('0x6'));module[_0xabd0('0x7')]=function(_0x221368,_0xb41697){return _0x221368[_0xabd0('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xabd0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 1d23bcc..f176fb8 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 _0x7fb4=['code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x7fb4,0x1e6));var _0x47fb=function(_0xbf5379,_0x3f3cf0){_0xbf5379=_0xbf5379-0x0;var _0x16bf4e=_0x7fb4[_0xbf5379];return _0x16bf4e;};'use strict';var _=require(_0x47fb('0x0'));var util=require(_0x47fb('0x1'));var moment=require(_0x47fb('0x2'));var BPromise=require(_0x47fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47fb('0x4'))['db'];var utils=require(_0x47fb('0x5'));var logger=require(_0x47fb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x47fb('0x7'));var client=jayson[_0x47fb('0x8')][_0x47fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3390f8,_0x42af2f,_0x55d255){return new BPromise(function(_0x5cade1,_0x536105){return client[_0x47fb('0xa')](_0x3390f8,_0x55d255)[_0x47fb('0xb')](function(_0x13c223){logger[_0x47fb('0xc')](_0x47fb('0xd'),_0x42af2f,'request\x20sent');logger[_0x47fb('0xe')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x42af2f,_0x47fb('0xf'),JSON[_0x47fb('0x10')](_0x13c223));if(_0x13c223[_0x47fb('0x11')]){if(_0x13c223[_0x47fb('0x11')][_0x47fb('0x12')]===0x1f4){logger[_0x47fb('0x11')](_0x47fb('0xd'),_0x42af2f,_0x13c223[_0x47fb('0x11')][_0x47fb('0x13')]);return _0x536105(_0x13c223['error'][_0x47fb('0x13')]);}logger[_0x47fb('0x11')](_0x47fb('0xd'),_0x42af2f,_0x13c223[_0x47fb('0x11')][_0x47fb('0x13')]);return _0x5cade1(_0x13c223['error'][_0x47fb('0x13')]);}else{logger[_0x47fb('0xc')](_0x47fb('0xd'),_0x42af2f,_0x47fb('0xf'));_0x5cade1(_0x13c223['result'][_0x47fb('0x13')]);}})[_0x47fb('0x14')](function(_0x3f547f){logger[_0x47fb('0x11')](_0x47fb('0xd'),_0x42af2f,_0x3f547f);_0x536105(_0x3f547f);});});}
\ No newline at end of file
+var _0xb704=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticTreeReport,\x20%s,\x20%s','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb704,0x169));var _0x4b70=function(_0x3c6118,_0x379956){_0x3c6118=_0x3c6118-0x0;var _0x436371=_0xb704[_0x3c6118];return _0x436371;};'use strict';var _=require(_0x4b70('0x0'));var util=require(_0x4b70('0x1'));var moment=require(_0x4b70('0x2'));var BPromise=require(_0x4b70('0x3'));var rs=require(_0x4b70('0x4'));var fs=require('fs');var Redis=require(_0x4b70('0x5'));var db=require(_0x4b70('0x6'))['db'];var utils=require(_0x4b70('0x7'));var logger=require(_0x4b70('0x8'))(_0x4b70('0x9'));var config=require(_0x4b70('0xa'));var jayson=require(_0x4b70('0xb'));var client=jayson[_0x4b70('0xc')][_0x4b70('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2119d9,_0x1346a0,_0x20a692){return new BPromise(function(_0x5cee64,_0x28c805){return client[_0x4b70('0xe')](_0x2119d9,_0x20a692)['then'](function(_0x5b38d2){logger[_0x4b70('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1346a0,_0x4b70('0x10'));logger[_0x4b70('0x11')](_0x4b70('0x12'),_0x1346a0,_0x4b70('0x10'),JSON['stringify'](_0x5b38d2));if(_0x5b38d2['error']){if(_0x5b38d2[_0x4b70('0x13')]['code']===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x1346a0,_0x5b38d2[_0x4b70('0x13')]['message']);return _0x28c805(_0x5b38d2[_0x4b70('0x13')][_0x4b70('0x14')]);}logger[_0x4b70('0x13')](_0x4b70('0x15'),_0x1346a0,_0x5b38d2[_0x4b70('0x13')][_0x4b70('0x14')]);return _0x5cee64(_0x5b38d2[_0x4b70('0x13')][_0x4b70('0x14')]);}else{logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x1346a0,_0x4b70('0x10'));_0x5cee64(_0x5b38d2[_0x4b70('0x16')][_0x4b70('0x14')]);}})[_0x4b70('0x17')](function(_0x1efd31){logger['error'](_0x4b70('0x15'),_0x1346a0,_0x1efd31);_0x28c805(_0x1efd31);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 586b7f6..7a29dcd 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 _0x0193=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4b5eca,_0x1b5e95){var _0x392c13=function(_0x1902dd){while(--_0x1902dd){_0x4b5eca['push'](_0x4b5eca['shift']());}};_0x392c13(++_0x1b5e95);}(_0x0193,0x72));var _0x3019=function(_0x132175,_0xe0ae44){_0x132175=_0x132175-0x0;var _0x16b37f=_0x0193[_0x132175];return _0x16b37f;};'use strict';var multer=require('multer');var util=require(_0x3019('0x0'));var path=require('path');var timeout=require(_0x3019('0x1'));var express=require('express');var router=express[_0x3019('0x2')]();var fs_extra=require(_0x3019('0x3'));var auth=require(_0x3019('0x4'));var interaction=require(_0x3019('0x5'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x3019('0x6')]('/',auth[_0x3019('0x7')](),controller[_0x3019('0x8')]);router[_0x3019('0x6')](_0x3019('0x9'),auth[_0x3019('0x7')](),controller[_0x3019('0xa')]);router[_0x3019('0xb')]('/',auth[_0x3019('0x7')](),controller['create']);router[_0x3019('0xc')](_0x3019('0x9'),auth[_0x3019('0x7')](),controller[_0x3019('0xd')]);router[_0x3019('0xe')](_0x3019('0x9'),auth[_0x3019('0x7')](),controller[_0x3019('0xf')]);module[_0x3019('0x10')]=router;
\ No newline at end of file
+var _0x6fcf=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','multer'];(function(_0x367336,_0x18c229){var _0x3423a7=function(_0xa8fa05){while(--_0xa8fa05){_0x367336['push'](_0x367336['shift']());}};_0x3423a7(++_0x18c229);}(_0x6fcf,0x18e));var _0xf6fc=function(_0x2d01df,_0x429d33){_0x2d01df=_0x2d01df-0x0;var _0x56e944=_0x6fcf[_0x2d01df];return _0x56e944;};'use strict';var multer=require(_0xf6fc('0x0'));var util=require(_0xf6fc('0x1'));var path=require(_0xf6fc('0x2'));var timeout=require(_0xf6fc('0x3'));var express=require(_0xf6fc('0x4'));var router=express[_0xf6fc('0x5')]();var fs_extra=require(_0xf6fc('0x6'));var auth=require(_0xf6fc('0x7'));var interaction=require(_0xf6fc('0x8'));var config=require(_0xf6fc('0x9'));var controller=require(_0xf6fc('0xa'));router[_0xf6fc('0xb')]('/',auth['isAuthenticated'](),controller[_0xf6fc('0xc')]);router[_0xf6fc('0xb')](_0xf6fc('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf6fc('0xe')]('/',auth[_0xf6fc('0xf')](),controller[_0xf6fc('0x10')]);router[_0xf6fc('0x11')](_0xf6fc('0xd'),auth['isAuthenticated'](),controller[_0xf6fc('0x12')]);router[_0xf6fc('0x13')](_0xf6fc('0xd'),auth[_0xf6fc('0xf')](),controller[_0xf6fc('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 5ee0f92..376e346 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 _0x4f2d=['STRING'];(function(_0xb28d75,_0x42c313){var _0x55ad7e=function(_0x2532eb){while(--_0x2532eb){_0xb28d75['push'](_0xb28d75['shift']());}};_0x55ad7e(++_0x42c313);}(_0x4f2d,0x8d));var _0xd4f2=function(_0x4286bc,_0x199bc1){_0x4286bc=_0x4286bc-0x0;var _0x514a5a=_0x4f2d[_0x4286bc];return _0x514a5a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd4f2('0x0')]},'type':{'type':Sequelize[_0xd4f2('0x0')]}};
\ No newline at end of file
+var _0x4fea=['STRING'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4fea,0x14d));var _0xa4fe=function(_0x40c6c9,_0x2b50ee){_0x40c6c9=_0x40c6c9-0x0;var _0x234967=_0x4fea[_0x40c6c9];return _0x234967;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa4fe('0x0')]},'basename':{'type':Sequelize[_0xa4fe('0x0')]},'type':{'type':Sequelize[_0xa4fe('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 8e3751f..027a0cd 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 _0xb5a1=['include','rows','catch','show','length','includeAll','find','params','get','updatedAt','body','omit','createdAt','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','name','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','Attachment'];(function(_0xca9e16,_0x4e801a){var _0x3785ab=function(_0xb79f92){while(--_0xb79f92){_0xca9e16['push'](_0xca9e16['shift']());}};_0x3785ab(++_0x4e801a);}(_0xb5a1,0x6d));var _0x1b5a=function(_0x2ab76b,_0x176579){_0x2ab76b=_0x2ab76b-0x0;var _0x201126=_0xb5a1[_0x2ab76b];return _0x201126;};'use strict';var emlformat=require(_0x1b5a('0x0'));var rimraf=require(_0x1b5a('0x1'));var zipdir=require(_0x1b5a('0x2'));var jsonpatch=require(_0x1b5a('0x3'));var rp=require('request-promise');var moment=require(_0x1b5a('0x4'));var BPromise=require(_0x1b5a('0x5'));var Mustache=require(_0x1b5a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1b5a('0x7'));var csv=require('to-csv');var ejs=require(_0x1b5a('0x8'));var fs=require('fs');var fs_extra=require(_0x1b5a('0x9'));var _=require(_0x1b5a('0xa'));var squel=require('squel');var crypto=require(_0x1b5a('0xb'));var jsforce=require(_0x1b5a('0xc'));var deskjs=require(_0x1b5a('0xd'));var toCsv=require(_0x1b5a('0xe'));var querystring=require(_0x1b5a('0xf'));var Papa=require(_0x1b5a('0x10'));var Redis=require(_0x1b5a('0x11'));var authService=require(_0x1b5a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b5a('0x13'));var logger=require(_0x1b5a('0x14'))(_0x1b5a('0x15'));var utils=require(_0x1b5a('0x16'));var config=require(_0x1b5a('0x17'));var licenseUtil=require(_0x1b5a('0x18'));var db=require(_0x1b5a('0x19'))['db'];function respondWithStatusCode(_0x513a5b,_0x246477){_0x246477=_0x246477||0xcc;return function(_0x3c93b7){if(_0x3c93b7){return _0x513a5b[_0x1b5a('0x1a')](_0x246477);}return _0x513a5b[_0x1b5a('0x1b')](_0x246477)['end']();};}function respondWithResult(_0x246022,_0x3b3384){_0x3b3384=_0x3b3384||0xc8;return function(_0x3c9b68){if(_0x3c9b68){return _0x246022['status'](_0x3b3384)[_0x1b5a('0x1c')](_0x3c9b68);}};}function respondWithFilteredResult(_0x41e293,_0x1d20b5){return function(_0x326a82){if(_0x326a82){var _0x211ea3=_0x326a82[_0x1b5a('0x1d')],_0x15efb7=_0x1d20b5[_0x1b5a('0x1e')],_0x82f69b=_0x1d20b5[_0x1b5a('0x1e')]+_0x1d20b5[_0x1b5a('0x1f')],_0x251a4a;if(_0x82f69b>=_0x211ea3){_0x82f69b=_0x211ea3;_0x251a4a=0xc8;}else{_0x251a4a=0xce;}_0x41e293[_0x1b5a('0x1b')](_0x251a4a);return _0x41e293[_0x1b5a('0x20')](_0x1b5a('0x21'),_0x15efb7+'-'+_0x82f69b+'/'+_0x211ea3)[_0x1b5a('0x1c')](_0x326a82);}return null;};}function patchUpdates(_0x42b334){return function(_0x75254f){try{jsonpatch['apply'](_0x75254f,_0x42b334,!![]);}catch(_0x1d1e68){return BPromise[_0x1b5a('0x22')](_0x1d1e68);}return _0x75254f[_0x1b5a('0x23')]();};}function saveUpdates(_0x3e17e3,_0x4e8712){return function(_0x5c52ba){if(_0x5c52ba){return _0x5c52ba[_0x1b5a('0x24')](_0x3e17e3)[_0x1b5a('0x25')](function(_0x59e8a2){return _0x59e8a2;});}return null;};}function removeEntity(_0x474909,_0x311068){return function(_0x4dd0a0){if(_0x4dd0a0){return _0x4dd0a0[_0x1b5a('0x26')]()[_0x1b5a('0x25')](function(){_0x474909[_0x1b5a('0x1b')](0xcc)[_0x1b5a('0x27')]();});}};}function handleEntityNotFound(_0x19ebfc,_0x4a413b){return function(_0x327c17){if(!_0x327c17){_0x19ebfc['sendStatus'](0x194);}return _0x327c17;};}function handleError(_0x368677,_0x504d74){_0x504d74=_0x504d74||0x1f4;return function(_0x151208){logger['error'](_0x151208['stack']);if(_0x151208['name']){delete _0x151208[_0x1b5a('0x28')];}_0x368677[_0x1b5a('0x1b')](_0x504d74)['send'](_0x151208);};}exports['index']=function(_0x3879d0,_0x10cfb8){var _0x5be0e1={},_0x141772={},_0x470aaa={'count':0x0,'rows':[]};var _0x7f9a68=_[_0x1b5a('0x29')](db['Attachment'][_0x1b5a('0x2a')],function(_0x1338a0){return{'name':_0x1338a0['fieldName'],'type':_0x1338a0[_0x1b5a('0x2b')]['key']};});_0x141772[_0x1b5a('0x2c')]=_[_0x1b5a('0x29')](_0x7f9a68,_0x1b5a('0x28'));_0x141772[_0x1b5a('0x2d')]=_[_0x1b5a('0x2e')](_0x3879d0['query']);_0x141772['filters']=_[_0x1b5a('0x2f')](_0x141772['model'],_0x141772[_0x1b5a('0x2d')]);_0x5be0e1[_0x1b5a('0x30')]=_[_0x1b5a('0x2f')](_0x141772[_0x1b5a('0x2c')],qs[_0x1b5a('0x31')](_0x3879d0['query']['fields']));_0x5be0e1[_0x1b5a('0x30')]=_0x5be0e1[_0x1b5a('0x30')]['length']?_0x5be0e1['attributes']:_0x141772[_0x1b5a('0x2c')];if(!_0x3879d0[_0x1b5a('0x2d')][_0x1b5a('0x32')]('nolimit')){_0x5be0e1[_0x1b5a('0x1f')]=qs[_0x1b5a('0x1f')](_0x3879d0['query'][_0x1b5a('0x1f')]);_0x5be0e1[_0x1b5a('0x1e')]=qs['offset'](_0x3879d0['query']['offset']);}_0x5be0e1[_0x1b5a('0x33')]=qs[_0x1b5a('0x34')](_0x3879d0['query']['sort']);_0x5be0e1[_0x1b5a('0x35')]=qs[_0x1b5a('0x36')](_[_0x1b5a('0x37')](_0x3879d0['query'],_0x141772['filters']),_0x7f9a68);if(_0x3879d0[_0x1b5a('0x2d')][_0x1b5a('0x38')]){_0x5be0e1[_0x1b5a('0x35')]=_['merge'](_0x5be0e1['where'],{'$or':_[_0x1b5a('0x29')](_0x7f9a68,function(_0x2f4c68){if(_0x2f4c68[_0x1b5a('0x2b')]!==_0x1b5a('0x39')){var _0x3047a5={};_0x3047a5[_0x2f4c68['name']]={'$like':'%'+_0x3879d0[_0x1b5a('0x2d')]['filter']+'%'};return _0x3047a5;}})});}_0x5be0e1=_[_0x1b5a('0x3a')]({},_0x5be0e1,_0x3879d0[_0x1b5a('0x3b')]);var _0x595940={'where':_0x5be0e1[_0x1b5a('0x35')]};return db[_0x1b5a('0x3c')][_0x1b5a('0x1d')](_0x595940)[_0x1b5a('0x25')](function(_0x5cf511){_0x470aaa['count']=_0x5cf511;if(_0x3879d0[_0x1b5a('0x2d')]['includeAll']){_0x5be0e1[_0x1b5a('0x3d')]=[{'all':!![]}];}return db[_0x1b5a('0x3c')]['findAll'](_0x5be0e1);})[_0x1b5a('0x25')](function(_0x1b562f){_0x470aaa[_0x1b5a('0x3e')]=_0x1b562f;return _0x470aaa;})[_0x1b5a('0x25')](respondWithFilteredResult(_0x10cfb8,_0x5be0e1))[_0x1b5a('0x3f')](handleError(_0x10cfb8,null));};exports[_0x1b5a('0x40')]=function(_0x3fd1af,_0x2b6d2b){var _0x3928a6={'raw':!![],'where':{'id':_0x3fd1af['params']['id']}},_0x3f75c3={};_0x3f75c3[_0x1b5a('0x2c')]=_[_0x1b5a('0x2e')](db[_0x1b5a('0x3c')]['rawAttributes']);_0x3f75c3[_0x1b5a('0x2d')]=_[_0x1b5a('0x2e')](_0x3fd1af[_0x1b5a('0x2d')]);_0x3f75c3[_0x1b5a('0x36')]=_[_0x1b5a('0x2f')](_0x3f75c3[_0x1b5a('0x2c')],_0x3f75c3[_0x1b5a('0x2d')]);_0x3928a6['attributes']=_['intersection'](_0x3f75c3[_0x1b5a('0x2c')],qs[_0x1b5a('0x31')](_0x3fd1af[_0x1b5a('0x2d')][_0x1b5a('0x31')]));_0x3928a6[_0x1b5a('0x30')]=_0x3928a6[_0x1b5a('0x30')][_0x1b5a('0x41')]?_0x3928a6[_0x1b5a('0x30')]:_0x3f75c3['model'];if(_0x3fd1af['query'][_0x1b5a('0x42')]){_0x3928a6['include']=[{'all':!![]}];}_0x3928a6=_[_0x1b5a('0x3a')]({},_0x3928a6,_0x3fd1af[_0x1b5a('0x3b')]);return db[_0x1b5a('0x3c')][_0x1b5a('0x43')](_0x3928a6)[_0x1b5a('0x25')](handleEntityNotFound(_0x2b6d2b,null))[_0x1b5a('0x25')](respondWithResult(_0x2b6d2b,null))[_0x1b5a('0x3f')](handleError(_0x2b6d2b,null));};exports['clone']=function(_0x21106d,_0x2954f1){var _0x19ef8c={'where':{'id':_0x21106d[_0x1b5a('0x44')]['id']}},_0x5cf476={};_0x5cf476[_0x1b5a('0x2c')]=_[_0x1b5a('0x2e')](db[_0x1b5a('0x3c')]['rawAttributes']);_0x19ef8c['attributes']=_[_0x1b5a('0x2f')](_0x5cf476['model'],qs[_0x1b5a('0x31')](_0x21106d['query']['fields']));_0x19ef8c[_0x1b5a('0x30')]=_0x19ef8c['attributes'][_0x1b5a('0x41')]?_0x19ef8c['attributes']:_0x5cf476['model'];if(_0x21106d[_0x1b5a('0x2d')][_0x1b5a('0x42')]){_0x19ef8c[_0x1b5a('0x3d')]=[{'all':!![]}];}_0x19ef8c=_[_0x1b5a('0x3a')]({},_0x19ef8c,_0x21106d['options']);return db[_0x1b5a('0x3c')][_0x1b5a('0x43')](_0x19ef8c)[_0x1b5a('0x25')](handleEntityNotFound(_0x2954f1,null))[_0x1b5a('0x25')](function(_0x1f38d0){if(_0x1f38d0){var _0x3545d8=_0x1f38d0[_0x1b5a('0x45')]({'plain':!![]});_0x3545d8=qs['omit'](_0x3545d8,['id','createdAt',_0x1b5a('0x46')]);_0x21106d[_0x1b5a('0x47')]=_[_0x1b5a('0x48')](_0x21106d['body'],['id',_0x1b5a('0x49'),_0x1b5a('0x46')]);return db[_0x1b5a('0x3c')]['create'](_[_0x1b5a('0x3a')](_0x3545d8,_0x21106d[_0x1b5a('0x47')]),{'include':_0x21106d[_0x1b5a('0x2d')][_0x1b5a('0x42')]?[{'all':!![]}]:undefined});}})[_0x1b5a('0x25')](respondWithResult(_0x2954f1,0xc9))[_0x1b5a('0x3f')](handleError(_0x2954f1,null));};exports[_0x1b5a('0x24')]=function(_0x5aafc0,_0x2a60d9){if(_0x5aafc0['body']['id']){delete _0x5aafc0[_0x1b5a('0x47')]['id'];}return db[_0x1b5a('0x3c')][_0x1b5a('0x43')]({'where':{'id':_0x5aafc0[_0x1b5a('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a60d9,null))[_0x1b5a('0x25')](saveUpdates(_0x5aafc0[_0x1b5a('0x47')],null))[_0x1b5a('0x25')](respondWithResult(_0x2a60d9,null))['catch'](handleError(_0x2a60d9,null));};exports['destroy']=function(_0x4329f0,_0x5a07d2){return db['Attachment'][_0x1b5a('0x43')]({'where':{'id':_0x4329f0[_0x1b5a('0x44')]['id']}})[_0x1b5a('0x25')](handleEntityNotFound(_0x5a07d2,null))['then'](removeEntity(_0x5a07d2,null))[_0x1b5a('0x3f')](handleError(_0x5a07d2,null));};exports[_0x1b5a('0x4a')]=function(_0x2c2a7b,_0x2de4b9,_0x512bfa){_0x2c2a7b[_0x1b5a('0x47')][_0x1b5a('0x28')]=_0x2c2a7b[_0x1b5a('0x4b')][_0x1b5a('0x4c')];_0x2c2a7b['body'][_0x1b5a('0x4d')]=_0x2c2a7b['file'][_0x1b5a('0x4e')];_0x2c2a7b[_0x1b5a('0x47')][_0x1b5a('0x2b')]=_0x2c2a7b[_0x1b5a('0x4b')][_0x1b5a('0x4f')];return db[_0x1b5a('0x3c')][_0x1b5a('0x4a')](_0x2c2a7b[_0x1b5a('0x47')])[_0x1b5a('0x25')](respondWithResult(_0x2de4b9,0xc9))[_0x1b5a('0x3f')](handleError(_0x2de4b9,null));};exports[_0x1b5a('0x50')]=function(_0x7153f5,_0x56fe19,_0x5d6089){return db[_0x1b5a('0x3c')]['findOne']({'where':{'id':_0x7153f5['params']['id']},'raw':!![]})[_0x1b5a('0x25')](handleEntityNotFound(_0x56fe19,null))[_0x1b5a('0x25')](function(_0x4a13b1){if(_0x4a13b1){var _0x3c1118=_0x4a13b1[_0x1b5a('0x51')]!==null;var _0x4c1c69=path[_0x1b5a('0x52')](config[_0x1b5a('0x53')],_0x1b5a('0x54'));if(_0x3c1118){_0x4c1c69=path['join'](_0x4c1c69,'offline-chat/');}var _0x865002=path[_0x1b5a('0x52')](_0x4c1c69,_0x4a13b1[_0x1b5a('0x4d')]);return _0x56fe19['download'](_0x865002);}})[_0x1b5a('0x3f')](handleError(_0x56fe19,null));};
\ No newline at end of file
+var _0xc0b7=['merge','get','omit','createdAt','updatedAt','body','create','destroy','file','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','basename','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','save','update','then','sendStatus','error','stack','name','index','map','rawAttributes','type','key','query','keys','filters','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','attributes','intersection','find','clone','Attachment'];(function(_0x3026cf,_0x4717b3){var _0x5bb000=function(_0x1f4996){while(--_0x1f4996){_0x3026cf['push'](_0x3026cf['shift']());}};_0x5bb000(++_0x4717b3);}(_0xc0b7,0x171));var _0x7c0b=function(_0x74f20e,_0x2fc090){_0x74f20e=_0x74f20e-0x0;var _0x4161dd=_0xc0b7[_0x74f20e];return _0x4161dd;};'use strict';var emlformat=require(_0x7c0b('0x0'));var rimraf=require(_0x7c0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c0b('0x2'));var rp=require(_0x7c0b('0x3'));var moment=require('moment');var BPromise=require(_0x7c0b('0x4'));var Mustache=require(_0x7c0b('0x5'));var util=require(_0x7c0b('0x6'));var path=require(_0x7c0b('0x7'));var sox=require('sox');var csv=require(_0x7c0b('0x8'));var ejs=require(_0x7c0b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c0b('0xa'));var squel=require(_0x7c0b('0xb'));var crypto=require(_0x7c0b('0xc'));var jsforce=require(_0x7c0b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7c0b('0x8'));var querystring=require(_0x7c0b('0xe'));var Papa=require(_0x7c0b('0xf'));var Redis=require(_0x7c0b('0x10'));var authService=require(_0x7c0b('0x11'));var qs=require(_0x7c0b('0x12'));var as=require(_0x7c0b('0x13'));var hardwareService=require(_0x7c0b('0x14'));var logger=require(_0x7c0b('0x15'))('api');var utils=require(_0x7c0b('0x16'));var config=require(_0x7c0b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c0b('0x18'))['db'];function respondWithStatusCode(_0x2efe8c,_0x31784a){_0x31784a=_0x31784a||0xcc;return function(_0x57e72e){if(_0x57e72e){return _0x2efe8c['sendStatus'](_0x31784a);}return _0x2efe8c[_0x7c0b('0x19')](_0x31784a)[_0x7c0b('0x1a')]();};}function respondWithResult(_0x3ae20a,_0x41d730){_0x41d730=_0x41d730||0xc8;return function(_0x4f5787){if(_0x4f5787){return _0x3ae20a[_0x7c0b('0x19')](_0x41d730)['json'](_0x4f5787);}};}function respondWithFilteredResult(_0x287307,_0x1eeec2){return function(_0x16a0e8){if(_0x16a0e8){var _0x302938=_0x16a0e8[_0x7c0b('0x1b')],_0x58f72b=_0x1eeec2[_0x7c0b('0x1c')],_0x4ade16=_0x1eeec2[_0x7c0b('0x1c')]+_0x1eeec2[_0x7c0b('0x1d')],_0x2137a2;if(_0x4ade16>=_0x302938){_0x4ade16=_0x302938;_0x2137a2=0xc8;}else{_0x2137a2=0xce;}_0x287307[_0x7c0b('0x19')](_0x2137a2);return _0x287307[_0x7c0b('0x1e')](_0x7c0b('0x1f'),_0x58f72b+'-'+_0x4ade16+'/'+_0x302938)[_0x7c0b('0x20')](_0x16a0e8);}return null;};}function patchUpdates(_0x1c192c){return function(_0x604e8){try{jsonpatch['apply'](_0x604e8,_0x1c192c,!![]);}catch(_0x3d3ada){return BPromise['reject'](_0x3d3ada);}return _0x604e8[_0x7c0b('0x21')]();};}function saveUpdates(_0x371639,_0x2f03e2){return function(_0x9d0dd3){if(_0x9d0dd3){return _0x9d0dd3[_0x7c0b('0x22')](_0x371639)['then'](function(_0x40d7f0){return _0x40d7f0;});}return null;};}function removeEntity(_0x3126f3,_0x47c743){return function(_0x4cd12e){if(_0x4cd12e){return _0x4cd12e['destroy']()[_0x7c0b('0x23')](function(){_0x3126f3['status'](0xcc)[_0x7c0b('0x1a')]();});}};}function handleEntityNotFound(_0xb49c0c,_0x3ffe90){return function(_0x3bc7c8){if(!_0x3bc7c8){_0xb49c0c[_0x7c0b('0x24')](0x194);}return _0x3bc7c8;};}function handleError(_0x2b72f2,_0x188820){_0x188820=_0x188820||0x1f4;return function(_0xec8898){logger[_0x7c0b('0x25')](_0xec8898[_0x7c0b('0x26')]);if(_0xec8898['name']){delete _0xec8898[_0x7c0b('0x27')];}_0x2b72f2[_0x7c0b('0x19')](_0x188820)['send'](_0xec8898);};}exports[_0x7c0b('0x28')]=function(_0x1a5d6f,_0x261154){var _0x41bbf8={},_0x52eb73={},_0xb956c8={'count':0x0,'rows':[]};var _0x4d72b7=_[_0x7c0b('0x29')](db['Attachment'][_0x7c0b('0x2a')],function(_0x5e32ca){return{'name':_0x5e32ca['fieldName'],'type':_0x5e32ca[_0x7c0b('0x2b')][_0x7c0b('0x2c')]};});_0x52eb73['model']=_[_0x7c0b('0x29')](_0x4d72b7,_0x7c0b('0x27'));_0x52eb73[_0x7c0b('0x2d')]=_[_0x7c0b('0x2e')](_0x1a5d6f[_0x7c0b('0x2d')]);_0x52eb73[_0x7c0b('0x2f')]=_['intersection'](_0x52eb73[_0x7c0b('0x30')],_0x52eb73[_0x7c0b('0x2d')]);_0x41bbf8['attributes']=_['intersection'](_0x52eb73['model'],qs[_0x7c0b('0x31')](_0x1a5d6f['query'][_0x7c0b('0x31')]));_0x41bbf8['attributes']=_0x41bbf8['attributes'][_0x7c0b('0x32')]?_0x41bbf8['attributes']:_0x52eb73['model'];if(!_0x1a5d6f[_0x7c0b('0x2d')][_0x7c0b('0x33')]('nolimit')){_0x41bbf8[_0x7c0b('0x1d')]=qs['limit'](_0x1a5d6f[_0x7c0b('0x2d')][_0x7c0b('0x1d')]);_0x41bbf8[_0x7c0b('0x1c')]=qs[_0x7c0b('0x1c')](_0x1a5d6f[_0x7c0b('0x2d')][_0x7c0b('0x1c')]);}_0x41bbf8[_0x7c0b('0x34')]=qs[_0x7c0b('0x35')](_0x1a5d6f[_0x7c0b('0x2d')][_0x7c0b('0x35')]);_0x41bbf8[_0x7c0b('0x36')]=qs[_0x7c0b('0x2f')](_[_0x7c0b('0x37')](_0x1a5d6f['query'],_0x52eb73[_0x7c0b('0x2f')]),_0x4d72b7);if(_0x1a5d6f[_0x7c0b('0x2d')][_0x7c0b('0x38')]){_0x41bbf8[_0x7c0b('0x36')]=_['merge'](_0x41bbf8['where'],{'$or':_[_0x7c0b('0x29')](_0x4d72b7,function(_0x31075c){if(_0x31075c[_0x7c0b('0x2b')]!==_0x7c0b('0x39')){var _0x203368={};_0x203368[_0x31075c[_0x7c0b('0x27')]]={'$like':'%'+_0x1a5d6f[_0x7c0b('0x2d')]['filter']+'%'};return _0x203368;}})});}_0x41bbf8=_['merge']({},_0x41bbf8,_0x1a5d6f[_0x7c0b('0x3a')]);var _0x155fa0={'where':_0x41bbf8[_0x7c0b('0x36')]};return db['Attachment'][_0x7c0b('0x1b')](_0x155fa0)[_0x7c0b('0x23')](function(_0x316c98){_0xb956c8[_0x7c0b('0x1b')]=_0x316c98;if(_0x1a5d6f[_0x7c0b('0x2d')][_0x7c0b('0x3b')]){_0x41bbf8[_0x7c0b('0x3c')]=[{'all':!![]}];}return db['Attachment'][_0x7c0b('0x3d')](_0x41bbf8);})[_0x7c0b('0x23')](function(_0x22ebac){_0xb956c8[_0x7c0b('0x3e')]=_0x22ebac;return _0xb956c8;})[_0x7c0b('0x23')](respondWithFilteredResult(_0x261154,_0x41bbf8))[_0x7c0b('0x3f')](handleError(_0x261154,null));};exports[_0x7c0b('0x40')]=function(_0x37e5de,_0x2cb2a7){var _0x310238={'raw':!![],'where':{'id':_0x37e5de[_0x7c0b('0x41')]['id']}},_0x5b1410={};_0x5b1410[_0x7c0b('0x30')]=_['keys'](db['Attachment'][_0x7c0b('0x2a')]);_0x5b1410[_0x7c0b('0x2d')]=_['keys'](_0x37e5de[_0x7c0b('0x2d')]);_0x5b1410[_0x7c0b('0x2f')]=_['intersection'](_0x5b1410[_0x7c0b('0x30')],_0x5b1410[_0x7c0b('0x2d')]);_0x310238[_0x7c0b('0x42')]=_[_0x7c0b('0x43')](_0x5b1410[_0x7c0b('0x30')],qs[_0x7c0b('0x31')](_0x37e5de[_0x7c0b('0x2d')][_0x7c0b('0x31')]));_0x310238['attributes']=_0x310238['attributes'][_0x7c0b('0x32')]?_0x310238[_0x7c0b('0x42')]:_0x5b1410[_0x7c0b('0x30')];if(_0x37e5de['query'][_0x7c0b('0x3b')]){_0x310238[_0x7c0b('0x3c')]=[{'all':!![]}];}_0x310238=_['merge']({},_0x310238,_0x37e5de[_0x7c0b('0x3a')]);return db['Attachment'][_0x7c0b('0x44')](_0x310238)[_0x7c0b('0x23')](handleEntityNotFound(_0x2cb2a7,null))[_0x7c0b('0x23')](respondWithResult(_0x2cb2a7,null))[_0x7c0b('0x3f')](handleError(_0x2cb2a7,null));};exports[_0x7c0b('0x45')]=function(_0x4418eb,_0x37a9f4){var _0x307813={'where':{'id':_0x4418eb[_0x7c0b('0x41')]['id']}},_0x264e71={};_0x264e71['model']=_[_0x7c0b('0x2e')](db[_0x7c0b('0x46')][_0x7c0b('0x2a')]);_0x307813[_0x7c0b('0x42')]=_[_0x7c0b('0x43')](_0x264e71['model'],qs[_0x7c0b('0x31')](_0x4418eb[_0x7c0b('0x2d')][_0x7c0b('0x31')]));_0x307813[_0x7c0b('0x42')]=_0x307813[_0x7c0b('0x42')][_0x7c0b('0x32')]?_0x307813['attributes']:_0x264e71['model'];if(_0x4418eb['query'][_0x7c0b('0x3b')]){_0x307813['include']=[{'all':!![]}];}_0x307813=_[_0x7c0b('0x47')]({},_0x307813,_0x4418eb[_0x7c0b('0x3a')]);return db[_0x7c0b('0x46')][_0x7c0b('0x44')](_0x307813)[_0x7c0b('0x23')](handleEntityNotFound(_0x37a9f4,null))['then'](function(_0x4e6706){if(_0x4e6706){var _0x4559aa=_0x4e6706[_0x7c0b('0x48')]({'plain':!![]});_0x4559aa=qs[_0x7c0b('0x49')](_0x4559aa,['id',_0x7c0b('0x4a'),_0x7c0b('0x4b')]);_0x4418eb[_0x7c0b('0x4c')]=_[_0x7c0b('0x49')](_0x4418eb[_0x7c0b('0x4c')],['id',_0x7c0b('0x4a'),_0x7c0b('0x4b')]);return db[_0x7c0b('0x46')][_0x7c0b('0x4d')](_['merge'](_0x4559aa,_0x4418eb[_0x7c0b('0x4c')]),{'include':_0x4418eb['query'][_0x7c0b('0x3b')]?[{'all':!![]}]:undefined});}})[_0x7c0b('0x23')](respondWithResult(_0x37a9f4,0xc9))[_0x7c0b('0x3f')](handleError(_0x37a9f4,null));};exports[_0x7c0b('0x22')]=function(_0x254d67,_0x27991f){if(_0x254d67[_0x7c0b('0x4c')]['id']){delete _0x254d67[_0x7c0b('0x4c')]['id'];}return db[_0x7c0b('0x46')][_0x7c0b('0x44')]({'where':{'id':_0x254d67[_0x7c0b('0x41')]['id']}})[_0x7c0b('0x23')](handleEntityNotFound(_0x27991f,null))[_0x7c0b('0x23')](saveUpdates(_0x254d67[_0x7c0b('0x4c')],null))[_0x7c0b('0x23')](respondWithResult(_0x27991f,null))[_0x7c0b('0x3f')](handleError(_0x27991f,null));};exports[_0x7c0b('0x4e')]=function(_0x57097a,_0x307053){return db['Attachment']['find']({'where':{'id':_0x57097a[_0x7c0b('0x41')]['id']}})[_0x7c0b('0x23')](handleEntityNotFound(_0x307053,null))[_0x7c0b('0x23')](removeEntity(_0x307053,null))[_0x7c0b('0x3f')](handleError(_0x307053,null));};exports['create']=function(_0x1bcee1,_0xe68238,_0x533147){_0x1bcee1[_0x7c0b('0x4c')]['name']=_0x1bcee1['file']['originalname'];_0x1bcee1['body']['basename']=_0x1bcee1[_0x7c0b('0x4f')][_0x7c0b('0x50')];_0x1bcee1[_0x7c0b('0x4c')][_0x7c0b('0x2b')]=_0x1bcee1['file']['mimetype'];return db[_0x7c0b('0x46')][_0x7c0b('0x4d')](_0x1bcee1[_0x7c0b('0x4c')])[_0x7c0b('0x23')](respondWithResult(_0xe68238,0xc9))[_0x7c0b('0x3f')](handleError(_0xe68238,null));};exports[_0x7c0b('0x51')]=function(_0x427766,_0x25cfcb,_0x446bb1){return db[_0x7c0b('0x46')][_0x7c0b('0x52')]({'where':{'id':_0x427766[_0x7c0b('0x41')]['id']},'raw':!![]})[_0x7c0b('0x23')](handleEntityNotFound(_0x25cfcb,null))[_0x7c0b('0x23')](function(_0x31c686){if(_0x31c686){var _0x22d0f9=_0x31c686[_0x7c0b('0x53')]!==null;var _0x967caf=path[_0x7c0b('0x54')](config[_0x7c0b('0x55')],'server/files/attachments/');if(_0x22d0f9){_0x967caf=path['join'](_0x967caf,_0x7c0b('0x56'));}var _0x5ed41d=path[_0x7c0b('0x54')](_0x967caf,_0x31c686[_0x7c0b('0x57')]);return _0x25cfcb['download'](_0x5ed41d);}})[_0x7c0b('0x3f')](handleError(_0x25cfcb,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index b3b2be1..60a975b 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 _0xcaef=['api','moment','request-promise','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x4f6b60,_0x47c449){var _0x406f77=function(_0x2f48aa){while(--_0x2f48aa){_0x4f6b60['push'](_0x4f6b60['shift']());}};_0x406f77(++_0x47c449);}(_0xcaef,0x1c9));var _0xfcae=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xcaef[_0x5a79e2];return _0x266c45;};'use strict';var _=require('lodash');var util=require(_0xfcae('0x0'));var logger=require(_0xfcae('0x1'))(_0xfcae('0x2'));var moment=require(_0xfcae('0x3'));var BPromise=require('bluebird');var rp=require(_0xfcae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcae('0x5'));var config=require(_0xfcae('0x6'));var attributes=require('./attachment.attributes');module[_0xfcae('0x7')]=function(_0x19dd62,_0x4e8311){return _0x19dd62[_0xfcae('0x8')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2fc9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','util'];(function(_0x491589,_0x2a0169){var _0x5b903c=function(_0x4416ab){while(--_0x4416ab){_0x491589['push'](_0x491589['shift']());}};_0x5b903c(++_0x2a0169);}(_0x2fc9,0xc2));var _0x92fc=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x2fc9[_0x540dcb];return _0x49353c;};'use strict';var _=require('lodash');var util=require(_0x92fc('0x0'));var logger=require(_0x92fc('0x1'))(_0x92fc('0x2'));var moment=require(_0x92fc('0x3'));var BPromise=require(_0x92fc('0x4'));var rp=require(_0x92fc('0x5'));var fs=require('fs');var path=require(_0x92fc('0x6'));var rimraf=require(_0x92fc('0x7'));var config=require(_0x92fc('0x8'));var attributes=require(_0x92fc('0x9'));module[_0x92fc('0xa')]=function(_0x5d492e,_0x580d4a){return _0x5d492e['define'](_0x92fc('0xb'),attributes,{'tableName':_0x92fc('0xc'),'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 f854d14..bf7cb21 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 _0x1ac4=['Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','body','options','raw','CreateAttachment','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x35ef47,_0x452872){var _0x534061=function(_0x4a24d2){while(--_0x4a24d2){_0x35ef47['push'](_0x35ef47['shift']());}};_0x534061(++_0x452872);}(_0x1ac4,0x1a1));var _0x41ac=function(_0x3692e5,_0x25869e){_0x3692e5=_0x3692e5-0x0;var _0x339657=_0x1ac4[_0x3692e5];return _0x339657;};'use strict';var _=require(_0x41ac('0x0'));var util=require(_0x41ac('0x1'));var moment=require('moment');var BPromise=require(_0x41ac('0x2'));var rs=require(_0x41ac('0x3'));var fs=require('fs');var Redis=require(_0x41ac('0x4'));var db=require(_0x41ac('0x5'))['db'];var utils=require(_0x41ac('0x6'));var logger=require(_0x41ac('0x7'))(_0x41ac('0x8'));var config=require(_0x41ac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x41ac('0xa')][_0x41ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x477888,_0x25b25e,_0x5cba87){return new BPromise(function(_0x183246,_0x482e8a){return client[_0x41ac('0xc')](_0x477888,_0x5cba87)[_0x41ac('0xd')](function(_0x5271a5){logger[_0x41ac('0xe')](_0x41ac('0xf'),_0x25b25e,_0x41ac('0x10'));logger['debug'](_0x41ac('0x11'),_0x25b25e,_0x41ac('0x10'),JSON[_0x41ac('0x12')](_0x5271a5));if(_0x5271a5[_0x41ac('0x13')]){if(_0x5271a5[_0x41ac('0x13')][_0x41ac('0x14')]===0x1f4){logger[_0x41ac('0x13')](_0x41ac('0xf'),_0x25b25e,_0x5271a5[_0x41ac('0x13')][_0x41ac('0x15')]);return _0x482e8a(_0x5271a5[_0x41ac('0x13')]['message']);}logger[_0x41ac('0x13')](_0x41ac('0xf'),_0x25b25e,_0x5271a5[_0x41ac('0x13')][_0x41ac('0x15')]);return _0x183246(_0x5271a5[_0x41ac('0x13')][_0x41ac('0x15')]);}else{logger[_0x41ac('0xe')](_0x41ac('0xf'),_0x25b25e,_0x41ac('0x10'));_0x183246(_0x5271a5['result'][_0x41ac('0x15')]);}})[_0x41ac('0x16')](function(_0x499421){logger[_0x41ac('0x13')](_0x41ac('0xf'),_0x25b25e,_0x499421);_0x482e8a(_0x499421);});});}exports['CreateAttachment']=function(_0xe0d9c3){var _0x5848a0=this;return new Promise(function(_0x159847,_0x57c6d9){return db['Attachment']['create'](_0xe0d9c3[_0x41ac('0x17')],{'raw':_0xe0d9c3['options']?_0xe0d9c3[_0x41ac('0x18')][_0x41ac('0x19')]===undefined?!![]:![]:!![]})[_0x41ac('0xd')](function(_0x29c467){logger[_0x41ac('0xe')]('CreateAttachment',_0xe0d9c3);logger['debug'](_0x41ac('0x1a'),_0xe0d9c3,JSON[_0x41ac('0x12')](_0x29c467));_0x159847(_0x29c467);})['catch'](function(_0x3589b1){logger['error']('CreateAttachment',_0x3589b1[_0x41ac('0x15')],_0xe0d9c3);_0x57c6d9(_0x5848a0[_0x41ac('0x13')](0x1f4,_0x3589b1[_0x41ac('0x15')]));});});};
\ No newline at end of file
+var _0x5140=['body','options','raw','CreateAttachment','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','create'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x5140,0x1d1));var _0x0514=function(_0x2d0d81,_0x41e51b){_0x2d0d81=_0x2d0d81-0x0;var _0xe9fcad=_0x5140[_0x2d0d81];return _0xe9fcad;};'use strict';var _=require(_0x0514('0x0'));var util=require(_0x0514('0x1'));var moment=require(_0x0514('0x2'));var BPromise=require(_0x0514('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0514('0x4'));var db=require(_0x0514('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0514('0x6'))(_0x0514('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0514('0x8')][_0x0514('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27d8cb,_0x582ad6,_0x1d38ef){return new BPromise(function(_0x3a2495,_0x12de7a){return client['request'](_0x27d8cb,_0x1d38ef)[_0x0514('0xa')](function(_0x2145e5){logger[_0x0514('0xb')](_0x0514('0xc'),_0x582ad6,_0x0514('0xd'));logger[_0x0514('0xe')](_0x0514('0xf'),_0x582ad6,_0x0514('0xd'),JSON['stringify'](_0x2145e5));if(_0x2145e5[_0x0514('0x10')]){if(_0x2145e5['error'][_0x0514('0x11')]===0x1f4){logger[_0x0514('0x10')]('Attachment,\x20%s,\x20%s',_0x582ad6,_0x2145e5[_0x0514('0x10')]['message']);return _0x12de7a(_0x2145e5['error'][_0x0514('0x12')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x582ad6,_0x2145e5[_0x0514('0x10')][_0x0514('0x12')]);return _0x3a2495(_0x2145e5[_0x0514('0x10')]['message']);}else{logger['info'](_0x0514('0xc'),_0x582ad6,_0x0514('0xd'));_0x3a2495(_0x2145e5[_0x0514('0x13')][_0x0514('0x12')]);}})['catch'](function(_0x528fdf){logger[_0x0514('0x10')](_0x0514('0xc'),_0x582ad6,_0x528fdf);_0x12de7a(_0x528fdf);});});}exports['CreateAttachment']=function(_0x2e4200){var _0x3596ac=this;return new Promise(function(_0x35ad19,_0x44b0a8){return db['Attachment'][_0x0514('0x14')](_0x2e4200[_0x0514('0x15')],{'raw':_0x2e4200[_0x0514('0x16')]?_0x2e4200[_0x0514('0x16')][_0x0514('0x17')]===undefined?!![]:![]:!![]})[_0x0514('0xa')](function(_0x43d10e){logger['info'](_0x0514('0x18'),_0x2e4200);logger[_0x0514('0xe')](_0x0514('0x18'),_0x2e4200,JSON[_0x0514('0x19')](_0x43d10e));_0x35ad19(_0x43d10e);})[_0x0514('0x1a')](function(_0x1b4c65){logger['error'](_0x0514('0x18'),_0x1b4c65[_0x0514('0x12')],_0x2e4200);_0x44b0a8(_0x3596ac[_0x0514('0x10')](0x1f4,_0x1b4c65[_0x0514('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index dbdc58b..f29418c 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 _0x00b3=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','create','put','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./attachment.controller','get','isAuthenticated','index','/:id/download','download'];(function(_0x1338e2,_0x574a8a){var _0x538596=function(_0x4265c9){while(--_0x4265c9){_0x1338e2['push'](_0x1338e2['shift']());}};_0x538596(++_0x574a8a);}(_0x00b3,0x17a));var _0x300b=function(_0x3185ad,_0x5a2a1f){_0x3185ad=_0x3185ad-0x0;var _0x5afcaf=_0x00b3[_0x3185ad];return _0x5afcaf;};'use strict';var multer=require('multer');var util=require(_0x300b('0x0'));var path=require(_0x300b('0x1'));var timeout=require(_0x300b('0x2'));var express=require(_0x300b('0x3'));var router=express['Router']();var fs_extra=require(_0x300b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x300b('0x5'));var config=require('../../config/environment');var controller=require(_0x300b('0x6'));router[_0x300b('0x7')]('/',auth[_0x300b('0x8')](),controller[_0x300b('0x9')]);router['get']('/:id',auth[_0x300b('0x8')](),controller['show']);router['get'](_0x300b('0xa'),auth[_0x300b('0x8')](),controller[_0x300b('0xb')]);router['post'](_0x300b('0xc'),auth[_0x300b('0x8')](),controller[_0x300b('0xd')]);var upload=multer({'storage':multer[_0x300b('0xe')]({'destination':function(_0x566fb9,_0x1a96aa,_0x2eeb2d){_0x2eeb2d(null,path[_0x300b('0xf')](config['root'],_0x300b('0x10')));},'filename':function(_0xea95bb,_0x138efb,_0x40c03b){_0x40c03b(null,util[_0x300b('0x11')](_0x300b('0x12'),Date[_0x300b('0x13')](),_0x138efb[_0x300b('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload['single']('file'),controller[_0x300b('0x15')]);router[_0x300b('0x16')](_0x300b('0x17'),auth[_0x300b('0x8')](),controller['update']);router['delete'](_0x300b('0x17'),auth[_0x300b('0x8')](),controller[_0x300b('0x18')]);module[_0x300b('0x19')]=router;
\ No newline at end of file
+var _0xdc9b=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/download','download','post','/:id/clone','clone','diskStorage','join','root','server/files/attachments/','format','now','single','create','put','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x276c47,_0xb9d4de){var _0x3e839b=function(_0x11580a){while(--_0x11580a){_0x276c47['push'](_0x276c47['shift']());}};_0x3e839b(++_0xb9d4de);}(_0xdc9b,0x70));var _0xbdc9=function(_0x16999e,_0x3db761){_0x16999e=_0x16999e-0x0;var _0x16f4dc=_0xdc9b[_0x16999e];return _0x16f4dc;};'use strict';var multer=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var path=require(_0xbdc9('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdc9('0x3'));var router=express[_0xbdc9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbdc9('0x5'));var config=require(_0xbdc9('0x6'));var controller=require('./attachment.controller');router[_0xbdc9('0x7')]('/',auth[_0xbdc9('0x8')](),controller['index']);router[_0xbdc9('0x7')]('/:id',auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x9')]);router[_0xbdc9('0x7')](_0xbdc9('0xa'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xb')]);router[_0xbdc9('0xc')](_0xbdc9('0xd'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0xe')]);var upload=multer({'storage':multer[_0xbdc9('0xf')]({'destination':function(_0x1f950a,_0x19fe9d,_0xb5a15b){_0xb5a15b(null,path[_0xbdc9('0x10')](config[_0xbdc9('0x11')],_0xbdc9('0x12')));},'filename':function(_0x465acf,_0x12a807,_0x2784c1){_0x2784c1(null,util[_0xbdc9('0x13')]('%s-%s',Date[_0xbdc9('0x14')](),_0x12a807['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbdc9('0xc')]('/',upload[_0xbdc9('0x15')]('file'),controller[_0xbdc9('0x16')]);router[_0xbdc9('0x17')](_0xbdc9('0x18'),auth[_0xbdc9('0x8')](),controller[_0xbdc9('0x19')]);router[_0xbdc9('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xbdc9('0x1b')]);module[_0xbdc9('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 5a01352..d9eeafe 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 _0x2497=['clientSecret','secret','callbackURL','allowedLoginAttempts','User','emails','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','blockDuration','minutes','clearBlockUser','then','getLicense','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','callback','use','clientID'];(function(_0x41c44d,_0x31d1eb){var _0x5e00f5=function(_0x235c98){while(--_0x235c98){_0x41c44d['push'](_0x41c44d['shift']());}};_0x5e00f5(++_0x31d1eb);}(_0x2497,0x101));var _0x7249=function(_0x20264d,_0x552ea5){_0x20264d=_0x20264d-0x0;var _0x4056f1=_0x2497[_0x20264d];return _0x4056f1;};'use strict';var _=require('lodash');var passport=require(_0x7249('0x0'));var GoogleStrategy=require(_0x7249('0x1'))[_0x7249('0x2')];var moment=require(_0x7249('0x3'));var db=require(_0x7249('0x4'))['db'];var config=require(_0x7249('0x5'));var signToken=require(_0x7249('0x6'))['signToken'];var utils=require(_0x7249('0x7'));exports[_0x7249('0x8')]=passport[_0x7249('0x9')](_0x7249('0xa'),{'failureRedirect':_0x7249('0xb'),'scope':['profile','email'],'session':![]});exports[_0x7249('0xc')]=passport['authenticate']('google',{'failureRedirect':_0x7249('0xb'),'session':![]});passport[_0x7249('0xd')](new GoogleStrategy({'clientID':config['google']?config[_0x7249('0xa')][_0x7249('0xe')]:'id','clientSecret':config[_0x7249('0xa')]?config['google'][_0x7249('0xf')]:_0x7249('0x10'),'callbackURL':config[_0x7249('0xa')]?config['google'][_0x7249('0x11')]:''},function(_0x268661,_0x1a731e,_0x313003,_0x241fa0){var _0x45df2e,_0x5ad818;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x7249('0x12'),'blockDuration'],'raw':!![]})['then'](function(_0x23e5af){_0x45df2e=_0x23e5af;return db[_0x7249('0x13')]['find']({'where':{'email':_['map'](_0x313003[_0x7249('0x14')],_0x7249('0x15')),'role':{'$or':[_0x7249('0x16'),_0x7249('0x17'),_0x7249('0x18')]}}});})['then'](function(_0x5cd17c){_0x5ad818=_0x5cd17c;if(_0x5ad818){if(_0x5ad818['disabled']){return _0x241fa0(_0x7249('0x19'));}else if(_0x45df2e['blockDuration']>0x0){if(_0x5ad818[_0x7249('0x1a')]){if(moment(_0x5ad818[_0x7249('0x1b')])[_0x7249('0x1c')](_0x45df2e[_0x7249('0x1d')],_0x7249('0x1e'))>moment()){return _0x241fa0(_0x7249('0x19'));}else{return utils[_0x7249('0x1f')](_0x5ad818,0x0,![],null)['then'](function(){return utils['getLicense'](_0x5ad818);})[_0x7249('0x20')](function(){return _0x241fa0(null,_0x5ad818);});}}else{return utils[_0x7249('0x21')](_0x5ad818)[_0x7249('0x20')](function(){return _0x241fa0(null,_0x5ad818);});}}else{return utils[_0x7249('0x21')](_0x5ad818)[_0x7249('0x20')](function(){return _0x241fa0(null,_0x5ad818);});}}return _0x241fa0('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x2ccfd9){_0x241fa0(_0x2ccfd9);});}));
\ No newline at end of file
+var _0x0255=['map','value','user','blockDuration','blocked','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','secret','callbackURL','findOne','allowedLoginAttempts','then','User'];(function(_0x51d71a,_0x596fda){var _0xff01f1=function(_0x30480f){while(--_0x30480f){_0x51d71a['push'](_0x51d71a['shift']());}};_0xff01f1(++_0x596fda);}(_0x0255,0xcb));var _0x5025=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0255[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5025('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x5025('0x1')];var moment=require(_0x5025('0x2'));var db=require(_0x5025('0x3'))['db'];var config=require('../../config/environment');var signToken=require(_0x5025('0x4'))[_0x5025('0x5')];var utils=require(_0x5025('0x6'));exports[_0x5025('0x7')]=passport['authenticate'](_0x5025('0x8'),{'failureRedirect':_0x5025('0x9'),'scope':[_0x5025('0xa'),_0x5025('0xb')],'session':![]});exports[_0x5025('0xc')]=passport[_0x5025('0xd')](_0x5025('0x8'),{'failureRedirect':_0x5025('0x9'),'session':![]});passport[_0x5025('0xe')](new GoogleStrategy({'clientID':config[_0x5025('0x8')]?config['google']['clientID']:'id','clientSecret':config[_0x5025('0x8')]?config[_0x5025('0x8')]['clientSecret']:_0x5025('0xf'),'callbackURL':config[_0x5025('0x8')]?config[_0x5025('0x8')][_0x5025('0x10')]:''},function(_0x16a9f2,_0x1aaa26,_0x5947b0,_0x5f13a8){var _0x22e41d,_0x35e7ec;return db['Setting'][_0x5025('0x11')]({'where':{'id':0x1},'attributes':[_0x5025('0x12'),'blockDuration'],'raw':!![]})[_0x5025('0x13')](function(_0x249323){_0x22e41d=_0x249323;return db[_0x5025('0x14')]['find']({'where':{'email':_[_0x5025('0x15')](_0x5947b0['emails'],_0x5025('0x16')),'role':{'$or':['admin',_0x5025('0x17'),'agent']}}});})['then'](function(_0x536d81){_0x35e7ec=_0x536d81;if(_0x35e7ec){if(_0x35e7ec['disabled']){return _0x5f13a8('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x22e41d[_0x5025('0x18')]>0x0){if(_0x35e7ec[_0x5025('0x19')]){if(moment(_0x35e7ec['blockedAt'])[_0x5025('0x1a')](_0x22e41d[_0x5025('0x18')],_0x5025('0x1b'))>moment()){return _0x5f13a8(_0x5025('0x1c'));}else{return utils[_0x5025('0x1d')](_0x35e7ec,0x0,![],null)[_0x5025('0x13')](function(){return utils[_0x5025('0x1e')](_0x35e7ec);})['then'](function(){return _0x5f13a8(null,_0x35e7ec);});}}else{return utils[_0x5025('0x1e')](_0x35e7ec)[_0x5025('0x13')](function(){return _0x5f13a8(null,_0x35e7ec);});}}else{return utils[_0x5025('0x1e')](_0x35e7ec)[_0x5025('0x13')](function(){return _0x5f13a8(null,_0x35e7ec);});}}return _0x5f13a8(_0x5025('0x1c'));})[_0x5025('0x1f')](function(_0x5d12a1){_0x5f13a8(_0x5d12a1);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 9193c09..a5045c1 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 _0x87df=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','setTokenCookie','express'];(function(_0x4d5bdc,_0x120b9e){var _0x3ada94=function(_0x1ae34e){while(--_0x1ae34e){_0x4d5bdc['push'](_0x4d5bdc['shift']());}};_0x3ada94(++_0x120b9e);}(_0x87df,0x167));var _0xf87d=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0x87df[_0x119629];return _0x49a771;};'use strict';var express=require(_0xf87d('0x0'));var passport=require(_0xf87d('0x1'));var router=express[_0xf87d('0x2')]();var controller=require(_0xf87d('0x3'));var userController=require(_0xf87d('0x4'));var authService=require(_0xf87d('0x5'));router[_0xf87d('0x6')]('/',controller[_0xf87d('0x7')]);router[_0xf87d('0x6')](_0xf87d('0x8'),controller['callback'],authService['isMiddleware'],userController[_0xf87d('0x7')],authService[_0xf87d('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x83f1=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','login','get','/callback'];(function(_0x5685c9,_0x4f8459){var _0x24a2c0=function(_0x779b15){while(--_0x779b15){_0x5685c9['push'](_0x5685c9['shift']());}};_0x24a2c0(++_0x4f8459);}(_0x83f1,0x1cc));var _0x183f=function(_0x2f704e,_0x352341){_0x2f704e=_0x2f704e-0x0;var _0x5534c1=_0x83f1[_0x2f704e];return _0x5534c1;};'use strict';var express=require(_0x183f('0x0'));var passport=require(_0x183f('0x1'));var router=express[_0x183f('0x2')]();var controller=require(_0x183f('0x3'));var userController=require(_0x183f('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x183f('0x5')]);router[_0x183f('0x6')](_0x183f('0x7'),controller[_0x183f('0x8')],authService[_0x183f('0x9')],userController['login'],authService[_0x183f('0xa')]);module[_0x183f('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 4f03007..8053e98 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 _0x741c=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','findOne','name','password','salt','role','disabled','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blocked','blockedAt','add','clearBlockUser','blockDuration','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error'];(function(_0x4953c6,_0x10c99a){var _0x3759e5=function(_0xb642a0){while(--_0xb642a0){_0x4953c6['push'](_0x4953c6['shift']());}};_0x3759e5(++_0x10c99a);}(_0x741c,0x196));var _0xc741=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x741c[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xc741('0x0'));var passport=require(_0xc741('0x1'));var LocalStrategy=require(_0xc741('0x2'))[_0xc741('0x3')];var jayson=require(_0xc741('0x4'));var _=require(_0xc741('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xc741('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc741('0x7'));var client=jayson[_0xc741('0x8')][_0xc741('0x9')]({'port':0x232b});function localAuthenticate(_0x133bc4,_0x3f3d82,_0x216e60,_0x46b743){var _0x598ead,_0x1ad6d9;return db[_0xc741('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xc741('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x286e7d){_0x598ead=_0x286e7d;return _0x133bc4[_0xc741('0xc')]({'attributes':['id',_0xc741('0xd'),_0xc741('0xe'),_0xc741('0xf'),_0xc741('0x10'),_0xc741('0x11'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x3f3d82,'role':{'$or':[_0xc741('0x12'),_0xc741('0x13'),_0xc741('0x14')]}}});})[_0xc741('0x15')](function(_0x1b4442){if(!_0x1b4442||_0x1b4442&&_0x1b4442['name']!==_0x3f3d82){throw new Error(_0xc741('0x16'));}else{_0x1ad6d9=_0x1b4442;return _0x1ad6d9;}})[_0xc741('0x15')](function(){_0x1ad6d9['authenticate'](_0x216e60,function(_0xc0383,_0x3c7569){var _0xd92df7=_0x1ad6d9[_0xc741('0x17')]+0x1;if(_0xc0383){return _0x46b743(_0xc0383);}else if(!_0x3c7569){if(_0x1ad6d9[_0xc741('0x11')]){return _0x46b743(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x598ead['allowedLoginAttempts']>0x0){if(_0x1ad6d9[_0xc741('0x18')]){if(_0x598ead['blockDuration']>0x0){if(moment(_0x1ad6d9[_0xc741('0x19')])[_0xc741('0x1a')](_0x598ead['blockDuration'],'minutes')>moment()){return _0x46b743(null,![],{'message':_0xc741('0x16')});}else{return utils[_0xc741('0x1b')](_0x1ad6d9,_0xd92df7,![],null)[_0xc741('0x15')](function(){return _0x46b743(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x46b743(null,![],{'message':_0xc741('0x16')});}}else{if(_0xd92df7>=_0x598ead[_0xc741('0xb')]){return utils[_0xc741('0x1b')](_0x1ad6d9,0x0,!![],moment())[_0xc741('0x15')](function(){return _0x46b743(null,![],{'message':_0xc741('0x16')});});}else{return utils[_0xc741('0x1b')](_0x1ad6d9,_0xd92df7,![],null)[_0xc741('0x15')](function(){return _0x46b743(null,![],{'message':_0xc741('0x16')});});}}}else{return _0x46b743(null,![],{'message':_0xc741('0x16')});}}else{if(_0x1ad6d9['disabled']){return _0x46b743(null,![],{'message':_0xc741('0x16')});}else if(_0x598ead['allowedLoginAttempts']>0x0){if(_0x1ad6d9[_0xc741('0x18')]){if(_0x598ead['blockDuration']>0x0){if(moment(_0x1ad6d9[_0xc741('0x19')])[_0xc741('0x1a')](_0x598ead[_0xc741('0x1c')],'minutes')>moment()){return _0x46b743(null,![],{'message':_0xc741('0x16')});}else{return utils['clearBlockUser'](_0x1ad6d9,0x0,![],null)[_0xc741('0x15')](function(){return utils[_0xc741('0x1d')](_0x1ad6d9);})[_0xc741('0x15')](function(){return _0x46b743(null,_0x1ad6d9);});}}else{return _0x46b743(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x1ad6d9,0x0,![],null)['then'](function(){return utils[_0xc741('0x1d')](_0x1ad6d9);})[_0xc741('0x15')](function(){return _0x46b743(null,_0x1ad6d9);})[_0xc741('0x1e')](function(_0x3f6940){return _0x46b743(null,![],_0x3f6940);});}}else{if(_0x1ad6d9[_0xc741('0x18')]){return _0x46b743(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x1ad6d9)[_0xc741('0x15')](function(){return _0x46b743(null,_0x1ad6d9);});}}}});})[_0xc741('0x1e')](function(_0x102408){return _0x46b743(null,![],_0x102408);});}function sendServiceMail(_0x328793){return db[_0xc741('0x1f')][_0xc741('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xc741('0x21')],'include':[{'model':db[_0xc741('0x22')],'as':'Smtp'}]})[_0xc741('0x15')](function(_0x314fc2){if(!_0x314fc2){throw new Error(_0xc741('0x23'));}var _0x1ce361={'tls':{'rejectUnauthorized':![]}};if(_0x314fc2[_0xc741('0x24')][_0xc741('0x25')]){_0x1ce361[_0xc741('0x25')]=_0x314fc2[_0xc741('0x24')][_0xc741('0x25')];}else{_0x1ce361['host']=_0x314fc2[_0xc741('0x24')]['host'];_0x1ce361[_0xc741('0x26')]=_0x314fc2['Smtp']['port'];_0x1ce361[_0xc741('0x27')]=_0x314fc2[_0xc741('0x24')][_0xc741('0x27')];}if(_0x314fc2['Smtp'][_0xc741('0x28')]){_0x1ce361[_0xc741('0x29')]={'user':_0x314fc2[_0xc741('0x24')]['user'],'pass':_0x314fc2[_0xc741('0x24')][_0xc741('0x2a')]};}var _0x308f01={'account':_0x1ce361,'message':_[_0xc741('0x2b')]({'from':util[_0xc741('0x2c')](_0xc741('0x2d'),_0x314fc2[_0xc741('0xd')],_0x314fc2['email']||_0x314fc2['Smtp'][_0xc741('0x13')])},_0x328793)};return client[_0xc741('0x2e')](_0xc741('0x2f'),_0x308f01);})[_0xc741('0x15')](function(_0xf7953e){if(_0xf7953e[_0xc741('0x30')]){throw new Error(util['format'](_0xc741('0x31'),_0xf7953e[_0xc741('0x30')]['message']||JSON[_0xc741('0x32')](_0xf7953e[_0xc741('0x30')])));}return!![];});}function handleError(_0x7321b9,_0x560e85,_0xff5e23){return _0x7321b9[_0xc741('0x33')](_0x560e85||0x1f4)[_0xc741('0x34')]({'message':_0xff5e23?_0xff5e23[_0xc741('0x35')]||_0xff5e23:''});}exports[_0xc741('0x36')]=function(_0x823009,_0x177db8,_0x5e390d){passport[_0xc741('0x37')](_0xc741('0x38'),function(_0x2e9b96,_0x1ae74d,_0x1e4433){var _0x76288a=_0x2e9b96||_0x1e4433;if(_0x76288a){return handleError(_0x177db8,0x191,_0x76288a);}if(!_0x1ae74d){return handleError(_0x177db8,0x194,{'message':_0xc741('0x39')});}else{var _0x207fcc={'payload':{'id':_0x1ae74d['id'],'role':_0x1ae74d['role']},'options':{'expiresIn':0x15180}};return authService[_0xc741('0x3a')](_0x207fcc)[_0xc741('0x15')](function(_0x29bc62){_0x177db8[_0xc741('0x3b')]({'id':_0x1ae74d['id'],'token':_0x29bc62,'statusCall':'','isAlreadyLogged':_0x1ae74d['online']});});}})(_0x823009,_0x177db8,_0x5e390d);};exports[_0xc741('0x3c')]=function(_0x51ba7a,_0x904dd4,_0x2fe60a){if(!_0x51ba7a[_0xc741('0x3d')]['email']){return handleError(_0x904dd4,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3686b2=rs[_0xc741('0x3e')]();_0x51ba7a[_0xc741('0x3d')][_0xc741('0x21')]=_0x51ba7a[_0xc741('0x3d')][_0xc741('0x21')][_0xc741('0x3f')]()[_0xc741('0x40')]();var _0x149a5e;return db[_0xc741('0xa')][_0xc741('0xc')]({'where':{'id':0x1},'attributes':[_0xc741('0xb'),_0xc741('0x1c')],'raw':!![]})[_0xc741('0x15')](function(_0x339b5f){_0x149a5e=_0x339b5f;return db[_0xc741('0x41')][_0xc741('0x20')]({'where':{'email':_0x51ba7a['body'][_0xc741('0x21')]}});})['then'](function(_0xb425c){if(!_0xb425c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xb425c[_0xc741('0x11')]){throw new Error(_0xc741('0x42'));}if(_0xb425c['blocked']){if(moment(_0xb425c[_0xc741('0x19')])[_0xc741('0x1a')](_0x149a5e['blockDuration'],_0xc741('0x43'))>moment()){throw new Error(_0xc741('0x44'));}else{_0xb425c[_0xc741('0x18')]=![];_0xb425c[_0xc741('0x19')]=null;}}_0xb425c[_0xc741('0x45')]=_0x3686b2;_0xb425c[_0xc741('0x46')]=Date[_0xc741('0x47')]()+0x36ee80;return _0xb425c['save']();})[_0xc741('0x15')](function(){return sendServiceMail({'to':_0x51ba7a['body']['email'],'subject':_0xc741('0x48'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc741('0x49')+_0xc741('0x4a')+_0x51ba7a[_0xc741('0x4b')][_0xc741('0x4c')]+_0xc741('0x4d')+_0x3686b2+'\x0a\x0a'+_0xc741('0x4e')});})[_0xc741('0x15')](function(){_0x904dd4[_0xc741('0x33')](0xc8)[_0xc741('0x34')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x12dde4){return handleError(_0x904dd4,0x1f4,_0x12dde4);});};exports[_0xc741('0x4f')]=function(_0x319198,_0x4414db,_0x4cec0b){return db[_0xc741('0x41')]['find']({'where':{'resetPasswordToken':_0x319198[_0xc741('0x50')][_0xc741('0x51')],'resetPasswordExpires':{'$gt':Date[_0xc741('0x47')]()}}})[_0xc741('0x15')](function(_0x2a390b){if(!_0x2a390b){throw new Error(_0xc741('0x52'));}return db[_0xc741('0xa')][_0xc741('0xc')]({'attributes':['id',_0xc741('0x53'),_0xc741('0x54'),_0xc741('0x55')]})[_0xc741('0x15')](function(_0x510db2){if(_0x510db2[_0xc741('0x53')])authService[_0xc741('0x56')](_0x319198[_0xc741('0x3d')]['password']);if(!_0x510db2[_0xc741('0x54')]||!_0x2a390b[_0xc741('0x57')])return _0x2a390b;authService[_0xc741('0x58')](_0x319198[_0xc741('0x3d')]['password'],_0x2a390b[_0xc741('0x57')],_0x510db2[_0xc741('0x55')]);return _0x2a390b;})[_0xc741('0x15')](function(){_0x2a390b[_0xc741('0xe')]=_0x319198['body'][_0xc741('0xe')];_0x2a390b['resetPasswordToken']=null;_0x2a390b[_0xc741('0x46')]=null;return _0x2a390b[_0xc741('0x59')]();});})[_0xc741('0x15')](function(){_0x4414db[_0xc741('0x33')](0xc8)[_0xc741('0x34')]({'message':_0xc741('0x5a')});})['catch'](function(_0x30a4f6){return handleError(_0x4414db,0x1f4,_0x30a4f6);});};passport['use'](new LocalStrategy({'usernameField':_0xc741('0xd'),'passwordField':_0xc741('0xe')},function(_0x70eaca,_0x1d15f9,_0x168076){return localAuthenticate(db['User'],_0x70eaca,_0x1d15f9,_0x168076);}));
\ No newline at end of file
+var _0x8f9d=['catch','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','port','secure','auth','merge','format','\x22%s\x22\x20<%s>','request','error','stringify','send','message','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','email','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','allowedLoginAttempts','findOne','name','password','salt','role','disabled','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','loginAttempts','add','minutes','clearBlockUser','blocked','blockDuration','getLicense'];(function(_0xe16025,_0x154f45){var _0x213442=function(_0x4c174d){while(--_0x4c174d){_0xe16025['push'](_0xe16025['shift']());}};_0x213442(++_0x154f45);}(_0x8f9d,0x93));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var util=require(_0xd8f9('0x0'));var passport=require('passport');var LocalStrategy=require(_0xd8f9('0x1'))['Strategy'];var jayson=require(_0xd8f9('0x2'));var _=require(_0xd8f9('0x3'));var rs=require(_0xd8f9('0x4'));var moment=require(_0xd8f9('0x5'));var db=require(_0xd8f9('0x6'))['db'];var authService=require(_0xd8f9('0x7'));var utils=require(_0xd8f9('0x8'));var client=jayson['client'][_0xd8f9('0x9')]({'port':0x232b});function localAuthenticate(_0x24dd1e,_0x25d417,_0x241aaa,_0xf6105){var _0x5c410f,_0x46babd;return db[_0xd8f9('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xd8f9('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x421aca){_0x5c410f=_0x421aca;return _0x24dd1e[_0xd8f9('0xc')]({'attributes':['id',_0xd8f9('0xd'),_0xd8f9('0xe'),_0xd8f9('0xf'),_0xd8f9('0x10'),_0xd8f9('0x11'),'blocked',_0xd8f9('0x12'),'loginAttempts'],'where':{'name':_0x25d417,'role':{'$or':[_0xd8f9('0x13'),_0xd8f9('0x14'),_0xd8f9('0x15')]}}});})['then'](function(_0x46468b){if(!_0x46468b||_0x46468b&&_0x46468b[_0xd8f9('0xd')]!==_0x25d417){throw new Error(_0xd8f9('0x16'));}else{_0x46babd=_0x46468b;return _0x46babd;}})[_0xd8f9('0x17')](function(){_0x46babd['authenticate'](_0x241aaa,function(_0x3529e9,_0x1525d6){var _0x234901=_0x46babd[_0xd8f9('0x18')]+0x1;if(_0x3529e9){return _0xf6105(_0x3529e9);}else if(!_0x1525d6){if(_0x46babd[_0xd8f9('0x11')]){return _0xf6105(null,![],{'message':_0xd8f9('0x16')});}else if(_0x5c410f[_0xd8f9('0xb')]>0x0){if(_0x46babd['blocked']){if(_0x5c410f['blockDuration']>0x0){if(moment(_0x46babd[_0xd8f9('0x12')])[_0xd8f9('0x19')](_0x5c410f['blockDuration'],_0xd8f9('0x1a'))>moment()){return _0xf6105(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xd8f9('0x1b')](_0x46babd,_0x234901,![],null)['then'](function(){return _0xf6105(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xf6105(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x234901>=_0x5c410f[_0xd8f9('0xb')]){return utils['clearBlockUser'](_0x46babd,0x0,!![],moment())[_0xd8f9('0x17')](function(){return _0xf6105(null,![],{'message':_0xd8f9('0x16')});});}else{return utils[_0xd8f9('0x1b')](_0x46babd,_0x234901,![],null)[_0xd8f9('0x17')](function(){return _0xf6105(null,![],{'message':_0xd8f9('0x16')});});}}}else{return _0xf6105(null,![],{'message':_0xd8f9('0x16')});}}else{if(_0x46babd['disabled']){return _0xf6105(null,![],{'message':_0xd8f9('0x16')});}else if(_0x5c410f[_0xd8f9('0xb')]>0x0){if(_0x46babd[_0xd8f9('0x1c')]){if(_0x5c410f[_0xd8f9('0x1d')]>0x0){if(moment(_0x46babd[_0xd8f9('0x12')])[_0xd8f9('0x19')](_0x5c410f['blockDuration'],_0xd8f9('0x1a'))>moment()){return _0xf6105(null,![],{'message':_0xd8f9('0x16')});}else{return utils[_0xd8f9('0x1b')](_0x46babd,0x0,![],null)[_0xd8f9('0x17')](function(){return utils[_0xd8f9('0x1e')](_0x46babd);})['then'](function(){return _0xf6105(null,_0x46babd);});}}else{return _0xf6105(null,![],{'message':_0xd8f9('0x16')});}}else{return utils[_0xd8f9('0x1b')](_0x46babd,0x0,![],null)[_0xd8f9('0x17')](function(){return utils[_0xd8f9('0x1e')](_0x46babd);})[_0xd8f9('0x17')](function(){return _0xf6105(null,_0x46babd);})[_0xd8f9('0x1f')](function(_0x175123){return _0xf6105(null,![],_0x175123);});}}else{if(_0x46babd[_0xd8f9('0x1c')]){return _0xf6105(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xd8f9('0x1e')](_0x46babd)[_0xd8f9('0x17')](function(){return _0xf6105(null,_0x46babd);});}}}});})[_0xd8f9('0x1f')](function(_0x58a3ca){return _0xf6105(null,![],_0x58a3ca);});}function sendServiceMail(_0x5bd32e){return db['MailAccount'][_0xd8f9('0x20')]({'where':{'service':!![]},'attributes':['id',_0xd8f9('0xd'),'email'],'include':[{'model':db[_0xd8f9('0x21')],'as':_0xd8f9('0x22')}]})['then'](function(_0x4b0de7){if(!_0x4b0de7){throw new Error(_0xd8f9('0x23'));}var _0x2786db={'tls':{'rejectUnauthorized':![]}};if(_0x4b0de7['Smtp'][_0xd8f9('0x24')]){_0x2786db['service']=_0x4b0de7[_0xd8f9('0x22')][_0xd8f9('0x24')];}else{_0x2786db['host']=_0x4b0de7[_0xd8f9('0x22')]['host'];_0x2786db[_0xd8f9('0x25')]=_0x4b0de7[_0xd8f9('0x22')][_0xd8f9('0x25')];_0x2786db[_0xd8f9('0x26')]=_0x4b0de7[_0xd8f9('0x22')][_0xd8f9('0x26')];}if(_0x4b0de7[_0xd8f9('0x22')]['authentication']){_0x2786db[_0xd8f9('0x27')]={'user':_0x4b0de7['Smtp']['user'],'pass':_0x4b0de7['Smtp']['pass']};}var _0x3690d7={'account':_0x2786db,'message':_[_0xd8f9('0x28')]({'from':util[_0xd8f9('0x29')](_0xd8f9('0x2a'),_0x4b0de7[_0xd8f9('0xd')],_0x4b0de7['email']||_0x4b0de7['Smtp'][_0xd8f9('0x14')])},_0x5bd32e)};return client[_0xd8f9('0x2b')]('SendMail',_0x3690d7);})[_0xd8f9('0x17')](function(_0x204ead){if(_0x204ead[_0xd8f9('0x2c')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x204ead['error']['message']||JSON[_0xd8f9('0x2d')](_0x204ead[_0xd8f9('0x2c')])));}return!![];});}function handleError(_0x324541,_0x219c5f,_0x1d41e2){return _0x324541['status'](_0x219c5f||0x1f4)[_0xd8f9('0x2e')]({'message':_0x1d41e2?_0x1d41e2[_0xd8f9('0x2f')]||_0x1d41e2:''});}exports[_0xd8f9('0x30')]=function(_0xb9ba18,_0x2758e8,_0x16e1f8){passport[_0xd8f9('0x31')](_0xd8f9('0x32'),function(_0x36aa04,_0x1953af,_0x2a94d6){var _0x5d16b8=_0x36aa04||_0x2a94d6;if(_0x5d16b8){return handleError(_0x2758e8,0x191,_0x5d16b8);}if(!_0x1953af){return handleError(_0x2758e8,0x194,{'message':_0xd8f9('0x33')});}else{var _0x3cfd69={'payload':{'id':_0x1953af['id'],'role':_0x1953af[_0xd8f9('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xd8f9('0x34')](_0x3cfd69)['then'](function(_0x157dfd){_0x2758e8[_0xd8f9('0x35')]({'id':_0x1953af['id'],'token':_0x157dfd,'statusCall':'','isAlreadyLogged':_0x1953af[_0xd8f9('0x36')]});});}})(_0xb9ba18,_0x2758e8,_0x16e1f8);};exports[_0xd8f9('0x37')]=function(_0x1ab301,_0x23330a,_0x597357){if(!_0x1ab301['body']['email']){return handleError(_0x23330a,0x1f4,{'message':_0xd8f9('0x38')});}var _0x293179=rs[_0xd8f9('0x39')]();_0x1ab301[_0xd8f9('0x3a')][_0xd8f9('0x3b')]=_0x1ab301[_0xd8f9('0x3a')][_0xd8f9('0x3b')][_0xd8f9('0x3c')]()[_0xd8f9('0x3d')]();var _0x5ed1b7;return db['Setting'][_0xd8f9('0xc')]({'where':{'id':0x1},'attributes':[_0xd8f9('0xb'),_0xd8f9('0x1d')],'raw':!![]})['then'](function(_0x5ad80d){_0x5ed1b7=_0x5ad80d;return db[_0xd8f9('0x3e')][_0xd8f9('0x20')]({'where':{'email':_0x1ab301[_0xd8f9('0x3a')]['email']}});})[_0xd8f9('0x17')](function(_0x388188){if(!_0x388188){throw new Error(_0xd8f9('0x3f'));}if(_0x388188[_0xd8f9('0x11')]){throw new Error(_0xd8f9('0x40'));}if(_0x388188[_0xd8f9('0x1c')]){if(moment(_0x388188[_0xd8f9('0x12')])[_0xd8f9('0x19')](_0x5ed1b7[_0xd8f9('0x1d')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x388188['blocked']=![];_0x388188[_0xd8f9('0x12')]=null;}}_0x388188[_0xd8f9('0x41')]=_0x293179;_0x388188[_0xd8f9('0x42')]=Date[_0xd8f9('0x43')]()+0x36ee80;return _0x388188[_0xd8f9('0x44')]();})[_0xd8f9('0x17')](function(){return sendServiceMail({'to':_0x1ab301[_0xd8f9('0x3a')][_0xd8f9('0x3b')],'subject':_0xd8f9('0x45'),'text':_0xd8f9('0x46')+_0xd8f9('0x47')+_0xd8f9('0x48')+_0x1ab301[_0xd8f9('0x49')]['host']+_0xd8f9('0x4a')+_0x293179+'\x0a\x0a'+_0xd8f9('0x4b')});})[_0xd8f9('0x17')](function(){_0x23330a[_0xd8f9('0x4c')](0xc8)['send']({'message':_0xd8f9('0x4d')});})['catch'](function(_0x59952e){return handleError(_0x23330a,0x1f4,_0x59952e);});};exports[_0xd8f9('0x4e')]=function(_0x14e622,_0x1614aa,_0x1361c4){return db[_0xd8f9('0x3e')][_0xd8f9('0x20')]({'where':{'resetPasswordToken':_0x14e622[_0xd8f9('0x4f')][_0xd8f9('0x50')],'resetPasswordExpires':{'$gt':Date[_0xd8f9('0x43')]()}}})[_0xd8f9('0x17')](function(_0x54b5d4){if(!_0x54b5d4){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xd8f9('0xc')]({'attributes':['id',_0xd8f9('0x51'),'enforcePasswordHistory',_0xd8f9('0x52')]})[_0xd8f9('0x17')](function(_0x1101ce){if(_0x1101ce[_0xd8f9('0x51')])authService[_0xd8f9('0x53')](_0x14e622[_0xd8f9('0x3a')][_0xd8f9('0xe')]);if(!_0x1101ce[_0xd8f9('0x54')]||!_0x54b5d4['previousPasswords'])return _0x54b5d4;authService[_0xd8f9('0x55')](_0x14e622[_0xd8f9('0x3a')][_0xd8f9('0xe')],_0x54b5d4[_0xd8f9('0x56')],_0x1101ce[_0xd8f9('0x52')]);return _0x54b5d4;})[_0xd8f9('0x17')](function(){_0x54b5d4[_0xd8f9('0xe')]=_0x14e622[_0xd8f9('0x3a')][_0xd8f9('0xe')];_0x54b5d4[_0xd8f9('0x41')]=null;_0x54b5d4[_0xd8f9('0x42')]=null;return _0x54b5d4['save']();});})[_0xd8f9('0x17')](function(){_0x1614aa[_0xd8f9('0x4c')](0xc8)[_0xd8f9('0x2e')]({'message':_0xd8f9('0x57')});})['catch'](function(_0x2de50d){return handleError(_0x1614aa,0x1f4,_0x2de50d);});};passport[_0xd8f9('0x58')](new LocalStrategy({'usernameField':_0xd8f9('0xd'),'passwordField':'password'},function(_0x101bd3,_0x195a46,_0x2218da){return localAuthenticate(db[_0xd8f9('0x3e')],_0x101bd3,_0x195a46,_0x2218da);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 70d398c..9f24e6e 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 _0xefdf=['forgot','/reset/:token','reset','exports','express','./authLocal.controller','post','/forgot'];(function(_0x252fb8,_0x1dcf7c){var _0x1f0c15=function(_0x1d2f06){while(--_0x1d2f06){_0x252fb8['push'](_0x252fb8['shift']());}};_0x1f0c15(++_0x1dcf7c);}(_0xefdf,0x15c));var _0xfefd=function(_0x2545d0,_0x397e79){_0x2545d0=_0x2545d0-0x0;var _0x10111b=_0xefdf[_0x2545d0];return _0x10111b;};'use strict';var express=require(_0xfefd('0x0'));var router=express['Router']();var controller=require(_0xfefd('0x1'));router[_0xfefd('0x2')]('/',controller['login']);router[_0xfefd('0x2')](_0xfefd('0x3'),controller[_0xfefd('0x4')]);router[_0xfefd('0x2')](_0xfefd('0x5'),controller[_0xfefd('0x6')]);module[_0xfefd('0x7')]=router;
\ No newline at end of file
+var _0x5c27=['exports','express','Router','./authLocal.controller','post','login','forgot','/reset/:token','reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c27,0x13c));var _0x75c2=function(_0x58c239,_0x1788bc){_0x58c239=_0x58c239-0x0;var _0x1cd7cb=_0x5c27[_0x58c239];return _0x1cd7cb;};'use strict';var express=require(_0x75c2('0x0'));var router=express[_0x75c2('0x1')]();var controller=require(_0x75c2('0x2'));router[_0x75c2('0x3')]('/',controller[_0x75c2('0x4')]);router[_0x75c2('0x3')]('/forgot',controller[_0x75c2('0x5')]);router[_0x75c2('0x3')](_0x75c2('0x6'),controller[_0x75c2('0x7')]);module[_0x75c2('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 43e298e..70b44e5 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 _0x9cd1=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0xb95586,_0x47fe9f){var _0x29a9d2=function(_0x12f8dc){while(--_0x12f8dc){_0xb95586['push'](_0xb95586['shift']());}};_0x29a9d2(++_0x47fe9f);}(_0x9cd1,0xac));var _0x19cd=function(_0x5ab1ec,_0x33e892){_0x5ab1ec=_0x5ab1ec-0x0;var _0xf1a432=_0x9cd1[_0x5ab1ec];return _0xf1a432;};'use strict';var Sequelize=require(_0x19cd('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x19cd('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x19cd('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x19cd('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x91d5=['STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x91d5,0x16d));var _0x591d=function(_0x200941,_0x3234d9){_0x200941=_0x200941-0x0;var _0x391186=_0x91d5[_0x200941];return _0x391186;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x591d('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x591d('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index f265d1e..fd6199a 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 _0x0fbf=['sort','where','pick','merge','type','VIRTUAL','name','filter','options','includeAll','findAll','rows','show','include','find','catch','create','body','params','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','send','index','map','Automation','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x46c443,_0xf4a763){var _0x87a3bb=function(_0x247643){while(--_0x247643){_0x46c443['push'](_0x46c443['shift']());}};_0x87a3bb(++_0xf4a763);}(_0x0fbf,0xc6));var _0xf0fb=function(_0x507c4e,_0x2bef11){_0x507c4e=_0x507c4e-0x0;var _0x99651d=_0x0fbf[_0x507c4e];return _0x99651d;};'use strict';var emlformat=require(_0xf0fb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf0fb('0x1'));var rp=require(_0xf0fb('0x2'));var moment=require(_0xf0fb('0x3'));var BPromise=require(_0xf0fb('0x4'));var Mustache=require('mustache');var util=require(_0xf0fb('0x5'));var path=require('path');var sox=require(_0xf0fb('0x6'));var csv=require(_0xf0fb('0x7'));var ejs=require(_0xf0fb('0x8'));var fs=require('fs');var fs_extra=require(_0xf0fb('0x9'));var _=require(_0xf0fb('0xa'));var squel=require('squel');var crypto=require(_0xf0fb('0xb'));var jsforce=require(_0xf0fb('0xc'));var deskjs=require(_0xf0fb('0xd'));var toCsv=require(_0xf0fb('0x7'));var querystring=require(_0xf0fb('0xe'));var Papa=require(_0xf0fb('0xf'));var Redis=require('ioredis');var authService=require(_0xf0fb('0x10'));var qs=require(_0xf0fb('0x11'));var as=require(_0xf0fb('0x12'));var hardwareService=require(_0xf0fb('0x13'));var logger=require('../../config/logger')(_0xf0fb('0x14'));var utils=require(_0xf0fb('0x15'));var config=require(_0xf0fb('0x16'));var licenseUtil=require(_0xf0fb('0x17'));var db=require(_0xf0fb('0x18'))['db'];function respondWithStatusCode(_0x2ffc43,_0x11170b){_0x11170b=_0x11170b||0xcc;return function(_0x2ab9c3){if(_0x2ab9c3){return _0x2ffc43[_0xf0fb('0x19')](_0x11170b);}return _0x2ffc43[_0xf0fb('0x1a')](_0x11170b)['end']();};}function respondWithResult(_0x9cd09c,_0x37e3cb){_0x37e3cb=_0x37e3cb||0xc8;return function(_0x36fcaf){if(_0x36fcaf){return _0x9cd09c[_0xf0fb('0x1a')](_0x37e3cb)['json'](_0x36fcaf);}};}function respondWithFilteredResult(_0x2cb89b,_0x44d61c){return function(_0x21cb6e){if(_0x21cb6e){var _0x2eae34=_0x21cb6e[_0xf0fb('0x1b')],_0x2c218a=_0x44d61c['offset'],_0x325cd1=_0x44d61c[_0xf0fb('0x1c')]+_0x44d61c['limit'],_0x21139f;if(_0x325cd1>=_0x2eae34){_0x325cd1=_0x2eae34;_0x21139f=0xc8;}else{_0x21139f=0xce;}_0x2cb89b[_0xf0fb('0x1a')](_0x21139f);return _0x2cb89b[_0xf0fb('0x1d')](_0xf0fb('0x1e'),_0x2c218a+'-'+_0x325cd1+'/'+_0x2eae34)[_0xf0fb('0x1f')](_0x21cb6e);}return null;};}function patchUpdates(_0x1d4b61){return function(_0x171f99){try{jsonpatch[_0xf0fb('0x20')](_0x171f99,_0x1d4b61,!![]);}catch(_0xab592f){return BPromise[_0xf0fb('0x21')](_0xab592f);}return _0x171f99['save']();};}function saveUpdates(_0x4773c7,_0x3509b3){return function(_0x49f0c4){if(_0x49f0c4){return _0x49f0c4[_0xf0fb('0x22')](_0x4773c7)[_0xf0fb('0x23')](function(_0x2d4349){return _0x2d4349;});}return null;};}function removeEntity(_0x255a48,_0x2d4723){return function(_0x39511c){if(_0x39511c){return _0x39511c[_0xf0fb('0x24')]()[_0xf0fb('0x23')](function(){_0x255a48['status'](0xcc)[_0xf0fb('0x25')]();});}};}function handleEntityNotFound(_0x455c23,_0x37dcf9){return function(_0x53e618){if(!_0x53e618){_0x455c23[_0xf0fb('0x19')](0x194);}return _0x53e618;};}function handleError(_0x414821,_0x1e7e30){_0x1e7e30=_0x1e7e30||0x1f4;return function(_0x43d0e1){logger[_0xf0fb('0x26')](_0x43d0e1[_0xf0fb('0x27')]);if(_0x43d0e1['name']){delete _0x43d0e1['name'];}_0x414821[_0xf0fb('0x1a')](_0x1e7e30)[_0xf0fb('0x28')](_0x43d0e1);};}exports[_0xf0fb('0x29')]=function(_0x22ec6b,_0x3d3bca){var _0x83b144={},_0x54487d={},_0x4b5580={'count':0x0,'rows':[]};var _0x37268a=_[_0xf0fb('0x2a')](db[_0xf0fb('0x2b')][_0xf0fb('0x2c')],function(_0x4332a9){return{'name':_0x4332a9['fieldName'],'type':_0x4332a9['type']['key']};});_0x54487d[_0xf0fb('0x2d')]=_[_0xf0fb('0x2a')](_0x37268a,'name');_0x54487d[_0xf0fb('0x2e')]=_[_0xf0fb('0x2f')](_0x22ec6b[_0xf0fb('0x2e')]);_0x54487d[_0xf0fb('0x30')]=_[_0xf0fb('0x31')](_0x54487d[_0xf0fb('0x2d')],_0x54487d[_0xf0fb('0x2e')]);_0x83b144[_0xf0fb('0x32')]=_[_0xf0fb('0x31')](_0x54487d[_0xf0fb('0x2d')],qs[_0xf0fb('0x33')](_0x22ec6b[_0xf0fb('0x2e')][_0xf0fb('0x33')]));_0x83b144[_0xf0fb('0x32')]=_0x83b144['attributes'][_0xf0fb('0x34')]?_0x83b144[_0xf0fb('0x32')]:_0x54487d[_0xf0fb('0x2d')];if(!_0x22ec6b[_0xf0fb('0x2e')][_0xf0fb('0x35')](_0xf0fb('0x36'))){_0x83b144[_0xf0fb('0x37')]=qs[_0xf0fb('0x37')](_0x22ec6b[_0xf0fb('0x2e')][_0xf0fb('0x37')]);_0x83b144[_0xf0fb('0x1c')]=qs['offset'](_0x22ec6b[_0xf0fb('0x2e')][_0xf0fb('0x1c')]);}_0x83b144[_0xf0fb('0x38')]=qs[_0xf0fb('0x39')](_0x22ec6b[_0xf0fb('0x2e')]['sort']);_0x83b144[_0xf0fb('0x3a')]=qs[_0xf0fb('0x30')](_[_0xf0fb('0x3b')](_0x22ec6b['query'],_0x54487d['filters']),_0x37268a);if(_0x22ec6b[_0xf0fb('0x2e')]['filter']){_0x83b144[_0xf0fb('0x3a')]=_[_0xf0fb('0x3c')](_0x83b144[_0xf0fb('0x3a')],{'$or':_[_0xf0fb('0x2a')](_0x37268a,function(_0x1498ae){if(_0x1498ae[_0xf0fb('0x3d')]!==_0xf0fb('0x3e')){var _0x3c4845={};_0x3c4845[_0x1498ae[_0xf0fb('0x3f')]]={'$like':'%'+_0x22ec6b[_0xf0fb('0x2e')][_0xf0fb('0x40')]+'%'};return _0x3c4845;}})});}_0x83b144=_['merge']({},_0x83b144,_0x22ec6b[_0xf0fb('0x41')]);var _0x53edb2={'where':_0x83b144[_0xf0fb('0x3a')]};return db[_0xf0fb('0x2b')][_0xf0fb('0x1b')](_0x53edb2)[_0xf0fb('0x23')](function(_0x408ec1){_0x4b5580[_0xf0fb('0x1b')]=_0x408ec1;if(_0x22ec6b['query'][_0xf0fb('0x42')]){_0x83b144['include']=[{'all':!![]}];}return db['Automation'][_0xf0fb('0x43')](_0x83b144);})['then'](function(_0x496fa3){_0x4b5580[_0xf0fb('0x44')]=_0x496fa3;return _0x4b5580;})[_0xf0fb('0x23')](respondWithFilteredResult(_0x3d3bca,_0x83b144))['catch'](handleError(_0x3d3bca,null));};exports[_0xf0fb('0x45')]=function(_0x29ec5c,_0x2ee941){var _0x296abf={'raw':![],'where':{'id':_0x29ec5c['params']['id']}},_0x259e3a={};_0x259e3a[_0xf0fb('0x2d')]=_[_0xf0fb('0x2f')](db['Automation']['rawAttributes']);_0x259e3a['query']=_[_0xf0fb('0x2f')](_0x29ec5c[_0xf0fb('0x2e')]);_0x259e3a[_0xf0fb('0x30')]=_[_0xf0fb('0x31')](_0x259e3a['model'],_0x259e3a['query']);_0x296abf['attributes']=_['intersection'](_0x259e3a[_0xf0fb('0x2d')],qs[_0xf0fb('0x33')](_0x29ec5c[_0xf0fb('0x2e')][_0xf0fb('0x33')]));_0x296abf[_0xf0fb('0x32')]=_0x296abf['attributes'][_0xf0fb('0x34')]?_0x296abf[_0xf0fb('0x32')]:_0x259e3a[_0xf0fb('0x2d')];if(_0x29ec5c[_0xf0fb('0x2e')][_0xf0fb('0x42')]){_0x296abf[_0xf0fb('0x46')]=[{'all':!![]}];}_0x296abf=_['merge']({},_0x296abf,_0x29ec5c[_0xf0fb('0x41')]);return db[_0xf0fb('0x2b')][_0xf0fb('0x47')](_0x296abf)[_0xf0fb('0x23')](handleEntityNotFound(_0x2ee941,null))[_0xf0fb('0x23')](respondWithResult(_0x2ee941,null))[_0xf0fb('0x48')](handleError(_0x2ee941,null));};exports[_0xf0fb('0x49')]=function(_0x24f265,_0x5069b2){return db[_0xf0fb('0x2b')][_0xf0fb('0x49')](_0x24f265['body'],{})[_0xf0fb('0x23')](respondWithResult(_0x5069b2,0xc9))[_0xf0fb('0x48')](handleError(_0x5069b2,null));};exports[_0xf0fb('0x22')]=function(_0x301754,_0x4dee33){if(_0x301754[_0xf0fb('0x4a')]['id']){delete _0x301754[_0xf0fb('0x4a')]['id'];}return db['Automation'][_0xf0fb('0x47')]({'where':{'id':_0x301754[_0xf0fb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4dee33,null))[_0xf0fb('0x23')](saveUpdates(_0x301754[_0xf0fb('0x4a')],null))['then'](respondWithResult(_0x4dee33,null))['catch'](handleError(_0x4dee33,null));};exports[_0xf0fb('0x24')]=function(_0x4f9f81,_0x1338f2){return db[_0xf0fb('0x2b')]['find']({'where':{'id':_0x4f9f81[_0xf0fb('0x4b')]['id']}})[_0xf0fb('0x23')](handleEntityNotFound(_0x1338f2,null))['then'](removeEntity(_0x1338f2,null))['catch'](handleError(_0x1338f2,null));};exports[_0xf0fb('0x4c')]=function(_0x23ea24,_0x50c271,_0x5c397b){return db[_0xf0fb('0x4d')][_0xf0fb('0x47')]({'where':{'id':_0x23ea24[_0xf0fb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50c271,null))['then'](function(_0x16b289){if(_0x16b289){return _0x16b289['addConditions'](_0x23ea24[_0xf0fb('0x4a')][_0xf0fb('0x4e')],_[_0xf0fb('0x4f')](_0x23ea24[_0xf0fb('0x4a')],['ids','id'])||{});}})[_0xf0fb('0x23')](respondWithResult(_0x50c271,null))[_0xf0fb('0x48')](handleError(_0x50c271,null));};exports[_0xf0fb('0x50')]=function(_0x2f3756,_0x13eda9,_0x47ca31){var _0x3917c4={};var _0x22f02a={};var _0x4d3b4b;var _0x614d15;return db[_0xf0fb('0x2b')][_0xf0fb('0x51')]({'where':{'id':_0x2f3756[_0xf0fb('0x4b')]['id']}})[_0xf0fb('0x23')](handleEntityNotFound(_0x13eda9,null))['then'](function(_0x8e5954){if(_0x8e5954){_0x4d3b4b=_0x8e5954;_0x22f02a[_0xf0fb('0x2d')]=_[_0xf0fb('0x2f')](db['Condition'][_0xf0fb('0x2c')]);_0x22f02a['query']=_[_0xf0fb('0x2f')](_0x2f3756[_0xf0fb('0x2e')]);_0x22f02a[_0xf0fb('0x30')]=_['intersection'](_0x22f02a[_0xf0fb('0x2d')],_0x22f02a['query']);_0x3917c4[_0xf0fb('0x32')]=_['intersection'](_0x22f02a[_0xf0fb('0x2d')],qs['fields'](_0x2f3756[_0xf0fb('0x2e')][_0xf0fb('0x33')]));_0x3917c4[_0xf0fb('0x32')]=_0x3917c4['attributes'][_0xf0fb('0x34')]?_0x3917c4['attributes']:_0x22f02a[_0xf0fb('0x2d')];_0x3917c4['order']=qs[_0xf0fb('0x39')](_0x2f3756[_0xf0fb('0x2e')][_0xf0fb('0x39')]);_0x3917c4[_0xf0fb('0x3a')]=qs['filters'](_[_0xf0fb('0x3b')](_0x2f3756[_0xf0fb('0x2e')],_0x22f02a['filters']));if(_0x2f3756['query'][_0xf0fb('0x40')]){_0x3917c4[_0xf0fb('0x3a')]=_[_0xf0fb('0x3c')](_0x3917c4[_0xf0fb('0x3a')],{'$or':_[_0xf0fb('0x2a')](_0x3917c4['attributes'],function(_0x46518a){var _0x53ac8e={};_0x53ac8e[_0x46518a]={'$like':'%'+_0x2f3756[_0xf0fb('0x2e')][_0xf0fb('0x40')]+'%'};return _0x53ac8e;})});}_0x3917c4=_['merge']({},_0x3917c4,_0x2f3756[_0xf0fb('0x41')]);return _0x4d3b4b[_0xf0fb('0x50')](_0x3917c4);}})[_0xf0fb('0x23')](function(_0x380396){if(_0x380396){_0x614d15=_0x380396['length'];if(!_0x2f3756[_0xf0fb('0x2e')][_0xf0fb('0x35')]('nolimit')){_0x3917c4[_0xf0fb('0x37')]=qs[_0xf0fb('0x37')](_0x2f3756[_0xf0fb('0x2e')][_0xf0fb('0x37')]);_0x3917c4[_0xf0fb('0x1c')]=qs[_0xf0fb('0x1c')](_0x2f3756[_0xf0fb('0x2e')][_0xf0fb('0x1c')]);}return _0x4d3b4b[_0xf0fb('0x50')](_0x3917c4);}})[_0xf0fb('0x23')](function(_0x2c8638){if(_0x2c8638){return _0x2c8638?{'count':_0x614d15,'rows':_0x2c8638}:null;}})['then'](respondWithResult(_0x13eda9,null))[_0xf0fb('0x48')](handleError(_0x13eda9,null));};exports[_0xf0fb('0x52')]=function(_0x3aaf90,_0x5cf282,_0x45aea0){return db[_0xf0fb('0x53')]['find']({'where':{'id':_0x3aaf90[_0xf0fb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5cf282,null))[_0xf0fb('0x23')](function(_0x2a58a6){if(_0x2a58a6){return _0x2a58a6[_0xf0fb('0x52')](_0x3aaf90[_0xf0fb('0x4a')][_0xf0fb('0x4e')],_[_0xf0fb('0x4f')](_0x3aaf90['body'],['ids','id'])||{});}})[_0xf0fb('0x23')](respondWithResult(_0x5cf282,null))[_0xf0fb('0x48')](handleError(_0x5cf282,null));};exports['getActions']=function(_0xb0ba6f,_0xac698,_0x254ee1){var _0xeef54a={};var _0x206575={};var _0x90c5c3;var _0x373813;return db['Automation']['findOne']({'where':{'id':_0xb0ba6f['params']['id']}})[_0xf0fb('0x23')](handleEntityNotFound(_0xac698,null))[_0xf0fb('0x23')](function(_0xa79280){if(_0xa79280){_0x90c5c3=_0xa79280;_0x206575[_0xf0fb('0x2d')]=_[_0xf0fb('0x2f')](db[_0xf0fb('0x53')]['rawAttributes']);_0x206575['query']=_[_0xf0fb('0x2f')](_0xb0ba6f[_0xf0fb('0x2e')]);_0x206575['filters']=_[_0xf0fb('0x31')](_0x206575[_0xf0fb('0x2d')],_0x206575[_0xf0fb('0x2e')]);_0xeef54a[_0xf0fb('0x32')]=_[_0xf0fb('0x31')](_0x206575[_0xf0fb('0x2d')],qs[_0xf0fb('0x33')](_0xb0ba6f[_0xf0fb('0x2e')][_0xf0fb('0x33')]));_0xeef54a[_0xf0fb('0x32')]=_0xeef54a[_0xf0fb('0x32')][_0xf0fb('0x34')]?_0xeef54a[_0xf0fb('0x32')]:_0x206575['model'];_0xeef54a[_0xf0fb('0x38')]=qs[_0xf0fb('0x39')](_0xb0ba6f[_0xf0fb('0x2e')]['sort']);_0xeef54a['where']=qs[_0xf0fb('0x30')](_[_0xf0fb('0x3b')](_0xb0ba6f['query'],_0x206575['filters']));if(_0xb0ba6f[_0xf0fb('0x2e')][_0xf0fb('0x40')]){_0xeef54a[_0xf0fb('0x3a')]=_['merge'](_0xeef54a[_0xf0fb('0x3a')],{'$or':_['map'](_0xeef54a[_0xf0fb('0x32')],function(_0xb81c75){var _0x3708af={};_0x3708af[_0xb81c75]={'$like':'%'+_0xb0ba6f[_0xf0fb('0x2e')]['filter']+'%'};return _0x3708af;})});}_0xeef54a=_['merge']({},_0xeef54a,_0xb0ba6f[_0xf0fb('0x41')]);return _0x90c5c3[_0xf0fb('0x54')](_0xeef54a);}})[_0xf0fb('0x23')](function(_0x51d662){if(_0x51d662){_0x373813=_0x51d662[_0xf0fb('0x34')];if(!_0xb0ba6f['query'][_0xf0fb('0x35')](_0xf0fb('0x36'))){_0xeef54a[_0xf0fb('0x37')]=qs[_0xf0fb('0x37')](_0xb0ba6f[_0xf0fb('0x2e')][_0xf0fb('0x37')]);_0xeef54a[_0xf0fb('0x1c')]=qs['offset'](_0xb0ba6f['query'][_0xf0fb('0x1c')]);}return _0x90c5c3[_0xf0fb('0x54')](_0xeef54a);}})[_0xf0fb('0x23')](function(_0x17a42d){if(_0x17a42d){return _0x17a42d?{'count':_0x373813,'rows':_0x17a42d}:null;}})[_0xf0fb('0x23')](respondWithResult(_0xac698,null))[_0xf0fb('0x48')](handleError(_0xac698,null));};
\ No newline at end of file
+var _0xe8bc=['index','Automation','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','body','addConditions','Condition','omit','ids','getConditions','hasOwnProperty','addActions','Action','getActions','findOne','eml-format','zip-dir','moment','bluebird','mustache','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xe8bc,0xc8));var _0xce8b=function(_0x399130,_0x5cb872){_0x399130=_0x399130-0x0;var _0x5dd1e7=_0xe8bc[_0x399130];return _0x5dd1e7;};'use strict';var emlformat=require(_0xce8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce8b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xce8b('0x2'));var BPromise=require(_0xce8b('0x3'));var Mustache=require(_0xce8b('0x4'));var util=require('util');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(_0xce8b('0x5'));var _=require(_0xce8b('0x6'));var squel=require(_0xce8b('0x7'));var crypto=require(_0xce8b('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xce8b('0x9'));var toCsv=require(_0xce8b('0xa'));var querystring=require(_0xce8b('0xb'));var Papa=require(_0xce8b('0xc'));var Redis=require(_0xce8b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xce8b('0xe'));var as=require(_0xce8b('0xf'));var hardwareService=require(_0xce8b('0x10'));var logger=require(_0xce8b('0x11'))(_0xce8b('0x12'));var utils=require(_0xce8b('0x13'));var config=require(_0xce8b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xce8b('0x15'))['db'];function respondWithStatusCode(_0xdcb985,_0x537159){_0x537159=_0x537159||0xcc;return function(_0x1b9e85){if(_0x1b9e85){return _0xdcb985[_0xce8b('0x16')](_0x537159);}return _0xdcb985[_0xce8b('0x17')](_0x537159)[_0xce8b('0x18')]();};}function respondWithResult(_0xbe4adf,_0x19e65f){_0x19e65f=_0x19e65f||0xc8;return function(_0x14039f){if(_0x14039f){return _0xbe4adf['status'](_0x19e65f)[_0xce8b('0x19')](_0x14039f);}};}function respondWithFilteredResult(_0xd9a8b2,_0x463f0e){return function(_0xdec3e9){if(_0xdec3e9){var _0x3ece01=_0xdec3e9[_0xce8b('0x1a')],_0x5538d9=_0x463f0e[_0xce8b('0x1b')],_0x248196=_0x463f0e[_0xce8b('0x1b')]+_0x463f0e[_0xce8b('0x1c')],_0xd4486c;if(_0x248196>=_0x3ece01){_0x248196=_0x3ece01;_0xd4486c=0xc8;}else{_0xd4486c=0xce;}_0xd9a8b2[_0xce8b('0x17')](_0xd4486c);return _0xd9a8b2[_0xce8b('0x1d')](_0xce8b('0x1e'),_0x5538d9+'-'+_0x248196+'/'+_0x3ece01)[_0xce8b('0x19')](_0xdec3e9);}return null;};}function patchUpdates(_0x191fc0){return function(_0xbfbf9d){try{jsonpatch[_0xce8b('0x1f')](_0xbfbf9d,_0x191fc0,!![]);}catch(_0x141de6){return BPromise[_0xce8b('0x20')](_0x141de6);}return _0xbfbf9d[_0xce8b('0x21')]();};}function saveUpdates(_0x46cd3d,_0x319673){return function(_0x599cfd){if(_0x599cfd){return _0x599cfd[_0xce8b('0x22')](_0x46cd3d)[_0xce8b('0x23')](function(_0xeb6356){return _0xeb6356;});}return null;};}function removeEntity(_0x13ad88,_0x444c50){return function(_0x3b3af2){if(_0x3b3af2){return _0x3b3af2[_0xce8b('0x24')]()[_0xce8b('0x23')](function(){_0x13ad88[_0xce8b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597256,_0x58da48){return function(_0x889602){if(!_0x889602){_0x597256[_0xce8b('0x16')](0x194);}return _0x889602;};}function handleError(_0x29b148,_0x4aaa9d){_0x4aaa9d=_0x4aaa9d||0x1f4;return function(_0x187fa0){logger[_0xce8b('0x25')](_0x187fa0['stack']);if(_0x187fa0[_0xce8b('0x26')]){delete _0x187fa0[_0xce8b('0x26')];}_0x29b148[_0xce8b('0x17')](_0x4aaa9d)[_0xce8b('0x27')](_0x187fa0);};}exports[_0xce8b('0x28')]=function(_0x5c31ed,_0x3f140b){var _0xaf513={},_0x2e7d4b={},_0x1ceac5={'count':0x0,'rows':[]};var _0x5d7570=_['map'](db[_0xce8b('0x29')][_0xce8b('0x2a')],function(_0x48f30e){return{'name':_0x48f30e[_0xce8b('0x2b')],'type':_0x48f30e[_0xce8b('0x2c')]['key']};});_0x2e7d4b[_0xce8b('0x2d')]=_[_0xce8b('0x2e')](_0x5d7570,'name');_0x2e7d4b[_0xce8b('0x2f')]=_[_0xce8b('0x30')](_0x5c31ed[_0xce8b('0x2f')]);_0x2e7d4b[_0xce8b('0x31')]=_['intersection'](_0x2e7d4b[_0xce8b('0x2d')],_0x2e7d4b[_0xce8b('0x2f')]);_0xaf513['attributes']=_[_0xce8b('0x32')](_0x2e7d4b[_0xce8b('0x2d')],qs[_0xce8b('0x33')](_0x5c31ed['query'][_0xce8b('0x33')]));_0xaf513[_0xce8b('0x34')]=_0xaf513[_0xce8b('0x34')][_0xce8b('0x35')]?_0xaf513[_0xce8b('0x34')]:_0x2e7d4b[_0xce8b('0x2d')];if(!_0x5c31ed['query']['hasOwnProperty'](_0xce8b('0x36'))){_0xaf513[_0xce8b('0x1c')]=qs[_0xce8b('0x1c')](_0x5c31ed['query'][_0xce8b('0x1c')]);_0xaf513['offset']=qs['offset'](_0x5c31ed[_0xce8b('0x2f')][_0xce8b('0x1b')]);}_0xaf513[_0xce8b('0x37')]=qs[_0xce8b('0x38')](_0x5c31ed[_0xce8b('0x2f')][_0xce8b('0x38')]);_0xaf513[_0xce8b('0x39')]=qs[_0xce8b('0x31')](_['pick'](_0x5c31ed[_0xce8b('0x2f')],_0x2e7d4b[_0xce8b('0x31')]),_0x5d7570);if(_0x5c31ed[_0xce8b('0x2f')]['filter']){_0xaf513[_0xce8b('0x39')]=_[_0xce8b('0x3a')](_0xaf513[_0xce8b('0x39')],{'$or':_['map'](_0x5d7570,function(_0x27272f){if(_0x27272f[_0xce8b('0x2c')]!==_0xce8b('0x3b')){var _0x2b1654={};_0x2b1654[_0x27272f[_0xce8b('0x26')]]={'$like':'%'+_0x5c31ed[_0xce8b('0x2f')][_0xce8b('0x3c')]+'%'};return _0x2b1654;}})});}_0xaf513=_[_0xce8b('0x3a')]({},_0xaf513,_0x5c31ed[_0xce8b('0x3d')]);var _0xd85b59={'where':_0xaf513[_0xce8b('0x39')]};return db[_0xce8b('0x29')][_0xce8b('0x1a')](_0xd85b59)['then'](function(_0x3131e9){_0x1ceac5[_0xce8b('0x1a')]=_0x3131e9;if(_0x5c31ed[_0xce8b('0x2f')][_0xce8b('0x3e')]){_0xaf513[_0xce8b('0x3f')]=[{'all':!![]}];}return db[_0xce8b('0x29')]['findAll'](_0xaf513);})[_0xce8b('0x23')](function(_0x350501){_0x1ceac5[_0xce8b('0x40')]=_0x350501;return _0x1ceac5;})[_0xce8b('0x23')](respondWithFilteredResult(_0x3f140b,_0xaf513))[_0xce8b('0x41')](handleError(_0x3f140b,null));};exports[_0xce8b('0x42')]=function(_0x512263,_0x175a35){var _0x293974={'raw':![],'where':{'id':_0x512263[_0xce8b('0x43')]['id']}},_0x12a461={};_0x12a461['model']=_[_0xce8b('0x30')](db[_0xce8b('0x29')]['rawAttributes']);_0x12a461['query']=_[_0xce8b('0x30')](_0x512263[_0xce8b('0x2f')]);_0x12a461[_0xce8b('0x31')]=_[_0xce8b('0x32')](_0x12a461['model'],_0x12a461[_0xce8b('0x2f')]);_0x293974[_0xce8b('0x34')]=_[_0xce8b('0x32')](_0x12a461[_0xce8b('0x2d')],qs[_0xce8b('0x33')](_0x512263[_0xce8b('0x2f')]['fields']));_0x293974[_0xce8b('0x34')]=_0x293974[_0xce8b('0x34')]['length']?_0x293974[_0xce8b('0x34')]:_0x12a461[_0xce8b('0x2d')];if(_0x512263[_0xce8b('0x2f')][_0xce8b('0x3e')]){_0x293974[_0xce8b('0x3f')]=[{'all':!![]}];}_0x293974=_[_0xce8b('0x3a')]({},_0x293974,_0x512263[_0xce8b('0x3d')]);return db[_0xce8b('0x29')][_0xce8b('0x44')](_0x293974)[_0xce8b('0x23')](handleEntityNotFound(_0x175a35,null))[_0xce8b('0x23')](respondWithResult(_0x175a35,null))['catch'](handleError(_0x175a35,null));};exports['create']=function(_0x216aac,_0x439fef){return db[_0xce8b('0x29')]['create'](_0x216aac[_0xce8b('0x45')],{})[_0xce8b('0x23')](respondWithResult(_0x439fef,0xc9))[_0xce8b('0x41')](handleError(_0x439fef,null));};exports[_0xce8b('0x22')]=function(_0x42f3da,_0x498b22){if(_0x42f3da[_0xce8b('0x45')]['id']){delete _0x42f3da[_0xce8b('0x45')]['id'];}return db['Automation'][_0xce8b('0x44')]({'where':{'id':_0x42f3da[_0xce8b('0x43')]['id']}})[_0xce8b('0x23')](handleEntityNotFound(_0x498b22,null))[_0xce8b('0x23')](saveUpdates(_0x42f3da[_0xce8b('0x45')],null))[_0xce8b('0x23')](respondWithResult(_0x498b22,null))['catch'](handleError(_0x498b22,null));};exports['destroy']=function(_0x31e65a,_0x4dcf6d){return db[_0xce8b('0x29')][_0xce8b('0x44')]({'where':{'id':_0x31e65a[_0xce8b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4dcf6d,null))[_0xce8b('0x23')](removeEntity(_0x4dcf6d,null))[_0xce8b('0x41')](handleError(_0x4dcf6d,null));};exports[_0xce8b('0x46')]=function(_0x210032,_0x51b478,_0xf29ce0){return db[_0xce8b('0x47')][_0xce8b('0x44')]({'where':{'id':_0x210032[_0xce8b('0x43')]['id']}})['then'](handleEntityNotFound(_0x51b478,null))[_0xce8b('0x23')](function(_0x486b7f){if(_0x486b7f){return _0x486b7f[_0xce8b('0x46')](_0x210032['body']['ids'],_[_0xce8b('0x48')](_0x210032[_0xce8b('0x45')],[_0xce8b('0x49'),'id'])||{});}})[_0xce8b('0x23')](respondWithResult(_0x51b478,null))[_0xce8b('0x41')](handleError(_0x51b478,null));};exports['getConditions']=function(_0x322356,_0x2ff051,_0x44c752){var _0x3af937={};var _0x610579={};var _0x1590d1;var _0x567e24;return db[_0xce8b('0x29')]['findOne']({'where':{'id':_0x322356['params']['id']}})[_0xce8b('0x23')](handleEntityNotFound(_0x2ff051,null))[_0xce8b('0x23')](function(_0x3a68f6){if(_0x3a68f6){_0x1590d1=_0x3a68f6;_0x610579['model']=_[_0xce8b('0x30')](db[_0xce8b('0x47')][_0xce8b('0x2a')]);_0x610579[_0xce8b('0x2f')]=_[_0xce8b('0x30')](_0x322356[_0xce8b('0x2f')]);_0x610579['filters']=_['intersection'](_0x610579[_0xce8b('0x2d')],_0x610579[_0xce8b('0x2f')]);_0x3af937[_0xce8b('0x34')]=_[_0xce8b('0x32')](_0x610579['model'],qs[_0xce8b('0x33')](_0x322356['query']['fields']));_0x3af937[_0xce8b('0x34')]=_0x3af937[_0xce8b('0x34')][_0xce8b('0x35')]?_0x3af937['attributes']:_0x610579[_0xce8b('0x2d')];_0x3af937[_0xce8b('0x37')]=qs[_0xce8b('0x38')](_0x322356[_0xce8b('0x2f')][_0xce8b('0x38')]);_0x3af937['where']=qs[_0xce8b('0x31')](_['pick'](_0x322356[_0xce8b('0x2f')],_0x610579[_0xce8b('0x31')]));if(_0x322356[_0xce8b('0x2f')]['filter']){_0x3af937[_0xce8b('0x39')]=_[_0xce8b('0x3a')](_0x3af937['where'],{'$or':_[_0xce8b('0x2e')](_0x3af937[_0xce8b('0x34')],function(_0x4df791){var _0xd91fde={};_0xd91fde[_0x4df791]={'$like':'%'+_0x322356['query'][_0xce8b('0x3c')]+'%'};return _0xd91fde;})});}_0x3af937=_[_0xce8b('0x3a')]({},_0x3af937,_0x322356['options']);return _0x1590d1[_0xce8b('0x4a')](_0x3af937);}})[_0xce8b('0x23')](function(_0x114882){if(_0x114882){_0x567e24=_0x114882['length'];if(!_0x322356[_0xce8b('0x2f')][_0xce8b('0x4b')](_0xce8b('0x36'))){_0x3af937[_0xce8b('0x1c')]=qs[_0xce8b('0x1c')](_0x322356[_0xce8b('0x2f')][_0xce8b('0x1c')]);_0x3af937[_0xce8b('0x1b')]=qs['offset'](_0x322356[_0xce8b('0x2f')][_0xce8b('0x1b')]);}return _0x1590d1[_0xce8b('0x4a')](_0x3af937);}})['then'](function(_0x344e93){if(_0x344e93){return _0x344e93?{'count':_0x567e24,'rows':_0x344e93}:null;}})['then'](respondWithResult(_0x2ff051,null))[_0xce8b('0x41')](handleError(_0x2ff051,null));};exports[_0xce8b('0x4c')]=function(_0x1702e6,_0x4bf341,_0x10fc3f){return db[_0xce8b('0x4d')][_0xce8b('0x44')]({'where':{'id':_0x1702e6[_0xce8b('0x43')]['id']}})[_0xce8b('0x23')](handleEntityNotFound(_0x4bf341,null))[_0xce8b('0x23')](function(_0x2a24f6){if(_0x2a24f6){return _0x2a24f6['addActions'](_0x1702e6[_0xce8b('0x45')][_0xce8b('0x49')],_['omit'](_0x1702e6[_0xce8b('0x45')],[_0xce8b('0x49'),'id'])||{});}})[_0xce8b('0x23')](respondWithResult(_0x4bf341,null))[_0xce8b('0x41')](handleError(_0x4bf341,null));};exports[_0xce8b('0x4e')]=function(_0x2d27fb,_0x45ee73,_0x4cb903){var _0x5e671a={};var _0xdb20b8={};var _0x11b392;var _0x2e903b;return db['Automation'][_0xce8b('0x4f')]({'where':{'id':_0x2d27fb[_0xce8b('0x43')]['id']}})[_0xce8b('0x23')](handleEntityNotFound(_0x45ee73,null))[_0xce8b('0x23')](function(_0x519026){if(_0x519026){_0x11b392=_0x519026;_0xdb20b8[_0xce8b('0x2d')]=_['keys'](db['Action'][_0xce8b('0x2a')]);_0xdb20b8[_0xce8b('0x2f')]=_['keys'](_0x2d27fb[_0xce8b('0x2f')]);_0xdb20b8['filters']=_[_0xce8b('0x32')](_0xdb20b8[_0xce8b('0x2d')],_0xdb20b8[_0xce8b('0x2f')]);_0x5e671a[_0xce8b('0x34')]=_[_0xce8b('0x32')](_0xdb20b8['model'],qs[_0xce8b('0x33')](_0x2d27fb[_0xce8b('0x2f')][_0xce8b('0x33')]));_0x5e671a[_0xce8b('0x34')]=_0x5e671a[_0xce8b('0x34')][_0xce8b('0x35')]?_0x5e671a['attributes']:_0xdb20b8[_0xce8b('0x2d')];_0x5e671a[_0xce8b('0x37')]=qs[_0xce8b('0x38')](_0x2d27fb[_0xce8b('0x2f')][_0xce8b('0x38')]);_0x5e671a[_0xce8b('0x39')]=qs[_0xce8b('0x31')](_['pick'](_0x2d27fb[_0xce8b('0x2f')],_0xdb20b8[_0xce8b('0x31')]));if(_0x2d27fb[_0xce8b('0x2f')][_0xce8b('0x3c')]){_0x5e671a['where']=_[_0xce8b('0x3a')](_0x5e671a[_0xce8b('0x39')],{'$or':_[_0xce8b('0x2e')](_0x5e671a[_0xce8b('0x34')],function(_0x1c88c2){var _0xdc087={};_0xdc087[_0x1c88c2]={'$like':'%'+_0x2d27fb[_0xce8b('0x2f')]['filter']+'%'};return _0xdc087;})});}_0x5e671a=_[_0xce8b('0x3a')]({},_0x5e671a,_0x2d27fb[_0xce8b('0x3d')]);return _0x11b392[_0xce8b('0x4e')](_0x5e671a);}})[_0xce8b('0x23')](function(_0x2362c7){if(_0x2362c7){_0x2e903b=_0x2362c7['length'];if(!_0x2d27fb[_0xce8b('0x2f')][_0xce8b('0x4b')](_0xce8b('0x36'))){_0x5e671a[_0xce8b('0x1c')]=qs[_0xce8b('0x1c')](_0x2d27fb['query'][_0xce8b('0x1c')]);_0x5e671a[_0xce8b('0x1b')]=qs[_0xce8b('0x1b')](_0x2d27fb['query'][_0xce8b('0x1b')]);}return _0x11b392[_0xce8b('0x4e')](_0x5e671a);}})[_0xce8b('0x23')](function(_0x8ba759){if(_0x8ba759){return _0x8ba759?{'count':_0x2e903b,'rows':_0x8ba759}:null;}})[_0xce8b('0x23')](respondWithResult(_0x45ee73,null))[_0xce8b('0x41')](handleError(_0x45ee73,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 656286c..ce5b1db 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 _0xef38=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef38,0x122));var _0x8ef3=function(_0x5c0165,_0x587802){_0x5c0165=_0x5c0165-0x0;var _0x1a3d29=_0xef38[_0x5c0165];return _0x1a3d29;};'use strict';var _=require('lodash');var util=require(_0x8ef3('0x0'));var logger=require(_0x8ef3('0x1'))(_0x8ef3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8ef3('0x3'));var fs=require('fs');var path=require(_0x8ef3('0x4'));var rimraf=require(_0x8ef3('0x5'));var config=require(_0x8ef3('0x6'));var attributes=require(_0x8ef3('0x7'));module['exports']=function(_0x142b71,_0x25d6ca){return _0x142b71['define'](_0x8ef3('0x8'),attributes,{'tableName':_0x8ef3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x53d6=['../../config/logger','api','moment','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util'];(function(_0x83cac2,_0xca4af1){var _0x28a715=function(_0x19d98a){while(--_0x19d98a){_0x83cac2['push'](_0x83cac2['shift']());}};_0x28a715(++_0xca4af1);}(_0x53d6,0x113));var _0x653d=function(_0x458c52,_0x5e3fb4){_0x458c52=_0x458c52-0x0;var _0x43f43b=_0x53d6[_0x458c52];return _0x43f43b;};'use strict';var _=require('lodash');var util=require(_0x653d('0x0'));var logger=require(_0x653d('0x1'))(_0x653d('0x2'));var moment=require(_0x653d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x653d('0x4'));var rimraf=require(_0x653d('0x5'));var config=require(_0x653d('0x6'));var attributes=require(_0x653d('0x7'));module[_0x653d('0x8')]=function(_0x116e97,_0x365e69){return _0x116e97[_0x653d('0x9')](_0x653d('0xa'),attributes,{'tableName':_0x653d('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 466f253..31ae9ab 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 _0xa022=['Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x4ca7c7,_0x5d16ee){var _0x456a87=function(_0x11c8fc){while(--_0x11c8fc){_0x4ca7c7['push'](_0x4ca7c7['shift']());}};_0x456a87(++_0x5d16ee);}(_0xa022,0x1e7));var _0x2a02=function(_0x3beef5,_0x5c99ff){_0x3beef5=_0x3beef5-0x0;var _0x4c6999=_0xa022[_0x3beef5];return _0x4c6999;};'use strict';var _=require(_0x2a02('0x0'));var util=require(_0x2a02('0x1'));var moment=require(_0x2a02('0x2'));var BPromise=require(_0x2a02('0x3'));var rs=require(_0x2a02('0x4'));var fs=require('fs');var Redis=require(_0x2a02('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2a02('0x6'))(_0x2a02('0x7'));var config=require('../../config/environment');var jayson=require(_0x2a02('0x8'));var client=jayson['client'][_0x2a02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1853ee,_0xfcfa50,_0x16647d){return new BPromise(function(_0x54e5fb,_0x20959d){return client[_0x2a02('0xa')](_0x1853ee,_0x16647d)[_0x2a02('0xb')](function(_0x5c700e){logger[_0x2a02('0xc')](_0x2a02('0xd'),_0xfcfa50,_0x2a02('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xfcfa50,_0x2a02('0xe'),JSON[_0x2a02('0xf')](_0x5c700e));if(_0x5c700e[_0x2a02('0x10')]){if(_0x5c700e[_0x2a02('0x10')][_0x2a02('0x11')]===0x1f4){logger['error'](_0x2a02('0xd'),_0xfcfa50,_0x5c700e[_0x2a02('0x10')][_0x2a02('0x12')]);return _0x20959d(_0x5c700e[_0x2a02('0x10')][_0x2a02('0x12')]);}logger[_0x2a02('0x10')]('Automation,\x20%s,\x20%s',_0xfcfa50,_0x5c700e[_0x2a02('0x10')][_0x2a02('0x12')]);return _0x54e5fb(_0x5c700e[_0x2a02('0x10')][_0x2a02('0x12')]);}else{logger[_0x2a02('0xc')](_0x2a02('0xd'),_0xfcfa50,_0x2a02('0xe'));_0x54e5fb(_0x5c700e[_0x2a02('0x13')][_0x2a02('0x12')]);}})['catch'](function(_0x570e89){logger[_0x2a02('0x10')](_0x2a02('0xd'),_0xfcfa50,_0x570e89);_0x20959d(_0x570e89);});});}
\ No newline at end of file
+var _0x6d33=['rpc','../../config/environment','jayson/promise','client','request','info','Automation,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d33,0x80));var _0x36d3=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0x6d33[_0x37c8ef];return _0x5eaee9;};'use strict';var _=require('lodash');var util=require(_0x36d3('0x0'));var moment=require(_0x36d3('0x1'));var BPromise=require('bluebird');var rs=require(_0x36d3('0x2'));var fs=require('fs');var Redis=require(_0x36d3('0x3'));var db=require(_0x36d3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x36d3('0x5'));var config=require(_0x36d3('0x6'));var jayson=require(_0x36d3('0x7'));var client=jayson[_0x36d3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba011,_0x598b9b,_0x375c63){return new BPromise(function(_0xf8bcfa,_0x3baf32){return client[_0x36d3('0x9')](_0x4ba011,_0x375c63)['then'](function(_0x226fb0){logger[_0x36d3('0xa')](_0x36d3('0xb'),_0x598b9b,'request\x20sent');logger[_0x36d3('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x598b9b,'request\x20sent',JSON[_0x36d3('0xd')](_0x226fb0));if(_0x226fb0['error']){if(_0x226fb0[_0x36d3('0xe')][_0x36d3('0xf')]===0x1f4){logger[_0x36d3('0xe')](_0x36d3('0xb'),_0x598b9b,_0x226fb0[_0x36d3('0xe')][_0x36d3('0x10')]);return _0x3baf32(_0x226fb0['error'][_0x36d3('0x10')]);}logger[_0x36d3('0xe')]('Automation,\x20%s,\x20%s',_0x598b9b,_0x226fb0[_0x36d3('0xe')][_0x36d3('0x10')]);return _0xf8bcfa(_0x226fb0[_0x36d3('0xe')]['message']);}else{logger[_0x36d3('0xa')]('Automation,\x20%s,\x20%s',_0x598b9b,'request\x20sent');_0xf8bcfa(_0x226fb0[_0x36d3('0x11')][_0x36d3('0x10')]);}})[_0x36d3('0x12')](function(_0x4dcbe6){logger['error'](_0x36d3('0xb'),_0x598b9b,_0x4dcbe6);_0x3baf32(_0x4dcbe6);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 723c6a3..fc757c3 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 _0x3f40=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','getActions','post','create','addConditions','addActions','put','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x4a9d4b,_0x470313){var _0x47d79e=function(_0x576f3f){while(--_0x576f3f){_0x4a9d4b['push'](_0x4a9d4b['shift']());}};_0x47d79e(++_0x470313);}(_0x3f40,0xbb));var _0x03f4=function(_0x6c5bce,_0x1d20da){_0x6c5bce=_0x6c5bce-0x0;var _0x527cf3=_0x3f40[_0x6c5bce];return _0x527cf3;};'use strict';var multer=require(_0x03f4('0x0'));var util=require(_0x03f4('0x1'));var path=require(_0x03f4('0x2'));var timeout=require('connect-timeout');var express=require(_0x03f4('0x3'));var router=express['Router']();var fs_extra=require(_0x03f4('0x4'));var auth=require(_0x03f4('0x5'));var interaction=require(_0x03f4('0x6'));var config=require(_0x03f4('0x7'));var controller=require('./automation.controller');router[_0x03f4('0x8')]('/',auth[_0x03f4('0x9')](),controller[_0x03f4('0xa')]);router[_0x03f4('0x8')](_0x03f4('0xb'),auth[_0x03f4('0x9')](),controller[_0x03f4('0xc')]);router['get'](_0x03f4('0xd'),auth[_0x03f4('0x9')](),controller['getConditions']);router['get'](_0x03f4('0xe'),auth[_0x03f4('0x9')](),controller[_0x03f4('0xf')]);router[_0x03f4('0x10')]('/',auth[_0x03f4('0x9')](),controller[_0x03f4('0x11')]);router[_0x03f4('0x10')]('/:id/conditions',auth[_0x03f4('0x9')](),controller[_0x03f4('0x12')]);router[_0x03f4('0x10')]('/:id/actions',auth[_0x03f4('0x9')](),controller[_0x03f4('0x13')]);router[_0x03f4('0x14')](_0x03f4('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x03f4('0x15')](_0x03f4('0xb'),auth[_0x03f4('0x9')](),controller[_0x03f4('0x16')]);module[_0x03f4('0x17')]=router;
\ No newline at end of file
+var _0x843b=['post','create','/:id/actions','addActions','put','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id/conditions','getConditions','getActions'];(function(_0x3e10b6,_0x4cce32){var _0x469b0e=function(_0x3d054f){while(--_0x3d054f){_0x3e10b6['push'](_0x3e10b6['shift']());}};_0x469b0e(++_0x4cce32);}(_0x843b,0x143));var _0xb843=function(_0x3c35c3,_0x5322e5){_0x3c35c3=_0x3c35c3-0x0;var _0x1748e4=_0x843b[_0x3c35c3];return _0x1748e4;};'use strict';var multer=require(_0xb843('0x0'));var util=require(_0xb843('0x1'));var path=require('path');var timeout=require(_0xb843('0x2'));var express=require('express');var router=express[_0xb843('0x3')]();var fs_extra=require(_0xb843('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb843('0x5'));var config=require(_0xb843('0x6'));var controller=require(_0xb843('0x7'));router[_0xb843('0x8')]('/',auth[_0xb843('0x9')](),controller['index']);router[_0xb843('0x8')]('/:id',auth[_0xb843('0x9')](),controller['show']);router[_0xb843('0x8')](_0xb843('0xa'),auth[_0xb843('0x9')](),controller[_0xb843('0xb')]);router['get']('/:id/actions',auth[_0xb843('0x9')](),controller[_0xb843('0xc')]);router[_0xb843('0xd')]('/',auth['isAuthenticated'](),controller[_0xb843('0xe')]);router[_0xb843('0xd')](_0xb843('0xa'),auth[_0xb843('0x9')](),controller['addConditions']);router[_0xb843('0xd')](_0xb843('0xf'),auth['isAuthenticated'](),controller[_0xb843('0x10')]);router[_0xb843('0x11')](_0xb843('0x12'),auth[_0xb843('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb843('0x13')]);module[_0xb843('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 1e53bdb..cc1b6e8 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 _0xe1c3=['STRING','name','ENUM','ivr','Max\x20200\x20calls.','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports'];(function(_0x69ede,_0x3f8e97){var _0x13e7e1=function(_0x314100){while(--_0x314100){_0x69ede['push'](_0x69ede['shift']());}};_0x13e7e1(++_0x3f8e97);}(_0xe1c3,0x12b));var _0x3e1c=function(_0x2d7607,_0x218161){_0x2d7607=_0x2d7607-0x0;var _0x328803=_0xe1c3[_0x2d7607];return _0x328803;};'use strict';var Sequelize=require(_0x3e1c('0x0'));module[_0x3e1c('0x1')]={'name':{'type':Sequelize[_0x3e1c('0x2')],'unique':_0x3e1c('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3e1c('0x4')](_0x3e1c('0x5')),'allowNull':![],'defaultValue':_0x3e1c('0x5')},'description':{'type':Sequelize[_0x3e1c('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3e1c('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3e1c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x3e1c('0x7')](0x3)[_0x3e1c('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3e1c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3e1c('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3e1c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3e1c('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x3e1c('0x7')](0x3)[_0x3e1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3e1c('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3e1c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3e1c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3e1c('0x7')](0x3)[_0x3e1c('0x8')],'defaultValue':0x3,'comment':_0x3e1c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3e1c('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3e1c('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3e1c('0xe')},'dialTimezone':{'type':Sequelize[_0x3e1c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x3e1c('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x3e1c('0x4')](_0x3e1c('0x10'),_0x3e1c('0x11'),_0x3e1c('0x12')),'defaultValue':_0x3e1c('0x10')},'dialAMDActive':{'type':Sequelize[_0x3e1c('0x13')],'defaultValue':0x0,'comment':_0x3e1c('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3e1c('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3e1c('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x3e1c('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3e1c('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3e1c('0x7')](0x9)[_0x3e1c('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3e1c('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x3e1c('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3e1c('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x3e1c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3e1c('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3e1c('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3e1c('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x3e1c('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3e1c('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3e1c('0x7')](0x5)[_0x3e1c('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3e1c('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3e1c('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3e1c('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3e1c('0x4')](_0x3e1c('0x1e'),_0x3e1c('0x1f')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x3e1c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3e1c('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3e1c('0x20')},'dialCutDigit':{'type':Sequelize[_0x3e1c('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3e1c('0x21')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3e1c('0x7')](0x3)[_0x3e1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3e1c('0x22')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3e1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3e1c('0x23')},'dialDropMaxRetry':{'type':Sequelize[_0x3e1c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3e1c('0x24')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3e1c('0x25')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3e1c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3e1c('0x26')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3e1c('0x7')](0x5)[_0x3e1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x3e1c('0x7')](0x3)[_0x3e1c('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3e1c('0x27')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3e1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3e1c('0x28')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3e1c('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3e1c('0x29')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3e1c('0x7')](0x5)[_0x3e1c('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3e1c('0x2a')}};
\ No newline at end of file
+var _0xdc3f=['sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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)'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xdc3f,0x1ce));var _0xfdc3=function(_0x5a14d9,_0x59a19f){_0x5a14d9=_0x5a14d9-0x0;var _0x113c70=_0xdc3f[_0x5a14d9];return _0x113c70;};'use strict';var Sequelize=require(_0xfdc3('0x0'));module[_0xfdc3('0x1')]={'name':{'type':Sequelize[_0xfdc3('0x2')],'unique':_0xfdc3('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xfdc3('0x4')),'allowNull':![],'defaultValue':_0xfdc3('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfdc3('0x5')],'defaultValue':0x0,'comment':_0xfdc3('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xfdc3('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xfdc3('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfdc3('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfdc3('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfdc3('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfdc3('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfdc3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfdc3('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfdc3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xfdc3('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfdc3('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfdc3('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfdc3('0x9')](0x5)[_0xfdc3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfdc3('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfdc3('0x9')](0x3)[_0xfdc3('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfdc3('0x2')],'defaultValue':_0xfdc3('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xfdc3('0xf')](_0xfdc3('0x10'),'never','onlyIfOpen'),'defaultValue':_0xfdc3('0x10')},'dialAMDActive':{'type':Sequelize[_0xfdc3('0x5')],'defaultValue':0x0,'comment':_0xfdc3('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xfdc3('0x9')](0x9)[_0xfdc3('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xfdc3('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfdc3('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfdc3('0x9')](0x9)[_0xfdc3('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfdc3('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xfdc3('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfdc3('0x9')](0x9)[_0xfdc3('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfdc3('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfdc3('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfdc3('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfdc3('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfdc3('0x9')](0x9)[_0xfdc3('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xfdc3('0x16'),_0xfdc3('0x17')),'defaultValue':_0xfdc3('0x16')},'dialPrefix':{'type':Sequelize[_0xfdc3('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfdc3('0x9')](0x3)[_0xfdc3('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xfdc3('0x9')](0x3)[_0xfdc3('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfdc3('0x9')](0x3)[_0xfdc3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfdc3('0x18')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfdc3('0x9')](0x5)[_0xfdc3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfdc3('0x19')},'dialDropMaxRetry':{'type':Sequelize[_0xfdc3('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfdc3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfdc3('0x1a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfdc3('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfdc3('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfdc3('0x9')](0x5)[_0xfdc3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfdc3('0x1c')},'dialMachineMaxRetry':{'type':Sequelize[_0xfdc3('0x9')](0x3)[_0xfdc3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfdc3('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfdc3('0x9')](0x5)[_0xfdc3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfdc3('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfdc3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfdc3('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfdc3('0x9')](0x5)[_0xfdc3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfdc3('0x20')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index b6c728e..624e0d0 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 _0x1171=['role','IvrCampaigns','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','CmHopperHistory','hasOwnProperty','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','into','cm_contacts','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','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','json','count','offset','limit','set','apply','reject','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','Campaign','findAll','rows','show','params','rawAttributes','intersection','include','find','catch','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt'];(function(_0x121737,_0x37e36b){var _0x5f4d4b=function(_0x14182a){while(--_0x14182a){_0x121737['push'](_0x121737['shift']());}};_0x5f4d4b(++_0x37e36b);}(_0x1171,0xbc));var _0x1117=function(_0x457e92,_0x3b624b){_0x457e92=_0x457e92-0x0;var _0x4fc1b8=_0x1171[_0x457e92];return _0x4fc1b8;};'use strict';var emlformat=require(_0x1117('0x0'));var rimraf=require(_0x1117('0x1'));var zipdir=require(_0x1117('0x2'));var jsonpatch=require(_0x1117('0x3'));var rp=require(_0x1117('0x4'));var moment=require(_0x1117('0x5'));var BPromise=require(_0x1117('0x6'));var Mustache=require(_0x1117('0x7'));var util=require('util');var path=require(_0x1117('0x8'));var sox=require(_0x1117('0x9'));var csv=require(_0x1117('0xa'));var ejs=require(_0x1117('0xb'));var fs=require('fs');var fs_extra=require(_0x1117('0xc'));var _=require(_0x1117('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1117('0xe'));var deskjs=require(_0x1117('0xf'));var toCsv=require(_0x1117('0xa'));var querystring=require(_0x1117('0x10'));var Papa=require(_0x1117('0x11'));var Redis=require(_0x1117('0x12'));var authService=require(_0x1117('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1117('0x14'));var hardwareService=require(_0x1117('0x15'));var logger=require(_0x1117('0x16'))(_0x1117('0x17'));var utils=require(_0x1117('0x18'));var config=require(_0x1117('0x19'));var licenseUtil=require(_0x1117('0x1a'));var db=require(_0x1117('0x1b'))['db'];function respondWithStatusCode(_0x1fa026,_0x35a0b9){_0x35a0b9=_0x35a0b9||0xcc;return function(_0x4ed7b2){if(_0x4ed7b2){return _0x1fa026['sendStatus'](_0x35a0b9);}return _0x1fa026['status'](_0x35a0b9)['end']();};}function respondWithResult(_0x14403b,_0x466b16){_0x466b16=_0x466b16||0xc8;return function(_0x5d0525){if(_0x5d0525){return _0x14403b[_0x1117('0x1c')](_0x466b16)[_0x1117('0x1d')](_0x5d0525);}};}function respondWithFilteredResult(_0x4ae931,_0x2ab78e){return function(_0x70c27a){if(_0x70c27a){var _0xbe42f9=_0x70c27a[_0x1117('0x1e')],_0x509926=_0x2ab78e[_0x1117('0x1f')],_0x5718a9=_0x2ab78e[_0x1117('0x1f')]+_0x2ab78e[_0x1117('0x20')],_0x1deff8;if(_0x5718a9>=_0xbe42f9){_0x5718a9=_0xbe42f9;_0x1deff8=0xc8;}else{_0x1deff8=0xce;}_0x4ae931[_0x1117('0x1c')](_0x1deff8);return _0x4ae931[_0x1117('0x21')]('Content-Range',_0x509926+'-'+_0x5718a9+'/'+_0xbe42f9)[_0x1117('0x1d')](_0x70c27a);}return null;};}function patchUpdates(_0x1d4690){return function(_0x24a6ce){try{jsonpatch[_0x1117('0x22')](_0x24a6ce,_0x1d4690,!![]);}catch(_0x530ff8){return BPromise[_0x1117('0x23')](_0x530ff8);}return _0x24a6ce['save']();};}function saveUpdates(_0x3e070a,_0x4ebf75){return function(_0x51ef8a){if(_0x51ef8a){return _0x51ef8a[_0x1117('0x24')](_0x3e070a)[_0x1117('0x25')](function(_0xad7a4f){return _0xad7a4f;});}return null;};}function removeEntity(_0x49e79e,_0x33b845){return function(_0x58e8bd){if(_0x58e8bd){return _0x58e8bd[_0x1117('0x26')]()[_0x1117('0x25')](function(){var _0x469ea=_0x58e8bd['get']({'plain':!![]});var _0xefd9a2='IvrCampaigns';return db[_0x1117('0x27')]['destroy']({'where':{'type':_0xefd9a2,'resourceId':_0x469ea['id']}})[_0x1117('0x25')](function(){return _0x58e8bd;});})[_0x1117('0x25')](function(){_0x49e79e[_0x1117('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d167d,_0x4d7983){return function(_0x57e619){if(!_0x57e619){_0x3d167d[_0x1117('0x28')](0x194);}return _0x57e619;};}function handleError(_0x5d4dec,_0x40e9b5){_0x40e9b5=_0x40e9b5||0x1f4;return function(_0x259914){logger[_0x1117('0x29')](_0x259914[_0x1117('0x2a')]);if(_0x259914[_0x1117('0x2b')]){delete _0x259914[_0x1117('0x2b')];}_0x5d4dec[_0x1117('0x1c')](_0x40e9b5)[_0x1117('0x2c')](_0x259914);};}exports[_0x1117('0x2d')]=function(_0x5b6c1a,_0x32eff1){var _0x156bb8={},_0x4fa250={},_0x5ec1f6={'count':0x0,'rows':[]};var _0x2fe27a=_[_0x1117('0x2e')](db['Campaign']['rawAttributes'],function(_0x49d417){return{'name':_0x49d417[_0x1117('0x2f')],'type':_0x49d417[_0x1117('0x30')][_0x1117('0x31')]};});_0x4fa250['model']=_[_0x1117('0x2e')](_0x2fe27a,_0x1117('0x2b'));_0x4fa250[_0x1117('0x32')]=_[_0x1117('0x33')](_0x5b6c1a[_0x1117('0x32')]);_0x4fa250[_0x1117('0x34')]=_['intersection'](_0x4fa250[_0x1117('0x35')],_0x4fa250[_0x1117('0x32')]);_0x156bb8[_0x1117('0x36')]=_['intersection'](_0x4fa250[_0x1117('0x35')],qs['fields'](_0x5b6c1a[_0x1117('0x32')][_0x1117('0x37')]));_0x156bb8[_0x1117('0x36')]=_0x156bb8[_0x1117('0x36')][_0x1117('0x38')]?_0x156bb8[_0x1117('0x36')]:_0x4fa250[_0x1117('0x35')];if(!_0x5b6c1a['query']['hasOwnProperty'](_0x1117('0x39'))){_0x156bb8[_0x1117('0x20')]=qs[_0x1117('0x20')](_0x5b6c1a[_0x1117('0x32')][_0x1117('0x20')]);_0x156bb8[_0x1117('0x1f')]=qs[_0x1117('0x1f')](_0x5b6c1a[_0x1117('0x32')][_0x1117('0x1f')]);}_0x156bb8[_0x1117('0x3a')]=qs[_0x1117('0x3b')](_0x5b6c1a[_0x1117('0x32')]['sort']);_0x156bb8[_0x1117('0x3c')]=qs[_0x1117('0x34')](_[_0x1117('0x3d')](_0x5b6c1a['query'],_0x4fa250[_0x1117('0x34')]),_0x2fe27a);if(_0x5b6c1a[_0x1117('0x32')]['filter']){_0x156bb8[_0x1117('0x3c')]=_[_0x1117('0x3e')](_0x156bb8[_0x1117('0x3c')],{'$or':_[_0x1117('0x2e')](_0x2fe27a,function(_0x26d93f){if(_0x26d93f[_0x1117('0x30')]!=='VIRTUAL'){var _0x3838ef={};_0x3838ef[_0x26d93f[_0x1117('0x2b')]]={'$like':'%'+_0x5b6c1a[_0x1117('0x32')][_0x1117('0x3f')]+'%'};return _0x3838ef;}})});}_0x156bb8=_['merge']({},_0x156bb8,_0x5b6c1a[_0x1117('0x40')]);var _0x31e8d9={'where':_0x156bb8[_0x1117('0x3c')]};return db['Campaign']['count'](_0x31e8d9)[_0x1117('0x25')](function(_0x366ab3){_0x5ec1f6[_0x1117('0x1e')]=_0x366ab3;if(_0x5b6c1a['query'][_0x1117('0x41')]){_0x156bb8['include']=[{'all':!![]}];}return db[_0x1117('0x42')][_0x1117('0x43')](_0x156bb8);})[_0x1117('0x25')](function(_0x4bf118){_0x5ec1f6[_0x1117('0x44')]=_0x4bf118;return _0x5ec1f6;})[_0x1117('0x25')](respondWithFilteredResult(_0x32eff1,_0x156bb8))['catch'](handleError(_0x32eff1,null));};exports[_0x1117('0x45')]=function(_0x81deb4,_0x56a801){var _0x305a73={'raw':![],'where':{'id':_0x81deb4[_0x1117('0x46')]['id']}},_0x4c55b5={};_0x4c55b5['model']=_[_0x1117('0x33')](db[_0x1117('0x42')][_0x1117('0x47')]);_0x4c55b5['query']=_[_0x1117('0x33')](_0x81deb4[_0x1117('0x32')]);_0x4c55b5[_0x1117('0x34')]=_[_0x1117('0x48')](_0x4c55b5[_0x1117('0x35')],_0x4c55b5[_0x1117('0x32')]);_0x305a73[_0x1117('0x36')]=_[_0x1117('0x48')](_0x4c55b5[_0x1117('0x35')],qs[_0x1117('0x37')](_0x81deb4[_0x1117('0x32')][_0x1117('0x37')]));_0x305a73[_0x1117('0x36')]=_0x305a73[_0x1117('0x36')][_0x1117('0x38')]?_0x305a73[_0x1117('0x36')]:_0x4c55b5['model'];if(_0x81deb4[_0x1117('0x32')][_0x1117('0x41')]){_0x305a73[_0x1117('0x49')]=[{'all':!![]}];}_0x305a73=_[_0x1117('0x3e')]({},_0x305a73,_0x81deb4['options']);return db['Campaign'][_0x1117('0x4a')](_0x305a73)[_0x1117('0x25')](handleEntityNotFound(_0x56a801,null))['then'](respondWithResult(_0x56a801,null))[_0x1117('0x4b')](handleError(_0x56a801,null));};exports['create']=function(_0x112efa,_0x28dbcb){return db[_0x1117('0x42')]['create'](_0x112efa[_0x1117('0x4c')],{})['then'](function(_0x371e0b){var _0xbaaa6e=_0x112efa[_0x1117('0x4d')][_0x1117('0x4e')]({'plain':!![]});if(!_0xbaaa6e)throw new Error(_0x1117('0x4f'));if(_0xbaaa6e['role']===_0x1117('0x4d')){var _0x2dda2a=_0x371e0b[_0x1117('0x4e')]({'plain':!![]});var _0x472541='IvrCampaigns';return db['UserProfileSection'][_0x1117('0x4a')]({'where':{'name':_0x472541,'userProfileId':_0xbaaa6e[_0x1117('0x50')]},'raw':!![]})[_0x1117('0x25')](function(_0xda94ab){if(_0xda94ab&&_0xda94ab[_0x1117('0x51')]===0x0){return db[_0x1117('0x27')]['create']({'name':_0x2dda2a[_0x1117('0x2b')],'resourceId':_0x2dda2a['id'],'type':_0xda94ab[_0x1117('0x2b')],'sectionId':_0xda94ab['id']},{})[_0x1117('0x25')](function(){return _0x371e0b;});}else{return _0x371e0b;}})['catch'](function(_0x520d1c){logger[_0x1117('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x520d1c);throw _0x520d1c;});}return _0x371e0b;})['then'](respondWithResult(_0x28dbcb,0xc9))[_0x1117('0x4b')](handleError(_0x28dbcb,null));};exports[_0x1117('0x52')]=function(_0x3cc6ac,_0x4a3a99){var _0x968182={'where':{'id':_0x3cc6ac['params']['id']}},_0x368ccc={};_0x368ccc['model']=_['keys'](db['Campaign'][_0x1117('0x47')]);_0x968182[_0x1117('0x36')]=_[_0x1117('0x48')](_0x368ccc[_0x1117('0x35')],qs[_0x1117('0x37')](_0x3cc6ac[_0x1117('0x32')][_0x1117('0x37')]));_0x968182[_0x1117('0x36')]=_0x968182['attributes'][_0x1117('0x38')]?_0x968182[_0x1117('0x36')]:_0x368ccc[_0x1117('0x35')];if(_0x3cc6ac[_0x1117('0x32')]['includeAll']){_0x968182[_0x1117('0x49')]=[{'all':!![]}];}_0x968182=_['merge']({},_0x968182,_0x3cc6ac['options']);return db[_0x1117('0x42')][_0x1117('0x4a')](_0x968182)[_0x1117('0x25')](handleEntityNotFound(_0x4a3a99,null))[_0x1117('0x25')](function(_0x3bdc13){if(_0x3bdc13){var _0x30e4ad=_0x3bdc13[_0x1117('0x4e')]({'plain':!![]});_0x30e4ad=qs[_0x1117('0x53')](_0x30e4ad,['id',_0x1117('0x54'),_0x1117('0x55')]);_0x3cc6ac[_0x1117('0x4c')]=_[_0x1117('0x53')](_0x3cc6ac[_0x1117('0x4c')],['id',_0x1117('0x54'),_0x1117('0x55')]);return db[_0x1117('0x42')]['create'](_['merge'](_0x30e4ad,_0x3cc6ac['body']),{'include':_0x3cc6ac[_0x1117('0x32')][_0x1117('0x41')]?[{'all':!![]}]:undefined})[_0x1117('0x25')](function(_0x209c66){var _0x5c48ab=_0x3cc6ac[_0x1117('0x4d')]['get']({'plain':!![]});if(!_0x5c48ab)throw new Error(_0x1117('0x4f'));if(_0x5c48ab[_0x1117('0x56')]===_0x1117('0x4d')){var _0x2ec1ff=_0x209c66[_0x1117('0x4e')]({'plain':!![]});var _0x518f6e=_0x1117('0x57');return db['UserProfileSection'][_0x1117('0x4a')]({'where':{'name':_0x518f6e,'userProfileId':_0x5c48ab[_0x1117('0x50')]},'raw':!![]})[_0x1117('0x25')](function(_0x3893fc){if(_0x3893fc&&_0x3893fc['autoAssociation']===0x0){return db[_0x1117('0x27')][_0x1117('0x58')]({'name':_0x2ec1ff[_0x1117('0x2b')],'resourceId':_0x2ec1ff['id'],'type':_0x3893fc[_0x1117('0x2b')],'sectionId':_0x3893fc['id']},{})[_0x1117('0x25')](function(){return _0x209c66;});}else{return _0x209c66;}})['catch'](function(_0x7d68f0){logger['error'](_0x1117('0x59'),_0x7d68f0);throw _0x7d68f0;});}return _0x209c66;});}})[_0x1117('0x25')](respondWithResult(_0x4a3a99,0xc9))[_0x1117('0x4b')](handleError(_0x4a3a99,null));};exports[_0x1117('0x24')]=function(_0x8dbe3c,_0x54dcd8){if(_0x8dbe3c[_0x1117('0x4c')]['id']){delete _0x8dbe3c['body']['id'];}return db[_0x1117('0x42')]['find']({'where':{'id':_0x8dbe3c[_0x1117('0x46')]['id']}})['then'](handleEntityNotFound(_0x54dcd8,null))[_0x1117('0x25')](saveUpdates(_0x8dbe3c[_0x1117('0x4c')],null))[_0x1117('0x25')](respondWithResult(_0x54dcd8,null))[_0x1117('0x4b')](handleError(_0x54dcd8,null));};exports['destroy']=function(_0x4d4eb6,_0x569725){return db[_0x1117('0x42')][_0x1117('0x4a')]({'where':{'id':_0x4d4eb6[_0x1117('0x46')]['id']}})[_0x1117('0x25')](handleEntityNotFound(_0x569725,null))[_0x1117('0x25')](removeEntity(_0x569725,null))[_0x1117('0x4b')](handleError(_0x569725,null));};exports['getHoppers']=function(_0x1a5997,_0x5482ca,_0x7407f5){var _0x52d4f4={'raw':!![],'where':{}};var _0xf772d5={};var _0x56f528={'count':0x0,'rows':[]};return db[_0x1117('0x42')][_0x1117('0x5a')]({'where':{'id':_0x1a5997[_0x1117('0x46')]['id']}})[_0x1117('0x25')](handleEntityNotFound(_0x5482ca,null))['then'](function(_0x576099){if(_0x576099){_0xf772d5[_0x1117('0x35')]=_[_0x1117('0x33')](db[_0x1117('0x5b')]['rawAttributes']);_0xf772d5[_0x1117('0x32')]=_['keys'](_0x1a5997[_0x1117('0x32')]);_0xf772d5[_0x1117('0x34')]=_[_0x1117('0x48')](_0xf772d5['model'],_0xf772d5[_0x1117('0x32')]);_0x52d4f4[_0x1117('0x36')]=_[_0x1117('0x48')](_0xf772d5[_0x1117('0x35')],qs[_0x1117('0x37')](_0x1a5997[_0x1117('0x32')][_0x1117('0x37')]));_0x52d4f4[_0x1117('0x36')]=_0x52d4f4[_0x1117('0x36')][_0x1117('0x38')]?_0x52d4f4[_0x1117('0x36')]:_0xf772d5[_0x1117('0x35')];if(!_0x1a5997[_0x1117('0x32')]['hasOwnProperty'](_0x1117('0x39'))){_0x52d4f4['limit']=qs[_0x1117('0x20')](_0x1a5997[_0x1117('0x32')]['limit']);_0x52d4f4[_0x1117('0x1f')]=qs[_0x1117('0x1f')](_0x1a5997[_0x1117('0x32')][_0x1117('0x1f')]);}_0x52d4f4[_0x1117('0x3a')]=qs[_0x1117('0x3b')](_0x1a5997[_0x1117('0x32')][_0x1117('0x3b')]);_0x52d4f4[_0x1117('0x3c')]=qs['filters'](_[_0x1117('0x3d')](_0x1a5997[_0x1117('0x32')],_0xf772d5[_0x1117('0x34')]));_0x52d4f4[_0x1117('0x3c')]['CampaignId']=_0x576099['id'];if(_0x1a5997[_0x1117('0x32')][_0x1117('0x3f')]){_0x52d4f4[_0x1117('0x3c')]=_[_0x1117('0x3e')](_0x52d4f4[_0x1117('0x3c')],{'$or':_[_0x1117('0x2e')](_0x52d4f4[_0x1117('0x36')],function(_0x14bdb3){var _0x418325={};_0x418325[_0x14bdb3]={'$like':'%'+_0x1a5997[_0x1117('0x32')][_0x1117('0x3f')]+'%'};return _0x418325;})});}_0x52d4f4=_['merge']({},_0x52d4f4,_0x1a5997['options']);return db[_0x1117('0x5b')]['count']({'where':_0x52d4f4[_0x1117('0x3c')]})[_0x1117('0x25')](function(_0xf7a04f){_0x56f528[_0x1117('0x1e')]=_0xf7a04f;if(_0x1a5997[_0x1117('0x32')][_0x1117('0x41')]){_0x52d4f4['include']=[{'all':!![]}];}return db[_0x1117('0x5b')][_0x1117('0x43')](_0x52d4f4);})['then'](function(_0x19d4a1){_0x56f528['rows']=_0x19d4a1;return _0x56f528;});}})['then'](respondWithFilteredResult(_0x5482ca,_0x52d4f4))[_0x1117('0x4b')](handleError(_0x5482ca,null));};exports['getHopperHistories']=function(_0x3bd65b,_0x1152cf,_0x3422d5){var _0x2bda15={'raw':!![],'where':{}};var _0x36e6f0={};var _0x534a9c={'count':0x0,'rows':[]};return db[_0x1117('0x42')][_0x1117('0x5a')]({'where':{'id':_0x3bd65b[_0x1117('0x46')]['id']}})[_0x1117('0x25')](handleEntityNotFound(_0x1152cf,null))[_0x1117('0x25')](function(_0xebe44b){if(_0xebe44b){_0x36e6f0['model']=_[_0x1117('0x33')](db[_0x1117('0x5c')][_0x1117('0x47')]);_0x36e6f0['query']=_['keys'](_0x3bd65b[_0x1117('0x32')]);_0x36e6f0['filters']=_[_0x1117('0x48')](_0x36e6f0['model'],_0x36e6f0[_0x1117('0x32')]);_0x2bda15[_0x1117('0x36')]=_[_0x1117('0x48')](_0x36e6f0[_0x1117('0x35')],qs['fields'](_0x3bd65b['query']['fields']));_0x2bda15[_0x1117('0x36')]=_0x2bda15[_0x1117('0x36')]['length']?_0x2bda15[_0x1117('0x36')]:_0x36e6f0['model'];if(!_0x3bd65b[_0x1117('0x32')][_0x1117('0x5d')](_0x1117('0x39'))){_0x2bda15[_0x1117('0x20')]=qs['limit'](_0x3bd65b[_0x1117('0x32')][_0x1117('0x20')]);_0x2bda15[_0x1117('0x1f')]=qs[_0x1117('0x1f')](_0x3bd65b['query'][_0x1117('0x1f')]);}_0x2bda15['order']=qs[_0x1117('0x3b')](_0x3bd65b[_0x1117('0x32')][_0x1117('0x3b')]);_0x2bda15[_0x1117('0x3c')]=qs[_0x1117('0x34')](_[_0x1117('0x3d')](_0x3bd65b['query'],_0x36e6f0['filters']));_0x2bda15[_0x1117('0x3c')][_0x1117('0x5e')]=_0xebe44b['id'];if(_0x3bd65b[_0x1117('0x32')][_0x1117('0x3f')]){_0x2bda15[_0x1117('0x3c')]=_[_0x1117('0x3e')](_0x2bda15['where'],{'$or':_['map'](_0x2bda15[_0x1117('0x36')],function(_0x23c43f){var _0x51e7b3={};_0x51e7b3[_0x23c43f]={'$like':'%'+_0x3bd65b[_0x1117('0x32')][_0x1117('0x3f')]+'%'};return _0x51e7b3;})});}_0x2bda15=_[_0x1117('0x3e')]({},_0x2bda15,_0x3bd65b['options']);return db['CmHopperHistory'][_0x1117('0x1e')]({'where':_0x2bda15['where']})[_0x1117('0x25')](function(_0x57a3cf){_0x534a9c[_0x1117('0x1e')]=_0x57a3cf;if(_0x3bd65b[_0x1117('0x32')][_0x1117('0x41')]){_0x2bda15[_0x1117('0x49')]=[{'all':!![]}];}return db[_0x1117('0x5c')][_0x1117('0x43')](_0x2bda15);})['then'](function(_0x4edcb1){_0x534a9c[_0x1117('0x44')]=_0x4edcb1;return _0x534a9c;});}})['then'](respondWithFilteredResult(_0x1152cf,_0x2bda15))[_0x1117('0x4b')](handleError(_0x1152cf,null));};exports[_0x1117('0x5f')]=function(_0x3314a5,_0x1fe5a8,_0x425a75){var _0x18d5c8={'raw':!![],'where':{}};var _0x4fadec={};var _0x2ce4fc={'count':0x0,'rows':[]};return db['Campaign'][_0x1117('0x5a')]({'where':{'id':_0x3314a5[_0x1117('0x46')]['id']}})[_0x1117('0x25')](handleEntityNotFound(_0x1fe5a8,null))[_0x1117('0x25')](function(_0x49478f){if(_0x49478f){_0x4fadec[_0x1117('0x35')]=_[_0x1117('0x33')](db[_0x1117('0x60')][_0x1117('0x47')]);_0x4fadec[_0x1117('0x32')]=_[_0x1117('0x33')](_0x3314a5[_0x1117('0x32')]);_0x4fadec['filters']=_[_0x1117('0x48')](_0x4fadec['model'],_0x4fadec[_0x1117('0x32')]);_0x18d5c8[_0x1117('0x36')]=_[_0x1117('0x48')](_0x4fadec[_0x1117('0x35')],qs[_0x1117('0x37')](_0x3314a5['query'][_0x1117('0x37')]));_0x18d5c8['attributes']=_0x18d5c8[_0x1117('0x36')]['length']?_0x18d5c8['attributes']:_0x4fadec[_0x1117('0x35')];if(!_0x3314a5[_0x1117('0x32')][_0x1117('0x5d')]('nolimit')){_0x18d5c8['limit']=qs[_0x1117('0x20')](_0x3314a5['query'][_0x1117('0x20')]);_0x18d5c8['offset']=qs[_0x1117('0x1f')](_0x3314a5[_0x1117('0x32')][_0x1117('0x1f')]);}_0x18d5c8['order']=qs[_0x1117('0x3b')](_0x3314a5[_0x1117('0x32')][_0x1117('0x3b')]);_0x18d5c8[_0x1117('0x3c')]=qs[_0x1117('0x34')](_['pick'](_0x3314a5[_0x1117('0x32')],_0x4fadec[_0x1117('0x34')]));_0x18d5c8[_0x1117('0x3c')][_0x1117('0x5e')]=_0x49478f['id'];if(_0x3314a5[_0x1117('0x32')][_0x1117('0x3f')]){_0x18d5c8['where']=_[_0x1117('0x3e')](_0x18d5c8['where'],{'$or':_['map'](_0x18d5c8[_0x1117('0x36')],function(_0x20051f){var _0x1760c6={};_0x1760c6[_0x20051f]={'$like':'%'+_0x3314a5[_0x1117('0x32')]['filter']+'%'};return _0x1760c6;})});}_0x18d5c8=_[_0x1117('0x3e')]({},_0x18d5c8,_0x3314a5[_0x1117('0x40')]);return db[_0x1117('0x60')][_0x1117('0x1e')]({'where':_0x18d5c8[_0x1117('0x3c')]})[_0x1117('0x25')](function(_0x3b0017){_0x2ce4fc['count']=_0x3b0017;if(_0x3314a5['query'][_0x1117('0x41')]){_0x18d5c8['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x18d5c8);})[_0x1117('0x25')](function(_0x254198){_0x2ce4fc[_0x1117('0x44')]=_0x254198;return _0x2ce4fc;});}})[_0x1117('0x25')](respondWithFilteredResult(_0x1fe5a8,_0x18d5c8))['catch'](handleError(_0x1fe5a8,null));};exports[_0x1117('0x61')]=function(_0x9a1ed7,_0x40fa82,_0x373fcd){var _0xa336ae={'raw':!![],'where':{}};var _0x311349={};var _0x319288={'count':0x0,'rows':[]};return db[_0x1117('0x42')]['findOne']({'where':{'id':_0x9a1ed7['params']['id']}})['then'](handleEntityNotFound(_0x40fa82,null))['then'](function(_0x3ce8ba){if(_0x3ce8ba){_0x311349['model']=_[_0x1117('0x33')](db['CmHopperBlack']['rawAttributes']);_0x311349['query']=_[_0x1117('0x33')](_0x9a1ed7[_0x1117('0x32')]);_0x311349[_0x1117('0x34')]=_[_0x1117('0x48')](_0x311349[_0x1117('0x35')],_0x311349[_0x1117('0x32')]);_0xa336ae[_0x1117('0x36')]=_[_0x1117('0x48')](_0x311349['model'],qs[_0x1117('0x37')](_0x9a1ed7['query'][_0x1117('0x37')]));_0xa336ae[_0x1117('0x36')]=_0xa336ae[_0x1117('0x36')][_0x1117('0x38')]?_0xa336ae[_0x1117('0x36')]:_0x311349['model'];if(!_0x9a1ed7[_0x1117('0x32')][_0x1117('0x5d')](_0x1117('0x39'))){_0xa336ae['limit']=qs[_0x1117('0x20')](_0x9a1ed7['query'][_0x1117('0x20')]);_0xa336ae[_0x1117('0x1f')]=qs['offset'](_0x9a1ed7[_0x1117('0x32')]['offset']);}_0xa336ae['order']=qs[_0x1117('0x3b')](_0x9a1ed7[_0x1117('0x32')][_0x1117('0x3b')]);_0xa336ae[_0x1117('0x3c')]=qs[_0x1117('0x34')](_[_0x1117('0x3d')](_0x9a1ed7[_0x1117('0x32')],_0x311349[_0x1117('0x34')]));_0xa336ae[_0x1117('0x3c')][_0x1117('0x5e')]=_0x3ce8ba['id'];if(_0x9a1ed7[_0x1117('0x32')][_0x1117('0x3f')]){_0xa336ae['where']=_[_0x1117('0x3e')](_0xa336ae['where'],{'$or':_[_0x1117('0x2e')](_0xa336ae['attributes'],function(_0x14db80){var _0x137542={};_0x137542[_0x14db80]={'$like':'%'+_0x9a1ed7['query'][_0x1117('0x3f')]+'%'};return _0x137542;})});}_0xa336ae=_[_0x1117('0x3e')]({},_0xa336ae,_0x9a1ed7['options']);return db[_0x1117('0x62')][_0x1117('0x1e')]({'where':_0xa336ae[_0x1117('0x3c')]})['then'](function(_0x497b0a){_0x319288[_0x1117('0x1e')]=_0x497b0a;if(_0x9a1ed7[_0x1117('0x32')]['includeAll']){_0xa336ae[_0x1117('0x49')]=[{'all':!![]}];}return db[_0x1117('0x62')][_0x1117('0x43')](_0xa336ae);})[_0x1117('0x25')](function(_0x376e8e){_0x319288[_0x1117('0x44')]=_0x376e8e;return _0x319288;});}})[_0x1117('0x25')](respondWithFilteredResult(_0x40fa82,_0xa336ae))[_0x1117('0x4b')](handleError(_0x40fa82,null));};exports['getLists']=function(_0x3ac1ef,_0x22da74,_0x3c9850){var _0x3d69a7={};var _0x375a80={};var _0x282721;var _0x569655;return db[_0x1117('0x42')][_0x1117('0x5a')]({'where':{'id':_0x3ac1ef[_0x1117('0x46')]['id']}})[_0x1117('0x25')](handleEntityNotFound(_0x22da74,null))[_0x1117('0x25')](function(_0xe58184){if(_0xe58184){_0x282721=_0xe58184;_0x375a80[_0x1117('0x35')]=_['keys'](db[_0x1117('0x63')][_0x1117('0x47')]);_0x375a80['query']=_['keys'](_0x3ac1ef[_0x1117('0x32')]);_0x375a80[_0x1117('0x34')]=_['intersection'](_0x375a80[_0x1117('0x35')],_0x375a80[_0x1117('0x32')]);_0x3d69a7[_0x1117('0x36')]=_[_0x1117('0x48')](_0x375a80[_0x1117('0x35')],qs['fields'](_0x3ac1ef[_0x1117('0x32')][_0x1117('0x37')]));_0x3d69a7[_0x1117('0x36')]=_0x3d69a7[_0x1117('0x36')]['length']?_0x3d69a7[_0x1117('0x36')]:_0x375a80['model'];_0x3d69a7[_0x1117('0x3a')]=qs['sort'](_0x3ac1ef['query']['sort']);_0x3d69a7[_0x1117('0x3c')]=qs[_0x1117('0x34')](_[_0x1117('0x3d')](_0x3ac1ef[_0x1117('0x32')],_0x375a80[_0x1117('0x34')]));if(_0x3ac1ef[_0x1117('0x32')][_0x1117('0x3f')]){_0x3d69a7[_0x1117('0x3c')]=_[_0x1117('0x3e')](_0x3d69a7[_0x1117('0x3c')],{'$or':_['map'](_0x3d69a7['attributes'],function(_0x1f01d5){var _0x251201={};_0x251201[_0x1f01d5]={'$like':'%'+_0x3ac1ef['query']['filter']+'%'};return _0x251201;})});}_0x3d69a7=_['merge']({},_0x3d69a7,_0x3ac1ef[_0x1117('0x40')]);return _0x282721['getLists'](_0x3d69a7);}})[_0x1117('0x25')](function(_0x1de11a){if(_0x1de11a){_0x569655=_0x1de11a[_0x1117('0x38')];if(!_0x3ac1ef[_0x1117('0x32')][_0x1117('0x5d')](_0x1117('0x39'))){_0x3d69a7[_0x1117('0x20')]=qs[_0x1117('0x20')](_0x3ac1ef[_0x1117('0x32')][_0x1117('0x20')]);_0x3d69a7[_0x1117('0x1f')]=qs[_0x1117('0x1f')](_0x3ac1ef[_0x1117('0x32')][_0x1117('0x1f')]);}return _0x282721[_0x1117('0x64')](_0x3d69a7);}})['then'](function(_0xc6c39b){if(_0xc6c39b){return _0xc6c39b?{'count':_0x569655,'rows':_0xc6c39b}:null;}})[_0x1117('0x25')](respondWithResult(_0x22da74,null))[_0x1117('0x4b')](handleError(_0x22da74,null));};exports[_0x1117('0x65')]=function(_0xce031,_0x408e51,_0x2a8d37){var _0x1724a1,_0x31ee50;return db[_0x1117('0x42')][_0x1117('0x4a')]({'where':{'id':_0xce031['params']['id']}})[_0x1117('0x25')](handleEntityNotFound(_0x408e51,null))[_0x1117('0x25')](function(_0x3bb7bb){if(_0x3bb7bb){_0x31ee50=_0x3bb7bb;return _0x3bb7bb['addLists'](_0xce031[_0x1117('0x4c')][_0x1117('0x66')],_[_0x1117('0x53')](_0xce031[_0x1117('0x4c')],[_0x1117('0x66'),'id'])||{});}return null;})['spread'](function(_0x526b7f){var _0x43e928;_0x1724a1=_0x526b7f||[];var _0xb6603a=[];if(_0x526b7f){for(var _0x30273a=0x0;_0x30273a<_0x526b7f[_0x1117('0x38')];_0x30273a+=0x1){var _0x503bfb=_0x526b7f[_0x30273a][_0x1117('0x4e')]({'plain':!![]});_0x31ee50[_0x1117('0x67')]=_0xce031[_0x1117('0x4c')][_0x1117('0x67')]?_0xce031['body'][_0x1117('0x67')]:_0x31ee50['dialCheckDuplicateType'];switch(_0x31ee50['dialCheckDuplicateType']){case _0x1117('0x68'):_0x43e928=squel['insert']()['into'](_0x1117('0x69'))[_0x1117('0x6a')]([_0x1117('0x6b'),_0x1117('0x6c'),_0x1117('0x6d'),_0x1117('0x6e'),'CampaignId',_0x1117('0x54'),'updatedAt'],squel[_0x1117('0x6f')]()[_0x1117('0x70')]('phone','phone')[_0x1117('0x70')](_0x1117('0x71'),_0x1117('0x6c'))['field']('id','ContactId')[_0x1117('0x70')](_0x503bfb[_0x1117('0x72')]['toString'](),'ListId')[_0x1117('0x70')](_0xce031['params']['id']['toString'](),_0x1117('0x5e'))[_0x1117('0x70')](_0x1117('0x71'),'createdAt')[_0x1117('0x70')](_0x1117('0x71'),'updatedAt')[_0x1117('0x73')]('cm_contacts')[_0x1117('0x3c')](_0x1117('0x74'))[_0x1117('0x3c')](_0x1117('0x75'),_0x503bfb[_0x1117('0x72')][_0x1117('0x76')]())[_0x1117('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x1117('0x3c')](_0x1117('0x77'),squel[_0x1117('0x6f')]()['field'](_0x1117('0x78'))['from'](_0x1117('0x79'))[_0x1117('0x3c')](_0x1117('0x7a'),_0xce031[_0x1117('0x46')]['id']['toString']()))[_0x1117('0x3c')](_0x1117('0x77'),squel['select']()[_0x1117('0x70')](_0x1117('0x7b'))['from'](_0x1117('0x69'))['where'](_0x1117('0x7a'),_0xce031[_0x1117('0x46')]['id'][_0x1117('0x76')]())))[_0x1117('0x76')]();break;case'onlyIfOpen':_0x43e928=squel[_0x1117('0x7c')]()[_0x1117('0x7d')](_0x1117('0x69'))['fromQuery']([_0x1117('0x6b'),_0x1117('0x6c'),_0x1117('0x6d'),'ListId',_0x1117('0x5e'),_0x1117('0x54'),'updatedAt'],squel[_0x1117('0x6f')]()[_0x1117('0x70')]('phone',_0x1117('0x6b'))[_0x1117('0x70')]('NOW()','scheduledAt')[_0x1117('0x70')]('id',_0x1117('0x6d'))[_0x1117('0x70')](_0x503bfb[_0x1117('0x72')]['toString'](),_0x1117('0x6e'))[_0x1117('0x70')](_0xce031[_0x1117('0x46')]['id'][_0x1117('0x76')](),'CampaignId')[_0x1117('0x70')](_0x1117('0x71'),'createdAt')['field'](_0x1117('0x71'),_0x1117('0x55'))[_0x1117('0x73')](_0x1117('0x7e'))[_0x1117('0x3c')]('deletedAt\x20IS\x20NULL')[_0x1117('0x3c')]('ListId\x20=\x20?',_0x503bfb[_0x1117('0x72')][_0x1117('0x76')]())[_0x1117('0x3c')](_0x1117('0x7f'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1117('0x6f')]()[_0x1117('0x70')]('COALESCE(phone,\x27\x27)')[_0x1117('0x73')]('cm_hopper')[_0x1117('0x3c')](_0x1117('0x7a'),_0xce031[_0x1117('0x46')]['id']['toString']())))[_0x1117('0x76')]();break;default:_0x43e928=squel[_0x1117('0x7c')]()[_0x1117('0x7d')](_0x1117('0x69'))[_0x1117('0x6a')]([_0x1117('0x6b'),_0x1117('0x6c'),_0x1117('0x6d'),_0x1117('0x6e'),_0x1117('0x5e'),_0x1117('0x54'),_0x1117('0x55')],squel['select']()[_0x1117('0x70')]('phone','phone')[_0x1117('0x70')]('NOW()',_0x1117('0x6c'))['field']('id','ContactId')[_0x1117('0x70')](_0x503bfb[_0x1117('0x72')][_0x1117('0x76')](),'ListId')[_0x1117('0x70')](_0xce031[_0x1117('0x46')]['id'][_0x1117('0x76')](),'CampaignId')[_0x1117('0x70')](_0x1117('0x71'),_0x1117('0x54'))['field'](_0x1117('0x71'),_0x1117('0x55'))['from'](_0x1117('0x7e'))[_0x1117('0x3c')](_0x1117('0x74'))[_0x1117('0x3c')](_0x1117('0x75'),_0x503bfb[_0x1117('0x72')][_0x1117('0x76')]())[_0x1117('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x1117('0x76')]();}_0xb6603a[_0x1117('0x80')](db[_0x1117('0x81')]['query'](_0x43e928));}return BPromise['all'](_0xb6603a);}})[_0x1117('0x25')](function(){return _0x1724a1;})['then'](respondWithResult(_0x408e51,null))[_0x1117('0x4b')](handleError(_0x408e51,null));};exports[_0x1117('0x82')]=function(_0x59f319,_0xdb3521,_0x12ab0d){return db['Campaign'][_0x1117('0x4a')]({'where':{'id':_0x59f319[_0x1117('0x46')]['id']}})['then'](handleEntityNotFound(_0xdb3521,null))[_0x1117('0x25')](function(_0xb081be){if(_0xb081be){return _0xb081be[_0x1117('0x82')](_0x59f319[_0x1117('0x32')]['ids']);}})[_0x1117('0x25')](function(_0x20cfa7){if(_0x20cfa7){return db[_0x1117('0x5b')]['destroy']({'where':{'ListId':_0x59f319[_0x1117('0x32')]['ids'],'CampaignId':_0x59f319[_0x1117('0x46')]['id']}})['then'](function(){return _0x20cfa7;});}})[_0x1117('0x25')](respondWithStatusCode(_0xdb3521,null))[_0x1117('0x4b')](handleError(_0xdb3521,null));};exports[_0x1117('0x83')]=function(_0x136a48,_0x34d140,_0x3c367f){var _0x39bc8e={};var _0x2c514e={};var _0x3d8ad1;var _0x2764d2;return db[_0x1117('0x42')][_0x1117('0x5a')]({'where':{'id':_0x136a48[_0x1117('0x46')]['id']}})[_0x1117('0x25')](handleEntityNotFound(_0x34d140,null))[_0x1117('0x25')](function(_0x3d0309){if(_0x3d0309){_0x3d8ad1=_0x3d0309;_0x2c514e[_0x1117('0x35')]=_['keys'](db[_0x1117('0x63')]['rawAttributes']);_0x2c514e[_0x1117('0x32')]=_[_0x1117('0x33')](_0x136a48[_0x1117('0x32')]);_0x2c514e[_0x1117('0x34')]=_[_0x1117('0x48')](_0x2c514e[_0x1117('0x35')],_0x2c514e[_0x1117('0x32')]);_0x39bc8e[_0x1117('0x36')]=_[_0x1117('0x48')](_0x2c514e[_0x1117('0x35')],qs[_0x1117('0x37')](_0x136a48['query'][_0x1117('0x37')]));_0x39bc8e[_0x1117('0x36')]=_0x39bc8e[_0x1117('0x36')]['length']?_0x39bc8e[_0x1117('0x36')]:_0x2c514e[_0x1117('0x35')];_0x39bc8e[_0x1117('0x3a')]=qs['sort'](_0x136a48[_0x1117('0x32')][_0x1117('0x3b')]);_0x39bc8e[_0x1117('0x3c')]=qs[_0x1117('0x34')](_[_0x1117('0x3d')](_0x136a48[_0x1117('0x32')],_0x2c514e[_0x1117('0x34')]));if(_0x136a48['query']['filter']){_0x39bc8e[_0x1117('0x3c')]=_[_0x1117('0x3e')](_0x39bc8e[_0x1117('0x3c')],{'$or':_['map'](_0x39bc8e['attributes'],function(_0x170046){var _0x3a3bac={};_0x3a3bac[_0x170046]={'$like':'%'+_0x136a48['query']['filter']+'%'};return _0x3a3bac;})});}_0x39bc8e=_[_0x1117('0x3e')]({},_0x39bc8e,_0x136a48[_0x1117('0x40')]);return _0x3d8ad1[_0x1117('0x83')](_0x39bc8e);}})[_0x1117('0x25')](function(_0x2cfaa5){if(_0x2cfaa5){_0x2764d2=_0x2cfaa5[_0x1117('0x38')];if(!_0x136a48[_0x1117('0x32')][_0x1117('0x5d')](_0x1117('0x39'))){_0x39bc8e[_0x1117('0x20')]=qs['limit'](_0x136a48['query'][_0x1117('0x20')]);_0x39bc8e[_0x1117('0x1f')]=qs[_0x1117('0x1f')](_0x136a48[_0x1117('0x32')][_0x1117('0x1f')]);}return _0x3d8ad1['getBlackLists'](_0x39bc8e);}})['then'](function(_0x1e5deb){if(_0x1e5deb){return _0x1e5deb?{'count':_0x2764d2,'rows':_0x1e5deb}:null;}})[_0x1117('0x25')](respondWithResult(_0x34d140,null))['catch'](handleError(_0x34d140,null));};exports['addBlackLists']=function(_0x1e38ec,_0x1aa2d4,_0x564fa5){var _0x1f9fba,_0x44a488;return db[_0x1117('0x42')][_0x1117('0x4a')]({'where':{'id':_0x1e38ec['params']['id']}})[_0x1117('0x25')](handleEntityNotFound(_0x1aa2d4,null))['then'](function(_0x5a4168){if(_0x5a4168){_0x44a488=_0x5a4168;return _0x5a4168[_0x1117('0x84')](_0x1e38ec[_0x1117('0x4c')][_0x1117('0x66')],_['omit'](_0x1e38ec[_0x1117('0x4c')],['ids','id'])||{});}return null;})[_0x1117('0x85')](function(_0x3d18f6){var _0x7715a5;_0x1f9fba=_0x3d18f6||[];var _0x425fcb=[];if(_0x3d18f6){for(var _0x3568a3=0x0;_0x3568a3<_0x3d18f6['length'];_0x3568a3+=0x1){var _0x18ac59=_0x3d18f6[_0x3568a3][_0x1117('0x4e')]({'plain':!![]});_0x7715a5=squel['insert']()[_0x1117('0x7d')](_0x1117('0x86'))['fromQuery']([_0x1117('0x6b'),_0x1117('0x6d'),_0x1117('0x6e'),_0x1117('0x5e'),_0x1117('0x54'),'updatedAt'],squel[_0x1117('0x6f')]()[_0x1117('0x70')]('phone','phone')[_0x1117('0x70')]('id',_0x1117('0x6d'))[_0x1117('0x70')](_0x18ac59[_0x1117('0x72')]['toString'](),_0x1117('0x6e'))['field'](_0x1e38ec['params']['id']['toString'](),_0x1117('0x5e'))[_0x1117('0x70')](_0x1117('0x71'),_0x1117('0x54'))[_0x1117('0x70')](_0x1117('0x71'),_0x1117('0x55'))[_0x1117('0x73')]('cm_contacts')[_0x1117('0x3c')](_0x1117('0x74'))[_0x1117('0x3c')]('ListId\x20=\x20?',_0x18ac59[_0x1117('0x72')][_0x1117('0x76')]())[_0x1117('0x3c')](_0x1117('0x7f')))[_0x1117('0x76')]();_0x425fcb[_0x1117('0x80')](db[_0x1117('0x81')][_0x1117('0x32')](_0x7715a5));}return BPromise[_0x1117('0x87')](_0x425fcb);}})[_0x1117('0x25')](function(){return _0x1f9fba;})[_0x1117('0x25')](respondWithResult(_0x1aa2d4,null))['catch'](handleError(_0x1aa2d4,null));};exports[_0x1117('0x88')]=function(_0x448bf0,_0x245c46,_0x2f3375){return db[_0x1117('0x42')][_0x1117('0x4a')]({'where':{'id':_0x448bf0[_0x1117('0x46')]['id']}})['then'](handleEntityNotFound(_0x245c46,null))[_0x1117('0x25')](function(_0x4916ac){if(_0x4916ac){return _0x4916ac[_0x1117('0x88')](_0x448bf0['query']['ids']);}})[_0x1117('0x25')](function(_0x4b0267){if(_0x4b0267){return db[_0x1117('0x62')][_0x1117('0x26')]({'where':{'ListId':_0x448bf0[_0x1117('0x32')][_0x1117('0x66')],'CampaignId':_0x448bf0[_0x1117('0x46')]['id']}})['then'](function(){return _0x4b0267;});}})[_0x1117('0x25')](respondWithStatusCode(_0x245c46,null))[_0x1117('0x4b')](handleError(_0x245c46,null));};
\ No newline at end of file
+var _0x7c9d=['cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','limit','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','offset','order','sort','where','pick','filter','merge','options','Campaign','includeAll','include','findAll','rows','catch','show','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','userProfileId','getHoppers','findOne','CmHopper','nolimit','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','hasOwnProperty','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from'];(function(_0x1d76dc,_0x66bf80){var _0x371f49=function(_0x37f0e7){while(--_0x37f0e7){_0x1d76dc['push'](_0x1d76dc['shift']());}};_0x371f49(++_0x66bf80);}(_0x7c9d,0x9b));var _0xd7c9=function(_0x1a6947,_0x55ad73){_0x1a6947=_0x1a6947-0x0;var _0x4a0946=_0x7c9d[_0x1a6947];return _0x4a0946;};'use strict';var emlformat=require(_0xd7c9('0x0'));var rimraf=require(_0xd7c9('0x1'));var zipdir=require(_0xd7c9('0x2'));var jsonpatch=require(_0xd7c9('0x3'));var rp=require(_0xd7c9('0x4'));var moment=require(_0xd7c9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd7c9('0x6'));var util=require(_0xd7c9('0x7'));var path=require(_0xd7c9('0x8'));var sox=require(_0xd7c9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd7c9('0xa'));var _=require(_0xd7c9('0xb'));var squel=require(_0xd7c9('0xc'));var crypto=require(_0xd7c9('0xd'));var jsforce=require(_0xd7c9('0xe'));var deskjs=require(_0xd7c9('0xf'));var toCsv=require(_0xd7c9('0x10'));var querystring=require(_0xd7c9('0x11'));var Papa=require(_0xd7c9('0x12'));var Redis=require(_0xd7c9('0x13'));var authService=require(_0xd7c9('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7c9('0x15'));var hardwareService=require(_0xd7c9('0x16'));var logger=require(_0xd7c9('0x17'))(_0xd7c9('0x18'));var utils=require('../../config/utils');var config=require(_0xd7c9('0x19'));var licenseUtil=require(_0xd7c9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe6b923,_0x5017a4){_0x5017a4=_0x5017a4||0xcc;return function(_0x526656){if(_0x526656){return _0xe6b923[_0xd7c9('0x1b')](_0x5017a4);}return _0xe6b923[_0xd7c9('0x1c')](_0x5017a4)[_0xd7c9('0x1d')]();};}function respondWithResult(_0x55b2c2,_0x4abe21){_0x4abe21=_0x4abe21||0xc8;return function(_0x5abb31){if(_0x5abb31){return _0x55b2c2[_0xd7c9('0x1c')](_0x4abe21)[_0xd7c9('0x1e')](_0x5abb31);}};}function respondWithFilteredResult(_0x39ae62,_0x228188){return function(_0x287069){if(_0x287069){var _0x515b0c=_0x287069[_0xd7c9('0x1f')],_0x59f49d=_0x228188['offset'],_0x527d9e=_0x228188['offset']+_0x228188[_0xd7c9('0x20')],_0x344764;if(_0x527d9e>=_0x515b0c){_0x527d9e=_0x515b0c;_0x344764=0xc8;}else{_0x344764=0xce;}_0x39ae62['status'](_0x344764);return _0x39ae62['set'](_0xd7c9('0x21'),_0x59f49d+'-'+_0x527d9e+'/'+_0x515b0c)[_0xd7c9('0x1e')](_0x287069);}return null;};}function patchUpdates(_0x96e066){return function(_0x228a61){try{jsonpatch[_0xd7c9('0x22')](_0x228a61,_0x96e066,!![]);}catch(_0x1b2a95){return BPromise[_0xd7c9('0x23')](_0x1b2a95);}return _0x228a61[_0xd7c9('0x24')]();};}function saveUpdates(_0x509c00,_0x3efaed){return function(_0x5b900b){if(_0x5b900b){return _0x5b900b[_0xd7c9('0x25')](_0x509c00)[_0xd7c9('0x26')](function(_0x4dc753){return _0x4dc753;});}return null;};}function removeEntity(_0x176883,_0x457eb6){return function(_0x2ec835){if(_0x2ec835){return _0x2ec835[_0xd7c9('0x27')]()['then'](function(){var _0x3ae743=_0x2ec835['get']({'plain':!![]});var _0x4176e7=_0xd7c9('0x28');return db['UserProfileResource'][_0xd7c9('0x27')]({'where':{'type':_0x4176e7,'resourceId':_0x3ae743['id']}})[_0xd7c9('0x26')](function(){return _0x2ec835;});})[_0xd7c9('0x26')](function(){_0x176883['status'](0xcc)[_0xd7c9('0x1d')]();});}};}function handleEntityNotFound(_0x5c657b,_0x511f99){return function(_0x36287c){if(!_0x36287c){_0x5c657b['sendStatus'](0x194);}return _0x36287c;};}function handleError(_0x2e55ec,_0xc124e1){_0xc124e1=_0xc124e1||0x1f4;return function(_0x34643a){logger[_0xd7c9('0x29')](_0x34643a[_0xd7c9('0x2a')]);if(_0x34643a[_0xd7c9('0x2b')]){delete _0x34643a[_0xd7c9('0x2b')];}_0x2e55ec[_0xd7c9('0x1c')](_0xc124e1)[_0xd7c9('0x2c')](_0x34643a);};}exports[_0xd7c9('0x2d')]=function(_0xa79bc4,_0x52a4c8){var _0xc231a0={},_0x1f1fbf={},_0x7f6aab={'count':0x0,'rows':[]};var _0xe17762=_[_0xd7c9('0x2e')](db['Campaign'][_0xd7c9('0x2f')],function(_0x3e3e17){return{'name':_0x3e3e17[_0xd7c9('0x30')],'type':_0x3e3e17['type'][_0xd7c9('0x31')]};});_0x1f1fbf['model']=_[_0xd7c9('0x2e')](_0xe17762,_0xd7c9('0x2b'));_0x1f1fbf[_0xd7c9('0x32')]=_[_0xd7c9('0x33')](_0xa79bc4[_0xd7c9('0x32')]);_0x1f1fbf[_0xd7c9('0x34')]=_[_0xd7c9('0x35')](_0x1f1fbf[_0xd7c9('0x36')],_0x1f1fbf[_0xd7c9('0x32')]);_0xc231a0['attributes']=_[_0xd7c9('0x35')](_0x1f1fbf[_0xd7c9('0x36')],qs['fields'](_0xa79bc4[_0xd7c9('0x32')][_0xd7c9('0x37')]));_0xc231a0['attributes']=_0xc231a0[_0xd7c9('0x38')][_0xd7c9('0x39')]?_0xc231a0[_0xd7c9('0x38')]:_0x1f1fbf['model'];if(!_0xa79bc4['query']['hasOwnProperty']('nolimit')){_0xc231a0[_0xd7c9('0x20')]=qs[_0xd7c9('0x20')](_0xa79bc4[_0xd7c9('0x32')][_0xd7c9('0x20')]);_0xc231a0['offset']=qs['offset'](_0xa79bc4['query'][_0xd7c9('0x3a')]);}_0xc231a0[_0xd7c9('0x3b')]=qs['sort'](_0xa79bc4[_0xd7c9('0x32')][_0xd7c9('0x3c')]);_0xc231a0[_0xd7c9('0x3d')]=qs[_0xd7c9('0x34')](_[_0xd7c9('0x3e')](_0xa79bc4['query'],_0x1f1fbf[_0xd7c9('0x34')]),_0xe17762);if(_0xa79bc4['query'][_0xd7c9('0x3f')]){_0xc231a0[_0xd7c9('0x3d')]=_[_0xd7c9('0x40')](_0xc231a0[_0xd7c9('0x3d')],{'$or':_['map'](_0xe17762,function(_0x159cf4){if(_0x159cf4['type']!=='VIRTUAL'){var _0x259221={};_0x259221[_0x159cf4[_0xd7c9('0x2b')]]={'$like':'%'+_0xa79bc4[_0xd7c9('0x32')][_0xd7c9('0x3f')]+'%'};return _0x259221;}})});}_0xc231a0=_['merge']({},_0xc231a0,_0xa79bc4[_0xd7c9('0x41')]);var _0x3e423d={'where':_0xc231a0[_0xd7c9('0x3d')]};return db[_0xd7c9('0x42')][_0xd7c9('0x1f')](_0x3e423d)[_0xd7c9('0x26')](function(_0x970c23){_0x7f6aab['count']=_0x970c23;if(_0xa79bc4[_0xd7c9('0x32')][_0xd7c9('0x43')]){_0xc231a0[_0xd7c9('0x44')]=[{'all':!![]}];}return db[_0xd7c9('0x42')][_0xd7c9('0x45')](_0xc231a0);})[_0xd7c9('0x26')](function(_0x46adbd){_0x7f6aab[_0xd7c9('0x46')]=_0x46adbd;return _0x7f6aab;})[_0xd7c9('0x26')](respondWithFilteredResult(_0x52a4c8,_0xc231a0))[_0xd7c9('0x47')](handleError(_0x52a4c8,null));};exports[_0xd7c9('0x48')]=function(_0x3d9a21,_0x476bc0){var _0x4eeb42={'raw':![],'where':{'id':_0x3d9a21[_0xd7c9('0x49')]['id']}},_0x47deab={};_0x47deab[_0xd7c9('0x36')]=_[_0xd7c9('0x33')](db[_0xd7c9('0x42')]['rawAttributes']);_0x47deab[_0xd7c9('0x32')]=_[_0xd7c9('0x33')](_0x3d9a21[_0xd7c9('0x32')]);_0x47deab[_0xd7c9('0x34')]=_[_0xd7c9('0x35')](_0x47deab[_0xd7c9('0x36')],_0x47deab[_0xd7c9('0x32')]);_0x4eeb42[_0xd7c9('0x38')]=_[_0xd7c9('0x35')](_0x47deab[_0xd7c9('0x36')],qs[_0xd7c9('0x37')](_0x3d9a21[_0xd7c9('0x32')]['fields']));_0x4eeb42['attributes']=_0x4eeb42[_0xd7c9('0x38')][_0xd7c9('0x39')]?_0x4eeb42['attributes']:_0x47deab['model'];if(_0x3d9a21[_0xd7c9('0x32')][_0xd7c9('0x43')]){_0x4eeb42['include']=[{'all':!![]}];}_0x4eeb42=_[_0xd7c9('0x40')]({},_0x4eeb42,_0x3d9a21['options']);return db['Campaign']['find'](_0x4eeb42)['then'](handleEntityNotFound(_0x476bc0,null))[_0xd7c9('0x26')](respondWithResult(_0x476bc0,null))[_0xd7c9('0x47')](handleError(_0x476bc0,null));};exports[_0xd7c9('0x4a')]=function(_0x4615ca,_0x5819ed){return db[_0xd7c9('0x42')]['create'](_0x4615ca['body'],{})[_0xd7c9('0x26')](function(_0x5bad88){var _0x285873=_0x4615ca[_0xd7c9('0x4b')][_0xd7c9('0x4c')]({'plain':!![]});if(!_0x285873)throw new Error(_0xd7c9('0x4d'));if(_0x285873[_0xd7c9('0x4e')]==='user'){var _0x46faec=_0x5bad88['get']({'plain':!![]});var _0x27b4e0=_0xd7c9('0x28');return db[_0xd7c9('0x4f')][_0xd7c9('0x50')]({'where':{'name':_0x27b4e0,'userProfileId':_0x285873['userProfileId']},'raw':!![]})[_0xd7c9('0x26')](function(_0x246a90){if(_0x246a90&&_0x246a90[_0xd7c9('0x51')]===0x0){return db[_0xd7c9('0x52')][_0xd7c9('0x4a')]({'name':_0x46faec[_0xd7c9('0x2b')],'resourceId':_0x46faec['id'],'type':_0x246a90[_0xd7c9('0x2b')],'sectionId':_0x246a90['id']},{})[_0xd7c9('0x26')](function(){return _0x5bad88;});}else{return _0x5bad88;}})[_0xd7c9('0x47')](function(_0x4482a1){logger[_0xd7c9('0x29')](_0xd7c9('0x53'),_0x4482a1);throw _0x4482a1;});}return _0x5bad88;})[_0xd7c9('0x26')](respondWithResult(_0x5819ed,0xc9))['catch'](handleError(_0x5819ed,null));};exports[_0xd7c9('0x54')]=function(_0x26c4f6,_0x324f8d){var _0x20430={'where':{'id':_0x26c4f6[_0xd7c9('0x49')]['id']}},_0x51e613={};_0x51e613['model']=_[_0xd7c9('0x33')](db[_0xd7c9('0x42')][_0xd7c9('0x2f')]);_0x20430[_0xd7c9('0x38')]=_[_0xd7c9('0x35')](_0x51e613[_0xd7c9('0x36')],qs[_0xd7c9('0x37')](_0x26c4f6[_0xd7c9('0x32')]['fields']));_0x20430[_0xd7c9('0x38')]=_0x20430[_0xd7c9('0x38')][_0xd7c9('0x39')]?_0x20430[_0xd7c9('0x38')]:_0x51e613['model'];if(_0x26c4f6[_0xd7c9('0x32')][_0xd7c9('0x43')]){_0x20430[_0xd7c9('0x44')]=[{'all':!![]}];}_0x20430=_['merge']({},_0x20430,_0x26c4f6[_0xd7c9('0x41')]);return db[_0xd7c9('0x42')][_0xd7c9('0x50')](_0x20430)[_0xd7c9('0x26')](handleEntityNotFound(_0x324f8d,null))[_0xd7c9('0x26')](function(_0x3a6d53){if(_0x3a6d53){var _0x43ad28=_0x3a6d53[_0xd7c9('0x4c')]({'plain':!![]});_0x43ad28=qs[_0xd7c9('0x55')](_0x43ad28,['id','createdAt',_0xd7c9('0x56')]);_0x26c4f6[_0xd7c9('0x57')]=_['omit'](_0x26c4f6[_0xd7c9('0x57')],['id',_0xd7c9('0x58'),_0xd7c9('0x56')]);return db[_0xd7c9('0x42')]['create'](_['merge'](_0x43ad28,_0x26c4f6[_0xd7c9('0x57')]),{'include':_0x26c4f6[_0xd7c9('0x32')][_0xd7c9('0x43')]?[{'all':!![]}]:undefined})[_0xd7c9('0x26')](function(_0x372de3){var _0x50d625=_0x26c4f6[_0xd7c9('0x4b')][_0xd7c9('0x4c')]({'plain':!![]});if(!_0x50d625)throw new Error(_0xd7c9('0x4d'));if(_0x50d625['role']==='user'){var _0x4a11a9=_0x372de3[_0xd7c9('0x4c')]({'plain':!![]});var _0x368ccb=_0xd7c9('0x28');return db[_0xd7c9('0x4f')][_0xd7c9('0x50')]({'where':{'name':_0x368ccb,'userProfileId':_0x50d625[_0xd7c9('0x59')]},'raw':!![]})[_0xd7c9('0x26')](function(_0x436745){if(_0x436745&&_0x436745[_0xd7c9('0x51')]===0x0){return db[_0xd7c9('0x52')]['create']({'name':_0x4a11a9[_0xd7c9('0x2b')],'resourceId':_0x4a11a9['id'],'type':_0x436745[_0xd7c9('0x2b')],'sectionId':_0x436745['id']},{})[_0xd7c9('0x26')](function(){return _0x372de3;});}else{return _0x372de3;}})[_0xd7c9('0x47')](function(_0x20e31e){logger[_0xd7c9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20e31e);throw _0x20e31e;});}return _0x372de3;});}})[_0xd7c9('0x26')](respondWithResult(_0x324f8d,0xc9))[_0xd7c9('0x47')](handleError(_0x324f8d,null));};exports[_0xd7c9('0x25')]=function(_0x3fdf83,_0x1acc02){if(_0x3fdf83[_0xd7c9('0x57')]['id']){delete _0x3fdf83[_0xd7c9('0x57')]['id'];}return db['Campaign'][_0xd7c9('0x50')]({'where':{'id':_0x3fdf83[_0xd7c9('0x49')]['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x1acc02,null))['then'](saveUpdates(_0x3fdf83[_0xd7c9('0x57')],null))['then'](respondWithResult(_0x1acc02,null))['catch'](handleError(_0x1acc02,null));};exports[_0xd7c9('0x27')]=function(_0xf01884,_0x45e88f){return db[_0xd7c9('0x42')]['find']({'where':{'id':_0xf01884['params']['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x45e88f,null))[_0xd7c9('0x26')](removeEntity(_0x45e88f,null))[_0xd7c9('0x47')](handleError(_0x45e88f,null));};exports[_0xd7c9('0x5a')]=function(_0x6ea635,_0x38916f,_0x20ebf8){var _0x1025c8={'raw':!![],'where':{}};var _0x2defa4={};var _0x2680d4={'count':0x0,'rows':[]};return db[_0xd7c9('0x42')][_0xd7c9('0x5b')]({'where':{'id':_0x6ea635[_0xd7c9('0x49')]['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x38916f,null))[_0xd7c9('0x26')](function(_0x53106f){if(_0x53106f){_0x2defa4[_0xd7c9('0x36')]=_[_0xd7c9('0x33')](db[_0xd7c9('0x5c')][_0xd7c9('0x2f')]);_0x2defa4[_0xd7c9('0x32')]=_[_0xd7c9('0x33')](_0x6ea635[_0xd7c9('0x32')]);_0x2defa4[_0xd7c9('0x34')]=_[_0xd7c9('0x35')](_0x2defa4['model'],_0x2defa4[_0xd7c9('0x32')]);_0x1025c8['attributes']=_[_0xd7c9('0x35')](_0x2defa4[_0xd7c9('0x36')],qs['fields'](_0x6ea635[_0xd7c9('0x32')]['fields']));_0x1025c8[_0xd7c9('0x38')]=_0x1025c8[_0xd7c9('0x38')]['length']?_0x1025c8[_0xd7c9('0x38')]:_0x2defa4[_0xd7c9('0x36')];if(!_0x6ea635[_0xd7c9('0x32')]['hasOwnProperty'](_0xd7c9('0x5d'))){_0x1025c8[_0xd7c9('0x20')]=qs[_0xd7c9('0x20')](_0x6ea635[_0xd7c9('0x32')][_0xd7c9('0x20')]);_0x1025c8['offset']=qs['offset'](_0x6ea635[_0xd7c9('0x32')]['offset']);}_0x1025c8['order']=qs[_0xd7c9('0x3c')](_0x6ea635['query']['sort']);_0x1025c8[_0xd7c9('0x3d')]=qs[_0xd7c9('0x34')](_[_0xd7c9('0x3e')](_0x6ea635[_0xd7c9('0x32')],_0x2defa4[_0xd7c9('0x34')]));_0x1025c8[_0xd7c9('0x3d')][_0xd7c9('0x5e')]=_0x53106f['id'];if(_0x6ea635[_0xd7c9('0x32')]['filter']){_0x1025c8[_0xd7c9('0x3d')]=_[_0xd7c9('0x40')](_0x1025c8[_0xd7c9('0x3d')],{'$or':_[_0xd7c9('0x2e')](_0x1025c8[_0xd7c9('0x38')],function(_0x35a1d8){var _0x5ca2fa={};_0x5ca2fa[_0x35a1d8]={'$like':'%'+_0x6ea635['query']['filter']+'%'};return _0x5ca2fa;})});}_0x1025c8=_['merge']({},_0x1025c8,_0x6ea635[_0xd7c9('0x41')]);return db['CmHopper'][_0xd7c9('0x1f')]({'where':_0x1025c8[_0xd7c9('0x3d')]})[_0xd7c9('0x26')](function(_0x1e3fcb){_0x2680d4['count']=_0x1e3fcb;if(_0x6ea635[_0xd7c9('0x32')][_0xd7c9('0x43')]){_0x1025c8[_0xd7c9('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0xd7c9('0x45')](_0x1025c8);})[_0xd7c9('0x26')](function(_0x248ca4){_0x2680d4[_0xd7c9('0x46')]=_0x248ca4;return _0x2680d4;});}})[_0xd7c9('0x26')](respondWithFilteredResult(_0x38916f,_0x1025c8))[_0xd7c9('0x47')](handleError(_0x38916f,null));};exports[_0xd7c9('0x5f')]=function(_0x29f231,_0x3f3832,_0x272447){var _0x425150={'raw':!![],'where':{}};var _0x3cc5d8={};var _0x3d220a={'count':0x0,'rows':[]};return db[_0xd7c9('0x42')][_0xd7c9('0x5b')]({'where':{'id':_0x29f231[_0xd7c9('0x49')]['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x3f3832,null))[_0xd7c9('0x26')](function(_0xf76dee){if(_0xf76dee){_0x3cc5d8['model']=_[_0xd7c9('0x33')](db['CmHopperHistory'][_0xd7c9('0x2f')]);_0x3cc5d8[_0xd7c9('0x32')]=_[_0xd7c9('0x33')](_0x29f231['query']);_0x3cc5d8[_0xd7c9('0x34')]=_['intersection'](_0x3cc5d8[_0xd7c9('0x36')],_0x3cc5d8[_0xd7c9('0x32')]);_0x425150[_0xd7c9('0x38')]=_['intersection'](_0x3cc5d8[_0xd7c9('0x36')],qs['fields'](_0x29f231[_0xd7c9('0x32')][_0xd7c9('0x37')]));_0x425150[_0xd7c9('0x38')]=_0x425150[_0xd7c9('0x38')]['length']?_0x425150[_0xd7c9('0x38')]:_0x3cc5d8[_0xd7c9('0x36')];if(!_0x29f231[_0xd7c9('0x32')]['hasOwnProperty'](_0xd7c9('0x5d'))){_0x425150[_0xd7c9('0x20')]=qs[_0xd7c9('0x20')](_0x29f231[_0xd7c9('0x32')][_0xd7c9('0x20')]);_0x425150[_0xd7c9('0x3a')]=qs[_0xd7c9('0x3a')](_0x29f231[_0xd7c9('0x32')][_0xd7c9('0x3a')]);}_0x425150[_0xd7c9('0x3b')]=qs['sort'](_0x29f231[_0xd7c9('0x32')][_0xd7c9('0x3c')]);_0x425150[_0xd7c9('0x3d')]=qs[_0xd7c9('0x34')](_[_0xd7c9('0x3e')](_0x29f231['query'],_0x3cc5d8[_0xd7c9('0x34')]));_0x425150[_0xd7c9('0x3d')]['CampaignId']=_0xf76dee['id'];if(_0x29f231[_0xd7c9('0x32')][_0xd7c9('0x3f')]){_0x425150[_0xd7c9('0x3d')]=_['merge'](_0x425150[_0xd7c9('0x3d')],{'$or':_[_0xd7c9('0x2e')](_0x425150['attributes'],function(_0x219f01){var _0x41bc6b={};_0x41bc6b[_0x219f01]={'$like':'%'+_0x29f231[_0xd7c9('0x32')]['filter']+'%'};return _0x41bc6b;})});}_0x425150=_[_0xd7c9('0x40')]({},_0x425150,_0x29f231[_0xd7c9('0x41')]);return db[_0xd7c9('0x60')]['count']({'where':_0x425150[_0xd7c9('0x3d')]})[_0xd7c9('0x26')](function(_0x312c33){_0x3d220a[_0xd7c9('0x1f')]=_0x312c33;if(_0x29f231[_0xd7c9('0x32')]['includeAll']){_0x425150[_0xd7c9('0x44')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xd7c9('0x45')](_0x425150);})['then'](function(_0x498b27){_0x3d220a['rows']=_0x498b27;return _0x3d220a;});}})[_0xd7c9('0x26')](respondWithFilteredResult(_0x3f3832,_0x425150))[_0xd7c9('0x47')](handleError(_0x3f3832,null));};exports[_0xd7c9('0x61')]=function(_0x105ad1,_0x70f9d7,_0x1fdaa7){var _0x2ffadc={'raw':!![],'where':{}};var _0x237d53={};var _0x38698e={'count':0x0,'rows':[]};return db['Campaign'][_0xd7c9('0x5b')]({'where':{'id':_0x105ad1['params']['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x70f9d7,null))['then'](function(_0x4065ab){if(_0x4065ab){_0x237d53[_0xd7c9('0x36')]=_[_0xd7c9('0x33')](db[_0xd7c9('0x62')]['rawAttributes']);_0x237d53[_0xd7c9('0x32')]=_['keys'](_0x105ad1['query']);_0x237d53[_0xd7c9('0x34')]=_[_0xd7c9('0x35')](_0x237d53[_0xd7c9('0x36')],_0x237d53[_0xd7c9('0x32')]);_0x2ffadc[_0xd7c9('0x38')]=_[_0xd7c9('0x35')](_0x237d53[_0xd7c9('0x36')],qs[_0xd7c9('0x37')](_0x105ad1[_0xd7c9('0x32')]['fields']));_0x2ffadc[_0xd7c9('0x38')]=_0x2ffadc[_0xd7c9('0x38')][_0xd7c9('0x39')]?_0x2ffadc['attributes']:_0x237d53[_0xd7c9('0x36')];if(!_0x105ad1[_0xd7c9('0x32')]['hasOwnProperty'](_0xd7c9('0x5d'))){_0x2ffadc[_0xd7c9('0x20')]=qs[_0xd7c9('0x20')](_0x105ad1[_0xd7c9('0x32')][_0xd7c9('0x20')]);_0x2ffadc[_0xd7c9('0x3a')]=qs[_0xd7c9('0x3a')](_0x105ad1[_0xd7c9('0x32')][_0xd7c9('0x3a')]);}_0x2ffadc['order']=qs[_0xd7c9('0x3c')](_0x105ad1['query'][_0xd7c9('0x3c')]);_0x2ffadc[_0xd7c9('0x3d')]=qs[_0xd7c9('0x34')](_[_0xd7c9('0x3e')](_0x105ad1[_0xd7c9('0x32')],_0x237d53[_0xd7c9('0x34')]));_0x2ffadc[_0xd7c9('0x3d')][_0xd7c9('0x5e')]=_0x4065ab['id'];if(_0x105ad1[_0xd7c9('0x32')]['filter']){_0x2ffadc[_0xd7c9('0x3d')]=_[_0xd7c9('0x40')](_0x2ffadc[_0xd7c9('0x3d')],{'$or':_['map'](_0x2ffadc[_0xd7c9('0x38')],function(_0xebb581){var _0x960e71={};_0x960e71[_0xebb581]={'$like':'%'+_0x105ad1[_0xd7c9('0x32')][_0xd7c9('0x3f')]+'%'};return _0x960e71;})});}_0x2ffadc=_[_0xd7c9('0x40')]({},_0x2ffadc,_0x105ad1[_0xd7c9('0x41')]);return db[_0xd7c9('0x62')][_0xd7c9('0x1f')]({'where':_0x2ffadc['where']})[_0xd7c9('0x26')](function(_0x3455c5){_0x38698e[_0xd7c9('0x1f')]=_0x3455c5;if(_0x105ad1[_0xd7c9('0x32')][_0xd7c9('0x43')]){_0x2ffadc['include']=[{'all':!![]}];}return db[_0xd7c9('0x62')]['findAll'](_0x2ffadc);})[_0xd7c9('0x26')](function(_0x55a75e){_0x38698e[_0xd7c9('0x46')]=_0x55a75e;return _0x38698e;});}})[_0xd7c9('0x26')](respondWithFilteredResult(_0x70f9d7,_0x2ffadc))[_0xd7c9('0x47')](handleError(_0x70f9d7,null));};exports[_0xd7c9('0x63')]=function(_0x3fd89f,_0x3f6d97,_0xf78b22){var _0x20be6d={'raw':!![],'where':{}};var _0x4024e9={};var _0x54f546={'count':0x0,'rows':[]};return db[_0xd7c9('0x42')]['findOne']({'where':{'id':_0x3fd89f[_0xd7c9('0x49')]['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x3f6d97,null))[_0xd7c9('0x26')](function(_0x3f8915){if(_0x3f8915){_0x4024e9[_0xd7c9('0x36')]=_[_0xd7c9('0x33')](db[_0xd7c9('0x64')][_0xd7c9('0x2f')]);_0x4024e9[_0xd7c9('0x32')]=_[_0xd7c9('0x33')](_0x3fd89f[_0xd7c9('0x32')]);_0x4024e9[_0xd7c9('0x34')]=_[_0xd7c9('0x35')](_0x4024e9['model'],_0x4024e9[_0xd7c9('0x32')]);_0x20be6d[_0xd7c9('0x38')]=_[_0xd7c9('0x35')](_0x4024e9[_0xd7c9('0x36')],qs[_0xd7c9('0x37')](_0x3fd89f['query'][_0xd7c9('0x37')]));_0x20be6d[_0xd7c9('0x38')]=_0x20be6d[_0xd7c9('0x38')]['length']?_0x20be6d['attributes']:_0x4024e9[_0xd7c9('0x36')];if(!_0x3fd89f[_0xd7c9('0x32')]['hasOwnProperty'](_0xd7c9('0x5d'))){_0x20be6d[_0xd7c9('0x20')]=qs[_0xd7c9('0x20')](_0x3fd89f['query'][_0xd7c9('0x20')]);_0x20be6d[_0xd7c9('0x3a')]=qs[_0xd7c9('0x3a')](_0x3fd89f[_0xd7c9('0x32')]['offset']);}_0x20be6d[_0xd7c9('0x3b')]=qs[_0xd7c9('0x3c')](_0x3fd89f[_0xd7c9('0x32')][_0xd7c9('0x3c')]);_0x20be6d['where']=qs[_0xd7c9('0x34')](_[_0xd7c9('0x3e')](_0x3fd89f[_0xd7c9('0x32')],_0x4024e9[_0xd7c9('0x34')]));_0x20be6d[_0xd7c9('0x3d')][_0xd7c9('0x5e')]=_0x3f8915['id'];if(_0x3fd89f[_0xd7c9('0x32')][_0xd7c9('0x3f')]){_0x20be6d[_0xd7c9('0x3d')]=_['merge'](_0x20be6d[_0xd7c9('0x3d')],{'$or':_['map'](_0x20be6d[_0xd7c9('0x38')],function(_0xcfe359){var _0xbae2b={};_0xbae2b[_0xcfe359]={'$like':'%'+_0x3fd89f[_0xd7c9('0x32')][_0xd7c9('0x3f')]+'%'};return _0xbae2b;})});}_0x20be6d=_[_0xd7c9('0x40')]({},_0x20be6d,_0x3fd89f[_0xd7c9('0x41')]);return db[_0xd7c9('0x64')][_0xd7c9('0x1f')]({'where':_0x20be6d['where']})['then'](function(_0x532fe7){_0x54f546[_0xd7c9('0x1f')]=_0x532fe7;if(_0x3fd89f[_0xd7c9('0x32')][_0xd7c9('0x43')]){_0x20be6d[_0xd7c9('0x44')]=[{'all':!![]}];}return db[_0xd7c9('0x64')][_0xd7c9('0x45')](_0x20be6d);})[_0xd7c9('0x26')](function(_0x22063e){_0x54f546[_0xd7c9('0x46')]=_0x22063e;return _0x54f546;});}})[_0xd7c9('0x26')](respondWithFilteredResult(_0x3f6d97,_0x20be6d))[_0xd7c9('0x47')](handleError(_0x3f6d97,null));};exports['getLists']=function(_0x3a6f03,_0x1f14f3,_0x52eec2){var _0x5d1988={};var _0x4eddac={};var _0x1aa650;var _0xa51687;return db[_0xd7c9('0x42')][_0xd7c9('0x5b')]({'where':{'id':_0x3a6f03['params']['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x1f14f3,null))[_0xd7c9('0x26')](function(_0x2a80ad){if(_0x2a80ad){_0x1aa650=_0x2a80ad;_0x4eddac[_0xd7c9('0x36')]=_[_0xd7c9('0x33')](db['CmList']['rawAttributes']);_0x4eddac['query']=_[_0xd7c9('0x33')](_0x3a6f03[_0xd7c9('0x32')]);_0x4eddac[_0xd7c9('0x34')]=_[_0xd7c9('0x35')](_0x4eddac[_0xd7c9('0x36')],_0x4eddac[_0xd7c9('0x32')]);_0x5d1988[_0xd7c9('0x38')]=_[_0xd7c9('0x35')](_0x4eddac['model'],qs[_0xd7c9('0x37')](_0x3a6f03['query']['fields']));_0x5d1988[_0xd7c9('0x38')]=_0x5d1988[_0xd7c9('0x38')][_0xd7c9('0x39')]?_0x5d1988[_0xd7c9('0x38')]:_0x4eddac[_0xd7c9('0x36')];_0x5d1988[_0xd7c9('0x3b')]=qs[_0xd7c9('0x3c')](_0x3a6f03[_0xd7c9('0x32')][_0xd7c9('0x3c')]);_0x5d1988[_0xd7c9('0x3d')]=qs[_0xd7c9('0x34')](_[_0xd7c9('0x3e')](_0x3a6f03[_0xd7c9('0x32')],_0x4eddac[_0xd7c9('0x34')]));if(_0x3a6f03[_0xd7c9('0x32')][_0xd7c9('0x3f')]){_0x5d1988[_0xd7c9('0x3d')]=_[_0xd7c9('0x40')](_0x5d1988['where'],{'$or':_[_0xd7c9('0x2e')](_0x5d1988[_0xd7c9('0x38')],function(_0x443f99){var _0x25e9ab={};_0x25e9ab[_0x443f99]={'$like':'%'+_0x3a6f03['query'][_0xd7c9('0x3f')]+'%'};return _0x25e9ab;})});}_0x5d1988=_[_0xd7c9('0x40')]({},_0x5d1988,_0x3a6f03[_0xd7c9('0x41')]);return _0x1aa650[_0xd7c9('0x65')](_0x5d1988);}})[_0xd7c9('0x26')](function(_0x165517){if(_0x165517){_0xa51687=_0x165517[_0xd7c9('0x39')];if(!_0x3a6f03[_0xd7c9('0x32')][_0xd7c9('0x66')](_0xd7c9('0x5d'))){_0x5d1988['limit']=qs[_0xd7c9('0x20')](_0x3a6f03[_0xd7c9('0x32')][_0xd7c9('0x20')]);_0x5d1988[_0xd7c9('0x3a')]=qs[_0xd7c9('0x3a')](_0x3a6f03['query'][_0xd7c9('0x3a')]);}return _0x1aa650[_0xd7c9('0x65')](_0x5d1988);}})['then'](function(_0x1d30ac){if(_0x1d30ac){return _0x1d30ac?{'count':_0xa51687,'rows':_0x1d30ac}:null;}})[_0xd7c9('0x26')](respondWithResult(_0x1f14f3,null))['catch'](handleError(_0x1f14f3,null));};exports[_0xd7c9('0x67')]=function(_0x34bbf9,_0x3e2456,_0x20b4e7){var _0x40db21,_0x4d6b87;return db[_0xd7c9('0x42')][_0xd7c9('0x50')]({'where':{'id':_0x34bbf9[_0xd7c9('0x49')]['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x3e2456,null))[_0xd7c9('0x26')](function(_0x4e3de4){if(_0x4e3de4){_0x4d6b87=_0x4e3de4;return _0x4e3de4[_0xd7c9('0x67')](_0x34bbf9[_0xd7c9('0x57')][_0xd7c9('0x68')],_[_0xd7c9('0x55')](_0x34bbf9[_0xd7c9('0x57')],[_0xd7c9('0x68'),'id'])||{});}return null;})[_0xd7c9('0x69')](function(_0x5b3418){var _0xd2c9cf;_0x40db21=_0x5b3418||[];var _0x49da18=[];if(_0x5b3418){for(var _0x22e168=0x0;_0x22e168<_0x5b3418[_0xd7c9('0x39')];_0x22e168+=0x1){var _0x3b2d0b=_0x5b3418[_0x22e168][_0xd7c9('0x4c')]({'plain':!![]});_0x4d6b87['dialCheckDuplicateType']=_0x34bbf9[_0xd7c9('0x57')][_0xd7c9('0x6a')]?_0x34bbf9[_0xd7c9('0x57')]['dialCheckDuplicateType']:_0x4d6b87[_0xd7c9('0x6a')];switch(_0x4d6b87['dialCheckDuplicateType']){case _0xd7c9('0x6b'):_0xd2c9cf=squel[_0xd7c9('0x6c')]()[_0xd7c9('0x6d')]('cm_hopper')[_0xd7c9('0x6e')]([_0xd7c9('0x6f'),_0xd7c9('0x70'),_0xd7c9('0x71'),_0xd7c9('0x72'),'CampaignId',_0xd7c9('0x58'),_0xd7c9('0x56')],squel[_0xd7c9('0x73')]()[_0xd7c9('0x74')]('phone','phone')[_0xd7c9('0x74')](_0xd7c9('0x75'),_0xd7c9('0x70'))[_0xd7c9('0x74')]('id',_0xd7c9('0x71'))[_0xd7c9('0x74')](_0x3b2d0b[_0xd7c9('0x76')][_0xd7c9('0x77')](),_0xd7c9('0x72'))[_0xd7c9('0x74')](_0x34bbf9['params']['id'][_0xd7c9('0x77')](),'CampaignId')[_0xd7c9('0x74')](_0xd7c9('0x75'),_0xd7c9('0x58'))[_0xd7c9('0x74')]('NOW()',_0xd7c9('0x56'))[_0xd7c9('0x78')](_0xd7c9('0x79'))['where'](_0xd7c9('0x7a'))[_0xd7c9('0x3d')]('ListId\x20=\x20?',_0x3b2d0b[_0xd7c9('0x76')][_0xd7c9('0x77')]())[_0xd7c9('0x3d')](_0xd7c9('0x7b'))[_0xd7c9('0x3d')](_0xd7c9('0x7c'),squel[_0xd7c9('0x73')]()[_0xd7c9('0x74')](_0xd7c9('0x7d'))[_0xd7c9('0x78')](_0xd7c9('0x7e'))[_0xd7c9('0x3d')](_0xd7c9('0x7f'),_0x34bbf9[_0xd7c9('0x49')]['id'][_0xd7c9('0x77')]()))['where'](_0xd7c9('0x7c'),squel['select']()[_0xd7c9('0x74')](_0xd7c9('0x80'))[_0xd7c9('0x78')]('cm_hopper')[_0xd7c9('0x3d')](_0xd7c9('0x7f'),_0x34bbf9['params']['id'][_0xd7c9('0x77')]())))[_0xd7c9('0x77')]();break;case'onlyIfOpen':_0xd2c9cf=squel[_0xd7c9('0x6c')]()[_0xd7c9('0x6d')](_0xd7c9('0x81'))['fromQuery']([_0xd7c9('0x6f'),_0xd7c9('0x70'),_0xd7c9('0x71'),_0xd7c9('0x72'),_0xd7c9('0x5e'),_0xd7c9('0x58'),_0xd7c9('0x56')],squel[_0xd7c9('0x73')]()['field'](_0xd7c9('0x6f'),_0xd7c9('0x6f'))[_0xd7c9('0x74')](_0xd7c9('0x75'),_0xd7c9('0x70'))['field']('id','ContactId')['field'](_0x3b2d0b[_0xd7c9('0x76')][_0xd7c9('0x77')](),_0xd7c9('0x72'))[_0xd7c9('0x74')](_0x34bbf9[_0xd7c9('0x49')]['id'][_0xd7c9('0x77')](),'CampaignId')[_0xd7c9('0x74')]('NOW()',_0xd7c9('0x58'))[_0xd7c9('0x74')]('NOW()','updatedAt')[_0xd7c9('0x78')](_0xd7c9('0x79'))[_0xd7c9('0x3d')](_0xd7c9('0x7a'))[_0xd7c9('0x3d')]('ListId\x20=\x20?',_0x3b2d0b[_0xd7c9('0x76')][_0xd7c9('0x77')]())[_0xd7c9('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0xd7c9('0x3d')](_0xd7c9('0x7c'),squel[_0xd7c9('0x73')]()[_0xd7c9('0x74')](_0xd7c9('0x80'))[_0xd7c9('0x78')](_0xd7c9('0x81'))['where'](_0xd7c9('0x7f'),_0x34bbf9[_0xd7c9('0x49')]['id'][_0xd7c9('0x77')]())))[_0xd7c9('0x77')]();break;default:_0xd2c9cf=squel[_0xd7c9('0x6c')]()['into'](_0xd7c9('0x81'))[_0xd7c9('0x6e')](['phone',_0xd7c9('0x70'),_0xd7c9('0x71'),'ListId',_0xd7c9('0x5e'),_0xd7c9('0x58'),_0xd7c9('0x56')],squel['select']()[_0xd7c9('0x74')]('phone',_0xd7c9('0x6f'))['field'](_0xd7c9('0x75'),_0xd7c9('0x70'))[_0xd7c9('0x74')]('id',_0xd7c9('0x71'))[_0xd7c9('0x74')](_0x3b2d0b[_0xd7c9('0x76')][_0xd7c9('0x77')](),_0xd7c9('0x72'))[_0xd7c9('0x74')](_0x34bbf9[_0xd7c9('0x49')]['id'][_0xd7c9('0x77')](),_0xd7c9('0x5e'))[_0xd7c9('0x74')]('NOW()','createdAt')['field'](_0xd7c9('0x75'),_0xd7c9('0x56'))[_0xd7c9('0x78')](_0xd7c9('0x79'))['where']('deletedAt\x20IS\x20NULL')[_0xd7c9('0x3d')]('ListId\x20=\x20?',_0x3b2d0b[_0xd7c9('0x76')][_0xd7c9('0x77')]())[_0xd7c9('0x3d')](_0xd7c9('0x7b')))[_0xd7c9('0x77')]();}_0x49da18[_0xd7c9('0x82')](db[_0xd7c9('0x83')][_0xd7c9('0x32')](_0xd2c9cf));}return BPromise[_0xd7c9('0x84')](_0x49da18);}})[_0xd7c9('0x26')](function(){return _0x40db21;})[_0xd7c9('0x26')](respondWithResult(_0x3e2456,null))['catch'](handleError(_0x3e2456,null));};exports['removeLists']=function(_0x189176,_0x4871e3,_0x4043c6){return db[_0xd7c9('0x42')][_0xd7c9('0x50')]({'where':{'id':_0x189176[_0xd7c9('0x49')]['id']}})['then'](handleEntityNotFound(_0x4871e3,null))[_0xd7c9('0x26')](function(_0x1c11a5){if(_0x1c11a5){return _0x1c11a5[_0xd7c9('0x85')](_0x189176[_0xd7c9('0x32')][_0xd7c9('0x68')]);}})[_0xd7c9('0x26')](function(_0x4c1484){if(_0x4c1484){return db[_0xd7c9('0x5c')][_0xd7c9('0x27')]({'where':{'ListId':_0x189176[_0xd7c9('0x32')][_0xd7c9('0x68')],'CampaignId':_0x189176[_0xd7c9('0x49')]['id']}})['then'](function(){return _0x4c1484;});}})[_0xd7c9('0x26')](respondWithStatusCode(_0x4871e3,null))[_0xd7c9('0x47')](handleError(_0x4871e3,null));};exports[_0xd7c9('0x86')]=function(_0x42b761,_0x8fc2bc,_0x383e1d){var _0x507223={};var _0x4e64be={};var _0x57f708;var _0x4b5707;return db[_0xd7c9('0x42')]['findOne']({'where':{'id':_0x42b761[_0xd7c9('0x49')]['id']}})['then'](handleEntityNotFound(_0x8fc2bc,null))[_0xd7c9('0x26')](function(_0x2b4813){if(_0x2b4813){_0x57f708=_0x2b4813;_0x4e64be[_0xd7c9('0x36')]=_[_0xd7c9('0x33')](db['CmList']['rawAttributes']);_0x4e64be[_0xd7c9('0x32')]=_[_0xd7c9('0x33')](_0x42b761[_0xd7c9('0x32')]);_0x4e64be['filters']=_[_0xd7c9('0x35')](_0x4e64be[_0xd7c9('0x36')],_0x4e64be[_0xd7c9('0x32')]);_0x507223[_0xd7c9('0x38')]=_[_0xd7c9('0x35')](_0x4e64be[_0xd7c9('0x36')],qs[_0xd7c9('0x37')](_0x42b761[_0xd7c9('0x32')][_0xd7c9('0x37')]));_0x507223[_0xd7c9('0x38')]=_0x507223[_0xd7c9('0x38')][_0xd7c9('0x39')]?_0x507223['attributes']:_0x4e64be[_0xd7c9('0x36')];_0x507223['order']=qs['sort'](_0x42b761[_0xd7c9('0x32')][_0xd7c9('0x3c')]);_0x507223[_0xd7c9('0x3d')]=qs['filters'](_[_0xd7c9('0x3e')](_0x42b761['query'],_0x4e64be['filters']));if(_0x42b761[_0xd7c9('0x32')][_0xd7c9('0x3f')]){_0x507223[_0xd7c9('0x3d')]=_['merge'](_0x507223[_0xd7c9('0x3d')],{'$or':_['map'](_0x507223[_0xd7c9('0x38')],function(_0x55b01f){var _0x2da488={};_0x2da488[_0x55b01f]={'$like':'%'+_0x42b761[_0xd7c9('0x32')]['filter']+'%'};return _0x2da488;})});}_0x507223=_[_0xd7c9('0x40')]({},_0x507223,_0x42b761[_0xd7c9('0x41')]);return _0x57f708['getBlackLists'](_0x507223);}})[_0xd7c9('0x26')](function(_0x1684a7){if(_0x1684a7){_0x4b5707=_0x1684a7[_0xd7c9('0x39')];if(!_0x42b761['query']['hasOwnProperty'](_0xd7c9('0x5d'))){_0x507223[_0xd7c9('0x20')]=qs[_0xd7c9('0x20')](_0x42b761[_0xd7c9('0x32')][_0xd7c9('0x20')]);_0x507223[_0xd7c9('0x3a')]=qs[_0xd7c9('0x3a')](_0x42b761[_0xd7c9('0x32')][_0xd7c9('0x3a')]);}return _0x57f708[_0xd7c9('0x86')](_0x507223);}})[_0xd7c9('0x26')](function(_0x1391da){if(_0x1391da){return _0x1391da?{'count':_0x4b5707,'rows':_0x1391da}:null;}})[_0xd7c9('0x26')](respondWithResult(_0x8fc2bc,null))[_0xd7c9('0x47')](handleError(_0x8fc2bc,null));};exports['addBlackLists']=function(_0x5b2d08,_0x4eaf81,_0x4f2812){var _0x3a0f65,_0x3a1e09;return db[_0xd7c9('0x42')]['find']({'where':{'id':_0x5b2d08[_0xd7c9('0x49')]['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x4eaf81,null))[_0xd7c9('0x26')](function(_0x468d23){if(_0x468d23){_0x3a1e09=_0x468d23;return _0x468d23[_0xd7c9('0x87')](_0x5b2d08[_0xd7c9('0x57')][_0xd7c9('0x68')],_['omit'](_0x5b2d08['body'],[_0xd7c9('0x68'),'id'])||{});}return null;})['spread'](function(_0x52da50){var _0x162b12;_0x3a0f65=_0x52da50||[];var _0x46ef78=[];if(_0x52da50){for(var _0x53272b=0x0;_0x53272b<_0x52da50[_0xd7c9('0x39')];_0x53272b+=0x1){var _0x5e9f5c=_0x52da50[_0x53272b][_0xd7c9('0x4c')]({'plain':!![]});_0x162b12=squel['insert']()[_0xd7c9('0x6d')](_0xd7c9('0x88'))[_0xd7c9('0x6e')]([_0xd7c9('0x6f'),'ContactId',_0xd7c9('0x72'),_0xd7c9('0x5e'),_0xd7c9('0x58'),'updatedAt'],squel[_0xd7c9('0x73')]()[_0xd7c9('0x74')](_0xd7c9('0x6f'),_0xd7c9('0x6f'))[_0xd7c9('0x74')]('id',_0xd7c9('0x71'))[_0xd7c9('0x74')](_0x5e9f5c['CmListId'][_0xd7c9('0x77')](),'ListId')['field'](_0x5b2d08[_0xd7c9('0x49')]['id'][_0xd7c9('0x77')](),_0xd7c9('0x5e'))[_0xd7c9('0x74')]('NOW()','createdAt')[_0xd7c9('0x74')](_0xd7c9('0x75'),_0xd7c9('0x56'))[_0xd7c9('0x78')]('cm_contacts')['where'](_0xd7c9('0x7a'))[_0xd7c9('0x3d')]('ListId\x20=\x20?',_0x5e9f5c['CmListId'][_0xd7c9('0x77')]())[_0xd7c9('0x3d')](_0xd7c9('0x7b')))[_0xd7c9('0x77')]();_0x46ef78[_0xd7c9('0x82')](db[_0xd7c9('0x83')][_0xd7c9('0x32')](_0x162b12));}return BPromise['all'](_0x46ef78);}})[_0xd7c9('0x26')](function(){return _0x3a0f65;})[_0xd7c9('0x26')](respondWithResult(_0x4eaf81,null))[_0xd7c9('0x47')](handleError(_0x4eaf81,null));};exports['removeBlackLists']=function(_0x1eba6e,_0x54198b,_0x125725){return db[_0xd7c9('0x42')][_0xd7c9('0x50')]({'where':{'id':_0x1eba6e[_0xd7c9('0x49')]['id']}})[_0xd7c9('0x26')](handleEntityNotFound(_0x54198b,null))[_0xd7c9('0x26')](function(_0x35e702){if(_0x35e702){return _0x35e702[_0xd7c9('0x89')](_0x1eba6e[_0xd7c9('0x32')][_0xd7c9('0x68')]);}})['then'](function(_0x4f987d){if(_0x4f987d){return db[_0xd7c9('0x64')][_0xd7c9('0x27')]({'where':{'ListId':_0x1eba6e[_0xd7c9('0x32')][_0xd7c9('0x68')],'CampaignId':_0x1eba6e[_0xd7c9('0x49')]['id']}})['then'](function(){return _0x4f987d;});}})[_0xd7c9('0x26')](respondWithStatusCode(_0x54198b,null))[_0xd7c9('0x47')](handleError(_0x54198b,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index d83d9fb..ecda943 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 _0x8b70=['exports','define','Campaign','campaigns','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./campaign.attributes'];(function(_0x414166,_0x5e87f3){var _0x373505=function(_0x1cd5b1){while(--_0x1cd5b1){_0x414166['push'](_0x414166['shift']());}};_0x373505(++_0x5e87f3);}(_0x8b70,0x1c0));var _0x08b7=function(_0x5b2865,_0x3b814b){_0x5b2865=_0x5b2865-0x0;var _0x3cb4c6=_0x8b70[_0x5b2865];return _0x3cb4c6;};'use strict';var _=require(_0x08b7('0x0'));var util=require('util');var logger=require(_0x08b7('0x1'))(_0x08b7('0x2'));var moment=require('moment');var BPromise=require(_0x08b7('0x3'));var rp=require(_0x08b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x08b7('0x5'));var config=require(_0x08b7('0x6'));var attributes=require(_0x08b7('0x7'));module[_0x08b7('0x8')]=function(_0xd2f508,_0xb0bad5){return _0xd2f508[_0x08b7('0x9')](_0x08b7('0xa'),attributes,{'tableName':_0x08b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cd5=['path','rimraf','exports','campaigns','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5f0465,_0x41cbeb){var _0x2cfe91=function(_0x394b68){while(--_0x394b68){_0x5f0465['push'](_0x5f0465['shift']());}};_0x2cfe91(++_0x41cbeb);}(_0x4cd5,0x1ab));var _0x54cd=function(_0x160393,_0x4e2ea7){_0x160393=_0x160393-0x0;var _0x39865d=_0x4cd5[_0x160393];return _0x39865d;};'use strict';var _=require(_0x54cd('0x0'));var util=require(_0x54cd('0x1'));var logger=require(_0x54cd('0x2'))('api');var moment=require(_0x54cd('0x3'));var BPromise=require(_0x54cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x54cd('0x5'));var rimraf=require(_0x54cd('0x6'));var config=require('../../config/environment');var attributes=require('./campaign.attributes');module[_0x54cd('0x7')]=function(_0x3ad688,_0x2c298e){return _0x3ad688['define']('Campaign',attributes,{'tableName':_0x54cd('0x8'),'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 49f1e66..4c51907 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x56a08d,_0x423e65){var _0x5a1e57=function(_0x8da505){while(--_0x8da505){_0x56a08d['push'](_0x56a08d['shift']());}};_0x5a1e57(++_0x423e65);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});};
\ No newline at end of file
+var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x426778,_0x17681a){var _0xad9bfe=function(_0x500c13){while(--_0x500c13){_0x426778['push'](_0x426778['shift']());}};_0xad9bfe(++_0x17681a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index e2f172a..41b7cbc 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 _0xb726=['post','addLists','addBlackLists','put','update','delete','removeLists','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb726,0xbc));var _0x6b72=function(_0x2402cf,_0x1dfd43){_0x2402cf=_0x2402cf-0x0;var _0x4a789a=_0xb726[_0x2402cf];return _0x4a789a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b72('0x0'));var router=express[_0x6b72('0x1')]();var fs_extra=require(_0x6b72('0x2'));var auth=require(_0x6b72('0x3'));var interaction=require(_0x6b72('0x4'));var config=require(_0x6b72('0x5'));var controller=require('./campaign.controller');router[_0x6b72('0x6')]('/',auth[_0x6b72('0x7')](),controller[_0x6b72('0x8')]);router['get'](_0x6b72('0x9'),auth[_0x6b72('0x7')](),controller[_0x6b72('0xa')]);router['get']('/:id/hoppers',auth['isAuthenticated'](),controller[_0x6b72('0xb')]);router[_0x6b72('0x6')](_0x6b72('0xc'),auth[_0x6b72('0x7')](),controller[_0x6b72('0xd')]);router[_0x6b72('0x6')](_0x6b72('0xe'),auth[_0x6b72('0x7')](),controller[_0x6b72('0xf')]);router[_0x6b72('0x6')](_0x6b72('0x10'),auth[_0x6b72('0x7')](),controller[_0x6b72('0x11')]);router['get']('/:id/lists',auth[_0x6b72('0x7')](),controller[_0x6b72('0x12')]);router[_0x6b72('0x6')](_0x6b72('0x13'),auth[_0x6b72('0x7')](),controller[_0x6b72('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b72('0x15')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x6b72('0x16')]('/:id/lists',auth[_0x6b72('0x7')](),controller[_0x6b72('0x17')]);router[_0x6b72('0x16')](_0x6b72('0x13'),auth[_0x6b72('0x7')](),controller[_0x6b72('0x18')]);router[_0x6b72('0x19')](_0x6b72('0x9'),auth[_0x6b72('0x7')](),controller[_0x6b72('0x1a')]);router[_0x6b72('0x1b')](_0x6b72('0x9'),auth[_0x6b72('0x7')](),controller['destroy']);router[_0x6b72('0x1b')]('/:id/lists',auth[_0x6b72('0x7')](),controller[_0x6b72('0x1c')]);router[_0x6b72('0x1b')](_0x6b72('0x13'),auth[_0x6b72('0x7')](),controller['removeBlackLists']);module[_0x6b72('0x1d')]=router;
\ No newline at end of file
+var _0xda73=['../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','destroy','delete','removeLists','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x8b5d15,_0x27b4c0){var _0x4ba000=function(_0x436298){while(--_0x436298){_0x8b5d15['push'](_0x8b5d15['shift']());}};_0x4ba000(++_0x27b4c0);}(_0xda73,0x1d7));var _0x3da7=function(_0x550f96,_0x17b89d){_0x550f96=_0x550f96-0x0;var _0x150e15=_0xda73[_0x550f96];return _0x150e15;};'use strict';var multer=require(_0x3da7('0x0'));var util=require('util');var path=require(_0x3da7('0x1'));var timeout=require(_0x3da7('0x2'));var express=require('express');var router=express[_0x3da7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3da7('0x4'));var interaction=require(_0x3da7('0x5'));var config=require(_0x3da7('0x6'));var controller=require(_0x3da7('0x7'));router[_0x3da7('0x8')]('/',auth[_0x3da7('0x9')](),controller['index']);router[_0x3da7('0x8')]('/:id',auth[_0x3da7('0x9')](),controller[_0x3da7('0xa')]);router[_0x3da7('0x8')](_0x3da7('0xb'),auth[_0x3da7('0x9')](),controller[_0x3da7('0xc')]);router[_0x3da7('0x8')]('/:id/hopper_histories',auth[_0x3da7('0x9')](),controller[_0x3da7('0xd')]);router[_0x3da7('0x8')](_0x3da7('0xe'),auth[_0x3da7('0x9')](),controller[_0x3da7('0xf')]);router[_0x3da7('0x8')](_0x3da7('0x10'),auth['isAuthenticated'](),controller[_0x3da7('0x11')]);router['get'](_0x3da7('0x12'),auth[_0x3da7('0x9')](),controller[_0x3da7('0x13')]);router[_0x3da7('0x8')](_0x3da7('0x14'),auth[_0x3da7('0x9')](),controller[_0x3da7('0x15')]);router[_0x3da7('0x16')]('/',auth[_0x3da7('0x9')](),controller[_0x3da7('0x17')]);router[_0x3da7('0x16')](_0x3da7('0x18'),auth[_0x3da7('0x9')](),controller[_0x3da7('0x19')]);router[_0x3da7('0x16')](_0x3da7('0x12'),auth[_0x3da7('0x9')](),controller[_0x3da7('0x1a')]);router[_0x3da7('0x16')](_0x3da7('0x14'),auth[_0x3da7('0x9')](),controller[_0x3da7('0x1b')]);router[_0x3da7('0x1c')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3da7('0x1d'),auth[_0x3da7('0x9')](),controller[_0x3da7('0x1e')]);router[_0x3da7('0x1f')](_0x3da7('0x12'),auth['isAuthenticated'](),controller[_0x3da7('0x20')]);router['delete'](_0x3da7('0x14'),auth[_0x3da7('0x9')](),controller['removeBlackLists']);module[_0x3da7('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 d8a40e2..1265d9e 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 _0xcfc9=['key','sequelize','STRING','TEXT','getDataValue'];(function(_0x3f72c1,_0x979a0d){var _0x9dd0ce=function(_0x1c1142){while(--_0x1c1142){_0x3f72c1['push'](_0x3f72c1['shift']());}};_0x9dd0ce(++_0x979a0d);}(_0xcfc9,0xdd));var _0x9cfc=function(_0x332d74,_0x216152){_0x332d74=_0x332d74-0x0;var _0x2a2f1b=_0xcfc9[_0x332d74];return _0x2a2f1b;};'use strict';var Sequelize=require(_0x9cfc('0x0'));module['exports']={'key':{'type':Sequelize[_0x9cfc('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x9cfc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9cfc('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9cfc('0x3')](_0x9cfc('0x4'));}}};
\ No newline at end of file
+var _0xe738=['sequelize','exports','TEXT','STRING','VIRTUAL','getDataValue','key'];(function(_0xce63fa,_0x415771){var _0x114eb1=function(_0x53c393){while(--_0x53c393){_0xce63fa['push'](_0xce63fa['shift']());}};_0x114eb1(++_0x415771);}(_0xe738,0xa1));var _0x8e73=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xe738[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0x8e73('0x0'));module[_0x8e73('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8e73('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8e73('0x3')]},'name':{'type':Sequelize[_0x8e73('0x4')],'get':function(){return this[_0x8e73('0x5')](_0x8e73('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 6cb4164..3015e69 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 _0xa958=['status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','CannedAnswers','UserProfileResource','error','name','send','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','CannedAnswer','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb'];(function(_0x46fd7d,_0x2fa147){var _0x3d64aa=function(_0x5da960){while(--_0x5da960){_0x46fd7d['push'](_0x46fd7d['shift']());}};_0x3d64aa(++_0x2fa147);}(_0xa958,0x94));var _0x8a95=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xa958[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0x8a95('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a95('0x1'));var jsonpatch=require(_0x8a95('0x2'));var rp=require(_0x8a95('0x3'));var moment=require(_0x8a95('0x4'));var BPromise=require(_0x8a95('0x5'));var Mustache=require(_0x8a95('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8a95('0x7'));var csv=require(_0x8a95('0x8'));var ejs=require(_0x8a95('0x9'));var fs=require('fs');var fs_extra=require(_0x8a95('0xa'));var _=require(_0x8a95('0xb'));var squel=require(_0x8a95('0xc'));var crypto=require(_0x8a95('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8a95('0xe'));var toCsv=require(_0x8a95('0x8'));var querystring=require(_0x8a95('0xf'));var Papa=require(_0x8a95('0x10'));var Redis=require(_0x8a95('0x11'));var authService=require(_0x8a95('0x12'));var qs=require(_0x8a95('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a95('0x14'));var logger=require(_0x8a95('0x15'))('api');var utils=require(_0x8a95('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a95('0x17'))['db'];function respondWithStatusCode(_0x4cb5a5,_0x2fdf66){_0x2fdf66=_0x2fdf66||0xcc;return function(_0x1579cd){if(_0x1579cd){return _0x4cb5a5['sendStatus'](_0x2fdf66);}return _0x4cb5a5[_0x8a95('0x18')](_0x2fdf66)[_0x8a95('0x19')]();};}function respondWithResult(_0x59c5cc,_0x25e4bd){_0x25e4bd=_0x25e4bd||0xc8;return function(_0x19caf2){if(_0x19caf2){return _0x59c5cc[_0x8a95('0x18')](_0x25e4bd)[_0x8a95('0x1a')](_0x19caf2);}};}function respondWithFilteredResult(_0x4528b2,_0x341c72){return function(_0x13922b){if(_0x13922b){var _0x52e3d9=_0x13922b['count'],_0x1d08bf=_0x341c72[_0x8a95('0x1b')],_0x556592=_0x341c72[_0x8a95('0x1b')]+_0x341c72[_0x8a95('0x1c')],_0x334b18;if(_0x556592>=_0x52e3d9){_0x556592=_0x52e3d9;_0x334b18=0xc8;}else{_0x334b18=0xce;}_0x4528b2[_0x8a95('0x18')](_0x334b18);return _0x4528b2[_0x8a95('0x1d')](_0x8a95('0x1e'),_0x1d08bf+'-'+_0x556592+'/'+_0x52e3d9)[_0x8a95('0x1a')](_0x13922b);}return null;};}function patchUpdates(_0x35566f){return function(_0x2b0eaf){try{jsonpatch[_0x8a95('0x1f')](_0x2b0eaf,_0x35566f,!![]);}catch(_0x39d371){return BPromise[_0x8a95('0x20')](_0x39d371);}return _0x2b0eaf[_0x8a95('0x21')]();};}function saveUpdates(_0x361804,_0xbcb93e){return function(_0xfb6dd9){if(_0xfb6dd9){return _0xfb6dd9[_0x8a95('0x22')](_0x361804)['then'](function(_0x5df2cf){return _0x5df2cf;});}return null;};}function removeEntity(_0x476c2c,_0x25e5a7){return function(_0x1d53ac){if(_0x1d53ac){return _0x1d53ac[_0x8a95('0x23')]()[_0x8a95('0x24')](function(){var _0xfc238=_0x1d53ac['get']({'plain':!![]});var _0x5a3320=_0x8a95('0x25');return db[_0x8a95('0x26')][_0x8a95('0x23')]({'where':{'type':_0x5a3320,'resourceId':_0xfc238['id']}})[_0x8a95('0x24')](function(){return _0x1d53ac;});})[_0x8a95('0x24')](function(){_0x476c2c[_0x8a95('0x18')](0xcc)[_0x8a95('0x19')]();});}};}function handleEntityNotFound(_0x171b58,_0x3e880b){return function(_0x22a1fb){if(!_0x22a1fb){_0x171b58['sendStatus'](0x194);}return _0x22a1fb;};}function handleError(_0x1a98e0,_0x57d711){_0x57d711=_0x57d711||0x1f4;return function(_0x5544b8){logger[_0x8a95('0x27')](_0x5544b8['stack']);if(_0x5544b8['name']){delete _0x5544b8[_0x8a95('0x28')];}_0x1a98e0['status'](_0x57d711)[_0x8a95('0x29')](_0x5544b8);};}exports['index']=function(_0x136188,_0x18b287){var _0x341b0e={},_0x13e2ed={},_0x251b54={'count':0x0,'rows':[]};var _0x599977=_[_0x8a95('0x2a')](db['CannedAnswer']['rawAttributes'],function(_0x26fac7){return{'name':_0x26fac7['fieldName'],'type':_0x26fac7['type'][_0x8a95('0x2b')]};});_0x13e2ed[_0x8a95('0x2c')]=_[_0x8a95('0x2a')](_0x599977,_0x8a95('0x28'));_0x13e2ed[_0x8a95('0x2d')]=_[_0x8a95('0x2e')](_0x136188[_0x8a95('0x2d')]);_0x13e2ed[_0x8a95('0x2f')]=_[_0x8a95('0x30')](_0x13e2ed[_0x8a95('0x2c')],_0x13e2ed[_0x8a95('0x2d')]);_0x341b0e[_0x8a95('0x31')]=_[_0x8a95('0x30')](_0x13e2ed['model'],qs[_0x8a95('0x32')](_0x136188[_0x8a95('0x2d')]['fields']));_0x341b0e[_0x8a95('0x31')]=_0x341b0e[_0x8a95('0x31')][_0x8a95('0x33')]?_0x341b0e['attributes']:_0x13e2ed[_0x8a95('0x2c')];if(!_0x136188[_0x8a95('0x2d')][_0x8a95('0x34')](_0x8a95('0x35'))){_0x341b0e[_0x8a95('0x1c')]=qs[_0x8a95('0x1c')](_0x136188[_0x8a95('0x2d')]['limit']);_0x341b0e[_0x8a95('0x1b')]=qs['offset'](_0x136188['query']['offset']);}_0x341b0e['order']=qs['sort'](_0x136188['query'][_0x8a95('0x36')]);_0x341b0e[_0x8a95('0x37')]=qs[_0x8a95('0x2f')](_[_0x8a95('0x38')](_0x136188[_0x8a95('0x2d')],_0x13e2ed[_0x8a95('0x2f')]),_0x599977);if(_0x136188[_0x8a95('0x2d')][_0x8a95('0x39')]){_0x341b0e['where']=_[_0x8a95('0x3a')](_0x341b0e['where'],{'$or':_[_0x8a95('0x2a')](_0x599977,function(_0x2abede){if(_0x2abede[_0x8a95('0x3b')]!==_0x8a95('0x3c')){var _0x1e7592={};_0x1e7592[_0x2abede[_0x8a95('0x28')]]={'$like':'%'+_0x136188[_0x8a95('0x2d')][_0x8a95('0x39')]+'%'};return _0x1e7592;}})});}_0x341b0e=_[_0x8a95('0x3a')]({},_0x341b0e,_0x136188[_0x8a95('0x3d')]);var _0x1aba8d={'where':_0x341b0e['where']};return db[_0x8a95('0x3e')]['count'](_0x1aba8d)[_0x8a95('0x24')](function(_0x597492){_0x251b54['count']=_0x597492;if(_0x136188[_0x8a95('0x2d')][_0x8a95('0x3f')]){_0x341b0e[_0x8a95('0x40')]=[{'all':!![]}];}return db[_0x8a95('0x3e')][_0x8a95('0x41')](_0x341b0e);})[_0x8a95('0x24')](function(_0x5eee1b){_0x251b54[_0x8a95('0x42')]=_0x5eee1b;return _0x251b54;})[_0x8a95('0x24')](respondWithFilteredResult(_0x18b287,_0x341b0e))['catch'](handleError(_0x18b287,null));};exports[_0x8a95('0x43')]=function(_0x3edbe9,_0xff9088){var _0x2e983a={'raw':!![],'where':{'id':_0x3edbe9[_0x8a95('0x44')]['id']}},_0x2729db={};_0x2729db['model']=_[_0x8a95('0x2e')](db['CannedAnswer'][_0x8a95('0x45')]);_0x2729db[_0x8a95('0x2d')]=_[_0x8a95('0x2e')](_0x3edbe9['query']);_0x2729db[_0x8a95('0x2f')]=_[_0x8a95('0x30')](_0x2729db['model'],_0x2729db['query']);_0x2e983a[_0x8a95('0x31')]=_['intersection'](_0x2729db[_0x8a95('0x2c')],qs[_0x8a95('0x32')](_0x3edbe9['query'][_0x8a95('0x32')]));_0x2e983a[_0x8a95('0x31')]=_0x2e983a[_0x8a95('0x31')][_0x8a95('0x33')]?_0x2e983a[_0x8a95('0x31')]:_0x2729db['model'];if(_0x3edbe9['query'][_0x8a95('0x3f')]){_0x2e983a['include']=[{'all':!![]}];}_0x2e983a=_[_0x8a95('0x3a')]({},_0x2e983a,_0x3edbe9[_0x8a95('0x3d')]);return db[_0x8a95('0x3e')][_0x8a95('0x46')](_0x2e983a)['then'](handleEntityNotFound(_0xff9088,null))[_0x8a95('0x24')](respondWithResult(_0xff9088,null))[_0x8a95('0x47')](handleError(_0xff9088,null));};exports[_0x8a95('0x22')]=function(_0x137c62,_0x1d3115){if(_0x137c62[_0x8a95('0x48')]['id']){delete _0x137c62[_0x8a95('0x48')]['id'];}return db[_0x8a95('0x3e')]['find']({'where':{'id':_0x137c62[_0x8a95('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d3115,null))[_0x8a95('0x24')](saveUpdates(_0x137c62[_0x8a95('0x48')],null))[_0x8a95('0x24')](respondWithResult(_0x1d3115,null))[_0x8a95('0x47')](handleError(_0x1d3115,null));};exports['destroy']=function(_0x541438,_0x40280b){return db['CannedAnswer'][_0x8a95('0x46')]({'where':{'id':_0x541438[_0x8a95('0x44')]['id']}})[_0x8a95('0x24')](handleEntityNotFound(_0x40280b,null))['then'](removeEntity(_0x40280b,null))[_0x8a95('0x47')](handleError(_0x40280b,null));};exports[_0x8a95('0x49')]=function(_0x28d163,_0x1460c7){var _0x2aef95={'key':_0x28d163[_0x8a95('0x48')][_0x8a95('0x2b')]};if(_0x28d163[_0x8a95('0x48')][_0x8a95('0x4a')]){_0x2aef95['MailAccountId']=_0x28d163[_0x8a95('0x48')][_0x8a95('0x4a')];}else if(_0x28d163[_0x8a95('0x48')]['SmsAccountId']){_0x2aef95[_0x8a95('0x4b')]=_0x28d163[_0x8a95('0x48')][_0x8a95('0x4b')];}else if(_0x28d163['body'][_0x8a95('0x4c')]){_0x2aef95[_0x8a95('0x4c')]=_0x28d163[_0x8a95('0x48')]['OpenchannelAccountId'];}else if(_0x28d163[_0x8a95('0x48')][_0x8a95('0x4d')]){_0x2aef95['ChatWebsiteId']=_0x28d163[_0x8a95('0x48')][_0x8a95('0x4d')];}return db[_0x8a95('0x3e')]['find']({'where':_0x2aef95})[_0x8a95('0x24')](function(_0x47bb7f){if(_0x47bb7f){throw new db[(_0x8a95('0x4e'))][(_0x8a95('0x4f'))](_0x8a95('0x50'));}return db['CannedAnswer'][_0x8a95('0x49')](_0x28d163[_0x8a95('0x48')]);})[_0x8a95('0x24')](function(_0x2c8b24){var _0x18d867=_0x28d163[_0x8a95('0x51')]['get']({'plain':!![]});if(!_0x18d867)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18d867[_0x8a95('0x52')]==='user'){var _0x1db297=_0x2c8b24['get']({'plain':!![]});return db[_0x8a95('0x53')][_0x8a95('0x46')]({'where':{'name':_0x8a95('0x25'),'userProfileId':_0x18d867[_0x8a95('0x54')]},'raw':!![]})[_0x8a95('0x24')](function(_0x4923d1){if(_0x4923d1&&_0x4923d1[_0x8a95('0x55')]===0x0){return db['UserProfileResource'][_0x8a95('0x49')]({'name':_0x1db297[_0x8a95('0x28')],'resourceId':_0x1db297['id'],'type':_0x4923d1['name'],'sectionId':_0x4923d1['id']},{})[_0x8a95('0x24')](function(){return _0x2c8b24;});}else{return _0x2c8b24;}})[_0x8a95('0x47')](function(_0x54c8db){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54c8db);throw _0x54c8db;});}return _0x2c8b24;})[_0x8a95('0x24')](respondWithResult(_0x1460c7,0xc9))[_0x8a95('0x47')](handleError(_0x1460c7,null));};
\ No newline at end of file
+var _0xb8a0=['length','includeAll','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','CannedAnswer','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','count','include','findAll','rows','catch','params','keys','rawAttributes'];(function(_0x532244,_0x8f53fe){var _0x1491ef=function(_0x23aa09){while(--_0x23aa09){_0x532244['push'](_0x532244['shift']());}};_0x1491ef(++_0x8f53fe);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x3ee8a0,_0x2d4799){_0x3ee8a0=_0x3ee8a0-0x0;var _0x1a0f7a=_0xb8a0[_0x3ee8a0];return _0x1a0f7a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0b8a('0x0'));var jsonpatch=require(_0x0b8a('0x1'));var rp=require('request-promise');var moment=require(_0x0b8a('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0b8a('0x3'));var csv=require(_0x0b8a('0x4'));var ejs=require(_0x0b8a('0x5'));var fs=require('fs');var fs_extra=require(_0x0b8a('0x6'));var _=require(_0x0b8a('0x7'));var squel=require(_0x0b8a('0x8'));var crypto=require(_0x0b8a('0x9'));var jsforce=require(_0x0b8a('0xa'));var deskjs=require(_0x0b8a('0xb'));var toCsv=require(_0x0b8a('0x4'));var querystring=require(_0x0b8a('0xc'));var Papa=require(_0x0b8a('0xd'));var Redis=require(_0x0b8a('0xe'));var authService=require(_0x0b8a('0xf'));var qs=require(_0x0b8a('0x10'));var as=require(_0x0b8a('0x11'));var hardwareService=require(_0x0b8a('0x12'));var logger=require(_0x0b8a('0x13'))(_0x0b8a('0x14'));var utils=require(_0x0b8a('0x15'));var config=require(_0x0b8a('0x16'));var licenseUtil=require(_0x0b8a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43aaa3,_0x2f7f7b){_0x2f7f7b=_0x2f7f7b||0xcc;return function(_0x3c96c9){if(_0x3c96c9){return _0x43aaa3[_0x0b8a('0x18')](_0x2f7f7b);}return _0x43aaa3[_0x0b8a('0x19')](_0x2f7f7b)[_0x0b8a('0x1a')]();};}function respondWithResult(_0x12838b,_0x4066ef){_0x4066ef=_0x4066ef||0xc8;return function(_0x1313d1){if(_0x1313d1){return _0x12838b['status'](_0x4066ef)[_0x0b8a('0x1b')](_0x1313d1);}};}function respondWithFilteredResult(_0x318983,_0x233a61){return function(_0x554237){if(_0x554237){var _0x1afb89=_0x554237['count'],_0x2f9867=_0x233a61['offset'],_0x1c5ac2=_0x233a61[_0x0b8a('0x1c')]+_0x233a61['limit'],_0x5a2623;if(_0x1c5ac2>=_0x1afb89){_0x1c5ac2=_0x1afb89;_0x5a2623=0xc8;}else{_0x5a2623=0xce;}_0x318983[_0x0b8a('0x19')](_0x5a2623);return _0x318983[_0x0b8a('0x1d')](_0x0b8a('0x1e'),_0x2f9867+'-'+_0x1c5ac2+'/'+_0x1afb89)[_0x0b8a('0x1b')](_0x554237);}return null;};}function patchUpdates(_0x3862bc){return function(_0x39da01){try{jsonpatch[_0x0b8a('0x1f')](_0x39da01,_0x3862bc,!![]);}catch(_0x13182e){return BPromise[_0x0b8a('0x20')](_0x13182e);}return _0x39da01[_0x0b8a('0x21')]();};}function saveUpdates(_0x313612,_0x568e89){return function(_0x57285b){if(_0x57285b){return _0x57285b[_0x0b8a('0x22')](_0x313612)['then'](function(_0x43ec10){return _0x43ec10;});}return null;};}function removeEntity(_0x1adeb4,_0xba351e){return function(_0x344653){if(_0x344653){return _0x344653['destroy']()[_0x0b8a('0x23')](function(){var _0x48e7dd=_0x344653[_0x0b8a('0x24')]({'plain':!![]});var _0x29dbf3='CannedAnswers';return db[_0x0b8a('0x25')][_0x0b8a('0x26')]({'where':{'type':_0x29dbf3,'resourceId':_0x48e7dd['id']}})[_0x0b8a('0x23')](function(){return _0x344653;});})['then'](function(){_0x1adeb4[_0x0b8a('0x19')](0xcc)[_0x0b8a('0x1a')]();});}};}function handleEntityNotFound(_0x34c83c,_0x4af078){return function(_0x37f47b){if(!_0x37f47b){_0x34c83c['sendStatus'](0x194);}return _0x37f47b;};}function handleError(_0x1ed000,_0x3e5e38){_0x3e5e38=_0x3e5e38||0x1f4;return function(_0x3d08c8){logger[_0x0b8a('0x27')](_0x3d08c8[_0x0b8a('0x28')]);if(_0x3d08c8[_0x0b8a('0x29')]){delete _0x3d08c8[_0x0b8a('0x29')];}_0x1ed000[_0x0b8a('0x19')](_0x3e5e38)[_0x0b8a('0x2a')](_0x3d08c8);};}exports[_0x0b8a('0x2b')]=function(_0x1e61f4,_0x20b16d){var _0x4b56fc={},_0x28ab04={},_0x223fdb={'count':0x0,'rows':[]};var _0x944638=_[_0x0b8a('0x2c')](db[_0x0b8a('0x2d')]['rawAttributes'],function(_0x2e9d5b){return{'name':_0x2e9d5b[_0x0b8a('0x2e')],'type':_0x2e9d5b['type'][_0x0b8a('0x2f')]};});_0x28ab04[_0x0b8a('0x30')]=_[_0x0b8a('0x2c')](_0x944638,_0x0b8a('0x29'));_0x28ab04[_0x0b8a('0x31')]=_['keys'](_0x1e61f4[_0x0b8a('0x31')]);_0x28ab04[_0x0b8a('0x32')]=_[_0x0b8a('0x33')](_0x28ab04[_0x0b8a('0x30')],_0x28ab04[_0x0b8a('0x31')]);_0x4b56fc['attributes']=_[_0x0b8a('0x33')](_0x28ab04[_0x0b8a('0x30')],qs['fields'](_0x1e61f4[_0x0b8a('0x31')][_0x0b8a('0x34')]));_0x4b56fc[_0x0b8a('0x35')]=_0x4b56fc[_0x0b8a('0x35')]['length']?_0x4b56fc[_0x0b8a('0x35')]:_0x28ab04[_0x0b8a('0x30')];if(!_0x1e61f4['query']['hasOwnProperty'](_0x0b8a('0x36'))){_0x4b56fc[_0x0b8a('0x37')]=qs[_0x0b8a('0x37')](_0x1e61f4[_0x0b8a('0x31')]['limit']);_0x4b56fc[_0x0b8a('0x1c')]=qs[_0x0b8a('0x1c')](_0x1e61f4[_0x0b8a('0x31')]['offset']);}_0x4b56fc[_0x0b8a('0x38')]=qs[_0x0b8a('0x39')](_0x1e61f4[_0x0b8a('0x31')][_0x0b8a('0x39')]);_0x4b56fc[_0x0b8a('0x3a')]=qs[_0x0b8a('0x32')](_[_0x0b8a('0x3b')](_0x1e61f4[_0x0b8a('0x31')],_0x28ab04[_0x0b8a('0x32')]),_0x944638);if(_0x1e61f4[_0x0b8a('0x31')]['filter']){_0x4b56fc[_0x0b8a('0x3a')]=_[_0x0b8a('0x3c')](_0x4b56fc[_0x0b8a('0x3a')],{'$or':_[_0x0b8a('0x2c')](_0x944638,function(_0x43ae2a){if(_0x43ae2a[_0x0b8a('0x3d')]!==_0x0b8a('0x3e')){var _0x42a780={};_0x42a780[_0x43ae2a['name']]={'$like':'%'+_0x1e61f4[_0x0b8a('0x31')]['filter']+'%'};return _0x42a780;}})});}_0x4b56fc=_[_0x0b8a('0x3c')]({},_0x4b56fc,_0x1e61f4['options']);var _0x384f7a={'where':_0x4b56fc[_0x0b8a('0x3a')]};return db['CannedAnswer'][_0x0b8a('0x3f')](_0x384f7a)[_0x0b8a('0x23')](function(_0x49a8e0){_0x223fdb[_0x0b8a('0x3f')]=_0x49a8e0;if(_0x1e61f4[_0x0b8a('0x31')]['includeAll']){_0x4b56fc[_0x0b8a('0x40')]=[{'all':!![]}];}return db[_0x0b8a('0x2d')][_0x0b8a('0x41')](_0x4b56fc);})['then'](function(_0x2ce77d){_0x223fdb[_0x0b8a('0x42')]=_0x2ce77d;return _0x223fdb;})['then'](respondWithFilteredResult(_0x20b16d,_0x4b56fc))[_0x0b8a('0x43')](handleError(_0x20b16d,null));};exports['show']=function(_0x47f9f1,_0x56a6ba){var _0x2bc3b7={'raw':!![],'where':{'id':_0x47f9f1[_0x0b8a('0x44')]['id']}},_0x2d3769={};_0x2d3769[_0x0b8a('0x30')]=_[_0x0b8a('0x45')](db[_0x0b8a('0x2d')][_0x0b8a('0x46')]);_0x2d3769[_0x0b8a('0x31')]=_[_0x0b8a('0x45')](_0x47f9f1['query']);_0x2d3769[_0x0b8a('0x32')]=_['intersection'](_0x2d3769['model'],_0x2d3769['query']);_0x2bc3b7['attributes']=_[_0x0b8a('0x33')](_0x2d3769[_0x0b8a('0x30')],qs[_0x0b8a('0x34')](_0x47f9f1[_0x0b8a('0x31')][_0x0b8a('0x34')]));_0x2bc3b7[_0x0b8a('0x35')]=_0x2bc3b7['attributes'][_0x0b8a('0x47')]?_0x2bc3b7['attributes']:_0x2d3769[_0x0b8a('0x30')];if(_0x47f9f1['query'][_0x0b8a('0x48')]){_0x2bc3b7[_0x0b8a('0x40')]=[{'all':!![]}];}_0x2bc3b7=_[_0x0b8a('0x3c')]({},_0x2bc3b7,_0x47f9f1[_0x0b8a('0x49')]);return db[_0x0b8a('0x2d')][_0x0b8a('0x4a')](_0x2bc3b7)['then'](handleEntityNotFound(_0x56a6ba,null))[_0x0b8a('0x23')](respondWithResult(_0x56a6ba,null))[_0x0b8a('0x43')](handleError(_0x56a6ba,null));};exports[_0x0b8a('0x22')]=function(_0x17d12c,_0x224b28){if(_0x17d12c[_0x0b8a('0x4b')]['id']){delete _0x17d12c[_0x0b8a('0x4b')]['id'];}return db[_0x0b8a('0x2d')][_0x0b8a('0x4a')]({'where':{'id':_0x17d12c[_0x0b8a('0x44')]['id']}})[_0x0b8a('0x23')](handleEntityNotFound(_0x224b28,null))[_0x0b8a('0x23')](saveUpdates(_0x17d12c['body'],null))[_0x0b8a('0x23')](respondWithResult(_0x224b28,null))[_0x0b8a('0x43')](handleError(_0x224b28,null));};exports[_0x0b8a('0x26')]=function(_0x5c465f,_0x2f13f5){return db[_0x0b8a('0x2d')][_0x0b8a('0x4a')]({'where':{'id':_0x5c465f['params']['id']}})['then'](handleEntityNotFound(_0x2f13f5,null))[_0x0b8a('0x23')](removeEntity(_0x2f13f5,null))['catch'](handleError(_0x2f13f5,null));};exports[_0x0b8a('0x4c')]=function(_0x3d98bb,_0x29e853){var _0x2e9472={'key':_0x3d98bb[_0x0b8a('0x4b')][_0x0b8a('0x2f')]};if(_0x3d98bb['body']['MailAccountId']){_0x2e9472[_0x0b8a('0x4d')]=_0x3d98bb[_0x0b8a('0x4b')][_0x0b8a('0x4d')];}else if(_0x3d98bb[_0x0b8a('0x4b')]['SmsAccountId']){_0x2e9472[_0x0b8a('0x4e')]=_0x3d98bb[_0x0b8a('0x4b')][_0x0b8a('0x4e')];}else if(_0x3d98bb[_0x0b8a('0x4b')][_0x0b8a('0x4f')]){_0x2e9472['OpenchannelAccountId']=_0x3d98bb[_0x0b8a('0x4b')][_0x0b8a('0x4f')];}else if(_0x3d98bb[_0x0b8a('0x4b')][_0x0b8a('0x50')]){_0x2e9472[_0x0b8a('0x50')]=_0x3d98bb[_0x0b8a('0x4b')][_0x0b8a('0x50')];}return db[_0x0b8a('0x2d')][_0x0b8a('0x4a')]({'where':_0x2e9472})[_0x0b8a('0x23')](function(_0x19822b){if(_0x19822b){throw new db[(_0x0b8a('0x51'))]['ValidationError'](_0x0b8a('0x52'));}return db[_0x0b8a('0x2d')]['create'](_0x3d98bb[_0x0b8a('0x4b')]);})[_0x0b8a('0x23')](function(_0x271dae){var _0x5648b1=_0x3d98bb['user'][_0x0b8a('0x24')]({'plain':!![]});if(!_0x5648b1)throw new Error(_0x0b8a('0x53'));if(_0x5648b1[_0x0b8a('0x54')]===_0x0b8a('0x55')){var _0x24a2cf=_0x271dae[_0x0b8a('0x24')]({'plain':!![]});return db[_0x0b8a('0x56')][_0x0b8a('0x4a')]({'where':{'name':_0x0b8a('0x57'),'userProfileId':_0x5648b1['userProfileId']},'raw':!![]})['then'](function(_0x28ce9f){if(_0x28ce9f&&_0x28ce9f[_0x0b8a('0x58')]===0x0){return db['UserProfileResource'][_0x0b8a('0x4c')]({'name':_0x24a2cf[_0x0b8a('0x29')],'resourceId':_0x24a2cf['id'],'type':_0x28ce9f[_0x0b8a('0x29')],'sectionId':_0x28ce9f['id']},{})[_0x0b8a('0x23')](function(){return _0x271dae;});}else{return _0x271dae;}})[_0x0b8a('0x43')](function(_0x4afcb1){logger[_0x0b8a('0x27')](_0x0b8a('0x59'),_0x4afcb1);throw _0x4afcb1;});}return _0x271dae;})['then'](respondWithResult(_0x29e853,0xc9))[_0x0b8a('0x43')](handleError(_0x29e853,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index e76fe6b..f9cd5c7 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 _0xc5e3=['request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x582974,_0x5968cb){var _0x364d64=function(_0xb2ac45){while(--_0xb2ac45){_0x582974['push'](_0x582974['shift']());}};_0x364d64(++_0x5968cb);}(_0xc5e3,0x10c));var _0x3c5e=function(_0x126ed0,_0x4d23e1){_0x126ed0=_0x126ed0-0x0;var _0x3ad298=_0xc5e3[_0x126ed0];return _0x3ad298;};'use strict';var _=require(_0x3c5e('0x0'));var util=require(_0x3c5e('0x1'));var logger=require(_0x3c5e('0x2'))(_0x3c5e('0x3'));var moment=require('moment');var BPromise=require(_0x3c5e('0x4'));var rp=require(_0x3c5e('0x5'));var fs=require('fs');var path=require(_0x3c5e('0x6'));var rimraf=require('rimraf');var config=require(_0x3c5e('0x7'));var attributes=require(_0x3c5e('0x8'));module[_0x3c5e('0x9')]=function(_0x33ed4d,_0x1cde99){return _0x33ed4d[_0x3c5e('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c5e('0xb'),'collate':_0x3c5e('0xc')});};
\ No newline at end of file
+var _0x1a72=['define','CannedAnswer','tools_canned_answers','lodash','util','api','moment','request-promise','rimraf','./cannedAnswer.attributes'];(function(_0x54f978,_0x3a6b7e){var _0x5d40b3=function(_0x44b545){while(--_0x44b545){_0x54f978['push'](_0x54f978['shift']());}};_0x5d40b3(++_0x3a6b7e);}(_0x1a72,0xad));var _0x21a7=function(_0xf92a92,_0x2111e4){_0xf92a92=_0xf92a92-0x0;var _0x546a0e=_0x1a72[_0xf92a92];return _0x546a0e;};'use strict';var _=require(_0x21a7('0x0'));var util=require(_0x21a7('0x1'));var logger=require('../../config/logger')(_0x21a7('0x2'));var moment=require(_0x21a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x21a7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21a7('0x5'));var config=require('../../config/environment');var attributes=require(_0x21a7('0x6'));module['exports']=function(_0x212fdb,_0x19a830){return _0x212fdb[_0x21a7('0x7')](_0x21a7('0x8'),attributes,{'tableName':_0x21a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 eeec13f..e36e745 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 _0x1f8a=['ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring'];(function(_0x460dae,_0x3a907f){var _0x36e6d0=function(_0x447057){while(--_0x447057){_0x460dae['push'](_0x460dae['shift']());}};_0x36e6d0(++_0x3a907f);}(_0x1f8a,0x137));var _0xa1f8=function(_0x13d42a,_0x11d7e7){_0x13d42a=_0x13d42a-0x0;var _0x2f87f0=_0x1f8a[_0x13d42a];return _0x2f87f0;};'use strict';var _=require(_0xa1f8('0x0'));var util=require(_0xa1f8('0x1'));var moment=require(_0xa1f8('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1f8('0x3'));var fs=require('fs');var Redis=require(_0xa1f8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa1f8('0x5'))('rpc');var config=require(_0xa1f8('0x6'));var jayson=require(_0xa1f8('0x7'));var client=jayson[_0xa1f8('0x8')][_0xa1f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1973f2,_0x40d83f,_0x5be3c1){return new BPromise(function(_0x446146,_0xdbc954){return client[_0xa1f8('0xa')](_0x1973f2,_0x5be3c1)[_0xa1f8('0xb')](function(_0x46699b){logger[_0xa1f8('0xc')](_0xa1f8('0xd'),_0x40d83f,_0xa1f8('0xe'));logger[_0xa1f8('0xf')](_0xa1f8('0x10'),_0x40d83f,_0xa1f8('0xe'),JSON[_0xa1f8('0x11')](_0x46699b));if(_0x46699b[_0xa1f8('0x12')]){if(_0x46699b[_0xa1f8('0x12')]['code']===0x1f4){logger[_0xa1f8('0x12')](_0xa1f8('0xd'),_0x40d83f,_0x46699b[_0xa1f8('0x12')][_0xa1f8('0x13')]);return _0xdbc954(_0x46699b[_0xa1f8('0x12')][_0xa1f8('0x13')]);}logger[_0xa1f8('0x12')](_0xa1f8('0xd'),_0x40d83f,_0x46699b[_0xa1f8('0x12')][_0xa1f8('0x13')]);return _0x446146(_0x46699b['error'][_0xa1f8('0x13')]);}else{logger[_0xa1f8('0xc')](_0xa1f8('0xd'),_0x40d83f,_0xa1f8('0xe'));_0x446146(_0x46699b['result']['message']);}})[_0xa1f8('0x14')](function(_0x5884a2){logger[_0xa1f8('0x12')](_0xa1f8('0xd'),_0x40d83f,_0x5884a2);_0xdbc954(_0x5884a2);});});}
\ No newline at end of file
+var _0xad08=['bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0xad08,0x18c));var _0x8ad0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xad08[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x8ad0('0x0'));var util=require(_0x8ad0('0x1'));var moment=require(_0x8ad0('0x2'));var BPromise=require(_0x8ad0('0x3'));var rs=require(_0x8ad0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ad0('0x5'))['db'];var utils=require(_0x8ad0('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8ad0('0x7'));var client=jayson[_0x8ad0('0x8')][_0x8ad0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24675d,_0xb46154,_0x336380){return new BPromise(function(_0x1e0771,_0x45a728){return client['request'](_0x24675d,_0x336380)[_0x8ad0('0xa')](function(_0x598c9b){logger[_0x8ad0('0xb')](_0x8ad0('0xc'),_0xb46154,'request\x20sent');logger[_0x8ad0('0xd')](_0x8ad0('0xe'),_0xb46154,_0x8ad0('0xf'),JSON[_0x8ad0('0x10')](_0x598c9b));if(_0x598c9b[_0x8ad0('0x11')]){if(_0x598c9b['error'][_0x8ad0('0x12')]===0x1f4){logger[_0x8ad0('0x11')](_0x8ad0('0xc'),_0xb46154,_0x598c9b[_0x8ad0('0x11')][_0x8ad0('0x13')]);return _0x45a728(_0x598c9b[_0x8ad0('0x11')][_0x8ad0('0x13')]);}logger['error'](_0x8ad0('0xc'),_0xb46154,_0x598c9b['error'][_0x8ad0('0x13')]);return _0x1e0771(_0x598c9b['error'][_0x8ad0('0x13')]);}else{logger[_0x8ad0('0xb')]('CannedAnswer,\x20%s,\x20%s',_0xb46154,_0x8ad0('0xf'));_0x1e0771(_0x598c9b['result'][_0x8ad0('0x13')]);}})[_0x8ad0('0x14')](function(_0x3692d3){logger[_0x8ad0('0x11')](_0x8ad0('0xc'),_0xb46154,_0x3692d3);_0x45a728(_0x3692d3);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 9808c62..9ce7f6c 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 _0x80d5=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x49857a,_0x2f6d60){var _0x39f0f4=function(_0x2d062a){while(--_0x2d062a){_0x49857a['push'](_0x49857a['shift']());}};_0x39f0f4(++_0x2f6d60);}(_0x80d5,0xae));var _0x580d=function(_0x31dc99,_0xad6537){_0x31dc99=_0x31dc99-0x0;var _0x33ee63=_0x80d5[_0x31dc99];return _0x33ee63;};'use strict';var multer=require(_0x580d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x580d('0x1'));var express=require(_0x580d('0x2'));var router=express[_0x580d('0x3')]();var fs_extra=require(_0x580d('0x4'));var auth=require(_0x580d('0x5'));var interaction=require(_0x580d('0x6'));var config=require(_0x580d('0x7'));var controller=require(_0x580d('0x8'));router[_0x580d('0x9')]('/',auth['isAuthenticated'](),controller[_0x580d('0xa')]);router[_0x580d('0x9')](_0x580d('0xb'),auth[_0x580d('0xc')](),controller[_0x580d('0xd')]);router[_0x580d('0xe')]('/',auth[_0x580d('0xc')](),controller['create']);router[_0x580d('0xf')](_0x580d('0xb'),auth['isAuthenticated'](),controller[_0x580d('0x10')]);router[_0x580d('0x11')](_0x580d('0xb'),auth['isAuthenticated'](),controller[_0x580d('0x12')]);module[_0x580d('0x13')]=router;
\ No newline at end of file
+var _0x36f3=['../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1ea73c,_0x33624c){var _0x55b879=function(_0x47aa84){while(--_0x47aa84){_0x1ea73c['push'](_0x1ea73c['shift']());}};_0x55b879(++_0x33624c);}(_0x36f3,0xf2));var _0x336f=function(_0x52fc4c,_0x4d5093){_0x52fc4c=_0x52fc4c-0x0;var _0x159b18=_0x36f3[_0x52fc4c];return _0x159b18;};'use strict';var multer=require(_0x336f('0x0'));var util=require(_0x336f('0x1'));var path=require(_0x336f('0x2'));var timeout=require(_0x336f('0x3'));var express=require(_0x336f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x336f('0x5'));var interaction=require(_0x336f('0x6'));var config=require('../../config/environment');var controller=require(_0x336f('0x7'));router[_0x336f('0x8')]('/',auth[_0x336f('0x9')](),controller[_0x336f('0xa')]);router[_0x336f('0x8')](_0x336f('0xb'),auth[_0x336f('0x9')](),controller[_0x336f('0xc')]);router['post']('/',auth[_0x336f('0x9')](),controller[_0x336f('0xd')]);router[_0x336f('0xe')](_0x336f('0xb'),auth[_0x336f('0x9')](),controller[_0x336f('0xf')]);router[_0x336f('0x10')](_0x336f('0xb'),auth[_0x336f('0x9')](),controller[_0x336f('0x11')]);module[_0x336f('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index b872603..5418848 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 _0x67b3=['STRING','INTEGER'];(function(_0x36a3c8,_0x538cb2){var _0x5618ad=function(_0x4a7f0e){while(--_0x4a7f0e){_0x36a3c8['push'](_0x36a3c8['shift']());}};_0x5618ad(++_0x538cb2);}(_0x67b3,0xbc));var _0x367b=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x67b3[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x367b('0x0')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x367b('0x0')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x367b('0x0')]},'dstchannel':{'type':Sequelize[_0x367b('0x0')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x367b('0x1')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x367b('0x1')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x367b('0x0')]},'amaflags':{'type':Sequelize[_0x367b('0x1')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x367b('0x0')]},'userfield':{'type':Sequelize[_0x367b('0x0')]},'uniqueid':{'type':Sequelize[_0x367b('0x0')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x367b('0x0')]},'type':{'type':Sequelize[_0x367b('0x0')]},'tag':{'type':Sequelize[_0x367b('0x0')]}};
\ No newline at end of file
+var _0x7ebd=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x2269c9,_0x296d28){var _0x5c16c3=function(_0xd35d4b){while(--_0xd35d4b){_0x2269c9['push'](_0x2269c9['shift']());}};_0x5c16c3(++_0x296d28);}(_0x7ebd,0xed));var _0xd7eb=function(_0x36b7cb,_0x5b5642){_0x36b7cb=_0x36b7cb-0x0;var _0x295514=_0x7ebd[_0x36b7cb];return _0x295514;};'use strict';var Sequelize=require(_0xd7eb('0x0'));module[_0xd7eb('0x1')]={'calldate':{'type':Sequelize[_0xd7eb('0x2')],'allowNull':![],'defaultValue':_0xd7eb('0x3')},'clid':{'type':Sequelize[_0xd7eb('0x4')]},'src':{'type':Sequelize[_0xd7eb('0x4')]},'dst':{'type':Sequelize[_0xd7eb('0x4')]},'dcontext':{'type':Sequelize[_0xd7eb('0x4')]},'channel':{'type':Sequelize[_0xd7eb('0x4')]},'dstchannel':{'type':Sequelize[_0xd7eb('0x4')]},'lastapp':{'type':Sequelize[_0xd7eb('0x4')]},'lastdata':{'type':Sequelize[_0xd7eb('0x4')]},'duration':{'type':Sequelize[_0xd7eb('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd7eb('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd7eb('0x4')]},'amaflags':{'type':Sequelize[_0xd7eb('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd7eb('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd7eb('0x4')]},'linkedid':{'type':Sequelize[_0xd7eb('0x4')]},'sequence':{'type':Sequelize[_0xd7eb('0x4')]},'peeraccount':{'type':Sequelize[_0xd7eb('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xd7eb('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 3247ee3..978b669 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 _0xab5b=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','Cdr','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xab5b,0x11a));var _0xbab5=function(_0x1bf221,_0x21940d){_0x1bf221=_0x1bf221-0x0;var _0x59c8bb=_0xab5b[_0x1bf221];return _0x59c8bb;};'use strict';var emlformat=require(_0xbab5('0x0'));var rimraf=require(_0xbab5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbab5('0x2'));var rp=require(_0xbab5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbab5('0x4'));var util=require('util');var path=require(_0xbab5('0x5'));var sox=require(_0xbab5('0x6'));var csv=require(_0xbab5('0x7'));var ejs=require(_0xbab5('0x8'));var fs=require('fs');var fs_extra=require(_0xbab5('0x9'));var _=require('lodash');var squel=require(_0xbab5('0xa'));var crypto=require(_0xbab5('0xb'));var jsforce=require(_0xbab5('0xc'));var deskjs=require(_0xbab5('0xd'));var toCsv=require(_0xbab5('0x7'));var querystring=require('querystring');var Papa=require(_0xbab5('0xe'));var Redis=require(_0xbab5('0xf'));var authService=require(_0xbab5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbab5('0x11'));var hardwareService=require(_0xbab5('0x12'));var logger=require('../../config/logger')(_0xbab5('0x13'));var utils=require(_0xbab5('0x14'));var config=require(_0xbab5('0x15'));var licenseUtil=require(_0xbab5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219f81,_0x51e348){_0x51e348=_0x51e348||0xcc;return function(_0x332b0e){if(_0x332b0e){return _0x219f81[_0xbab5('0x17')](_0x51e348);}return _0x219f81[_0xbab5('0x18')](_0x51e348)[_0xbab5('0x19')]();};}function respondWithResult(_0x40c9e1,_0x51acbc){_0x51acbc=_0x51acbc||0xc8;return function(_0x360b72){if(_0x360b72){return _0x40c9e1[_0xbab5('0x18')](_0x51acbc)[_0xbab5('0x1a')](_0x360b72);}};}function respondWithFilteredResult(_0x39e802,_0x21b818){return function(_0xea96d){if(_0xea96d){var _0xdfd788=_0xea96d[_0xbab5('0x1b')],_0x1afef5=_0x21b818[_0xbab5('0x1c')],_0x27b2fe=_0x21b818[_0xbab5('0x1c')]+_0x21b818['limit'],_0x59b10e;if(_0x27b2fe>=_0xdfd788){_0x27b2fe=_0xdfd788;_0x59b10e=0xc8;}else{_0x59b10e=0xce;}_0x39e802['status'](_0x59b10e);return _0x39e802[_0xbab5('0x1d')](_0xbab5('0x1e'),_0x1afef5+'-'+_0x27b2fe+'/'+_0xdfd788)[_0xbab5('0x1a')](_0xea96d);}return null;};}function patchUpdates(_0x1dd0b2){return function(_0x1d70a1){try{jsonpatch[_0xbab5('0x1f')](_0x1d70a1,_0x1dd0b2,!![]);}catch(_0x1dc646){return BPromise['reject'](_0x1dc646);}return _0x1d70a1[_0xbab5('0x20')]();};}function saveUpdates(_0x176be1,_0x5ebeea){return function(_0x4d0891){if(_0x4d0891){return _0x4d0891[_0xbab5('0x21')](_0x176be1)[_0xbab5('0x22')](function(_0x124e64){return _0x124e64;});}return null;};}function removeEntity(_0x33e40e,_0x24a1ff){return function(_0xbc2989){if(_0xbc2989){return _0xbc2989[_0xbab5('0x23')]()[_0xbab5('0x22')](function(){_0x33e40e[_0xbab5('0x18')](0xcc)[_0xbab5('0x19')]();});}};}function handleEntityNotFound(_0x27e76f,_0x58ba05){return function(_0x14ed3a){if(!_0x14ed3a){_0x27e76f[_0xbab5('0x17')](0x194);}return _0x14ed3a;};}function handleError(_0x1bc672,_0x14e649){_0x14e649=_0x14e649||0x1f4;return function(_0x229d82){logger['error'](_0x229d82[_0xbab5('0x24')]);if(_0x229d82[_0xbab5('0x25')]){delete _0x229d82[_0xbab5('0x25')];}_0x1bc672['status'](_0x14e649)[_0xbab5('0x26')](_0x229d82);};}exports[_0xbab5('0x27')]=function(_0x168d75,_0xaac42){var _0x194e60={},_0x1437fd={},_0x1cfd89={'count':0x0,'rows':[]};var _0x1e1b2e=_['map'](db[_0xbab5('0x28')]['rawAttributes'],function(_0x2ed82c){return{'name':_0x2ed82c[_0xbab5('0x29')],'type':_0x2ed82c['type'][_0xbab5('0x2a')]};});_0x1437fd[_0xbab5('0x2b')]=_[_0xbab5('0x2c')](_0x1e1b2e,_0xbab5('0x25'));_0x1437fd[_0xbab5('0x2d')]=_[_0xbab5('0x2e')](_0x168d75[_0xbab5('0x2d')]);_0x1437fd['filters']=_['intersection'](_0x1437fd[_0xbab5('0x2b')],_0x1437fd['query']);_0x194e60[_0xbab5('0x2f')]=_[_0xbab5('0x30')](_0x1437fd['model'],qs[_0xbab5('0x31')](_0x168d75[_0xbab5('0x2d')][_0xbab5('0x31')]));_0x194e60[_0xbab5('0x2f')]=_0x194e60[_0xbab5('0x2f')][_0xbab5('0x32')]?_0x194e60[_0xbab5('0x2f')]:_0x1437fd['model'];if(!_0x168d75[_0xbab5('0x2d')][_0xbab5('0x33')](_0xbab5('0x34'))){_0x194e60[_0xbab5('0x35')]=qs[_0xbab5('0x35')](_0x168d75[_0xbab5('0x2d')][_0xbab5('0x35')]);_0x194e60['offset']=qs[_0xbab5('0x1c')](_0x168d75[_0xbab5('0x2d')][_0xbab5('0x1c')]);}_0x194e60['order']=qs[_0xbab5('0x36')](_0x168d75[_0xbab5('0x2d')]['sort']);_0x194e60[_0xbab5('0x37')]=qs[_0xbab5('0x38')](_[_0xbab5('0x39')](_0x168d75[_0xbab5('0x2d')],_0x1437fd[_0xbab5('0x38')]),_0x1e1b2e);if(_0x168d75[_0xbab5('0x2d')][_0xbab5('0x3a')]){_0x194e60[_0xbab5('0x37')]=_[_0xbab5('0x3b')](_0x194e60[_0xbab5('0x37')],{'$or':_[_0xbab5('0x2c')](_0x1e1b2e,function(_0x16ec7a){if(_0x16ec7a[_0xbab5('0x3c')]!==_0xbab5('0x3d')){var _0x17d4fc={};_0x17d4fc[_0x16ec7a[_0xbab5('0x25')]]={'$like':'%'+_0x168d75['query'][_0xbab5('0x3a')]+'%'};return _0x17d4fc;}})});}_0x194e60=_['merge']({},_0x194e60,_0x168d75[_0xbab5('0x3e')]);var _0x4dd39b={'where':_0x194e60['where']};return db[_0xbab5('0x28')][_0xbab5('0x1b')](_0x4dd39b)[_0xbab5('0x22')](function(_0x5eaeb4){_0x1cfd89[_0xbab5('0x1b')]=_0x5eaeb4;if(_0x168d75['query'][_0xbab5('0x3f')]){_0x194e60[_0xbab5('0x40')]=[{'all':!![]}];}return db[_0xbab5('0x28')]['findAll'](_0x194e60);})[_0xbab5('0x22')](function(_0x489c8f){_0x1cfd89[_0xbab5('0x41')]=_0x489c8f;return _0x1cfd89;})[_0xbab5('0x22')](respondWithFilteredResult(_0xaac42,_0x194e60))[_0xbab5('0x42')](handleError(_0xaac42,null));};exports[_0xbab5('0x43')]=function(_0x4ce5be,_0x40505f){var _0x36bcaf={'raw':!![],'where':{'id':_0x4ce5be[_0xbab5('0x44')]['id']}},_0x508e61={};_0x508e61[_0xbab5('0x2b')]=_[_0xbab5('0x2e')](db[_0xbab5('0x28')][_0xbab5('0x45')]);_0x508e61[_0xbab5('0x2d')]=_[_0xbab5('0x2e')](_0x4ce5be[_0xbab5('0x2d')]);_0x508e61[_0xbab5('0x38')]=_['intersection'](_0x508e61[_0xbab5('0x2b')],_0x508e61[_0xbab5('0x2d')]);_0x36bcaf[_0xbab5('0x2f')]=_[_0xbab5('0x30')](_0x508e61[_0xbab5('0x2b')],qs[_0xbab5('0x31')](_0x4ce5be[_0xbab5('0x2d')][_0xbab5('0x31')]));_0x36bcaf[_0xbab5('0x2f')]=_0x36bcaf[_0xbab5('0x2f')]['length']?_0x36bcaf[_0xbab5('0x2f')]:_0x508e61['model'];if(_0x4ce5be[_0xbab5('0x2d')]['includeAll']){_0x36bcaf[_0xbab5('0x40')]=[{'all':!![]}];}_0x36bcaf=_[_0xbab5('0x3b')]({},_0x36bcaf,_0x4ce5be[_0xbab5('0x3e')]);return db[_0xbab5('0x28')]['find'](_0x36bcaf)['then'](handleEntityNotFound(_0x40505f,null))[_0xbab5('0x22')](respondWithResult(_0x40505f,null))[_0xbab5('0x42')](handleError(_0x40505f,null));};exports[_0xbab5('0x46')]=function(_0x43d630,_0x126455){return db[_0xbab5('0x28')]['create'](_0x43d630[_0xbab5('0x47')],{})[_0xbab5('0x22')](respondWithResult(_0x126455,0xc9))[_0xbab5('0x42')](handleError(_0x126455,null));};exports['update']=function(_0x24aa49,_0x351b9d){if(_0x24aa49[_0xbab5('0x47')]['id']){delete _0x24aa49[_0xbab5('0x47')]['id'];}return db[_0xbab5('0x28')][_0xbab5('0x48')]({'where':{'id':_0x24aa49[_0xbab5('0x44')]['id']}})[_0xbab5('0x22')](handleEntityNotFound(_0x351b9d,null))[_0xbab5('0x22')](saveUpdates(_0x24aa49['body'],null))[_0xbab5('0x22')](respondWithResult(_0x351b9d,null))['catch'](handleError(_0x351b9d,null));};exports[_0xbab5('0x23')]=function(_0x47446b,_0x246b7a){return db[_0xbab5('0x28')][_0xbab5('0x48')]({'where':{'id':_0x47446b[_0xbab5('0x44')]['id']}})[_0xbab5('0x22')](handleEntityNotFound(_0x246b7a,null))['then'](removeEntity(_0x246b7a,null))[_0xbab5('0x42')](handleError(_0x246b7a,null));};exports['describe']=function(_0xa1b143,_0x1e68a7){return db['Cdr'][_0xbab5('0x49')]()[_0xbab5('0x22')](respondWithResult(_0x1e68a7,null))['catch'](handleError(_0x1e68a7,null));};
\ No newline at end of file
+var _0xc73e=['includeAll','include','create','body','params','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','Cdr','rows','catch','show'];(function(_0x147e56,_0x2efae8){var _0x40c49c=function(_0x380aaa){while(--_0x380aaa){_0x147e56['push'](_0x147e56['shift']());}};_0x40c49c(++_0x2efae8);}(_0xc73e,0x1e9));var _0xec73=function(_0x81c2a8,_0x467017){_0x81c2a8=_0x81c2a8-0x0;var _0x72c044=_0xc73e[_0x81c2a8];return _0x72c044;};'use strict';var emlformat=require(_0xec73('0x0'));var rimraf=require(_0xec73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec73('0x2'));var rp=require(_0xec73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec73('0x4'));var path=require(_0xec73('0x5'));var sox=require('sox');var csv=require(_0xec73('0x6'));var ejs=require(_0xec73('0x7'));var fs=require('fs');var fs_extra=require(_0xec73('0x8'));var _=require(_0xec73('0x9'));var squel=require('squel');var crypto=require(_0xec73('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xec73('0xb'));var toCsv=require(_0xec73('0x6'));var querystring=require(_0xec73('0xc'));var Papa=require(_0xec73('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec73('0xe'));var as=require(_0xec73('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xec73('0x10'));var utils=require(_0xec73('0x11'));var config=require(_0xec73('0x12'));var licenseUtil=require(_0xec73('0x13'));var db=require(_0xec73('0x14'))['db'];function respondWithStatusCode(_0x19d0f2,_0x1e67ac){_0x1e67ac=_0x1e67ac||0xcc;return function(_0x5f5594){if(_0x5f5594){return _0x19d0f2[_0xec73('0x15')](_0x1e67ac);}return _0x19d0f2['status'](_0x1e67ac)[_0xec73('0x16')]();};}function respondWithResult(_0x4be73c,_0x10f003){_0x10f003=_0x10f003||0xc8;return function(_0x1e4869){if(_0x1e4869){return _0x4be73c[_0xec73('0x17')](_0x10f003)[_0xec73('0x18')](_0x1e4869);}};}function respondWithFilteredResult(_0x3690c3,_0x2a3296){return function(_0x35be28){if(_0x35be28){var _0x2b4e70=_0x35be28[_0xec73('0x19')],_0x5de659=_0x2a3296[_0xec73('0x1a')],_0x308eb4=_0x2a3296[_0xec73('0x1a')]+_0x2a3296[_0xec73('0x1b')],_0x418770;if(_0x308eb4>=_0x2b4e70){_0x308eb4=_0x2b4e70;_0x418770=0xc8;}else{_0x418770=0xce;}_0x3690c3['status'](_0x418770);return _0x3690c3[_0xec73('0x1c')](_0xec73('0x1d'),_0x5de659+'-'+_0x308eb4+'/'+_0x2b4e70)[_0xec73('0x18')](_0x35be28);}return null;};}function patchUpdates(_0x506772){return function(_0x57ac66){try{jsonpatch[_0xec73('0x1e')](_0x57ac66,_0x506772,!![]);}catch(_0x32899b){return BPromise[_0xec73('0x1f')](_0x32899b);}return _0x57ac66[_0xec73('0x20')]();};}function saveUpdates(_0x1169c4,_0x5d4c7c){return function(_0x519813){if(_0x519813){return _0x519813[_0xec73('0x21')](_0x1169c4)[_0xec73('0x22')](function(_0x30c236){return _0x30c236;});}return null;};}function removeEntity(_0x60bfec,_0x451715){return function(_0x4a862b){if(_0x4a862b){return _0x4a862b[_0xec73('0x23')]()['then'](function(){_0x60bfec[_0xec73('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4df08e,_0x490ee2){return function(_0x12b865){if(!_0x12b865){_0x4df08e[_0xec73('0x15')](0x194);}return _0x12b865;};}function handleError(_0x2caf6b,_0xffc1af){_0xffc1af=_0xffc1af||0x1f4;return function(_0x3df864){logger['error'](_0x3df864['stack']);if(_0x3df864[_0xec73('0x24')]){delete _0x3df864[_0xec73('0x24')];}_0x2caf6b['status'](_0xffc1af)[_0xec73('0x25')](_0x3df864);};}exports[_0xec73('0x26')]=function(_0x3bf259,_0x4dc430){var _0x23ff51={},_0x2e671c={},_0x370e7a={'count':0x0,'rows':[]};var _0x28361e=_['map'](db['Cdr'][_0xec73('0x27')],function(_0x2af2db){return{'name':_0x2af2db[_0xec73('0x28')],'type':_0x2af2db[_0xec73('0x29')]['key']};});_0x2e671c[_0xec73('0x2a')]=_[_0xec73('0x2b')](_0x28361e,_0xec73('0x24'));_0x2e671c[_0xec73('0x2c')]=_[_0xec73('0x2d')](_0x3bf259[_0xec73('0x2c')]);_0x2e671c['filters']=_[_0xec73('0x2e')](_0x2e671c[_0xec73('0x2a')],_0x2e671c[_0xec73('0x2c')]);_0x23ff51[_0xec73('0x2f')]=_[_0xec73('0x2e')](_0x2e671c[_0xec73('0x2a')],qs['fields'](_0x3bf259[_0xec73('0x2c')][_0xec73('0x30')]));_0x23ff51[_0xec73('0x2f')]=_0x23ff51[_0xec73('0x2f')][_0xec73('0x31')]?_0x23ff51[_0xec73('0x2f')]:_0x2e671c[_0xec73('0x2a')];if(!_0x3bf259['query'][_0xec73('0x32')]('nolimit')){_0x23ff51[_0xec73('0x1b')]=qs[_0xec73('0x1b')](_0x3bf259[_0xec73('0x2c')][_0xec73('0x1b')]);_0x23ff51[_0xec73('0x1a')]=qs[_0xec73('0x1a')](_0x3bf259[_0xec73('0x2c')][_0xec73('0x1a')]);}_0x23ff51[_0xec73('0x33')]=qs['sort'](_0x3bf259['query'][_0xec73('0x34')]);_0x23ff51[_0xec73('0x35')]=qs[_0xec73('0x36')](_[_0xec73('0x37')](_0x3bf259[_0xec73('0x2c')],_0x2e671c[_0xec73('0x36')]),_0x28361e);if(_0x3bf259[_0xec73('0x2c')][_0xec73('0x38')]){_0x23ff51['where']=_[_0xec73('0x39')](_0x23ff51[_0xec73('0x35')],{'$or':_[_0xec73('0x2b')](_0x28361e,function(_0x56c0d4){if(_0x56c0d4['type']!=='VIRTUAL'){var _0x174f05={};_0x174f05[_0x56c0d4['name']]={'$like':'%'+_0x3bf259[_0xec73('0x2c')]['filter']+'%'};return _0x174f05;}})});}_0x23ff51=_['merge']({},_0x23ff51,_0x3bf259[_0xec73('0x3a')]);var _0x59cceb={'where':_0x23ff51[_0xec73('0x35')]};return db['Cdr'][_0xec73('0x19')](_0x59cceb)['then'](function(_0x3a971e){_0x370e7a[_0xec73('0x19')]=_0x3a971e;if(_0x3bf259['query']['includeAll']){_0x23ff51['include']=[{'all':!![]}];}return db[_0xec73('0x3b')]['findAll'](_0x23ff51);})[_0xec73('0x22')](function(_0x10e388){_0x370e7a[_0xec73('0x3c')]=_0x10e388;return _0x370e7a;})['then'](respondWithFilteredResult(_0x4dc430,_0x23ff51))[_0xec73('0x3d')](handleError(_0x4dc430,null));};exports[_0xec73('0x3e')]=function(_0x12bb46,_0x1c5e2b){var _0x1b7b30={'raw':!![],'where':{'id':_0x12bb46['params']['id']}},_0x4f65d4={};_0x4f65d4[_0xec73('0x2a')]=_[_0xec73('0x2d')](db[_0xec73('0x3b')][_0xec73('0x27')]);_0x4f65d4[_0xec73('0x2c')]=_[_0xec73('0x2d')](_0x12bb46[_0xec73('0x2c')]);_0x4f65d4[_0xec73('0x36')]=_[_0xec73('0x2e')](_0x4f65d4[_0xec73('0x2a')],_0x4f65d4[_0xec73('0x2c')]);_0x1b7b30[_0xec73('0x2f')]=_[_0xec73('0x2e')](_0x4f65d4[_0xec73('0x2a')],qs['fields'](_0x12bb46['query'][_0xec73('0x30')]));_0x1b7b30[_0xec73('0x2f')]=_0x1b7b30[_0xec73('0x2f')][_0xec73('0x31')]?_0x1b7b30[_0xec73('0x2f')]:_0x4f65d4[_0xec73('0x2a')];if(_0x12bb46[_0xec73('0x2c')][_0xec73('0x3f')]){_0x1b7b30[_0xec73('0x40')]=[{'all':!![]}];}_0x1b7b30=_['merge']({},_0x1b7b30,_0x12bb46['options']);return db[_0xec73('0x3b')]['find'](_0x1b7b30)[_0xec73('0x22')](handleEntityNotFound(_0x1c5e2b,null))['then'](respondWithResult(_0x1c5e2b,null))[_0xec73('0x3d')](handleError(_0x1c5e2b,null));};exports[_0xec73('0x41')]=function(_0x30feaf,_0x21174b){return db[_0xec73('0x3b')]['create'](_0x30feaf[_0xec73('0x42')],{})[_0xec73('0x22')](respondWithResult(_0x21174b,0xc9))['catch'](handleError(_0x21174b,null));};exports[_0xec73('0x21')]=function(_0x290938,_0x44a5ef){if(_0x290938[_0xec73('0x42')]['id']){delete _0x290938[_0xec73('0x42')]['id'];}return db['Cdr']['find']({'where':{'id':_0x290938[_0xec73('0x43')]['id']}})[_0xec73('0x22')](handleEntityNotFound(_0x44a5ef,null))[_0xec73('0x22')](saveUpdates(_0x290938['body'],null))[_0xec73('0x22')](respondWithResult(_0x44a5ef,null))['catch'](handleError(_0x44a5ef,null));};exports[_0xec73('0x23')]=function(_0x990149,_0x101c94){return db[_0xec73('0x3b')][_0xec73('0x44')]({'where':{'id':_0x990149[_0xec73('0x43')]['id']}})['then'](handleEntityNotFound(_0x101c94,null))['then'](removeEntity(_0x101c94,null))[_0xec73('0x3d')](handleError(_0x101c94,null));};exports['describe']=function(_0x3d7d1a,_0xde7373){return db[_0xec73('0x3b')]['describe']()[_0xec73('0x22')](respondWithResult(_0xde7373,null))[_0xec73('0x3d')](handleError(_0xde7373,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 3c3740f..cb9bd28 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 _0x1261=['src','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','define','cdr','accountcode','calldate','disposition','dst'];(function(_0x295a3d,_0x56d487){var _0x23a732=function(_0x15cfc2){while(--_0x15cfc2){_0x295a3d['push'](_0x295a3d['shift']());}};_0x23a732(++_0x56d487);}(_0x1261,0x144));var _0x1126=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x1261[_0x4bd06e];return _0x85ebb;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('Cdr',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]},{'name':_0x1126('0xd'),'fields':[_0x1126('0xd')]},{'name':'disposition','fields':[_0x1126('0xe')]},{'name':_0x1126('0xf'),'fields':[_0x1126('0xf')]},{'name':'src','fields':[_0x1126('0x10')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
+var _0x7880=['accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0x20a68a,_0x54502e){var _0x56c5d4=function(_0x4ace56){while(--_0x4ace56){_0x20a68a['push'](_0x20a68a['shift']());}};_0x56c5d4(++_0x54502e);}(_0x7880,0x1f4));var _0x0788=function(_0xca1091,_0x539dbf){_0xca1091=_0xca1091-0x0;var _0xd3019c=_0x7880[_0xca1091];return _0xd3019c;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));module[_0x0788('0x9')]=function(_0x262f5c,_0x775629){return _0x262f5c[_0x0788('0xa')](_0x0788('0xb'),attributes,{'tableName':_0x0788('0xc'),'paranoid':![],'indexes':[{'name':_0x0788('0xd'),'fields':['accountcode']},{'name':_0x0788('0xe'),'fields':['calldate']},{'name':_0x0788('0xf'),'fields':['disposition']},{'name':_0x0788('0x10'),'fields':[_0x0788('0x10')]},{'name':_0x0788('0x11'),'fields':[_0x0788('0x11')]},{'name':_0x0788('0x12'),'fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 9bf56e1..41b4f1a 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 _0xc59b=['stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xc59b,0x131));var _0xbc59=function(_0x2d4310,_0x2c4294){_0x2d4310=_0x2d4310-0x0;var _0x52099f=_0xc59b[_0x2d4310];return _0x52099f;};'use strict';var _=require(_0xbc59('0x0'));var util=require(_0xbc59('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc59('0x2'));var fs=require('fs');var Redis=require(_0xbc59('0x3'));var db=require(_0xbc59('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbc59('0x5'));var config=require(_0xbc59('0x6'));var jayson=require(_0xbc59('0x7'));var client=jayson[_0xbc59('0x8')][_0xbc59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f258e,_0x3a2593,_0x20564a){return new BPromise(function(_0x527423,_0x705cbf){return client[_0xbc59('0xa')](_0x2f258e,_0x20564a)['then'](function(_0xdf4b8b){logger[_0xbc59('0xb')](_0xbc59('0xc'),_0x3a2593,_0xbc59('0xd'));logger[_0xbc59('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x3a2593,_0xbc59('0xd'),JSON[_0xbc59('0xf')](_0xdf4b8b));if(_0xdf4b8b[_0xbc59('0x10')]){if(_0xdf4b8b[_0xbc59('0x10')]['code']===0x1f4){logger[_0xbc59('0x10')]('Cdr,\x20%s,\x20%s',_0x3a2593,_0xdf4b8b[_0xbc59('0x10')]['message']);return _0x705cbf(_0xdf4b8b[_0xbc59('0x10')][_0xbc59('0x11')]);}logger[_0xbc59('0x10')](_0xbc59('0xc'),_0x3a2593,_0xdf4b8b['error'][_0xbc59('0x11')]);return _0x527423(_0xdf4b8b[_0xbc59('0x10')][_0xbc59('0x11')]);}else{logger[_0xbc59('0xb')](_0xbc59('0xc'),_0x3a2593,_0xbc59('0xd'));_0x527423(_0xdf4b8b[_0xbc59('0x12')]['message']);}})[_0xbc59('0x13')](function(_0x556400){logger['error']('Cdr,\x20%s,\x20%s',_0x3a2593,_0x556400);_0x705cbf(_0x556400);});});}
\ No newline at end of file
+var _0xcfe8=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','lodash','util','moment','bluebird'];(function(_0x58ccaf,_0x55b8b6){var _0x32d94c=function(_0x22cc71){while(--_0x22cc71){_0x58ccaf['push'](_0x58ccaf['shift']());}};_0x32d94c(++_0x55b8b6);}(_0xcfe8,0x65));var _0x8cfe=function(_0x5ab374,_0x41bd90){_0x5ab374=_0x5ab374-0x0;var _0x4fb419=_0xcfe8[_0x5ab374];return _0x4fb419;};'use strict';var _=require(_0x8cfe('0x0'));var util=require(_0x8cfe('0x1'));var moment=require(_0x8cfe('0x2'));var BPromise=require(_0x8cfe('0x3'));var rs=require(_0x8cfe('0x4'));var fs=require('fs');var Redis=require(_0x8cfe('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cfe('0x6'));var logger=require(_0x8cfe('0x7'))(_0x8cfe('0x8'));var config=require('../../config/environment');var jayson=require(_0x8cfe('0x9'));var client=jayson[_0x8cfe('0xa')][_0x8cfe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44e5e8,_0x545e42,_0x3eb913){return new BPromise(function(_0x1b34d2,_0x40b535){return client[_0x8cfe('0xc')](_0x44e5e8,_0x3eb913)['then'](function(_0xb5b086){logger['info'](_0x8cfe('0xd'),_0x545e42,_0x8cfe('0xe'));logger[_0x8cfe('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x545e42,'request\x20sent',JSON[_0x8cfe('0x10')](_0xb5b086));if(_0xb5b086[_0x8cfe('0x11')]){if(_0xb5b086[_0x8cfe('0x11')]['code']===0x1f4){logger[_0x8cfe('0x11')](_0x8cfe('0xd'),_0x545e42,_0xb5b086[_0x8cfe('0x11')]['message']);return _0x40b535(_0xb5b086[_0x8cfe('0x11')][_0x8cfe('0x12')]);}logger[_0x8cfe('0x11')](_0x8cfe('0xd'),_0x545e42,_0xb5b086[_0x8cfe('0x11')]['message']);return _0x1b34d2(_0xb5b086['error'][_0x8cfe('0x12')]);}else{logger[_0x8cfe('0x13')](_0x8cfe('0xd'),_0x545e42,_0x8cfe('0xe'));_0x1b34d2(_0xb5b086['result'][_0x8cfe('0x12')]);}})[_0x8cfe('0x14')](function(_0x372ba6){logger['error'](_0x8cfe('0xd'),_0x545e42,_0x372ba6);_0x40b535(_0x372ba6);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index b77d501..9d20854 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 _0x69d7=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cdr.controller','get','isAuthenticated'];(function(_0x5779be,_0x52d30d){var _0x28e499=function(_0x3e0aab){while(--_0x3e0aab){_0x5779be['push'](_0x5779be['shift']());}};_0x28e499(++_0x52d30d);}(_0x69d7,0x14e));var _0x769d=function(_0x18b1c8,_0x4205e2){_0x18b1c8=_0x18b1c8-0x0;var _0x484756=_0x69d7[_0x18b1c8];return _0x484756;};'use strict';var multer=require(_0x769d('0x0'));var util=require(_0x769d('0x1'));var path=require(_0x769d('0x2'));var timeout=require(_0x769d('0x3'));var express=require('express');var router=express[_0x769d('0x4')]();var fs_extra=require(_0x769d('0x5'));var auth=require(_0x769d('0x6'));var interaction=require(_0x769d('0x7'));var config=require('../../config/environment');var controller=require(_0x769d('0x8'));router[_0x769d('0x9')]('/',auth[_0x769d('0xa')](),controller[_0x769d('0xb')]);router[_0x769d('0x9')](_0x769d('0xc'),auth[_0x769d('0xa')](),controller[_0x769d('0xd')]);router[_0x769d('0x9')](_0x769d('0xe'),auth[_0x769d('0xa')](),controller[_0x769d('0xf')]);router[_0x769d('0x10')]('/',auth[_0x769d('0xa')](),controller[_0x769d('0x11')]);router[_0x769d('0x12')](_0x769d('0xe'),auth[_0x769d('0xa')](),controller[_0x769d('0x13')]);router[_0x769d('0x14')]('/:id',auth[_0x769d('0xa')](),controller[_0x769d('0x15')]);module[_0x769d('0x16')]=router;
\ No newline at end of file
+var _0xccc4=['put','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cdr.controller','isAuthenticated','index','get','describe','/:id','post','create'];(function(_0x23fcde,_0x300120){var _0x242954=function(_0x141ed5){while(--_0x141ed5){_0x23fcde['push'](_0x23fcde['shift']());}};_0x242954(++_0x300120);}(_0xccc4,0x9b));var _0x4ccc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xccc4[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x4ccc('0x0'));var util=require(_0x4ccc('0x1'));var path=require('path');var timeout=require(_0x4ccc('0x2'));var express=require('express');var router=express[_0x4ccc('0x3')]();var fs_extra=require(_0x4ccc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4ccc('0x5'));var config=require(_0x4ccc('0x6'));var controller=require(_0x4ccc('0x7'));router['get']('/',auth[_0x4ccc('0x8')](),controller[_0x4ccc('0x9')]);router[_0x4ccc('0xa')]('/describe',auth[_0x4ccc('0x8')](),controller[_0x4ccc('0xb')]);router['get'](_0x4ccc('0xc'),auth[_0x4ccc('0x8')](),controller['show']);router[_0x4ccc('0xd')]('/',auth['isAuthenticated'](),controller[_0x4ccc('0xe')]);router[_0x4ccc('0xf')](_0x4ccc('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x4ccc('0xc'),auth[_0x4ccc('0x8')](),controller['destroy']);module[_0x4ccc('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 1c46800..9e857c7 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 _0x78ee=['sequelize','exports','noop','TEXT','STRING','*,*,*,*'];(function(_0x18b6a6,_0xe0ee41){var _0x109350=function(_0x5dac09){while(--_0x5dac09){_0x18b6a6['push'](_0x18b6a6['shift']());}};_0x109350(++_0xe0ee41);}(_0x78ee,0x1ec));var _0xe78e=function(_0x47280a,_0x541f81){_0x47280a=_0x47280a-0x0;var _0x1c893c=_0x78ee[_0x47280a];return _0x1c893c;};'use strict';var Sequelize=require(_0xe78e('0x0'));module[_0xe78e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe78e('0x2')},'appdata':{'type':Sequelize[_0xe78e('0x3')]()},'description':{'type':Sequelize[_0xe78e('0x4')]},'interval':{'type':Sequelize[_0xe78e('0x4')],'defaultValue':_0xe78e('0x5')}};
\ No newline at end of file
+var _0x95c2=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x201817,_0x5e8cd6){var _0x20a5e2=function(_0xb6fb2c){while(--_0xb6fb2c){_0x201817['push'](_0x201817['shift']());}};_0x20a5e2(++_0x5e8cd6);}(_0x95c2,0x1bc));var _0x295c=function(_0x17c870,_0x44538d){_0x17c870=_0x17c870-0x0;var _0x329b96=_0x95c2[_0x17c870];return _0x329b96;};'use strict';var Sequelize=require(_0x295c('0x0'));module[_0x295c('0x1')]={'priority':{'type':Sequelize[_0x295c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x295c('0x3')},'appdata':{'type':Sequelize[_0x295c('0x4')]()},'description':{'type':Sequelize[_0x295c('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x295c('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index b62c5ce..9acae41 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 _0x1295=['save','update','then','destroy','error','stack','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','include','body','catch','find','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','apply','reject'];(function(_0x30c7c5,_0x168208){var _0x29e24e=function(_0x427d3e){while(--_0x427d3e){_0x30c7c5['push'](_0x30c7c5['shift']());}};_0x29e24e(++_0x168208);}(_0x1295,0x191));var _0x5129=function(_0x42b005,_0x58973a){_0x42b005=_0x42b005-0x0;var _0x33f71b=_0x1295[_0x42b005];return _0x33f71b;};'use strict';var emlformat=require(_0x5129('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5129('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5129('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5129('0x3'));var util=require(_0x5129('0x4'));var path=require(_0x5129('0x5'));var sox=require(_0x5129('0x6'));var csv=require(_0x5129('0x7'));var ejs=require(_0x5129('0x8'));var fs=require('fs');var fs_extra=require(_0x5129('0x9'));var _=require(_0x5129('0xa'));var squel=require(_0x5129('0xb'));var crypto=require(_0x5129('0xc'));var jsforce=require(_0x5129('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5129('0xe'));var Papa=require(_0x5129('0xf'));var Redis=require(_0x5129('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5129('0x11'));var as=require(_0x5129('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5129('0x13'))(_0x5129('0x14'));var utils=require(_0x5129('0x15'));var config=require(_0x5129('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5129('0x17'))['db'];function respondWithStatusCode(_0xcb11c6,_0x350507){_0x350507=_0x350507||0xcc;return function(_0x2774bf){if(_0x2774bf){return _0xcb11c6[_0x5129('0x18')](_0x350507);}return _0xcb11c6[_0x5129('0x19')](_0x350507)[_0x5129('0x1a')]();};}function respondWithResult(_0x23457f,_0x5e9a46){_0x5e9a46=_0x5e9a46||0xc8;return function(_0x2b9d65){if(_0x2b9d65){return _0x23457f[_0x5129('0x19')](_0x5e9a46)['json'](_0x2b9d65);}};}function respondWithFilteredResult(_0x1a6dd8,_0x2fefda){return function(_0xb47643){if(_0xb47643){var _0x36a5c6=_0xb47643['count'],_0x183807=_0x2fefda[_0x5129('0x1b')],_0x10a38f=_0x2fefda['offset']+_0x2fefda['limit'],_0x3f98d1;if(_0x10a38f>=_0x36a5c6){_0x10a38f=_0x36a5c6;_0x3f98d1=0xc8;}else{_0x3f98d1=0xce;}_0x1a6dd8[_0x5129('0x19')](_0x3f98d1);return _0x1a6dd8[_0x5129('0x1c')]('Content-Range',_0x183807+'-'+_0x10a38f+'/'+_0x36a5c6)['json'](_0xb47643);}return null;};}function patchUpdates(_0x4b50fe){return function(_0x1288d5){try{jsonpatch[_0x5129('0x1d')](_0x1288d5,_0x4b50fe,!![]);}catch(_0x1999df){return BPromise[_0x5129('0x1e')](_0x1999df);}return _0x1288d5[_0x5129('0x1f')]();};}function saveUpdates(_0x272202,_0x32a0be){return function(_0x139e71){if(_0x139e71){return _0x139e71[_0x5129('0x20')](_0x272202)[_0x5129('0x21')](function(_0x3fc4d8){return _0x3fc4d8;});}return null;};}function removeEntity(_0x191e6f,_0x295c11){return function(_0x210f1d){if(_0x210f1d){return _0x210f1d[_0x5129('0x22')]()[_0x5129('0x21')](function(){_0x191e6f['status'](0xcc)[_0x5129('0x1a')]();});}};}function handleEntityNotFound(_0x3f54b9,_0x2f1114){return function(_0x31f59b){if(!_0x31f59b){_0x3f54b9['sendStatus'](0x194);}return _0x31f59b;};}function handleError(_0x181fb9,_0x2e64e4){_0x2e64e4=_0x2e64e4||0x1f4;return function(_0x1b2509){logger[_0x5129('0x23')](_0x1b2509[_0x5129('0x24')]);if(_0x1b2509['name']){delete _0x1b2509['name'];}_0x181fb9[_0x5129('0x19')](_0x2e64e4)[_0x5129('0x25')](_0x1b2509);};}exports[_0x5129('0x26')]=function(_0x317c9d,_0x3e87df){var _0x2db994={'raw':!![],'where':{'id':_0x317c9d[_0x5129('0x27')]['id']}},_0x179021={};_0x179021['model']=_[_0x5129('0x28')](db[_0x5129('0x29')][_0x5129('0x2a')]);_0x179021['query']=_[_0x5129('0x28')](_0x317c9d[_0x5129('0x2b')]);_0x179021[_0x5129('0x2c')]=_[_0x5129('0x2d')](_0x179021[_0x5129('0x2e')],_0x179021[_0x5129('0x2b')]);_0x2db994[_0x5129('0x2f')]=_[_0x5129('0x2d')](_0x179021[_0x5129('0x2e')],qs[_0x5129('0x30')](_0x317c9d[_0x5129('0x2b')][_0x5129('0x30')]));_0x2db994['attributes']=_0x2db994[_0x5129('0x2f')]['length']?_0x2db994[_0x5129('0x2f')]:_0x179021[_0x5129('0x2e')];if(_0x317c9d['query'][_0x5129('0x31')]){_0x2db994[_0x5129('0x32')]=[{'all':!![]}];}_0x2db994=_['merge']({},_0x2db994,_0x317c9d['options']);return db[_0x5129('0x29')]['find'](_0x2db994)[_0x5129('0x21')](handleEntityNotFound(_0x3e87df,null))[_0x5129('0x21')](respondWithResult(_0x3e87df,null))['catch'](handleError(_0x3e87df,null));};exports[_0x5129('0x20')]=function(_0x169053,_0x47d852){if(_0x169053['body']['id']){delete _0x169053[_0x5129('0x33')]['id'];}return db[_0x5129('0x29')]['find']({'where':{'id':_0x169053[_0x5129('0x27')]['id']}})[_0x5129('0x21')](handleEntityNotFound(_0x47d852,null))[_0x5129('0x21')](saveUpdates(_0x169053['body'],null))[_0x5129('0x21')](respondWithResult(_0x47d852,null))[_0x5129('0x34')](handleError(_0x47d852,null));};exports[_0x5129('0x22')]=function(_0x30eea4,_0x1c1f53){return db['ChatApplication'][_0x5129('0x35')]({'where':{'id':_0x30eea4['params']['id']}})[_0x5129('0x21')](handleEntityNotFound(_0x1c1f53,null))[_0x5129('0x21')](removeEntity(_0x1c1f53,null))[_0x5129('0x34')](handleError(_0x1c1f53,null));};
\ No newline at end of file
+var _0xb689=['fs-extra','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','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','show','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','options','catch','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x23672f,_0x1a829e){var _0x245ad4=function(_0x381fee){while(--_0x381fee){_0x23672f['push'](_0x23672f['shift']());}};_0x245ad4(++_0x1a829e);}(_0xb689,0x6f));var _0x9b68=function(_0x4e7103,_0x2833f4){_0x4e7103=_0x4e7103-0x0;var _0x1eb67a=_0xb689[_0x4e7103];return _0x1eb67a;};'use strict';var emlformat=require(_0x9b68('0x0'));var rimraf=require(_0x9b68('0x1'));var zipdir=require(_0x9b68('0x2'));var jsonpatch=require(_0x9b68('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9b68('0x4'));var Mustache=require(_0x9b68('0x5'));var util=require(_0x9b68('0x6'));var path=require(_0x9b68('0x7'));var sox=require(_0x9b68('0x8'));var csv=require(_0x9b68('0x9'));var ejs=require(_0x9b68('0xa'));var fs=require('fs');var fs_extra=require(_0x9b68('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b68('0xc'));var jsforce=require(_0x9b68('0xd'));var deskjs=require(_0x9b68('0xe'));var toCsv=require(_0x9b68('0x9'));var querystring=require(_0x9b68('0xf'));var Papa=require(_0x9b68('0x10'));var Redis=require(_0x9b68('0x11'));var authService=require(_0x9b68('0x12'));var qs=require(_0x9b68('0x13'));var as=require(_0x9b68('0x14'));var hardwareService=require(_0x9b68('0x15'));var logger=require(_0x9b68('0x16'))(_0x9b68('0x17'));var utils=require(_0x9b68('0x18'));var config=require(_0x9b68('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9b68('0x1a'))['db'];function respondWithStatusCode(_0x3c5b2e,_0x55d3d0){_0x55d3d0=_0x55d3d0||0xcc;return function(_0x5af163){if(_0x5af163){return _0x3c5b2e['sendStatus'](_0x55d3d0);}return _0x3c5b2e[_0x9b68('0x1b')](_0x55d3d0)['end']();};}function respondWithResult(_0x4b63e7,_0x477954){_0x477954=_0x477954||0xc8;return function(_0x59c753){if(_0x59c753){return _0x4b63e7[_0x9b68('0x1b')](_0x477954)['json'](_0x59c753);}};}function respondWithFilteredResult(_0x1485a3,_0x15fabf){return function(_0x31b0f4){if(_0x31b0f4){var _0x4adac2=_0x31b0f4[_0x9b68('0x1c')],_0x10612d=_0x15fabf['offset'],_0x565ed8=_0x15fabf[_0x9b68('0x1d')]+_0x15fabf[_0x9b68('0x1e')],_0x1c4b81;if(_0x565ed8>=_0x4adac2){_0x565ed8=_0x4adac2;_0x1c4b81=0xc8;}else{_0x1c4b81=0xce;}_0x1485a3[_0x9b68('0x1b')](_0x1c4b81);return _0x1485a3[_0x9b68('0x1f')](_0x9b68('0x20'),_0x10612d+'-'+_0x565ed8+'/'+_0x4adac2)[_0x9b68('0x21')](_0x31b0f4);}return null;};}function patchUpdates(_0x5c3dea){return function(_0x159c44){try{jsonpatch[_0x9b68('0x22')](_0x159c44,_0x5c3dea,!![]);}catch(_0x1bdb41){return BPromise[_0x9b68('0x23')](_0x1bdb41);}return _0x159c44[_0x9b68('0x24')]();};}function saveUpdates(_0x1607e2,_0x14165e){return function(_0x314103){if(_0x314103){return _0x314103[_0x9b68('0x25')](_0x1607e2)[_0x9b68('0x26')](function(_0x5ed449){return _0x5ed449;});}return null;};}function removeEntity(_0x380ea4,_0x217f19){return function(_0xab9dad){if(_0xab9dad){return _0xab9dad['destroy']()[_0x9b68('0x26')](function(){_0x380ea4[_0x9b68('0x1b')](0xcc)[_0x9b68('0x27')]();});}};}function handleEntityNotFound(_0x571f4f,_0x57420f){return function(_0x4a60ed){if(!_0x4a60ed){_0x571f4f['sendStatus'](0x194);}return _0x4a60ed;};}function handleError(_0x5772ad,_0x1cefa1){_0x1cefa1=_0x1cefa1||0x1f4;return function(_0x4c7a7d){logger[_0x9b68('0x28')](_0x4c7a7d['stack']);if(_0x4c7a7d[_0x9b68('0x29')]){delete _0x4c7a7d[_0x9b68('0x29')];}_0x5772ad[_0x9b68('0x1b')](_0x1cefa1)[_0x9b68('0x2a')](_0x4c7a7d);};}exports[_0x9b68('0x2b')]=function(_0x2a67cf,_0x5c75f4){var _0x214e81={'raw':!![],'where':{'id':_0x2a67cf['params']['id']}},_0x4249b4={};_0x4249b4[_0x9b68('0x2c')]=_[_0x9b68('0x2d')](db[_0x9b68('0x2e')][_0x9b68('0x2f')]);_0x4249b4[_0x9b68('0x30')]=_[_0x9b68('0x2d')](_0x2a67cf['query']);_0x4249b4['filters']=_[_0x9b68('0x31')](_0x4249b4[_0x9b68('0x2c')],_0x4249b4[_0x9b68('0x30')]);_0x214e81[_0x9b68('0x32')]=_[_0x9b68('0x31')](_0x4249b4[_0x9b68('0x2c')],qs[_0x9b68('0x33')](_0x2a67cf[_0x9b68('0x30')][_0x9b68('0x33')]));_0x214e81[_0x9b68('0x32')]=_0x214e81['attributes'][_0x9b68('0x34')]?_0x214e81[_0x9b68('0x32')]:_0x4249b4[_0x9b68('0x2c')];if(_0x2a67cf['query'][_0x9b68('0x35')]){_0x214e81['include']=[{'all':!![]}];}_0x214e81=_[_0x9b68('0x36')]({},_0x214e81,_0x2a67cf[_0x9b68('0x37')]);return db[_0x9b68('0x2e')]['find'](_0x214e81)['then'](handleEntityNotFound(_0x5c75f4,null))['then'](respondWithResult(_0x5c75f4,null))[_0x9b68('0x38')](handleError(_0x5c75f4,null));};exports[_0x9b68('0x25')]=function(_0x3fec87,_0x49765d){if(_0x3fec87['body']['id']){delete _0x3fec87[_0x9b68('0x39')]['id'];}return db[_0x9b68('0x2e')][_0x9b68('0x3a')]({'where':{'id':_0x3fec87[_0x9b68('0x3b')]['id']}})['then'](handleEntityNotFound(_0x49765d,null))[_0x9b68('0x26')](saveUpdates(_0x3fec87['body'],null))[_0x9b68('0x26')](respondWithResult(_0x49765d,null))['catch'](handleError(_0x49765d,null));};exports[_0x9b68('0x3c')]=function(_0x3487dd,_0x107291){return db['ChatApplication'][_0x9b68('0x3a')]({'where':{'id':_0x3487dd[_0x9b68('0x3b')]['id']}})[_0x9b68('0x26')](handleEntityNotFound(_0x107291,null))[_0x9b68('0x26')](removeEntity(_0x107291,null))[_0x9b68('0x38')](handleError(_0x107291,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 0af3f7f..858569a 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index e17bb03..a292e30 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 _0x01d1=['code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5ebf3b,_0x134b74){var _0x2b0982=function(_0x6f3963){while(--_0x6f3963){_0x5ebf3b['push'](_0x5ebf3b['shift']());}};_0x2b0982(++_0x134b74);}(_0x01d1,0x14e));var _0x101d=function(_0xf70dcd,_0x4548e0){_0xf70dcd=_0xf70dcd-0x0;var _0x54ad43=_0x01d1[_0xf70dcd];return _0x54ad43;};'use strict';var _=require(_0x101d('0x0'));var util=require(_0x101d('0x1'));var moment=require(_0x101d('0x2'));var BPromise=require('bluebird');var rs=require(_0x101d('0x3'));var fs=require('fs');var Redis=require(_0x101d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x101d('0x5'));var logger=require(_0x101d('0x6'))(_0x101d('0x7'));var config=require('../../config/environment');var jayson=require(_0x101d('0x8'));var client=jayson[_0x101d('0x9')][_0x101d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e495e,_0x49025e,_0x93e282){return new BPromise(function(_0x14c4aa,_0x2f52c4){return client['request'](_0x4e495e,_0x93e282)[_0x101d('0xb')](function(_0x2ef45a){logger['info'](_0x101d('0xc'),_0x49025e,_0x101d('0xd'));logger[_0x101d('0xe')](_0x101d('0xf'),_0x49025e,_0x101d('0xd'),JSON[_0x101d('0x10')](_0x2ef45a));if(_0x2ef45a['error']){if(_0x2ef45a[_0x101d('0x11')][_0x101d('0x12')]===0x1f4){logger[_0x101d('0x11')](_0x101d('0xc'),_0x49025e,_0x2ef45a[_0x101d('0x11')][_0x101d('0x13')]);return _0x2f52c4(_0x2ef45a['error']['message']);}logger[_0x101d('0x11')](_0x101d('0xc'),_0x49025e,_0x2ef45a[_0x101d('0x11')][_0x101d('0x13')]);return _0x14c4aa(_0x2ef45a[_0x101d('0x11')][_0x101d('0x13')]);}else{logger[_0x101d('0x14')]('ChatApplication,\x20%s,\x20%s',_0x49025e,'request\x20sent');_0x14c4aa(_0x2ef45a['result'][_0x101d('0x13')]);}})[_0x101d('0x15')](function(_0x34f2c6){logger[_0x101d('0x11')](_0x101d('0xc'),_0x49025e,_0x34f2c6);_0x2f52c4(_0x34f2c6);});});}
\ No newline at end of file
+var _0x0a57=['info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3d4320,_0x31b6e5){var _0x3ef70e=function(_0x136c29){while(--_0x136c29){_0x3d4320['push'](_0x3d4320['shift']());}};_0x3ef70e(++_0x31b6e5);}(_0x0a57,0x137));var _0x70a5=function(_0x10975f,_0x470dd3){_0x10975f=_0x10975f-0x0;var _0x306a16=_0x0a57[_0x10975f];return _0x306a16;};'use strict';var _=require('lodash');var util=require(_0x70a5('0x0'));var moment=require(_0x70a5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70a5('0x2'));var db=require(_0x70a5('0x3'))['db'];var utils=require(_0x70a5('0x4'));var logger=require(_0x70a5('0x5'))(_0x70a5('0x6'));var config=require(_0x70a5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x70a5('0x8')][_0x70a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24cb82,_0x3a0fce,_0x289934){return new BPromise(function(_0x385b03,_0x3db1ea){return client[_0x70a5('0xa')](_0x24cb82,_0x289934)[_0x70a5('0xb')](function(_0x44a2dc){logger['info'](_0x70a5('0xc'),_0x3a0fce,_0x70a5('0xd'));logger[_0x70a5('0xe')](_0x70a5('0xf'),_0x3a0fce,_0x70a5('0xd'),JSON[_0x70a5('0x10')](_0x44a2dc));if(_0x44a2dc['error']){if(_0x44a2dc[_0x70a5('0x11')]['code']===0x1f4){logger[_0x70a5('0x11')]('ChatApplication,\x20%s,\x20%s',_0x3a0fce,_0x44a2dc[_0x70a5('0x11')]['message']);return _0x3db1ea(_0x44a2dc[_0x70a5('0x11')][_0x70a5('0x12')]);}logger[_0x70a5('0x11')](_0x70a5('0xc'),_0x3a0fce,_0x44a2dc['error'][_0x70a5('0x12')]);return _0x385b03(_0x44a2dc[_0x70a5('0x11')]['message']);}else{logger[_0x70a5('0x13')](_0x70a5('0xc'),_0x3a0fce,_0x70a5('0xd'));_0x385b03(_0x44a2dc[_0x70a5('0x14')][_0x70a5('0x12')]);}})[_0x70a5('0x15')](function(_0xea87fd){logger[_0x70a5('0x11')](_0x70a5('0xc'),_0x3a0fce,_0xea87fd);_0x3db1ea(_0xea87fd);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 7f1c0ea..b632e5a 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 _0xa8d5=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','put','destroy','exports','multer','path','connect-timeout'];(function(_0x193339,_0x283492){var _0x3fa73b=function(_0x1ab212){while(--_0x1ab212){_0x193339['push'](_0x193339['shift']());}};_0x3fa73b(++_0x283492);}(_0xa8d5,0x66));var _0x5a8d=function(_0x4f4578,_0x24a469){_0x4f4578=_0x4f4578-0x0;var _0xe169f6=_0xa8d5[_0x4f4578];return _0xe169f6;};'use strict';var multer=require(_0x5a8d('0x0'));var util=require('util');var path=require(_0x5a8d('0x1'));var timeout=require(_0x5a8d('0x2'));var express=require(_0x5a8d('0x3'));var router=express[_0x5a8d('0x4')]();var fs_extra=require(_0x5a8d('0x5'));var auth=require(_0x5a8d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5a8d('0x7'));var controller=require('./chatApplication.controller');router[_0x5a8d('0x8')](_0x5a8d('0x9'),auth[_0x5a8d('0xa')](),controller[_0x5a8d('0xb')]);router[_0x5a8d('0xc')](_0x5a8d('0x9'),auth[_0x5a8d('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5a8d('0xd')]);module[_0x5a8d('0xe')]=router;
\ No newline at end of file
+var _0x6834=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x141fcc,_0x35e4db){var _0x51d10e=function(_0x247793){while(--_0x247793){_0x141fcc['push'](_0x141fcc['shift']());}};_0x51d10e(++_0x35e4db);}(_0x6834,0x156));var _0x4683=function(_0x51c27d,_0x3feea2){_0x51c27d=_0x51c27d-0x0;var _0x342e05=_0x6834[_0x51c27d];return _0x342e05;};'use strict';var multer=require(_0x4683('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4683('0x1'));var express=require('express');var router=express[_0x4683('0x2')]();var fs_extra=require(_0x4683('0x3'));var auth=require(_0x4683('0x4'));var interaction=require(_0x4683('0x5'));var config=require(_0x4683('0x6'));var controller=require('./chatApplication.controller');router['get'](_0x4683('0x7'),auth['isAuthenticated'](),controller[_0x4683('0x8')]);router[_0x4683('0x9')](_0x4683('0x7'),auth[_0x4683('0xa')](),controller[_0x4683('0xb')]);router[_0x4683('0xc')](_0x4683('0x7'),auth['isAuthenticated'](),controller[_0x4683('0xd')]);module[_0x4683('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 19c8655..a10c590 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 _0x5200=['BOOLEAN','sequelize','exports','STRING'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x5200,0xbd));var _0x0520=function(_0x28c4f5,_0x483592){_0x28c4f5=_0x28c4f5-0x0;var _0x296953=_0x5200[_0x28c4f5];return _0x296953;};'use strict';var Sequelize=require(_0x0520('0x0'));module[_0x0520('0x1')]={'name':{'type':Sequelize[_0x0520('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x0520('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2ebe=['sequelize','BOOLEAN'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x2ebe,0xd8));var _0xe2eb=function(_0xc36836,_0x58812e){_0xc36836=_0xc36836-0x0;var _0x5bad55=_0x2ebe[_0xc36836];return _0x5bad55;};'use strict';var Sequelize=require(_0xe2eb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xe2eb('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 1d85d53..5237a18 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 _0x7cfe=['YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','info','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','end','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','order','$gte','format'];(function(_0xd13ec3,_0x3dd124){var _0x4e79e9=function(_0x1b68cf){while(--_0x1b68cf){_0xd13ec3['push'](_0xd13ec3['shift']());}};_0x4e79e9(++_0x3dd124);}(_0x7cfe,0xd9));var _0xe7cf=function(_0x3ad133,_0x53bc68){_0x3ad133=_0x3ad133-0x0;var _0x8120f9=_0x7cfe[_0x3ad133];return _0x8120f9;};'use strict';var emlformat=require(_0xe7cf('0x0'));var rimraf=require(_0xe7cf('0x1'));var zipdir=require(_0xe7cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7cf('0x3'));var moment=require(_0xe7cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe7cf('0x5'));var util=require('util');var path=require(_0xe7cf('0x6'));var sox=require('sox');var csv=require(_0xe7cf('0x7'));var ejs=require(_0xe7cf('0x8'));var fs=require('fs');var fs_extra=require(_0xe7cf('0x9'));var _=require(_0xe7cf('0xa'));var squel=require(_0xe7cf('0xb'));var crypto=require(_0xe7cf('0xc'));var jsforce=require(_0xe7cf('0xd'));var deskjs=require(_0xe7cf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe7cf('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7cf('0x10'));var authService=require(_0xe7cf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe7cf('0x12'));var hardwareService=require(_0xe7cf('0x13'));var logger=require('../../config/logger')(_0xe7cf('0x14'));var utils=require(_0xe7cf('0x15'));var config=require(_0xe7cf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7cf('0x17'))['db'];config['redis']=_['defaults'](config[_0xe7cf('0x18')],{'host':_0xe7cf('0x19'),'port':0x18eb});var socket=require(_0xe7cf('0x1a'))(new Redis(config[_0xe7cf('0x18')]));require('./chatGroup.socket')[_0xe7cf('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe7cf('0x1c')][_0xe7cf('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5e84d8,_0x280824,_0xbb52c8,_0x2e34a5){return new BPromise(function(_0x311696,_0x54ab0a){var _0x39d0c0=_0x2e34a5||client;return _0x39d0c0[_0xe7cf('0x1e')](_0x5e84d8,_0xbb52c8)[_0xe7cf('0x1f')](function(_0x57721c){logger['info']('ChatGroup,\x20%s,\x20%s',_0x280824,_0xe7cf('0x20'));logger[_0xe7cf('0x21')](_0xe7cf('0x22'),_0x280824,_0xe7cf('0x20'),JSON[_0xe7cf('0x23')](_0x57721c));if(_0x57721c['error']){if(_0x57721c[_0xe7cf('0x24')][_0xe7cf('0x25')]===0x1f4){logger[_0xe7cf('0x24')]('ChatGroup,\x20%s,\x20%s',_0x280824,_0x57721c[_0xe7cf('0x24')][_0xe7cf('0x26')]);return _0x54ab0a(_0x57721c['error'][_0xe7cf('0x26')]);}logger[_0xe7cf('0x24')](_0xe7cf('0x27'),_0x280824,_0x57721c[_0xe7cf('0x24')]['message']);return _0x311696(_0x57721c[_0xe7cf('0x24')][_0xe7cf('0x26')]);}else{logger[_0xe7cf('0x28')](_0xe7cf('0x27'),_0x280824,_0xe7cf('0x20'));_0x311696(_0x57721c['result'][_0xe7cf('0x26')]);}})['catch'](function(_0x3954f6){logger[_0xe7cf('0x24')](_0xe7cf('0x27'),_0x280824,_0x3954f6);_0x54ab0a(_0x3954f6);});});}function respondWithStatusCode(_0x3d670e,_0x5e24c8){_0x5e24c8=_0x5e24c8||0xcc;return function(_0x461c76){if(_0x461c76){return _0x3d670e[_0xe7cf('0x29')](_0x5e24c8);}return _0x3d670e[_0xe7cf('0x2a')](_0x5e24c8)['end']();};}function respondWithResult(_0x38cd7c,_0x538f17){_0x538f17=_0x538f17||0xc8;return function(_0x115a12){if(_0x115a12){return _0x38cd7c[_0xe7cf('0x2a')](_0x538f17)['json'](_0x115a12);}};}function respondWithFilteredResult(_0x28ac76,_0x58ec15){return function(_0x2431ad){if(_0x2431ad){var _0xce8f32=_0x2431ad[_0xe7cf('0x2b')],_0x398c4a=_0x58ec15[_0xe7cf('0x2c')],_0x28ae60=_0x58ec15[_0xe7cf('0x2c')]+_0x58ec15['limit'],_0x3d60f1;if(_0x28ae60>=_0xce8f32){_0x28ae60=_0xce8f32;_0x3d60f1=0xc8;}else{_0x3d60f1=0xce;}_0x28ac76[_0xe7cf('0x2a')](_0x3d60f1);return _0x28ac76[_0xe7cf('0x2d')](_0xe7cf('0x2e'),_0x398c4a+'-'+_0x28ae60+'/'+_0xce8f32)[_0xe7cf('0x2f')](_0x2431ad);}return null;};}function patchUpdates(_0x409081){return function(_0x56ad2c){try{jsonpatch[_0xe7cf('0x30')](_0x56ad2c,_0x409081,!![]);}catch(_0x571e75){return BPromise[_0xe7cf('0x31')](_0x571e75);}return _0x56ad2c[_0xe7cf('0x32')]();};}function saveUpdates(_0x53555a,_0xfaab88){return function(_0x3cf55c){if(_0x3cf55c){return _0x3cf55c[_0xe7cf('0x33')](_0x53555a)[_0xe7cf('0x1f')](function(_0x141e83){return _0x141e83;});}return null;};}function removeEntity(_0x26b5e4,_0x4aedfe){return function(_0x1442b5){if(_0x1442b5){return _0x1442b5['destroy']()[_0xe7cf('0x1f')](function(){_0x26b5e4[_0xe7cf('0x2a')](0xcc)[_0xe7cf('0x34')]();});}};}function handleEntityNotFound(_0x1f124f,_0x1de38a){return function(_0x1e0cdb){if(!_0x1e0cdb){_0x1f124f['sendStatus'](0x194);}return _0x1e0cdb;};}function handleError(_0x54ae53,_0x5c8d75){_0x5c8d75=_0x5c8d75||0x1f4;return function(_0x5388bc){logger[_0xe7cf('0x24')](_0x5388bc[_0xe7cf('0x35')]);if(_0x5388bc[_0xe7cf('0x36')]){delete _0x5388bc[_0xe7cf('0x36')];}_0x54ae53[_0xe7cf('0x2a')](_0x5c8d75)['send'](_0x5388bc);};}exports[_0xe7cf('0x37')]=function(_0x2ad4ad,_0x2c6a3d){var _0xecfdbf={},_0x132591={},_0x17d4db={'count':0x0,'rows':[]};var _0x455a7c=_[_0xe7cf('0x38')](db[_0xe7cf('0x39')][_0xe7cf('0x3a')],function(_0x1b6732){return{'name':_0x1b6732[_0xe7cf('0x3b')],'type':_0x1b6732[_0xe7cf('0x3c')][_0xe7cf('0x3d')]};});_0x132591[_0xe7cf('0x3e')]=_[_0xe7cf('0x38')](_0x455a7c,_0xe7cf('0x36'));_0x132591[_0xe7cf('0x3f')]=_[_0xe7cf('0x40')](_0x2ad4ad[_0xe7cf('0x3f')]);_0x132591['filters']=_[_0xe7cf('0x41')](_0x132591[_0xe7cf('0x3e')],_0x132591[_0xe7cf('0x3f')]);_0xecfdbf['attributes']=_[_0xe7cf('0x41')](_0x132591[_0xe7cf('0x3e')],qs['fields'](_0x2ad4ad['query'][_0xe7cf('0x42')]));_0xecfdbf[_0xe7cf('0x43')]=_0xecfdbf[_0xe7cf('0x43')][_0xe7cf('0x44')]?_0xecfdbf[_0xe7cf('0x43')]:_0x132591['model'];if(!_0x2ad4ad[_0xe7cf('0x3f')][_0xe7cf('0x45')]('nolimit')){_0xecfdbf[_0xe7cf('0x46')]=qs[_0xe7cf('0x46')](_0x2ad4ad[_0xe7cf('0x3f')]['limit']);_0xecfdbf[_0xe7cf('0x2c')]=qs[_0xe7cf('0x2c')](_0x2ad4ad['query']['offset']);}_0xecfdbf['order']=qs[_0xe7cf('0x47')](_0x2ad4ad[_0xe7cf('0x3f')]['sort']);_0xecfdbf[_0xe7cf('0x48')]=qs['filters'](_[_0xe7cf('0x49')](_0x2ad4ad[_0xe7cf('0x3f')],_0x132591[_0xe7cf('0x4a')]),_0x455a7c);if(_0x2ad4ad[_0xe7cf('0x3f')][_0xe7cf('0x4b')]){_0xecfdbf[_0xe7cf('0x48')]=_[_0xe7cf('0x4c')](_0xecfdbf[_0xe7cf('0x48')],{'$or':_['map'](_0x455a7c,function(_0x25e421){if(_0x25e421[_0xe7cf('0x3c')]!==_0xe7cf('0x4d')){var _0x452453={};_0x452453[_0x25e421[_0xe7cf('0x36')]]={'$like':'%'+_0x2ad4ad[_0xe7cf('0x3f')][_0xe7cf('0x4b')]+'%'};return _0x452453;}})});}_0xecfdbf=_['merge']({},_0xecfdbf,_0x2ad4ad[_0xe7cf('0x4e')]);var _0x1e858a={'where':_0xecfdbf[_0xe7cf('0x48')]};return db[_0xe7cf('0x39')][_0xe7cf('0x2b')](_0x1e858a)['then'](function(_0x1b647b){_0x17d4db[_0xe7cf('0x2b')]=_0x1b647b;if(_0x2ad4ad[_0xe7cf('0x3f')][_0xe7cf('0x4f')]){_0xecfdbf[_0xe7cf('0x50')]=[{'all':!![]}];}return db[_0xe7cf('0x39')][_0xe7cf('0x51')](_0xecfdbf);})[_0xe7cf('0x1f')](function(_0x43b45c){_0x17d4db[_0xe7cf('0x52')]=_0x43b45c;return _0x17d4db;})[_0xe7cf('0x1f')](respondWithFilteredResult(_0x2c6a3d,_0xecfdbf))[_0xe7cf('0x53')](handleError(_0x2c6a3d,null));};exports[_0xe7cf('0x54')]=function(_0x2a33cd,_0x764cca){var _0x5cb430={'raw':!![],'where':{'id':_0x2a33cd['params']['id']}},_0x502ec3={};_0x502ec3[_0xe7cf('0x3e')]=_['keys'](db[_0xe7cf('0x39')][_0xe7cf('0x3a')]);_0x502ec3[_0xe7cf('0x3f')]=_[_0xe7cf('0x40')](_0x2a33cd[_0xe7cf('0x3f')]);_0x502ec3[_0xe7cf('0x4a')]=_[_0xe7cf('0x41')](_0x502ec3[_0xe7cf('0x3e')],_0x502ec3[_0xe7cf('0x3f')]);_0x5cb430[_0xe7cf('0x43')]=_[_0xe7cf('0x41')](_0x502ec3['model'],qs[_0xe7cf('0x42')](_0x2a33cd['query'][_0xe7cf('0x42')]));_0x5cb430[_0xe7cf('0x43')]=_0x5cb430[_0xe7cf('0x43')][_0xe7cf('0x44')]?_0x5cb430['attributes']:_0x502ec3[_0xe7cf('0x3e')];if(_0x2a33cd[_0xe7cf('0x3f')]['includeAll']){_0x5cb430[_0xe7cf('0x50')]=[{'all':!![]}];}_0x5cb430=_[_0xe7cf('0x4c')]({},_0x5cb430,_0x2a33cd['options']);return db[_0xe7cf('0x39')][_0xe7cf('0x55')](_0x5cb430)['then'](handleEntityNotFound(_0x764cca,null))[_0xe7cf('0x1f')](respondWithResult(_0x764cca,null))['catch'](handleError(_0x764cca,null));};exports[_0xe7cf('0x56')]=function(_0x57c37d,_0x2136fe){return db[_0xe7cf('0x39')][_0xe7cf('0x56')](_0x57c37d['body'],{})[_0xe7cf('0x1f')](respondWithResult(_0x2136fe,0xc9))[_0xe7cf('0x53')](handleError(_0x2136fe,null));};exports[_0xe7cf('0x33')]=function(_0x1d1b68,_0x74e91c){if(_0x1d1b68[_0xe7cf('0x57')]['id']){delete _0x1d1b68['body']['id'];}return db[_0xe7cf('0x39')][_0xe7cf('0x55')]({'where':{'id':_0x1d1b68[_0xe7cf('0x58')]['id']}})[_0xe7cf('0x1f')](handleEntityNotFound(_0x74e91c,null))[_0xe7cf('0x1f')](saveUpdates(_0x1d1b68[_0xe7cf('0x57')],null))[_0xe7cf('0x1f')](respondWithResult(_0x74e91c,null))[_0xe7cf('0x53')](handleError(_0x74e91c,null));};exports[_0xe7cf('0x59')]=function(_0x15c30d,_0x2e9668){return db['ChatGroup'][_0xe7cf('0x55')]({'where':{'id':_0x15c30d[_0xe7cf('0x58')]['id']}})[_0xe7cf('0x1f')](handleEntityNotFound(_0x2e9668,null))['then'](removeEntity(_0x2e9668,null))[_0xe7cf('0x53')](handleError(_0x2e9668,null));};exports[_0xe7cf('0x5a')]=function(_0x1be84b,_0x701ea){return db[_0xe7cf('0x39')][_0xe7cf('0x5a')]()[_0xe7cf('0x1f')](respondWithResult(_0x701ea,null))[_0xe7cf('0x53')](handleError(_0x701ea,null));};exports['getUnread']=function(_0x3ce70e,_0x1ff79c,_0x5356aa){return db[_0xe7cf('0x5b')]['count']({'where':{'ChatGroupId':_0x3ce70e[_0xe7cf('0x58')]['id'],'ToId':_0x3ce70e[_0xe7cf('0x5c')]['id'],'read':![]}})[_0xe7cf('0x1f')](function(_0x3bcc6d){return{'id':_[_0xe7cf('0x5d')](_0x3ce70e[_0xe7cf('0x58')]['id']),'count':_0x3bcc6d};})[_0xe7cf('0x1f')](respondWithResult(_0x1ff79c,null))[_0xe7cf('0x53')](handleError(_0x1ff79c,null));};exports['addMembers']=function(_0xb005c6,_0x31c1a4,_0x2f4f6f){return db[_0xe7cf('0x39')][_0xe7cf('0x55')]({'where':{'id':_0xb005c6[_0xe7cf('0x58')]['id']}})[_0xe7cf('0x1f')](handleEntityNotFound(_0x31c1a4,null))[_0xe7cf('0x1f')](function(_0xbb3669){if(_0xbb3669){return _0xbb3669[_0xe7cf('0x5e')](_0xb005c6['body'][_0xe7cf('0x5f')],_['omit'](_0xb005c6[_0xe7cf('0x57')],[_0xe7cf('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x31c1a4,null))[_0xe7cf('0x53')](handleError(_0x31c1a4,null));};exports[_0xe7cf('0x60')]=function(_0x1cae6f,_0x5109ea,_0x482c80){var _0x19ad9e={};var _0x38a152={};var _0x492d3b;var _0x4984a3;return db[_0xe7cf('0x39')]['findOne']({'where':{'id':_0x1cae6f['params']['id']}})['then'](handleEntityNotFound(_0x5109ea,null))[_0xe7cf('0x1f')](function(_0x218180){if(_0x218180){_0x492d3b=_0x218180;_0x38a152[_0xe7cf('0x3e')]=_[_0xe7cf('0x40')](db[_0xe7cf('0x61')]['rawAttributes']);_0x38a152[_0xe7cf('0x3f')]=_['keys'](_0x1cae6f[_0xe7cf('0x3f')]);_0x38a152[_0xe7cf('0x4a')]=_['intersection'](_0x38a152[_0xe7cf('0x3e')],_0x38a152[_0xe7cf('0x3f')]);_0x19ad9e['attributes']=_[_0xe7cf('0x41')](_0x38a152['model'],qs[_0xe7cf('0x42')](_0x1cae6f[_0xe7cf('0x3f')][_0xe7cf('0x42')]));_0x19ad9e[_0xe7cf('0x43')]=_0x19ad9e[_0xe7cf('0x43')][_0xe7cf('0x44')]?_0x19ad9e['attributes']:_0x38a152['model'];_0x19ad9e['order']=qs[_0xe7cf('0x47')](_0x1cae6f[_0xe7cf('0x3f')][_0xe7cf('0x47')]);_0x19ad9e[_0xe7cf('0x48')]=qs[_0xe7cf('0x4a')](_[_0xe7cf('0x49')](_0x1cae6f[_0xe7cf('0x3f')],_0x38a152[_0xe7cf('0x4a')]));if(_0x1cae6f['query'][_0xe7cf('0x4b')]){_0x19ad9e[_0xe7cf('0x48')]=_['merge'](_0x19ad9e[_0xe7cf('0x48')],{'$or':_['map'](_0x19ad9e[_0xe7cf('0x43')],function(_0x2d9708){var _0x3f9b25={};_0x3f9b25[_0x2d9708]={'$like':'%'+_0x1cae6f[_0xe7cf('0x3f')][_0xe7cf('0x4b')]+'%'};return _0x3f9b25;})});}_0x19ad9e=_[_0xe7cf('0x4c')]({},_0x19ad9e,_0x1cae6f[_0xe7cf('0x4e')]);return _0x492d3b[_0xe7cf('0x60')](_0x19ad9e);}})['then'](function(_0x791fbc){if(_0x791fbc){_0x4984a3=_0x791fbc[_0xe7cf('0x44')];if(!_0x1cae6f['query'][_0xe7cf('0x45')](_0xe7cf('0x62'))){_0x19ad9e['limit']=qs[_0xe7cf('0x46')](_0x1cae6f[_0xe7cf('0x3f')][_0xe7cf('0x46')]);_0x19ad9e[_0xe7cf('0x2c')]=qs[_0xe7cf('0x2c')](_0x1cae6f[_0xe7cf('0x3f')]['offset']);}return _0x492d3b[_0xe7cf('0x60')](_0x19ad9e);}})[_0xe7cf('0x1f')](function(_0x1222af){if(_0x1222af){return _0x1222af?{'count':_0x4984a3,'rows':_0x1222af}:null;}})[_0xe7cf('0x1f')](respondWithResult(_0x5109ea,null))[_0xe7cf('0x53')](handleError(_0x5109ea,null));};exports['removeMembers']=function(_0x1d9381,_0x1d2b1f,_0x5de265){return db['ChatGroup'][_0xe7cf('0x55')]({'where':{'id':_0x1d9381[_0xe7cf('0x58')]['id']}})['then'](handleEntityNotFound(_0x1d2b1f,null))['then'](function(_0x11eac0){if(_0x11eac0){return _0x11eac0[_0xe7cf('0x63')](_0x1d9381[_0xe7cf('0x3f')][_0xe7cf('0x5f')]);}})[_0xe7cf('0x1f')](respondWithStatusCode(_0x1d2b1f,null))[_0xe7cf('0x53')](handleError(_0x1d2b1f,null));};exports[_0xe7cf('0x64')]=function(_0x4fc3a9,_0x192fad,_0x871d6d){if(_0x4fc3a9['body']['id']){delete _0x4fc3a9[_0xe7cf('0x57')]['id'];}return db[_0xe7cf('0x39')][_0xe7cf('0x55')]({'where':{'id':_0x4fc3a9[_0xe7cf('0x58')]['id']}})[_0xe7cf('0x1f')](handleEntityNotFound(_0x192fad,null))[_0xe7cf('0x1f')](function(_0x1da1df){if(_0x1da1df){_0x4fc3a9[_0xe7cf('0x57')][_0xe7cf('0x65')]=_0x1da1df['id'];return db['ChatInternalMessage'][_0xe7cf('0x56')](_0x4fc3a9['body']);}})[_0xe7cf('0x1f')](respondWithResult(_0x192fad,null))[_0xe7cf('0x53')](handleError(_0x192fad,null));};exports[_0xe7cf('0x66')]=function(_0x380948,_0x39d572,_0x64bda3){var _0x3a19d2={};var _0x551485={};var _0x37eeeb;var _0x586320;return db[_0xe7cf('0x39')][_0xe7cf('0x67')]({'where':{'id':_0x380948[_0xe7cf('0x58')]['id']}})['then'](handleEntityNotFound(_0x39d572,null))[_0xe7cf('0x1f')](function(_0x3ea542){if(_0x3ea542){_0x37eeeb=_0x3ea542;_0x551485[_0xe7cf('0x3e')]=_[_0xe7cf('0x40')](db[_0xe7cf('0x5b')][_0xe7cf('0x3a')]);_0x551485['query']=_[_0xe7cf('0x40')](_0x380948[_0xe7cf('0x3f')]);_0x551485['filters']=_[_0xe7cf('0x41')](_0x551485[_0xe7cf('0x3e')],_0x551485[_0xe7cf('0x3f')]);_0x3a19d2[_0xe7cf('0x43')]=_[_0xe7cf('0x41')](_0x551485[_0xe7cf('0x3e')],qs[_0xe7cf('0x42')](_0x380948['query'][_0xe7cf('0x42')]));_0x3a19d2[_0xe7cf('0x43')]=_0x3a19d2['attributes']['length']?_0x3a19d2[_0xe7cf('0x43')]:_0x551485['model'];_0x3a19d2[_0xe7cf('0x68')]=qs[_0xe7cf('0x47')](_0x380948[_0xe7cf('0x3f')][_0xe7cf('0x47')]);_0x3a19d2[_0xe7cf('0x48')]=qs[_0xe7cf('0x4a')](_[_0xe7cf('0x49')](_0x380948[_0xe7cf('0x3f')],_0x551485[_0xe7cf('0x4a')]));if(_0x380948[_0xe7cf('0x3f')][_0xe7cf('0x4b')]){_0x3a19d2[_0xe7cf('0x48')]=_[_0xe7cf('0x4c')](_0x3a19d2[_0xe7cf('0x48')],{'$or':_[_0xe7cf('0x38')](_0x3a19d2[_0xe7cf('0x43')],function(_0x51355a){var _0x47de37={};_0x47de37[_0x51355a]={'$like':'%'+_0x380948[_0xe7cf('0x3f')][_0xe7cf('0x4b')]+'%'};return _0x47de37;})});}if(_0x380948[_0xe7cf('0x3f')][_0xe7cf('0x69')]){var _0x2a2d37=_0x380948['query'][_0xe7cf('0x69')]['split'](',');var _0x16bcf1={};_0x16bcf1[_0x2a2d37[0x0]]={'$gte':moment(_0x2a2d37[0x1])[_0xe7cf('0x6a')](_0xe7cf('0x6b'))};_0x3a19d2[_0xe7cf('0x48')]=_[_0xe7cf('0x4c')](_0x3a19d2['where'],_0x16bcf1);}_0x3a19d2=_[_0xe7cf('0x4c')]({},_0x3a19d2,_0x380948[_0xe7cf('0x4e')]);return _0x37eeeb[_0xe7cf('0x66')](_0x3a19d2);}})[_0xe7cf('0x1f')](function(_0xcdacb8){if(_0xcdacb8){_0x586320=_0xcdacb8[_0xe7cf('0x44')];if(!_0x380948[_0xe7cf('0x3f')][_0xe7cf('0x45')](_0xe7cf('0x62'))){_0x3a19d2[_0xe7cf('0x46')]=qs[_0xe7cf('0x46')](_0x380948['query'][_0xe7cf('0x46')]);_0x3a19d2[_0xe7cf('0x2c')]=qs[_0xe7cf('0x2c')](_0x380948['query'][_0xe7cf('0x2c')]);}return _0x37eeeb[_0xe7cf('0x66')](_0x3a19d2);}})[_0xe7cf('0x1f')](function(_0x3e2937){if(_0x3e2937){return _0x3e2937?{'count':_0x586320,'rows':_0x3e2937}:null;}})[_0xe7cf('0x1f')](respondWithResult(_0x39d572,null))[_0xe7cf('0x53')](handleError(_0x39d572,null));};
\ No newline at end of file
+var _0x595e=['VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','length','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','destroy','end','stack','name','map','ChatGroup','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','order','sort','where','filters','pick','filter','merge'];(function(_0x509a6a,_0x53e73d){var _0x2d989d=function(_0xccce0e){while(--_0xccce0e){_0x509a6a['push'](_0x509a6a['shift']());}};_0x2d989d(++_0x53e73d);}(_0x595e,0x91));var _0xe595=function(_0x6e7d56,_0x5d9b0a){_0x6e7d56=_0x6e7d56-0x0;var _0x249c38=_0x595e[_0x6e7d56];return _0x249c38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe595('0x0'));var zipdir=require(_0xe595('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe595('0x2'));var BPromise=require(_0xe595('0x3'));var Mustache=require('mustache');var util=require(_0xe595('0x4'));var path=require(_0xe595('0x5'));var sox=require(_0xe595('0x6'));var csv=require(_0xe595('0x7'));var ejs=require(_0xe595('0x8'));var fs=require('fs');var fs_extra=require(_0xe595('0x9'));var _=require('lodash');var squel=require(_0xe595('0xa'));var crypto=require(_0xe595('0xb'));var jsforce=require(_0xe595('0xc'));var deskjs=require(_0xe595('0xd'));var toCsv=require(_0xe595('0x7'));var querystring=require(_0xe595('0xe'));var Papa=require(_0xe595('0xf'));var Redis=require(_0xe595('0x10'));var authService=require(_0xe595('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe595('0x12'));var logger=require(_0xe595('0x13'))(_0xe595('0x14'));var utils=require(_0xe595('0x15'));var config=require(_0xe595('0x16'));var licenseUtil=require(_0xe595('0x17'));var db=require(_0xe595('0x18'))['db'];config[_0xe595('0x19')]=_['defaults'](config[_0xe595('0x19')],{'host':_0xe595('0x1a'),'port':0x18eb});var socket=require(_0xe595('0x1b'))(new Redis(config[_0xe595('0x19')]));require(_0xe595('0x1c'))[_0xe595('0x1d')](socket);var jayson=require(_0xe595('0x1e'));var client=jayson[_0xe595('0x1f')][_0xe595('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x35f5cd,_0x54fde4,_0x240067,_0x36325e){return new BPromise(function(_0x21ce53,_0x5be777){var _0x17fc3d=_0x36325e||client;return _0x17fc3d[_0xe595('0x21')](_0x35f5cd,_0x240067)[_0xe595('0x22')](function(_0x3e2a00){logger['info']('ChatGroup,\x20%s,\x20%s',_0x54fde4,_0xe595('0x23'));logger[_0xe595('0x24')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x54fde4,_0xe595('0x23'),JSON[_0xe595('0x25')](_0x3e2a00));if(_0x3e2a00[_0xe595('0x26')]){if(_0x3e2a00[_0xe595('0x26')]['code']===0x1f4){logger['error'](_0xe595('0x27'),_0x54fde4,_0x3e2a00['error']['message']);return _0x5be777(_0x3e2a00[_0xe595('0x26')][_0xe595('0x28')]);}logger[_0xe595('0x26')](_0xe595('0x27'),_0x54fde4,_0x3e2a00[_0xe595('0x26')]['message']);return _0x21ce53(_0x3e2a00[_0xe595('0x26')][_0xe595('0x28')]);}else{logger[_0xe595('0x29')]('ChatGroup,\x20%s,\x20%s',_0x54fde4,_0xe595('0x23'));_0x21ce53(_0x3e2a00[_0xe595('0x2a')][_0xe595('0x28')]);}})[_0xe595('0x2b')](function(_0x2a1104){logger[_0xe595('0x26')](_0xe595('0x27'),_0x54fde4,_0x2a1104);_0x5be777(_0x2a1104);});});}function respondWithStatusCode(_0x367955,_0x366872){_0x366872=_0x366872||0xcc;return function(_0x24f363){if(_0x24f363){return _0x367955[_0xe595('0x2c')](_0x366872);}return _0x367955[_0xe595('0x2d')](_0x366872)['end']();};}function respondWithResult(_0x182d3f,_0x1fe754){_0x1fe754=_0x1fe754||0xc8;return function(_0x3ea336){if(_0x3ea336){return _0x182d3f[_0xe595('0x2d')](_0x1fe754)[_0xe595('0x2e')](_0x3ea336);}};}function respondWithFilteredResult(_0x31e0e6,_0x3cc3bb){return function(_0x52b710){if(_0x52b710){var _0x4fb6fc=_0x52b710['count'],_0xd12344=_0x3cc3bb[_0xe595('0x2f')],_0x897ede=_0x3cc3bb[_0xe595('0x2f')]+_0x3cc3bb[_0xe595('0x30')],_0x354065;if(_0x897ede>=_0x4fb6fc){_0x897ede=_0x4fb6fc;_0x354065=0xc8;}else{_0x354065=0xce;}_0x31e0e6[_0xe595('0x2d')](_0x354065);return _0x31e0e6['set'](_0xe595('0x31'),_0xd12344+'-'+_0x897ede+'/'+_0x4fb6fc)[_0xe595('0x2e')](_0x52b710);}return null;};}function patchUpdates(_0x386fe4){return function(_0x51da6e){try{jsonpatch[_0xe595('0x32')](_0x51da6e,_0x386fe4,!![]);}catch(_0x18e2b7){return BPromise[_0xe595('0x33')](_0x18e2b7);}return _0x51da6e[_0xe595('0x34')]();};}function saveUpdates(_0x2c732d,_0x3c2d0f){return function(_0x2a3115){if(_0x2a3115){return _0x2a3115['update'](_0x2c732d)[_0xe595('0x22')](function(_0xa0f88f){return _0xa0f88f;});}return null;};}function removeEntity(_0x3fe0b9,_0x5e5fb2){return function(_0x1f58c8){if(_0x1f58c8){return _0x1f58c8[_0xe595('0x35')]()['then'](function(){_0x3fe0b9[_0xe595('0x2d')](0xcc)[_0xe595('0x36')]();});}};}function handleEntityNotFound(_0x1df5ef,_0x267fea){return function(_0x23c960){if(!_0x23c960){_0x1df5ef[_0xe595('0x2c')](0x194);}return _0x23c960;};}function handleError(_0x361872,_0x452d93){_0x452d93=_0x452d93||0x1f4;return function(_0x56ec68){logger[_0xe595('0x26')](_0x56ec68[_0xe595('0x37')]);if(_0x56ec68['name']){delete _0x56ec68[_0xe595('0x38')];}_0x361872[_0xe595('0x2d')](_0x452d93)['send'](_0x56ec68);};}exports['index']=function(_0x20fd38,_0x31043a){var _0x50a662={},_0x5eb3f8={},_0x3618b0={'count':0x0,'rows':[]};var _0xbe26a1=_[_0xe595('0x39')](db[_0xe595('0x3a')][_0xe595('0x3b')],function(_0x26e0f6){return{'name':_0x26e0f6[_0xe595('0x3c')],'type':_0x26e0f6[_0xe595('0x3d')]['key']};});_0x5eb3f8[_0xe595('0x3e')]=_[_0xe595('0x39')](_0xbe26a1,_0xe595('0x38'));_0x5eb3f8[_0xe595('0x3f')]=_[_0xe595('0x40')](_0x20fd38[_0xe595('0x3f')]);_0x5eb3f8['filters']=_[_0xe595('0x41')](_0x5eb3f8[_0xe595('0x3e')],_0x5eb3f8[_0xe595('0x3f')]);_0x50a662[_0xe595('0x42')]=_[_0xe595('0x41')](_0x5eb3f8['model'],qs[_0xe595('0x43')](_0x20fd38[_0xe595('0x3f')][_0xe595('0x43')]));_0x50a662[_0xe595('0x42')]=_0x50a662[_0xe595('0x42')]['length']?_0x50a662[_0xe595('0x42')]:_0x5eb3f8[_0xe595('0x3e')];if(!_0x20fd38['query']['hasOwnProperty']('nolimit')){_0x50a662[_0xe595('0x30')]=qs[_0xe595('0x30')](_0x20fd38[_0xe595('0x3f')][_0xe595('0x30')]);_0x50a662[_0xe595('0x2f')]=qs[_0xe595('0x2f')](_0x20fd38[_0xe595('0x3f')][_0xe595('0x2f')]);}_0x50a662[_0xe595('0x44')]=qs[_0xe595('0x45')](_0x20fd38[_0xe595('0x3f')][_0xe595('0x45')]);_0x50a662[_0xe595('0x46')]=qs[_0xe595('0x47')](_[_0xe595('0x48')](_0x20fd38[_0xe595('0x3f')],_0x5eb3f8[_0xe595('0x47')]),_0xbe26a1);if(_0x20fd38[_0xe595('0x3f')][_0xe595('0x49')]){_0x50a662[_0xe595('0x46')]=_[_0xe595('0x4a')](_0x50a662[_0xe595('0x46')],{'$or':_['map'](_0xbe26a1,function(_0x21a5ad){if(_0x21a5ad['type']!==_0xe595('0x4b')){var _0x3a2b40={};_0x3a2b40[_0x21a5ad[_0xe595('0x38')]]={'$like':'%'+_0x20fd38[_0xe595('0x3f')][_0xe595('0x49')]+'%'};return _0x3a2b40;}})});}_0x50a662=_[_0xe595('0x4a')]({},_0x50a662,_0x20fd38[_0xe595('0x4c')]);var _0x4c6f3={'where':_0x50a662['where']};return db['ChatGroup'][_0xe595('0x4d')](_0x4c6f3)['then'](function(_0x4a4261){_0x3618b0[_0xe595('0x4d')]=_0x4a4261;if(_0x20fd38['query'][_0xe595('0x4e')]){_0x50a662[_0xe595('0x4f')]=[{'all':!![]}];}return db[_0xe595('0x3a')][_0xe595('0x50')](_0x50a662);})['then'](function(_0x347172){_0x3618b0[_0xe595('0x51')]=_0x347172;return _0x3618b0;})[_0xe595('0x22')](respondWithFilteredResult(_0x31043a,_0x50a662))[_0xe595('0x2b')](handleError(_0x31043a,null));};exports[_0xe595('0x52')]=function(_0x154232,_0x1d1254){var _0x3ba62e={'raw':!![],'where':{'id':_0x154232[_0xe595('0x53')]['id']}},_0x203ecc={};_0x203ecc[_0xe595('0x3e')]=_['keys'](db[_0xe595('0x3a')][_0xe595('0x3b')]);_0x203ecc[_0xe595('0x3f')]=_[_0xe595('0x40')](_0x154232['query']);_0x203ecc[_0xe595('0x47')]=_[_0xe595('0x41')](_0x203ecc[_0xe595('0x3e')],_0x203ecc[_0xe595('0x3f')]);_0x3ba62e['attributes']=_['intersection'](_0x203ecc[_0xe595('0x3e')],qs[_0xe595('0x43')](_0x154232[_0xe595('0x3f')]['fields']));_0x3ba62e[_0xe595('0x42')]=_0x3ba62e[_0xe595('0x42')][_0xe595('0x54')]?_0x3ba62e[_0xe595('0x42')]:_0x203ecc[_0xe595('0x3e')];if(_0x154232['query'][_0xe595('0x4e')]){_0x3ba62e[_0xe595('0x4f')]=[{'all':!![]}];}_0x3ba62e=_[_0xe595('0x4a')]({},_0x3ba62e,_0x154232['options']);return db[_0xe595('0x3a')][_0xe595('0x55')](_0x3ba62e)[_0xe595('0x22')](handleEntityNotFound(_0x1d1254,null))[_0xe595('0x22')](respondWithResult(_0x1d1254,null))[_0xe595('0x2b')](handleError(_0x1d1254,null));};exports[_0xe595('0x56')]=function(_0xd1e2c4,_0x28d3a9){return db['ChatGroup'][_0xe595('0x56')](_0xd1e2c4[_0xe595('0x57')],{})['then'](respondWithResult(_0x28d3a9,0xc9))['catch'](handleError(_0x28d3a9,null));};exports[_0xe595('0x58')]=function(_0x7ddcaa,_0x3e912b){if(_0x7ddcaa[_0xe595('0x57')]['id']){delete _0x7ddcaa[_0xe595('0x57')]['id'];}return db[_0xe595('0x3a')][_0xe595('0x55')]({'where':{'id':_0x7ddcaa[_0xe595('0x53')]['id']}})[_0xe595('0x22')](handleEntityNotFound(_0x3e912b,null))[_0xe595('0x22')](saveUpdates(_0x7ddcaa[_0xe595('0x57')],null))[_0xe595('0x22')](respondWithResult(_0x3e912b,null))[_0xe595('0x2b')](handleError(_0x3e912b,null));};exports[_0xe595('0x35')]=function(_0x10b9ff,_0x55e68b){return db['ChatGroup']['find']({'where':{'id':_0x10b9ff[_0xe595('0x53')]['id']}})['then'](handleEntityNotFound(_0x55e68b,null))['then'](removeEntity(_0x55e68b,null))[_0xe595('0x2b')](handleError(_0x55e68b,null));};exports[_0xe595('0x59')]=function(_0x50c673,_0x4a4ee){return db['ChatGroup'][_0xe595('0x59')]()[_0xe595('0x22')](respondWithResult(_0x4a4ee,null))[_0xe595('0x2b')](handleError(_0x4a4ee,null));};exports[_0xe595('0x5a')]=function(_0xa3e42a,_0xc07b26,_0x536472){return db[_0xe595('0x5b')][_0xe595('0x4d')]({'where':{'ChatGroupId':_0xa3e42a[_0xe595('0x53')]['id'],'ToId':_0xa3e42a[_0xe595('0x5c')]['id'],'read':![]}})['then'](function(_0x548800){return{'id':_[_0xe595('0x5d')](_0xa3e42a['params']['id']),'count':_0x548800};})['then'](respondWithResult(_0xc07b26,null))[_0xe595('0x2b')](handleError(_0xc07b26,null));};exports[_0xe595('0x5e')]=function(_0x14fc27,_0xb573cc,_0x13da89){return db['ChatGroup']['find']({'where':{'id':_0x14fc27[_0xe595('0x53')]['id']}})[_0xe595('0x22')](handleEntityNotFound(_0xb573cc,null))[_0xe595('0x22')](function(_0x3effbb){if(_0x3effbb){return _0x3effbb['addMembers'](_0x14fc27['body'][_0xe595('0x5f')],_[_0xe595('0x60')](_0x14fc27['body'],[_0xe595('0x5f'),'id'])||{});}})[_0xe595('0x22')](respondWithResult(_0xb573cc,null))[_0xe595('0x2b')](handleError(_0xb573cc,null));};exports[_0xe595('0x61')]=function(_0x1e6407,_0x18cb51,_0x138825){var _0x26bfce={};var _0x570ed8={};var _0x1741f3;var _0x50fdbb;return db['ChatGroup'][_0xe595('0x62')]({'where':{'id':_0x1e6407[_0xe595('0x53')]['id']}})[_0xe595('0x22')](handleEntityNotFound(_0x18cb51,null))[_0xe595('0x22')](function(_0x23f867){if(_0x23f867){_0x1741f3=_0x23f867;_0x570ed8[_0xe595('0x3e')]=_[_0xe595('0x40')](db[_0xe595('0x63')][_0xe595('0x3b')]);_0x570ed8[_0xe595('0x3f')]=_['keys'](_0x1e6407['query']);_0x570ed8[_0xe595('0x47')]=_['intersection'](_0x570ed8[_0xe595('0x3e')],_0x570ed8[_0xe595('0x3f')]);_0x26bfce['attributes']=_['intersection'](_0x570ed8[_0xe595('0x3e')],qs[_0xe595('0x43')](_0x1e6407[_0xe595('0x3f')][_0xe595('0x43')]));_0x26bfce[_0xe595('0x42')]=_0x26bfce['attributes'][_0xe595('0x54')]?_0x26bfce[_0xe595('0x42')]:_0x570ed8['model'];_0x26bfce['order']=qs[_0xe595('0x45')](_0x1e6407[_0xe595('0x3f')][_0xe595('0x45')]);_0x26bfce['where']=qs[_0xe595('0x47')](_['pick'](_0x1e6407[_0xe595('0x3f')],_0x570ed8[_0xe595('0x47')]));if(_0x1e6407[_0xe595('0x3f')]['filter']){_0x26bfce[_0xe595('0x46')]=_['merge'](_0x26bfce[_0xe595('0x46')],{'$or':_[_0xe595('0x39')](_0x26bfce['attributes'],function(_0xa76e61){var _0x5ae30f={};_0x5ae30f[_0xa76e61]={'$like':'%'+_0x1e6407[_0xe595('0x3f')][_0xe595('0x49')]+'%'};return _0x5ae30f;})});}_0x26bfce=_[_0xe595('0x4a')]({},_0x26bfce,_0x1e6407[_0xe595('0x4c')]);return _0x1741f3['getMembers'](_0x26bfce);}})[_0xe595('0x22')](function(_0x1f133c){if(_0x1f133c){_0x50fdbb=_0x1f133c[_0xe595('0x54')];if(!_0x1e6407[_0xe595('0x3f')][_0xe595('0x64')](_0xe595('0x65'))){_0x26bfce[_0xe595('0x30')]=qs[_0xe595('0x30')](_0x1e6407['query'][_0xe595('0x30')]);_0x26bfce[_0xe595('0x2f')]=qs[_0xe595('0x2f')](_0x1e6407['query'][_0xe595('0x2f')]);}return _0x1741f3[_0xe595('0x61')](_0x26bfce);}})[_0xe595('0x22')](function(_0x27521c){if(_0x27521c){return _0x27521c?{'count':_0x50fdbb,'rows':_0x27521c}:null;}})[_0xe595('0x22')](respondWithResult(_0x18cb51,null))[_0xe595('0x2b')](handleError(_0x18cb51,null));};exports['removeMembers']=function(_0x21ec00,_0x55a4a1,_0x4d81cc){return db[_0xe595('0x3a')][_0xe595('0x55')]({'where':{'id':_0x21ec00[_0xe595('0x53')]['id']}})[_0xe595('0x22')](handleEntityNotFound(_0x55a4a1,null))['then'](function(_0x5351dc){if(_0x5351dc){return _0x5351dc[_0xe595('0x66')](_0x21ec00[_0xe595('0x3f')][_0xe595('0x5f')]);}})[_0xe595('0x22')](respondWithStatusCode(_0x55a4a1,null))['catch'](handleError(_0x55a4a1,null));};exports[_0xe595('0x67')]=function(_0x16e5bf,_0x50c7f1,_0x70c006){if(_0x16e5bf['body']['id']){delete _0x16e5bf['body']['id'];}return db[_0xe595('0x3a')]['find']({'where':{'id':_0x16e5bf[_0xe595('0x53')]['id']}})[_0xe595('0x22')](handleEntityNotFound(_0x50c7f1,null))['then'](function(_0x160148){if(_0x160148){_0x16e5bf[_0xe595('0x57')][_0xe595('0x68')]=_0x160148['id'];return db[_0xe595('0x5b')]['create'](_0x16e5bf[_0xe595('0x57')]);}})[_0xe595('0x22')](respondWithResult(_0x50c7f1,null))[_0xe595('0x2b')](handleError(_0x50c7f1,null));};exports[_0xe595('0x69')]=function(_0x440d55,_0x59ffb5,_0x2a15eb){var _0x3177b7={};var _0x177b51={};var _0x27e2a2;var _0x11b81f;return db['ChatGroup'][_0xe595('0x62')]({'where':{'id':_0x440d55[_0xe595('0x53')]['id']}})['then'](handleEntityNotFound(_0x59ffb5,null))[_0xe595('0x22')](function(_0x3316c2){if(_0x3316c2){_0x27e2a2=_0x3316c2;_0x177b51[_0xe595('0x3e')]=_[_0xe595('0x40')](db[_0xe595('0x5b')][_0xe595('0x3b')]);_0x177b51[_0xe595('0x3f')]=_[_0xe595('0x40')](_0x440d55[_0xe595('0x3f')]);_0x177b51[_0xe595('0x47')]=_[_0xe595('0x41')](_0x177b51[_0xe595('0x3e')],_0x177b51['query']);_0x3177b7[_0xe595('0x42')]=_[_0xe595('0x41')](_0x177b51['model'],qs['fields'](_0x440d55[_0xe595('0x3f')][_0xe595('0x43')]));_0x3177b7['attributes']=_0x3177b7[_0xe595('0x42')][_0xe595('0x54')]?_0x3177b7[_0xe595('0x42')]:_0x177b51[_0xe595('0x3e')];_0x3177b7[_0xe595('0x44')]=qs[_0xe595('0x45')](_0x440d55[_0xe595('0x3f')][_0xe595('0x45')]);_0x3177b7[_0xe595('0x46')]=qs['filters'](_[_0xe595('0x48')](_0x440d55['query'],_0x177b51[_0xe595('0x47')]));if(_0x440d55[_0xe595('0x3f')][_0xe595('0x49')]){_0x3177b7[_0xe595('0x46')]=_[_0xe595('0x4a')](_0x3177b7['where'],{'$or':_[_0xe595('0x39')](_0x3177b7['attributes'],function(_0x45b5d8){var _0xcd33ea={};_0xcd33ea[_0x45b5d8]={'$like':'%'+_0x440d55[_0xe595('0x3f')][_0xe595('0x49')]+'%'};return _0xcd33ea;})});}if(_0x440d55[_0xe595('0x3f')]['$gte']){var _0x4da3bf=_0x440d55[_0xe595('0x3f')][_0xe595('0x6a')][_0xe595('0x6b')](',');var _0x5dcb20={};_0x5dcb20[_0x4da3bf[0x0]]={'$gte':moment(_0x4da3bf[0x1])[_0xe595('0x6c')](_0xe595('0x6d'))};_0x3177b7['where']=_[_0xe595('0x4a')](_0x3177b7[_0xe595('0x46')],_0x5dcb20);}_0x3177b7=_[_0xe595('0x4a')]({},_0x3177b7,_0x440d55['options']);return _0x27e2a2['getMessages'](_0x3177b7);}})['then'](function(_0x42ed3c){if(_0x42ed3c){_0x11b81f=_0x42ed3c[_0xe595('0x54')];if(!_0x440d55['query'][_0xe595('0x64')](_0xe595('0x65'))){_0x3177b7[_0xe595('0x30')]=qs[_0xe595('0x30')](_0x440d55[_0xe595('0x3f')][_0xe595('0x30')]);_0x3177b7[_0xe595('0x2f')]=qs[_0xe595('0x2f')](_0x440d55[_0xe595('0x3f')][_0xe595('0x2f')]);}return _0x27e2a2[_0xe595('0x69')](_0x3177b7);}})[_0xe595('0x22')](function(_0x463d11){if(_0x463d11){return _0x463d11?{'count':_0x11b81f,'rows':_0x463d11}:null;}})[_0xe595('0x22')](respondWithResult(_0x59ffb5,null))[_0xe595('0x2b')](handleError(_0x59ffb5,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index f0fdc8a..3d0fe24 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 _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x413206,_0x541645){var _0x2675c4=function(_0x1cbe17){while(--_0x1cbe17){_0x413206['push'](_0x413206['shift']());}};_0x2675c4(++_0x541645);}(_0x5f2f,0x73));var _0xf5f2=function(_0x47decd,_0x57e643){_0x47decd=_0x47decd-0x0;var _0xdea891=_0x5f2f[_0x47decd];return _0xdea891;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatGroup=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatGroupEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatGroupEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatGroup[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x2032=['exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x2032,0xd9));var _0x2203=function(_0x47f601,_0x5ed63b){_0x47f601=_0x47f601-0x0;var _0x263aec=_0x2032[_0x47f601];return _0x263aec;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];ChatGroup[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index cd3fca9..e3f09fd 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 _0xd0bb=['ChatGroup','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x26183d,_0x247e2c){var _0x4dd8c8=function(_0xa36b5b){while(--_0xa36b5b){_0x26183d['push'](_0x26183d['shift']());}};_0x4dd8c8(++_0x247e2c);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4c4fbe,_0x483482){_0x4c4fbe=_0x4c4fbe-0x0;var _0x39b3b9=_0xd0bb[_0x4c4fbe];return _0x39b3b9;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var logger=require(_0xbd0b('0x2'))('api');var moment=require(_0xbd0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd0b('0x4'));var fs=require('fs');var path=require(_0xbd0b('0x5'));var rimraf=require('rimraf');var config=require(_0xbd0b('0x6'));var attributes=require('./chatGroup.attributes');module[_0xbd0b('0x7')]=function(_0x1b2499,_0x158b5c){return _0x1b2499[_0xbd0b('0x8')](_0xbd0b('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe22=['../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x36acb3,_0x204e94){var _0x13976c=function(_0x4371dd){while(--_0x4371dd){_0x36acb3['push'](_0x36acb3['shift']());}};_0x13976c(++_0x204e94);}(_0xbe22,0x1c1));var _0x2be2=function(_0x33fbc3,_0x3d7b54){_0x33fbc3=_0x33fbc3-0x0;var _0x170d16=_0xbe22[_0x33fbc3];return _0x170d16;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2be2('0x2'));var BPromise=require(_0x2be2('0x3'));var rp=require(_0x2be2('0x4'));var fs=require('fs');var path=require(_0x2be2('0x5'));var rimraf=require(_0x2be2('0x6'));var config=require(_0x2be2('0x7'));var attributes=require(_0x2be2('0x8'));module[_0x2be2('0x9')]=function(_0x1b3bde,_0x3a4d77){return _0x1b3bde['define'](_0x2be2('0xa'),attributes,{'tableName':_0x2be2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index a18c5cb..992b2dc 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 _0x86e5=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util'];(function(_0x144d87,_0x5f119f){var _0x4c65a2=function(_0x47e97f){while(--_0x47e97f){_0x144d87['push'](_0x144d87['shift']());}};_0x4c65a2(++_0x5f119f);}(_0x86e5,0xe5));var _0x586e=function(_0x485e18,_0x8792ff){_0x485e18=_0x485e18-0x0;var _0x193f49=_0x86e5[_0x485e18];return _0x193f49;};'use strict';var _=require('lodash');var util=require(_0x586e('0x0'));var moment=require(_0x586e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x586e('0x2'));var db=require(_0x586e('0x3'))['db'];var utils=require(_0x586e('0x4'));var logger=require('../../config/logger')(_0x586e('0x5'));var config=require(_0x586e('0x6'));var jayson=require(_0x586e('0x7'));var client=jayson['client'][_0x586e('0x8')]({'port':0x232a});config[_0x586e('0x9')]=_[_0x586e('0xa')](config[_0x586e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x586e('0xb'))(new Redis(config[_0x586e('0x9')]));require(_0x586e('0xc'))[_0x586e('0xd')](socket);function respondWithRpcPromise(_0x192736,_0x3bf7c2,_0x2296ae){return new BPromise(function(_0x261320,_0x5bc30b){return client['request'](_0x192736,_0x2296ae)['then'](function(_0x51ba91){logger[_0x586e('0xe')](_0x586e('0xf'),_0x3bf7c2,'request\x20sent');logger[_0x586e('0x10')](_0x586e('0x11'),_0x3bf7c2,_0x586e('0x12'),JSON['stringify'](_0x51ba91));if(_0x51ba91[_0x586e('0x13')]){if(_0x51ba91[_0x586e('0x13')][_0x586e('0x14')]===0x1f4){logger[_0x586e('0x13')](_0x586e('0xf'),_0x3bf7c2,_0x51ba91[_0x586e('0x13')][_0x586e('0x15')]);return _0x5bc30b(_0x51ba91['error'][_0x586e('0x15')]);}logger[_0x586e('0x13')](_0x586e('0xf'),_0x3bf7c2,_0x51ba91[_0x586e('0x13')][_0x586e('0x15')]);return _0x261320(_0x51ba91[_0x586e('0x13')]['message']);}else{logger['info'](_0x586e('0xf'),_0x3bf7c2,_0x586e('0x12'));_0x261320(_0x51ba91[_0x586e('0x16')]['message']);}})['catch'](function(_0x44eafe){logger[_0x586e('0x13')](_0x586e('0xf'),_0x3bf7c2,_0x44eafe);_0x5bc30b(_0x44eafe);});});}
\ No newline at end of file
+var _0xe9ed=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s'];(function(_0x2d608d,_0x5746dd){var _0x323097=function(_0x35eb8b){while(--_0x35eb8b){_0x2d608d['push'](_0x2d608d['shift']());}};_0x323097(++_0x5746dd);}(_0xe9ed,0x171));var _0xde9e=function(_0x17b253,_0x649956){_0x17b253=_0x17b253-0x0;var _0xe3fef0=_0xe9ed[_0x17b253];return _0xe3fef0;};'use strict';var _=require(_0xde9e('0x0'));var util=require('util');var moment=require(_0xde9e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde9e('0x2'));var db=require(_0xde9e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xde9e('0x4'));var config=require(_0xde9e('0x5'));var jayson=require(_0xde9e('0x6'));var client=jayson[_0xde9e('0x7')]['http']({'port':0x232a});config[_0xde9e('0x8')]=_[_0xde9e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xde9e('0xa'))(new Redis(config[_0xde9e('0x8')]));require('./chatGroup.socket')[_0xde9e('0xb')](socket);function respondWithRpcPromise(_0x1c9dd0,_0x4d7bf7,_0x5c4a59){return new BPromise(function(_0xfe0696,_0x1bb59c){return client[_0xde9e('0xc')](_0x1c9dd0,_0x5c4a59)['then'](function(_0x34db26){logger[_0xde9e('0xd')](_0xde9e('0xe'),_0x4d7bf7,_0xde9e('0xf'));logger[_0xde9e('0x10')](_0xde9e('0x11'),_0x4d7bf7,_0xde9e('0xf'),JSON[_0xde9e('0x12')](_0x34db26));if(_0x34db26[_0xde9e('0x13')]){if(_0x34db26[_0xde9e('0x13')][_0xde9e('0x14')]===0x1f4){logger[_0xde9e('0x13')]('ChatGroup,\x20%s,\x20%s',_0x4d7bf7,_0x34db26['error'][_0xde9e('0x15')]);return _0x1bb59c(_0x34db26[_0xde9e('0x13')][_0xde9e('0x15')]);}logger[_0xde9e('0x13')](_0xde9e('0xe'),_0x4d7bf7,_0x34db26['error'][_0xde9e('0x15')]);return _0xfe0696(_0x34db26[_0xde9e('0x13')][_0xde9e('0x15')]);}else{logger[_0xde9e('0xd')](_0xde9e('0xe'),_0x4d7bf7,_0xde9e('0xf'));_0xfe0696(_0x34db26[_0xde9e('0x16')][_0xde9e('0x15')]);}})[_0xde9e('0x17')](function(_0x2f06ce){logger[_0xde9e('0x13')](_0xde9e('0xe'),_0x4d7bf7,_0x2f06ce);_0x1bb59c(_0x2f06ce);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index cc63a0a..28c7711 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 _0x1e8c=['emit','removeListener','register','length','./chatGroup.events','remove','update'];(function(_0x4e12ee,_0x3675a8){var _0x54ab8f=function(_0x352cec){while(--_0x352cec){_0x4e12ee['push'](_0x4e12ee['shift']());}};_0x54ab8f(++_0x3675a8);}(_0x1e8c,0x1af));var _0xc1e8=function(_0x164ef5,_0xba6238){_0x164ef5=_0x164ef5-0x0;var _0x2d60c5=_0x1e8c[_0x164ef5];return _0x2d60c5;};'use strict';var ChatGroupEvents=require(_0xc1e8('0x0'));var events=['save',_0xc1e8('0x1'),_0xc1e8('0x2')];function createListener(_0x95e457,_0x4c22cc){return function(_0x5a69db){_0x4c22cc[_0xc1e8('0x3')](_0x95e457,_0x5a69db);};}function removeListener(_0x572118,_0x108c6e){return function(){ChatGroupEvents[_0xc1e8('0x4')](_0x572118,_0x108c6e);};}exports[_0xc1e8('0x5')]=function(_0x1d4f32){for(var _0x103880=0x0,_0x4004ae=events[_0xc1e8('0x6')];_0x103880<_0x4004ae;_0x103880++){var _0x21a4f5=events[_0x103880];var _0x1933e1=createListener('chatGroup:'+_0x21a4f5,_0x1d4f32);ChatGroupEvents['on'](_0x21a4f5,_0x1933e1);}};
\ No newline at end of file
+var _0xfb72=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register','length'];(function(_0x472fbc,_0x441a89){var _0x27a335=function(_0x675cd7){while(--_0x675cd7){_0x472fbc['push'](_0x472fbc['shift']());}};_0x27a335(++_0x441a89);}(_0xfb72,0xb1));var _0x2fb7=function(_0x4b8968,_0x5c9b44){_0x4b8968=_0x4b8968-0x0;var _0x3a0ab7=_0xfb72[_0x4b8968];return _0x3a0ab7;};'use strict';var ChatGroupEvents=require(_0x2fb7('0x0'));var events=['save',_0x2fb7('0x1'),_0x2fb7('0x2')];function createListener(_0xfaa86d,_0x31bbb8){return function(_0x3dd985){_0x31bbb8[_0x2fb7('0x3')](_0xfaa86d,_0x3dd985);};}function removeListener(_0x47bd0e,_0x66c98){return function(){ChatGroupEvents[_0x2fb7('0x4')](_0x47bd0e,_0x66c98);};}exports[_0x2fb7('0x5')]=function(_0x42d562){for(var _0x1e0e92=0x0,_0x47d6e8=events[_0x2fb7('0x6')];_0x1e0e92<_0x47d6e8;_0x1e0e92++){var _0x3efd5c=events[_0x1e0e92];var _0x5a6677=createListener(_0x2fb7('0x7')+_0x3efd5c,_0x42d562);ChatGroupEvents['on'](_0x3efd5c,_0x5a6677);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 86c10d9..0727ed1 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 _0x8e7a=['../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','/:id','isAuthenticated','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','express','Router'];(function(_0x4cec8d,_0x1dd165){var _0x5da9a7=function(_0x15c527){while(--_0x15c527){_0x4cec8d['push'](_0x4cec8d['shift']());}};_0x5da9a7(++_0x1dd165);}(_0x8e7a,0x1ac));var _0xa8e7=function(_0x519438,_0x24027d){_0x519438=_0x519438-0x0;var _0x324200=_0x8e7a[_0x519438];return _0x324200;};'use strict';var multer=require('multer');var util=require(_0xa8e7('0x0'));var path=require(_0xa8e7('0x1'));var timeout=require('connect-timeout');var express=require(_0xa8e7('0x2'));var router=express[_0xa8e7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa8e7('0x4'));var config=require(_0xa8e7('0x5'));var controller=require(_0xa8e7('0x6'));router[_0xa8e7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa8e7('0x7')](_0xa8e7('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xa8e7('0x7')](_0xa8e7('0x9'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0xb')]);router['get'](_0xa8e7('0xc'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0xd')]);router[_0xa8e7('0x7')](_0xa8e7('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0xa8e7('0x7')](_0xa8e7('0xf'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0x10')]);router[_0xa8e7('0x11')]('/',auth['isAuthenticated'](),controller[_0xa8e7('0x12')]);router['post']('/:id/members',auth['isAuthenticated'](),controller[_0xa8e7('0x13')]);router[_0xa8e7('0x11')](_0xa8e7('0xf'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0x14')]);router[_0xa8e7('0x15')](_0xa8e7('0x9'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0x16')]);router[_0xa8e7('0x17')](_0xa8e7('0x9'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0x18')]);router[_0xa8e7('0x17')](_0xa8e7('0xe'),auth[_0xa8e7('0xa')](),controller[_0xa8e7('0x19')]);module[_0xa8e7('0x1a')]=router;
\ No newline at end of file
+var _0x1642=['getMembers','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','path','connect-timeout','../../components/auth/service','../../config/environment','./chatGroup.controller','/describe','isAuthenticated','describe','get','/:id','/:id/unread','getUnread'];(function(_0x1b65fa,_0x525365){var _0x2e3e6b=function(_0x2affef){while(--_0x2affef){_0x1b65fa['push'](_0x1b65fa['shift']());}};_0x2e3e6b(++_0x525365);}(_0x1642,0x1e8));var _0x2164=function(_0x123700,_0x3760c1){_0x123700=_0x123700-0x0;var _0x2d6bcf=_0x1642[_0x123700];return _0x2d6bcf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2164('0x0'));var timeout=require(_0x2164('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2164('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x2164('0x3'));var controller=require(_0x2164('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2164('0x5'),auth[_0x2164('0x6')](),controller[_0x2164('0x7')]);router[_0x2164('0x8')](_0x2164('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x2164('0x8')](_0x2164('0xa'),auth[_0x2164('0x6')](),controller[_0x2164('0xb')]);router[_0x2164('0x8')]('/:id/members',auth[_0x2164('0x6')](),controller[_0x2164('0xc')]);router[_0x2164('0x8')](_0x2164('0xd'),auth[_0x2164('0x6')](),controller[_0x2164('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2164('0xf')](_0x2164('0x10'),auth['isAuthenticated'](),controller[_0x2164('0x11')]);router[_0x2164('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2164('0x12')]);router[_0x2164('0x13')]('/:id',auth[_0x2164('0x6')](),controller[_0x2164('0x14')]);router[_0x2164('0x15')](_0x2164('0x9'),auth[_0x2164('0x6')](),controller[_0x2164('0x16')]);router[_0x2164('0x15')](_0x2164('0x10'),auth[_0x2164('0x6')](),controller[_0x2164('0x17')]);module[_0x2164('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 a5f1ef1..7f1598f 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 _0x51a2=['out','exports','BOOLEAN','ENUM','star','TEXT','STRING','DATE','long'];(function(_0x507527,_0x3d1f6e){var _0x2dec80=function(_0x5c1e5f){while(--_0x5c1e5f){_0x507527['push'](_0x507527['shift']());}};_0x2dec80(++_0x3d1f6e);}(_0x51a2,0x76));var _0x251a=function(_0x299995,_0x54a9c4){_0x299995=_0x299995-0x0;var _0x2cc68b=_0x51a2[_0x299995];return _0x2cc68b;};'use strict';var Sequelize=require('sequelize');module[_0x251a('0x0')]={'closed':{'type':Sequelize[_0x251a('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x251a('0x2')](_0x251a('0x3'),'thumb'),'defaultValue':_0x251a('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x251a('0x4')]},'mailTranscript':{'type':Sequelize[_0x251a('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x251a('0x6')]},'disposition':{'type':Sequelize[_0x251a('0x5')]},'secondDisposition':{'type':Sequelize[_0x251a('0x5')]},'thirdDisposition':{'type':Sequelize[_0x251a('0x5')]},'note':{'type':Sequelize[_0x251a('0x5')]},'browserName':{'type':Sequelize[_0x251a('0x5')]},'browserVersion':{'type':Sequelize[_0x251a('0x5')]},'osName':{'type':Sequelize[_0x251a('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x251a('0x5')]},'deviceType':{'type':Sequelize[_0x251a('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x251a('0x5')]},'formData':{'type':Sequelize[_0x251a('0x4')](_0x251a('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x251a('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x251a('0x2')]('in',_0x251a('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x251a('0x5')]},'customerPort':{'type':Sequelize[_0x251a('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x251a('0x4')]}};
\ No newline at end of file
+var _0x3b93=['DATE','long','out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x5fb102,_0x50bc80){var _0x485417=function(_0x3064f7){while(--_0x3064f7){_0x5fb102['push'](_0x5fb102['shift']());}};_0x485417(++_0x50bc80);}(_0x3b93,0x92));var _0x33b9=function(_0x501f04,_0x2d4092){_0x501f04=_0x501f04-0x0;var _0x3d0924=_0x3b93[_0x501f04];return _0x3d0924;};'use strict';var Sequelize=require('sequelize');module[_0x33b9('0x0')]={'closed':{'type':Sequelize[_0x33b9('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x33b9('0x2')]},'ratingType':{'type':Sequelize[_0x33b9('0x3')](_0x33b9('0x4'),_0x33b9('0x5')),'defaultValue':_0x33b9('0x4')},'ratingMessage':{'type':Sequelize[_0x33b9('0x6')]},'pathTranscript':{'type':Sequelize[_0x33b9('0x6')]},'mailTranscript':{'type':Sequelize[_0x33b9('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x33b9('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x33b9('0x7')]},'thirdDisposition':{'type':Sequelize[_0x33b9('0x7')]},'note':{'type':Sequelize[_0x33b9('0x7')]},'browserName':{'type':Sequelize[_0x33b9('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x33b9('0x7')]},'osVersion':{'type':Sequelize[_0x33b9('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x33b9('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x33b9('0x6')]},'customerIp':{'type':Sequelize[_0x33b9('0x7')]},'formData':{'type':Sequelize[_0x33b9('0x6')](_0x33b9('0x9'))},'read1stAt':{'type':Sequelize[_0x33b9('0x8')]},'lastMsgAt':{'type':Sequelize[_0x33b9('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x33b9('0x3')]('in',_0x33b9('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x33b9('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x33b9('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 9ab7026..b737bf5 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 _0x1d24=['options','create','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','MotionCWB:','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','format','now','pathTranscript','Messages','agentAlias','System','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','secret','includeAgent','setTags','spread','chatInteractionTags:save','removeTags','unix','files','tmp','server','attachments','CmContact','firstName','lastName','direction','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','disposition','browserName','osName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','sendStatus','stack','name','Users','map','fullname','Tags','split','forEach','index','ChatInteraction','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_messages','me.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','Tag','union','User','operator','UserId','buildExpression','text','start','body','keys','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','push','all','show','params','includeAll','include'];(function(_0x417a22,_0x588555){var _0x569b43=function(_0x23c332){while(--_0x23c332){_0x417a22['push'](_0x417a22['shift']());}};_0x569b43(++_0x588555);}(_0x1d24,0x75));var _0x41d2=function(_0x3c77f9,_0x2abb07){_0x3c77f9=_0x3c77f9-0x0;var _0x41790a=_0x1d24[_0x3c77f9];return _0x41790a;};'use strict';var emlformat=require(_0x41d2('0x0'));var rimraf=require(_0x41d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41d2('0x2'));var rp=require(_0x41d2('0x3'));var moment=require(_0x41d2('0x4'));var BPromise=require(_0x41d2('0x5'));var Mustache=require(_0x41d2('0x6'));var util=require(_0x41d2('0x7'));var path=require(_0x41d2('0x8'));var sox=require(_0x41d2('0x9'));var csv=require(_0x41d2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41d2('0xb'));var squel=require(_0x41d2('0xc'));var crypto=require('crypto');var jsforce=require(_0x41d2('0xd'));var deskjs=require(_0x41d2('0xe'));var toCsv=require(_0x41d2('0xa'));var querystring=require(_0x41d2('0xf'));var Papa=require(_0x41d2('0x10'));var Redis=require(_0x41d2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x41d2('0x12'));var as=require(_0x41d2('0x13'));var pdf=require(_0x41d2('0x14'));var hardwareService=require(_0x41d2('0x15'));var logger=require(_0x41d2('0x16'))(_0x41d2('0x17'));var utils=require(_0x41d2('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x41d2('0x19'))['db'];config['redis']=_[_0x41d2('0x1a')](config[_0x41d2('0x1b')],{'host':_0x41d2('0x1c'),'port':0x18eb});var socket=require(_0x41d2('0x1d'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x41d2('0x1e')](socket);var jayson=require(_0x41d2('0x1f'));var client=jayson['client'][_0x41d2('0x20')]({'port':0x232b});var client9004=jayson[_0x41d2('0x21')][_0x41d2('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x59eee3,_0x46d471,_0x31521b,_0x5aece9){return new BPromise(function(_0x54ac4e,_0x4643aa){var _0x325c1b=_0x5aece9||client;return _0x325c1b[_0x41d2('0x22')](_0x59eee3,_0x31521b)['then'](function(_0x561071){logger['info'](_0x41d2('0x23'),_0x46d471,'request\x20sent');logger[_0x41d2('0x24')](_0x41d2('0x25'),_0x46d471,'request\x20sent',JSON[_0x41d2('0x26')](_0x561071));if(_0x561071[_0x41d2('0x27')]){if(_0x561071[_0x41d2('0x27')]['code']===0x1f4){logger[_0x41d2('0x27')](_0x41d2('0x23'),_0x46d471,_0x561071[_0x41d2('0x27')][_0x41d2('0x28')]);return _0x4643aa(_0x561071[_0x41d2('0x27')][_0x41d2('0x28')]);}logger['error'](_0x41d2('0x23'),_0x46d471,_0x561071['error']['message']);return _0x54ac4e(_0x561071[_0x41d2('0x27')][_0x41d2('0x28')]);}else{logger[_0x41d2('0x29')](_0x41d2('0x23'),_0x46d471,_0x41d2('0x2a'));_0x54ac4e(_0x561071[_0x41d2('0x2b')]['message']);}})[_0x41d2('0x2c')](function(_0x38d9be){logger['error'](_0x41d2('0x23'),_0x46d471,_0x38d9be);_0x4643aa(_0x38d9be);});});}function respondWithStatusCode(_0x4bf3f2,_0x4a952d){_0x4a952d=_0x4a952d||0xcc;return function(_0x2cec87){if(_0x2cec87){return _0x4bf3f2['sendStatus'](_0x4a952d);}return _0x4bf3f2[_0x41d2('0x2d')](_0x4a952d)[_0x41d2('0x2e')]();};}function respondWithResult(_0x545fa6,_0x9c7498){_0x9c7498=_0x9c7498||0xc8;return function(_0x121b56){if(_0x121b56){return _0x545fa6[_0x41d2('0x2d')](_0x9c7498)[_0x41d2('0x2f')](_0x121b56);}};}function respondWithFilteredResult(_0x38102e,_0x5bf5a3){return function(_0xa7f22a){if(_0xa7f22a){var _0x427835=_0xa7f22a[_0x41d2('0x30')],_0x272b38=_0x5bf5a3[_0x41d2('0x31')],_0x4122e5=_0x5bf5a3[_0x41d2('0x31')]+_0x5bf5a3[_0x41d2('0x32')],_0x2cc99c;if(_0x4122e5>=_0x427835){_0x4122e5=_0x427835;_0x2cc99c=0xc8;}else{_0x2cc99c=0xce;}_0x38102e[_0x41d2('0x2d')](_0x2cc99c);return _0x38102e[_0x41d2('0x33')](_0x41d2('0x34'),_0x272b38+'-'+_0x4122e5+'/'+_0x427835)[_0x41d2('0x2f')](_0xa7f22a);}return null;};}function patchUpdates(_0x4258fe){return function(_0x4b5753){try{jsonpatch['apply'](_0x4b5753,_0x4258fe,!![]);}catch(_0x2e51f0){return BPromise[_0x41d2('0x35')](_0x2e51f0);}return _0x4b5753[_0x41d2('0x36')]();};}function saveUpdates(_0x10762b,_0x3e6fb5){return function(_0x77940b){if(_0x77940b){return _0x77940b[_0x41d2('0x37')](_0x10762b)[_0x41d2('0x38')](function(_0x3e82db){return _0x3e82db;});}return null;};}function removeEntity(_0x3b4edc,_0xd15f11){return function(_0x5f1838){if(_0x5f1838){return _0x5f1838['destroy']()['then'](function(){_0x3b4edc[_0x41d2('0x2d')](0xcc)[_0x41d2('0x2e')]();});}};}function handleEntityNotFound(_0x53fa5f,_0x520261){return function(_0x38293c){if(!_0x38293c){_0x53fa5f[_0x41d2('0x39')](0x194);}return _0x38293c;};}function handleError(_0x277cc8,_0xe504dc){_0xe504dc=_0xe504dc||0x1f4;return function(_0x20773d){logger[_0x41d2('0x27')](_0x20773d[_0x41d2('0x3a')]);if(_0x20773d[_0x41d2('0x3b')]){delete _0x20773d[_0x41d2('0x3b')];}_0x277cc8['status'](_0xe504dc)['send'](_0x20773d);};}function getInteractionUsers(_0x1b66b,_0x2315b1){return new BPromise(function(_0x1c41c4,_0x312424){try{if(_0x2315b1[_0x1b66b['id']]){_0x1b66b[_0x41d2('0x3c')]=_[_0x41d2('0x3d')](_0x2315b1[_0x1b66b['id']],function(_0x45891d){return{'id':_0x45891d['id'],'fullname':_0x45891d[_0x41d2('0x3e')]};});}}catch(_0x45042e){_0x312424(_0x45042e);}_0x1c41c4(_0x1b66b);});}function getInteractionTags(_0x16f70c,_0xa4ef53){return new BPromise(function(_0x3cd719,_0x165613){try{if(_0x16f70c['TagIds']){_0x16f70c[_0x41d2('0x3f')]=[];_0x16f70c['TagIds'][_0x41d2('0x40')](',')[_0x41d2('0x41')](function(_0x3879a7){_0x16f70c['Tags']['push'](_0xa4ef53[_0x3879a7]);});}delete _0x16f70c['TagIds'];}catch(_0x10049d){_0x165613(_0x10049d);}_0x3cd719(_0x16f70c);});}function updateChatInteraction(_0x54d72f,_0x2af5df,_0x86f802){return new BPromise(function(_0x18d157,_0x2ac394){return getInteractionUsers(_0x54d72f,_0x86f802)[_0x41d2('0x38')](function(_0x660c9f){return getInteractionTags(_0x660c9f,_0x2af5df);})[_0x41d2('0x38')](function(_0xdd270d){_0x18d157(_0xdd270d);})['catch'](function(_0x546754){_0x2ac394(_0x546754);});});}exports[_0x41d2('0x42')]=function(_0x5c1dbe,_0x4a9157){var _0x39a885={},_0x3da08c={},_0x498308={'count':0x0,'rows':[]};var _0x2e43d3=_[_0x41d2('0x3d')](db[_0x41d2('0x43')][_0x41d2('0x44')],function(_0x4b5ef5){return{'name':_0x4b5ef5[_0x41d2('0x45')],'type':_0x4b5ef5['type']['key']};});_0x3da08c[_0x41d2('0x46')]=_[_0x41d2('0x3d')](_0x2e43d3,_0x41d2('0x3b'));_0x3da08c[_0x41d2('0x47')]=_['keys'](_0x5c1dbe[_0x41d2('0x47')]);_0x3da08c['filters']=_[_0x41d2('0x48')](_0x3da08c[_0x41d2('0x46')],_0x3da08c['query']);_0x39a885[_0x41d2('0x49')]=_[_0x41d2('0x48')](_0x3da08c['model'],qs[_0x41d2('0x4a')](_0x5c1dbe[_0x41d2('0x47')]['fields']));_0x39a885[_0x41d2('0x49')]=_0x39a885[_0x41d2('0x49')][_0x41d2('0x4b')]?_0x39a885[_0x41d2('0x49')]:_0x3da08c[_0x41d2('0x46')];if(!_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x4c')](_0x41d2('0x4d'))){_0x39a885[_0x41d2('0x32')]=qs[_0x41d2('0x32')](_0x5c1dbe['query'][_0x41d2('0x32')]);_0x39a885[_0x41d2('0x31')]=qs[_0x41d2('0x31')](_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x31')]);}_0x39a885['order']=qs['sort'](_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x4e')]);_0x39a885[_0x41d2('0x4f')]=qs['filters'](_[_0x41d2('0x50')](_0x5c1dbe[_0x41d2('0x47')],_0x3da08c[_0x41d2('0x51')]),_0x2e43d3);var _0x1b65a0=[];var _0x209701=squel[_0x41d2('0x52')]()[_0x41d2('0x53')]('id')[_0x41d2('0x53')]('name')[_0x41d2('0x53')](_0x41d2('0x54'))[_0x41d2('0x55')](_0x41d2('0x56'));var _0x4be4ef=squel[_0x41d2('0x52')]()[_0x41d2('0x53')](_0x41d2('0x57'))[_0x41d2('0x53')](_0x41d2('0x58'))['field'](_0x41d2('0x59'))[_0x41d2('0x55')]('user_has_chat_interactions','ui')[_0x41d2('0x5a')](_0x41d2('0x5b'),'u',_0x41d2('0x5c'));var _0x358027=squel[_0x41d2('0x52')]()[_0x41d2('0x55')](_0x41d2('0x5d'),'i')[_0x41d2('0x5a')](_0x41d2('0x5e'),'c',_0x41d2('0x5f'))[_0x41d2('0x5a')](_0x41d2('0x5b'),'o',_0x41d2('0x60'))[_0x41d2('0x5a')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x41d2('0x61'),'me',_0x41d2('0x62'))['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join'](_0x41d2('0x56'),'t','t.id\x20=\x20it.TagId');var _0x3291fd=squel[_0x41d2('0x63')]();var _0x5868e0=[];var _0x30ac5d=squel[_0x41d2('0x63')]();var _0x1f191c;if(_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x64')]){_0x1f191c=as[_0x41d2('0x65')](_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x64')]);var _0x2ccf68=_0x1f191c[_0x41d2('0x66')];for(var _0x2cddbb=0x0;_0x2cddbb<_0x1f191c[_0x41d2('0x67')][_0x41d2('0x4b')];_0x2cddbb++){var _0x43cad4=_0x1f191c[_0x41d2('0x67')][_0x2cddbb];var _0x59da53='i';var _0x546915=_[_0x41d2('0x68')](_0x2e43d3,[_0x41d2('0x3b'),_0x43cad4[_0x41d2('0x53')]]);if(!_0x546915){switch(_0x43cad4['field']){case _0x41d2('0x69'):if(_0x43cad4[_0x41d2('0x6a')]==0x1){_0x358027[_0x41d2('0x6b')]('`'+_0x43cad4[_0x41d2('0x53')]+_0x41d2('0x6c'));}else{_0x358027[_0x41d2('0x6b')]('`'+_0x43cad4[_0x41d2('0x53')]+_0x41d2('0x6d'));}break;case _0x41d2('0x6e'):if(_0x43cad4['operator']===_0x41d2('0x6f')){if(_0x43cad4[_0x41d2('0x6a')][_0x41d2('0x40')]('\x20')[_0x41d2('0x4b')]>0x1){_0x3291fd[_0x2ccf68](_0x41d2('0x70'),qs[_0x41d2('0x71')](_0x43cad4['value']),null);}else{var _0x3526a3='%'+_0x43cad4[_0x41d2('0x6a')]+'%';_0x3291fd[_0x2ccf68](_0x41d2('0x72'),_0x3526a3,_0x3526a3,_0x3526a3);}}else{_0x546915=_['find'](_0x2e43d3,['name',_0x41d2('0x73')]);_0x43cad4['field']=_0x41d2('0x73');_0x5e2358=as['buildExpression'](_0x59da53,_0x546915[_0x41d2('0x74')],_0x43cad4);_0x3291fd[_0x2ccf68](_0x5e2358['text'],_0x5e2358[_0x41d2('0x6a')]['start'],_0x5e2358[_0x41d2('0x6a')][_0x41d2('0x2e')]);}break;case _0x41d2('0x75'):var _0x10e967=_0x43cad4[_0x41d2('0x6a')][_0x41d2('0x40')](',')[_0x41d2('0x3d')](function(_0x248f71){return Number(_0x248f71);});_0x10e967[_0x41d2('0x41')](function(_0x1bb8fd){_0x30ac5d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1bb8fd+',%');});_0x5868e0=_[_0x41d2('0x76')](_0x5868e0,_0x10e967);break;case _0x41d2('0x77'):if(_0x43cad4[_0x41d2('0x78')]===_0x41d2('0x6f')){_0x3291fd[_0x2ccf68]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x43cad4[_0x41d2('0x6a')]+'%',null);}else{_0x546915=_[_0x41d2('0x68')](_0x2e43d3,[_0x41d2('0x3b'),_0x41d2('0x79')]);_0x43cad4['field']='UserId';_0x5e2358=as[_0x41d2('0x7a')](_0x59da53,_0x546915[_0x41d2('0x74')],_0x43cad4);_0x3291fd[_0x2ccf68](_0x5e2358[_0x41d2('0x7b')],_0x5e2358[_0x41d2('0x6a')][_0x41d2('0x7c')],_0x5e2358[_0x41d2('0x6a')][_0x41d2('0x2e')]);}break;case _0x41d2('0x7d'):_0x5e2358=as[_0x41d2('0x7a')]('me',null,_0x43cad4);_0x3291fd[_0x2ccf68](_0x5e2358[_0x41d2('0x7b')],_0x5e2358[_0x41d2('0x6a')][_0x41d2('0x7c')],_0x5e2358['value']['end']);break;}}else{var _0x5e2358=as[_0x41d2('0x7a')](_0x59da53,_0x546915[_0x41d2('0x74')],_0x43cad4);_0x3291fd[_0x2ccf68](_0x5e2358[_0x41d2('0x7b')],_0x5e2358['value'][_0x41d2('0x7c')],_0x5e2358['value'][_0x41d2('0x2e')]);}}}else{var _0x2d7702=_(_0x5c1dbe[_0x41d2('0x47')])[_0x41d2('0x7e')]()[_0x41d2('0x3d')](function(_0x15c65c){return _[_0x41d2('0x7f')](_0x2e43d3,[_0x41d2('0x3b'),_0x15c65c])?_0x15c65c:undefined;})[_0x41d2('0x80')]()['value']();if(!_[_0x41d2('0x81')](_0x2d7702)){_0x2d7702[_0x41d2('0x41')](function(_0x2a45c5){if(_0x2a45c5===_0x41d2('0x82')){_0x358027[_0x41d2('0x4f')](_0x41d2('0x83'),[][_0x41d2('0x84')](_0x5c1dbe[_0x41d2('0x47')][_0x2a45c5]));}else if(_0x2a45c5==='createdAt'){var _0x579ca3=JSON[_0x41d2('0x85')](_0x5c1dbe[_0x41d2('0x47')][_0x2a45c5])[_0x41d2('0x86')];var _0x3a54aa=JSON[_0x41d2('0x85')](_0x5c1dbe[_0x41d2('0x47')][_0x2a45c5])[_0x41d2('0x87')];_0x358027[_0x41d2('0x4f')](_0x41d2('0x88'),_0x579ca3,_0x3a54aa);}else{if(_0x5c1dbe[_0x41d2('0x47')][_0x2a45c5]===_0x41d2('0x89')){_0x358027[_0x41d2('0x4f')]('i.'+_0x2a45c5+_0x41d2('0x8a'));}else{_0x358027[_0x41d2('0x4f')]('i.'+_0x2a45c5+_0x41d2('0x8b'),_0x5c1dbe[_0x41d2('0x47')][_0x2a45c5]);}}});}if(_0x5c1dbe['query'][_0x41d2('0x8c')]){if(_0x5c1dbe[_0x41d2('0x47')]['read']==0x1){_0x358027[_0x41d2('0x6b')](_0x41d2('0x8d'));}else{_0x358027['having'](_0x41d2('0x8e'));}}if(_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x8f')]){_0x5868e0=_['isArray'](_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x8f')])?_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x8f')]:new Array(_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x8f')]);_0x5868e0[_0x41d2('0x41')](function(_0xee2f31){_0x30ac5d['or'](_0x41d2('0x90'),'%,'+_0xee2f31+',%');});}if(_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x91')]){var _0x1a0ffd=_0x5c1dbe['query'][_0x41d2('0x91')]['replace']('\x5c','\x5c\x5c')[_0x41d2('0x92')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1a0ffd)){_0x3291fd['or'](_0x41d2('0x93'),_0x1a0ffd+'%');}else{_0x3291fd['or'](_0x41d2('0x94'),qs[_0x41d2('0x71')](_0x1a0ffd))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1a0ffd+'%');}}}_0x358027[_0x41d2('0x4f')](_0x3291fd);_0x358027[_0x41d2('0x95')](_0x41d2('0x96'));var _0x5de4a9={'type':db[_0x41d2('0x97')][_0x41d2('0x98')][_0x41d2('0x99')],'raw':!![]};var _0x16a58a=_0x358027[_0x41d2('0x9a')]();_0x16a58a['field'](_0x41d2('0x96'));_0x16a58a['field'](_0x41d2('0x9b'),'unreadMessages');if(_0x39a885[_0x41d2('0x9c')]){_0x39a885[_0x41d2('0x9c')][_0x41d2('0x41')](function(_0x5d9b7e){var _0x1acf59=_0x5d9b7e[0x0]==='contactName'?_0x5d9b7e[0x0]:'i.'+_0x5d9b7e[0x0];_0x358027[_0x41d2('0x9c')](_0x1acf59,_0x5d9b7e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x41d2('0x81')](_0x5868e0)){_0x358027[_0x41d2('0x6b')](_0x30ac5d);_0x16a58a[_0x41d2('0x4f')]('t.id\x20IN\x20?',_0x5868e0);}BPromise[_0x41d2('0x9d')]()['then'](function(){if(!_0x1f191c){if(_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x82')])return;_0x16a58a['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x358027[_0x41d2('0x4f')](_0x41d2('0x9e'));return;}if(_0x5c1dbe[_0x41d2('0x9f')][_0x41d2('0xa0')]!==_0x41d2('0xa1'))return;return _0x5c1dbe[_0x41d2('0x9f')][_0x41d2('0xa2')]({'attributes':['id'],'raw':!![]})[_0x41d2('0x38')](function(_0x601d72){if(_[_0x41d2('0x81')](_0x601d72)){_0x16a58a[_0x41d2('0x4f')]('i.ChatWebsiteId\x20IS\x20NULL');_0x358027[_0x41d2('0x4f')](_0x41d2('0xa3'));}else{_0x16a58a[_0x41d2('0x4f')](_0x41d2('0x83'),_[_0x41d2('0x3d')](_0x601d72,'id'));_0x358027['where'](_0x41d2('0x83'),_[_0x41d2('0x3d')](_0x601d72,'id'));}});})['then'](function(){if(_0x5c1dbe[_0x41d2('0x9f')][_0x41d2('0xa0')]==='agent'&&!_0x1f191c&&!_0x5c1dbe[_0x41d2('0x47')]['ChatWebsiteId'])return[];return db[_0x41d2('0xa4')][_0x41d2('0x47')](_0x16a58a['toString'](),_0x5de4a9);})[_0x41d2('0x38')](function(_0x2a2a47){_0x498308[_0x41d2('0x30')]=_0x2a2a47[_0x41d2('0x4b')];if(_0x498308[_0x41d2('0x30')]===0x0)return[];return db[_0x41d2('0xa4')][_0x41d2('0x47')](_0x209701[_0x41d2('0xa5')](),_0x5de4a9)[_0x41d2('0x38')](function(_0x59c814){_0x1b65a0=_[_0x41d2('0xa6')](_0x59c814,'id');_0x5de4a9=_['merge'](_0x5de4a9,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5c1dbe[_0x41d2('0x47')][_0x41d2('0x4a')]){_0x39a885['attributes'][_0x41d2('0x41')](function(_0x263157){_0x358027[_0x41d2('0x53')]('i.'+_0x263157);});}else{_0x358027[_0x41d2('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x41d2('0x69'));_0x358027[_0x41d2('0x53')]('a.key',_0x41d2('0xa7'));_0x358027[_0x41d2('0x53')](_0x41d2('0xa8'),_0x41d2('0xa9'));_0x358027[_0x41d2('0x53')](_0x41d2('0xaa'),_0x41d2('0xab'));_0x358027['field'](_0x41d2('0xac'));_0x358027['field'](_0x41d2('0xad'),_0x41d2('0xae'));_0x358027[_0x41d2('0x53')]('c.lastName',_0x41d2('0xaf'));_0x358027[_0x41d2('0x53')](_0x41d2('0xb0'),'Contact.email');_0x358027[_0x41d2('0x53')](_0x41d2('0xb1'),'Contact.phone');_0x358027[_0x41d2('0x53')](_0x41d2('0xb2'),_0x41d2('0xb3'));_0x358027[_0x41d2('0x53')](_0x41d2('0xb4'),_0x41d2('0xb5'));_0x358027['field']('o.fullname',_0x41d2('0xb6'));_0x358027[_0x41d2('0x53')](_0x41d2('0xb7'),'Owner.internal');_0x358027[_0x41d2('0x53')](_0x41d2('0xb8'),'TagIds');}if(_0x39a885['limit'])_0x358027['limit'](_0x39a885['limit']);if(_0x39a885['offset'])_0x358027['offset'](_0x39a885['offset']);return db['sequelize'][_0x41d2('0x47')](_0x358027[_0x41d2('0xa5')](),_0x5de4a9);})[_0x41d2('0x38')](function(_0x29be02){_0x4be4ef[_0x41d2('0x4f')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x29be02,'id'));return db[_0x41d2('0xa4')][_0x41d2('0x47')](_0x4be4ef[_0x41d2('0xa5')](),_0x5de4a9)['then'](function(_0x5e01b4){var _0x14cff7=_['groupBy'](_0x5e01b4,_0x41d2('0xb9'));var _0x5cdd3d=[];_0x29be02[_0x41d2('0x41')](function(_0x3f7597){_0x5cdd3d[_0x41d2('0xba')](updateChatInteraction(_0x3f7597,_0x1b65a0,_0x14cff7));});return BPromise[_0x41d2('0xbb')](_0x5cdd3d);});});})[_0x41d2('0x38')](function(_0x59856a){_0x498308['rows']=_0x59856a;return _0x498308;})[_0x41d2('0x38')](respondWithFilteredResult(_0x4a9157,_0x39a885))['catch'](handleError(_0x4a9157,null));};exports[_0x41d2('0xbc')]=function(_0x1221a0,_0x1d250d){var _0x592a04={'raw':![],'where':{'id':_0x1221a0[_0x41d2('0xbd')]['id']}},_0x45fff6={};_0x45fff6['model']=_[_0x41d2('0x7e')](db[_0x41d2('0x43')][_0x41d2('0x44')]);_0x45fff6['query']=_['keys'](_0x1221a0[_0x41d2('0x47')]);_0x45fff6[_0x41d2('0x51')]=_[_0x41d2('0x48')](_0x45fff6[_0x41d2('0x46')],_0x45fff6[_0x41d2('0x47')]);_0x592a04[_0x41d2('0x49')]=_['intersection'](_0x45fff6['model'],qs['fields'](_0x1221a0[_0x41d2('0x47')][_0x41d2('0x4a')]));_0x592a04[_0x41d2('0x49')]=_0x592a04[_0x41d2('0x49')]['length']?_0x592a04['attributes']:_0x45fff6[_0x41d2('0x46')];if(_0x1221a0[_0x41d2('0x47')][_0x41d2('0xbe')]){_0x592a04[_0x41d2('0xbf')]=[{'all':!![]}];}_0x592a04=_['merge']({},_0x592a04,_0x1221a0[_0x41d2('0xc0')]);return db['ChatInteraction'][_0x41d2('0x68')](_0x592a04)[_0x41d2('0x38')](handleEntityNotFound(_0x1d250d,null))[_0x41d2('0x38')](respondWithResult(_0x1d250d,null))['catch'](handleError(_0x1d250d,null));};exports[_0x41d2('0xc1')]=function(_0x1722dc,_0x45034c){return db[_0x41d2('0x43')]['create'](_0x1722dc[_0x41d2('0x7d')],{})['then'](respondWithResult(_0x45034c,0xc9))['catch'](handleError(_0x45034c,null));};exports[_0x41d2('0x37')]=function(_0x5ce1d9,_0xe103f){if(_0x5ce1d9[_0x41d2('0x7d')]['id']){delete _0x5ce1d9[_0x41d2('0x7d')]['id'];}return db[_0x41d2('0x43')]['find']({'where':{'id':_0x5ce1d9[_0x41d2('0xbd')]['id']}})[_0x41d2('0x38')](handleEntityNotFound(_0xe103f,null))[_0x41d2('0x38')](saveUpdates(_0x5ce1d9[_0x41d2('0x7d')],null))[_0x41d2('0x38')](respondWithResult(_0xe103f,null))[_0x41d2('0x2c')](handleError(_0xe103f,null));};exports[_0x41d2('0xc2')]=function(_0x1b1be5,_0x3b8ac9){return db[_0x41d2('0x43')][_0x41d2('0x68')]({'where':{'id':_0x1b1be5['params']['id']}})[_0x41d2('0x38')](handleEntityNotFound(_0x3b8ac9,null))[_0x41d2('0x38')](removeEntity(_0x3b8ac9,null))[_0x41d2('0x2c')](handleError(_0x3b8ac9,null));};exports['describe']=function(_0x1d4a41,_0x566214){return db[_0x41d2('0x43')][_0x41d2('0xc3')]()[_0x41d2('0x38')](respondWithResult(_0x566214,null))[_0x41d2('0x2c')](handleError(_0x566214,null));};exports[_0x41d2('0xc4')]=function(_0x2fba4c,_0x14b414){var _0x38c99f=_0x2fba4c['params']['id'];var _0x1e4665;var _0x4eb5d7;var _0x4400ec;return db[_0x41d2('0x43')][_0x41d2('0xc5')]({'where':{'id':_0x38c99f}})[_0x41d2('0x38')](function(_0x40bacf){_0x1e4665=_0x40bacf;return db['ChatWebsite'][_0x41d2('0xc5')]({'where':{'id':_0x40bacf[_0x41d2('0x82')]},'attributes':['id',_0x41d2('0xc6'),'vidaooEscalation'],'raw':!![]});})[_0x41d2('0x38')](function(_0x2efcea){if(_0x2efcea&&_0x2efcea[_0x41d2('0xc6')]&&_0x2efcea[_0x41d2('0xc7')]){_0x4eb5d7=_0x2efcea;var _0x1abb65={'rejectUnauthorized':![],'method':'POST','uri':'https://api-vidaoo.xcally.com/api/v1/sessions','headers':{'X-APIKEY':_0x2efcea['vidaooApiKey']},'body':{'name':_0x41d2('0xc8')+_0x38c99f},'redirect':_0x41d2('0xc9'),'json':!![]};return rp(_0x1abb65);}else{throw new db[(_0x41d2('0x97'))][(_0x41d2('0xca'))](_0x41d2('0xcb'));}})[_0x41d2('0x38')](function(_0x438a6b){_0x4400ec=_0x438a6b;if(_0x4400ec['id']){var _0x4d9b2b={'body':_0x4400ec[_0x41d2('0xcc')],'ChatWebsiteId':_0x4eb5d7['id'],'ChatInteractionId':_0x1e4665['id'],'direction':_0x41d2('0xcd'),'UserId':_0x2fba4c[_0x41d2('0x9f')]['id']};return db[_0x41d2('0xce')][_0x41d2('0xc1')](_0x4d9b2b,{});}else{throw new db['Sequelize'][(_0x41d2('0xca'))](_0x41d2('0xcf'));}})['then'](function(){return _0x1e4665[_0x41d2('0xd0')]({'vidaooSessionId':_0x4400ec['id']});})[_0x41d2('0x38')](respondWithResult(_0x14b414,null))[_0x41d2('0x2c')](handleError(_0x14b414,null));};exports[_0x41d2('0xd1')]=function(_0x1de97f,_0x391121){if(_0x1de97f[_0x41d2('0x7d')]['id']){delete _0x1de97f[_0x41d2('0x7d')]['id'];}return db[_0x41d2('0x43')][_0x41d2('0x68')]({'where':{'id':_0x1de97f['params']['id']},'include':[{'model':db['CmContact'],'as':_0x41d2('0x6e')}]})[_0x41d2('0x38')](handleEntityNotFound(_0x391121,null))[_0x41d2('0x38')](saveUpdates(_0x1de97f[_0x41d2('0x7d')],null))[_0x41d2('0x38')](respondWithResult(_0x391121,null))[_0x41d2('0x2c')](handleError(_0x391121,null));};exports[_0x41d2('0xd2')]=function(_0x4eacb3,_0x287bf6,_0x13b506){if(_0x4eacb3['body']['id']){delete _0x4eacb3[_0x41d2('0x7d')]['id'];}return db[_0x41d2('0x43')][_0x41d2('0x68')]({'where':{'id':_0x4eacb3[_0x41d2('0xbd')]['id']}})['then'](function(_0x120e97){if(!_0x120e97){logger[_0x41d2('0x27')](_0x41d2('0xd3'),_0x41d2('0xd2'),0x194,_0x41d2('0xd4'));_0x287bf6[_0x41d2('0x39')](0x194);}else{if(_0x120e97[_0x41d2('0x79')]){throw new db[(_0x41d2('0x97'))][(_0x41d2('0xca'))](_0x41d2('0xd5'));}}return _0x120e97;})[_0x41d2('0x38')](function(_0x1dd09f){if(_0x1dd09f){return _0x1dd09f[_0x41d2('0x37')]({'closed':_0x4eacb3['body'][_0x41d2('0xd6')],'disposition':_0x4eacb3[_0x41d2('0x7d')]['disposition']})[_0x41d2('0x38')](function(_0x5ec55e){return _0x5ec55e;});}})[_0x41d2('0x38')](function(_0x1ee257){return respondWithRpcPromise(_0x41d2('0xd7'),'abandon',_0x4eacb3[_0x41d2('0x7d')],client9004);})[_0x41d2('0x38')](respondWithResult(_0x287bf6,null))['catch'](handleError(_0x287bf6,null));};exports[_0x41d2('0xd8')]=function(_0x4b8df2,_0x536e08,_0x3cc30b){_0x4b8df2[_0x41d2('0x7d')][_0x41d2('0x3b')]=_0x4b8df2[_0x41d2('0xd9')][_0x41d2('0xda')];_0x4b8df2['body'][_0x41d2('0xdb')]=_0x4b8df2[_0x41d2('0xd9')][_0x41d2('0xdc')];_0x4b8df2['body'][_0x41d2('0x74')]=_0x4b8df2['file'][_0x41d2('0xdd')];return db[_0x41d2('0xde')][_0x41d2('0xc1')](_0x4b8df2['body'])[_0x41d2('0x38')](respondWithResult(_0x536e08,0xc9))[_0x41d2('0x2c')](handleError(_0x536e08,null));};exports[_0x41d2('0xdf')]=function(_0x327b98,_0x1528c2,_0x3bd65b){return db[_0x41d2('0x43')][_0x41d2('0xc5')]({'where':{'id':_0x327b98['params']['id']},'raw':!![]})[_0x41d2('0x38')](handleEntityNotFound(_0x1528c2,null))[_0x41d2('0x38')](function(_0x400991){if(_0x400991){if(_0x400991[_0x41d2('0xd6')]){return _0x1528c2[_0x41d2('0x2d')](0x193)[_0x41d2('0x2f')]({'status':0x193,'message':'Unauthorized'});}return db[_0x41d2('0xde')][_0x41d2('0xc5')]({'where':{'id':_0x327b98[_0x41d2('0x47')]['attachId']},'raw':!![]})[_0x41d2('0x38')](handleEntityNotFound(_0x1528c2,null));}})[_0x41d2('0x38')](function(_0x3d7f89){if(_0x3d7f89){var _0x17b7d5=_0x3d7f89[_0x41d2('0xe0')]!==null;var _0x27e06e=path[_0x41d2('0xe1')](config['root'],_0x41d2('0xe2'));if(_0x17b7d5){_0x27e06e=path[_0x41d2('0xe1')](_0x27e06e,_0x41d2('0xe3'));}var _0x52a3bf=path[_0x41d2('0xe1')](_0x27e06e,_0x3d7f89['basename']);return _0x1528c2[_0x41d2('0xe4')](_0x52a3bf);}})[_0x41d2('0x2c')](handleError(_0x1528c2,null));};exports[_0x41d2('0xe5')]=function(_0x28ce28,_0x18dff1){var _0x1c8db3=null;var _0x45d57d=null;var _0x52952d=null;var _0x3565a7=null;if(_0x28ce28[_0x41d2('0x7d')]['id']){delete _0x28ce28['body']['id'];}if(_0x28ce28[_0x41d2('0x7d')][_0x41d2('0xe6')]){_0x3565a7=path[_0x41d2('0xe1')](config[_0x41d2('0xe7')],'server/files/chat/upload/',util[_0x41d2('0xe8')]('transcript-%s.txt',Date[_0x41d2('0xe9')]()));_0x28ce28[_0x41d2('0x7d')][_0x41d2('0xea')]=_0x3565a7;}return db[_0x41d2('0x43')][_0x41d2('0x68')]({'where':{'id':_0x28ce28[_0x41d2('0xbd')]['id']},'include':[{'model':db[_0x41d2('0xce')],'as':'Messages','include':[{'model':db[_0x41d2('0x77')],'as':_0x41d2('0x77')}]}]})[_0x41d2('0x38')](handleEntityNotFound(_0x18dff1,null))[_0x41d2('0x38')](saveUpdates(_0x28ce28[_0x41d2('0x7d')],null))[_0x41d2('0x38')](function(_0x56f884){if(_0x56f884){_0x1c8db3=_0x56f884;return db['ChatWebsite']['find']({'where':{'id':_0x1c8db3[_0x41d2('0x82')]}});}})[_0x41d2('0x38')](function(_0x469e8b){if(_0x469e8b){_0x52952d=_0x469e8b;return db['CmContact'][_0x41d2('0x68')]({'where':{'id':_0x1c8db3[_0x41d2('0x73')]}});}})[_0x41d2('0x38')](function(_0x47f18d){if(_0x47f18d){_0x45d57d=_0x47f18d;if(_0x3565a7){var _0x2ee23c=null;for(var _0x4fe573=0x1;_0x4fe573<_0x1c8db3[_0x41d2('0xeb')][_0x41d2('0x4b')];++_0x4fe573){_0x2ee23c=_0x1c8db3[_0x41d2('0xeb')][_0x4fe573];var _0x50b242=_0x2ee23c['UserId']?util[_0x41d2('0xe8')]('%s%d',_0x52952d[_0x41d2('0xec')],_0x2ee23c[_0x41d2('0x79')]):_0x41d2('0xed');var _0x3323ad=_0x28ce28[_0x41d2('0x7d')]['customer']||util['format'](_0x41d2('0xee'),_0x41d2('0xef'),_0x2ee23c['ContactId']);switch(_0x52952d[_0x41d2('0xf0')]){case _0x41d2('0xf1'):_0x50b242=_0x2ee23c[_0x41d2('0x79')]?util[_0x41d2('0xe8')]('%s%d',_0x52952d[_0x41d2('0xec')],_0x2ee23c['UserId']):_0x41d2('0xed');break;case _0x41d2('0xf2'):_0x50b242=_0x2ee23c[_0x41d2('0x79')]?_0x2ee23c[_0x41d2('0x77')][_0x41d2('0xf3')]||_0x2ee23c['User'][_0x41d2('0x3e')]:'System';break;case _0x41d2('0xf4'):_0x50b242=_0x2ee23c[_0x41d2('0x79')]?_0x2ee23c[_0x41d2('0x77')][_0x41d2('0x3e')]:_0x41d2('0xed');break;default:_0x50b242=_0x2ee23c[_0x41d2('0x79')]?util[_0x41d2('0xe8')](_0x41d2('0xee'),_0x52952d['agentAlias'],_0x2ee23c[_0x41d2('0x79')]):_0x41d2('0xed');}var _0x586117=util['format'](_0x41d2('0xf5'),moment(_0x2ee23c[_0x41d2('0xf6')])[_0x41d2('0xe8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2ee23c['direction']==='in'?_0x3323ad:_0x50b242,_0x2ee23c[_0x41d2('0x7d')]);if(!_0x2ee23c['secret']){fs[_0x41d2('0xf7')](_0x3565a7,_0x586117);}}return db['MailAccount'][_0x41d2('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x41d2('0xf8')],'as':_0x41d2('0xf9'),'raw':!![]}]});}}})[_0x41d2('0x38')](function(_0x4e2301){if(_0x4e2301&&_0x4e2301[_0x41d2('0xf9')]&&_0x28ce28[_0x41d2('0x7d')]){var _0x35dfaa={'tls':{'rejectUnauthorized':![]}};if(_0x4e2301['Smtp'][_0x41d2('0xfa')]){_0x35dfaa[_0x41d2('0xfa')]=_0x4e2301[_0x41d2('0xf9')][_0x41d2('0xfa')];}else{_0x35dfaa[_0x41d2('0xfb')]=_0x4e2301[_0x41d2('0xf9')][_0x41d2('0xfb')];_0x35dfaa[_0x41d2('0xfc')]=_0x4e2301[_0x41d2('0xf9')]['port'];_0x35dfaa[_0x41d2('0xfd')]=_0x4e2301[_0x41d2('0xf9')][_0x41d2('0xfd')];}if(_0x4e2301['Smtp'][_0x41d2('0xfe')]){_0x35dfaa[_0x41d2('0xff')]={'user':_0x4e2301['Smtp']['user'],'pass':_0x4e2301[_0x41d2('0xf9')][_0x41d2('0x100')]};}return respondWithRpcPromise(_0x41d2('0x101'),'sendMail',{'account':_0x35dfaa,'message':{'from':util[_0x41d2('0xe8')](_0x41d2('0x102'),_0x4e2301[_0x41d2('0x3b')],_0x4e2301[_0x41d2('0x103')]||_0x4e2301[_0x41d2('0xf9')][_0x41d2('0x9f')]),'to':_0x28ce28['body'][_0x41d2('0xe6')],'subject':_0x41d2('0x104'),'text':util[_0x41d2('0xe8')](_0x41d2('0x105'),_0x28ce28['body'][_0x41d2('0xe6')]),'attachments':[{'path':_0x3565a7}]}})[_0x41d2('0x38')](function(){return _0x1c8db3;})['catch'](function(_0x466f7b){console[_0x41d2('0x27')](_0x466f7b);});}else{return _0x1c8db3;}})[_0x41d2('0x38')](respondWithStatusCode(_0x18dff1,0xc8))['catch'](handleError(_0x18dff1,null));};exports[_0x41d2('0x106')]=function(_0x20d6ae,_0x32fa58,_0x234cab){return db[_0x41d2('0xce')][_0x41d2('0x68')]({'where':{'id':_0x20d6ae[_0x41d2('0xbd')]['id']}})[_0x41d2('0x38')](handleEntityNotFound(_0x32fa58,null))[_0x41d2('0x38')](function(_0x1c3ffd){if(_0x1c3ffd){return _0x1c3ffd[_0x41d2('0x106')](_0x20d6ae[_0x41d2('0x7d')]['ids'],_[_0x41d2('0x107')](_0x20d6ae[_0x41d2('0x7d')],[_0x41d2('0x108'),'id'])||{});}})[_0x41d2('0x38')](respondWithResult(_0x32fa58,null))[_0x41d2('0x2c')](handleError(_0x32fa58,null));};exports[_0x41d2('0x109')]=function(_0x424b3f,_0x55fe2e,_0x8c5f81){var _0x2a3c7f={'raw':![],'where':{}};var _0x35616c={};var _0x159dcf={'count':0x0,'rows':[]};return db[_0x41d2('0x43')][_0x41d2('0xc5')]({'where':{'id':_0x424b3f[_0x41d2('0xbd')]['id']}})[_0x41d2('0x38')](handleEntityNotFound(_0x55fe2e,null))[_0x41d2('0x38')](function(_0x53bdd2){if(_0x53bdd2){_0x35616c['model']=_['keys'](db[_0x41d2('0xce')][_0x41d2('0x44')]);_0x35616c[_0x41d2('0x47')]=_[_0x41d2('0x7e')](_0x424b3f[_0x41d2('0x47')]);_0x35616c[_0x41d2('0x51')]=_['intersection'](_0x35616c[_0x41d2('0x46')],_0x35616c[_0x41d2('0x47')]);_0x2a3c7f[_0x41d2('0x49')]=_[_0x41d2('0x48')](_0x35616c[_0x41d2('0x46')],qs[_0x41d2('0x4a')](_0x424b3f[_0x41d2('0x47')][_0x41d2('0x4a')]));_0x2a3c7f[_0x41d2('0x49')]=_0x2a3c7f[_0x41d2('0x49')][_0x41d2('0x4b')]?_0x2a3c7f[_0x41d2('0x49')]:_0x35616c[_0x41d2('0x46')];if(!_0x424b3f[_0x41d2('0x47')][_0x41d2('0x4c')](_0x41d2('0x4d'))){_0x2a3c7f['limit']=qs[_0x41d2('0x32')](_0x424b3f[_0x41d2('0x47')][_0x41d2('0x32')]);_0x2a3c7f[_0x41d2('0x31')]=qs['offset'](_0x424b3f[_0x41d2('0x47')][_0x41d2('0x31')]);}_0x2a3c7f[_0x41d2('0x9c')]=qs[_0x41d2('0x4e')](_0x424b3f[_0x41d2('0x47')][_0x41d2('0x4e')]);_0x2a3c7f[_0x41d2('0x4f')]=qs[_0x41d2('0x51')](_[_0x41d2('0x50')](_0x424b3f[_0x41d2('0x47')],_0x35616c[_0x41d2('0x51')]));_0x2a3c7f[_0x41d2('0x4f')]['ChatInteractionId']=_0x53bdd2['id'];if(_0x424b3f[_0x41d2('0x47')][_0x41d2('0x91')]){_0x2a3c7f[_0x41d2('0x4f')]=_[_0x41d2('0x10a')](_0x2a3c7f[_0x41d2('0x4f')],{'$or':_[_0x41d2('0x3d')](_0x2a3c7f[_0x41d2('0x49')],function(_0x5d8b0b){var _0x46cede={};_0x46cede[_0x5d8b0b]={'$like':'%'+_0x424b3f[_0x41d2('0x47')][_0x41d2('0x91')]+'%'};return _0x46cede;})});}if(_0x424b3f[_0x41d2('0x47')][_0x41d2('0x86')]){var _0x442bb7=_0x424b3f[_0x41d2('0x47')][_0x41d2('0x86')][_0x41d2('0x40')](',');var _0x17eaeb={};_0x17eaeb[_0x442bb7[0x0]]={'$gte':moment(_0x442bb7[0x1])[_0x41d2('0xe8')](_0x41d2('0x10b'))};_0x2a3c7f[_0x41d2('0x4f')]=_[_0x41d2('0x10a')](_0x2a3c7f[_0x41d2('0x4f')],_0x17eaeb);}_0x2a3c7f=_['merge']({},_0x2a3c7f,_0x424b3f[_0x41d2('0xc0')]);return db['ChatMessage'][_0x41d2('0x30')]({'where':_0x2a3c7f[_0x41d2('0x4f')]})[_0x41d2('0x38')](function(_0x1f9ac1){_0x159dcf[_0x41d2('0x30')]=_0x1f9ac1;if(_0x424b3f[_0x41d2('0x47')][_0x41d2('0xbe')]){_0x2a3c7f['include']=[{'all':!![]}];}return db[_0x41d2('0xce')][_0x41d2('0x10c')](_0x2a3c7f);})[_0x41d2('0x38')](function(_0x250461){_0x159dcf[_0x41d2('0x10d')]=_0x250461;return _0x159dcf;});}})[_0x41d2('0x38')](respondWithFilteredResult(_0x55fe2e,_0x2a3c7f))[_0x41d2('0x2c')](handleError(_0x55fe2e,null));};exports[_0x41d2('0x10e')]=function(_0x47388d,_0x1eb46c,_0x34baae){var _0x40726e={'where':{}},_0x17220c={},_0x5aced6={'count':0x0,'rows':[]};return db[_0x41d2('0x43')][_0x41d2('0xc5')]({'where':{'id':_0x47388d[_0x41d2('0xbd')]['id']}})[_0x41d2('0x38')](handleEntityNotFound(_0x1eb46c,null))[_0x41d2('0x38')](function(_0x2220ef){if(_0x2220ef){_0x17220c[_0x41d2('0x46')]=_[_0x41d2('0x7e')](db['ChatMessage']['rawAttributes']);_0x17220c[_0x41d2('0x47')]=_[_0x41d2('0x7e')](_0x47388d[_0x41d2('0x47')]);_0x17220c['filters']=_[_0x41d2('0x48')](_0x17220c['model'],_0x17220c['query']);_0x40726e[_0x41d2('0x49')]=_[_0x41d2('0x48')](_0x17220c[_0x41d2('0x46')],qs[_0x41d2('0x4a')](_0x47388d[_0x41d2('0x47')][_0x41d2('0x4a')]));_0x40726e['attributes']=_0x40726e[_0x41d2('0x49')][_0x41d2('0x4b')]?_0x40726e[_0x41d2('0x49')]:_0x17220c[_0x41d2('0x46')];if(!_0x47388d['query'][_0x41d2('0x4c')](_0x41d2('0x4d'))){_0x40726e['limit']=qs['limit'](_0x47388d[_0x41d2('0x47')][_0x41d2('0x32')]);_0x40726e[_0x41d2('0x31')]=qs['offset'](_0x47388d['query'][_0x41d2('0x31')]);}_0x40726e['order']=qs[_0x41d2('0x4e')](_0x47388d[_0x41d2('0x47')]['sort']);_0x40726e[_0x41d2('0x4f')]=qs[_0x41d2('0x51')](_[_0x41d2('0x50')](_0x47388d[_0x41d2('0x47')],_0x17220c['filters']));_0x40726e[_0x41d2('0x4f')][_0x41d2('0xb9')]=_0x2220ef['id'];if(_0x47388d[_0x41d2('0x47')]['filter']){_0x40726e[_0x41d2('0x4f')]=_[_0x41d2('0x10a')](_0x40726e[_0x41d2('0x4f')],{'$or':_[_0x41d2('0x3d')](_0x40726e['attributes'],function(_0x2da5d3){var _0x2c384f={};_0x2c384f[_0x2da5d3]={'$like':'%'+_0x47388d[_0x41d2('0x47')][_0x41d2('0x91')]+'%'};return _0x2c384f;})});}_0x40726e[_0x41d2('0x4f')][_0x41d2('0x10f')]=![];if(_0x47388d['query']['id']){_0x40726e['where']['id']={'$gt':_0x47388d[_0x41d2('0x47')]['id']};}_0x40726e=_['merge']({},_0x40726e,_0x47388d['options']);return db['ChatMessage'][_0x41d2('0x30')]({'where':_0x40726e[_0x41d2('0x4f')]})[_0x41d2('0x38')](function(_0x5a640a){_0x5aced6[_0x41d2('0x30')]=_0x5a640a;_0x40726e['include']=[];if(_0x47388d[_0x41d2('0x47')][_0x41d2('0x110')]){_0x40726e[_0x41d2('0xbf')][_0x41d2('0xba')]({'model':db['User'],'as':_0x41d2('0x77'),'attributes':['id','fullname',_0x41d2('0xf3')]});}if(_0x47388d['query'][_0x41d2('0xbe')]){_0x40726e[_0x41d2('0xbf')]=[{'all':!![]}];}return db[_0x41d2('0xce')][_0x41d2('0x10c')](_0x40726e);})[_0x41d2('0x38')](function(_0x282ec3){_0x5aced6['rows']=_0x282ec3;return _0x5aced6;});}})[_0x41d2('0x38')](respondWithFilteredResult(_0x1eb46c,_0x40726e))['catch'](handleError(_0x1eb46c,null));};exports['addTags']=function(_0x48f9c6,_0x409b89,_0x18e92a){return db[_0x41d2('0x43')][_0x41d2('0x68')]({'where':{'id':_0x48f9c6[_0x41d2('0xbd')]['id']}})[_0x41d2('0x38')](handleEntityNotFound(_0x409b89,null))['then'](function(_0x488d58){if(_0x488d58){return _0x488d58[_0x41d2('0x111')](_0x48f9c6[_0x41d2('0x7d')]['ids'],_[_0x41d2('0x107')](_0x48f9c6[_0x41d2('0x7d')],['ids','id'])||{})[_0x41d2('0x112')](function(){return db['Tag'][_0x41d2('0x10c')]({'attributes':['id','name',_0x41d2('0x54')],'where':{'id':_0x48f9c6[_0x41d2('0x7d')][_0x41d2('0x108')]}});})[_0x41d2('0x38')](function(_0x4de22f){socket['emit'](_0x41d2('0x113'),{'id':Number(_0x48f9c6[_0x41d2('0xbd')]['id']),'tags':_0x4de22f||[]});return{'id':Number(_0x48f9c6['params']['id']),'tags':_0x4de22f||[]};});}})['then'](respondWithResult(_0x409b89,null))[_0x41d2('0x2c')](handleError(_0x409b89,null));};exports[_0x41d2('0x114')]=function(_0x3ee253,_0x2a6812,_0x1cf3cc){return db[_0x41d2('0x43')][_0x41d2('0x68')]({'where':{'id':_0x3ee253[_0x41d2('0xbd')]['id']}})[_0x41d2('0x38')](handleEntityNotFound(_0x2a6812,null))[_0x41d2('0x38')](function(_0x3d4a5e){if(_0x3d4a5e){return _0x3d4a5e[_0x41d2('0x114')](_0x3ee253[_0x41d2('0x47')][_0x41d2('0x108')]);}})[_0x41d2('0x38')](respondWithStatusCode(_0x2a6812,null))[_0x41d2('0x2c')](handleError(_0x2a6812,null));};exports[_0x41d2('0xe4')]=function(_0x269a13,_0x3afa63){var _0x31edb5=moment()[_0x41d2('0x115')]()['toString']();var _0x438537=path[_0x41d2('0xe1')](config[_0x41d2('0xe7')],'server',_0x41d2('0x116'),_0x41d2('0x117'));var _0x4cc45a=path[_0x41d2('0xe1')](config['root'],_0x41d2('0x118'),'files',_0x41d2('0x119'));var _0x460ddb=path[_0x41d2('0xe1')](_0x438537,_0x31edb5);var _0x4d60a1=util[_0x41d2('0xe8')]('transcript-%d-%s.zip',_0x269a13[_0x41d2('0xbd')]['id'],_0x31edb5);var _0x3ad6a4=path[_0x41d2('0xe1')](_0x438537,_0x4d60a1);var _0x2cc667=[];_0x2cc667['push']({'model':db[_0x41d2('0x77')],'as':_0x41d2('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x2cc667['push']({'model':db[_0x41d2('0x11a')],'as':_0x41d2('0x6e'),'attributes':['id',_0x41d2('0x11b'),_0x41d2('0x11c')],'raw':!![]});if(_0x269a13[_0x41d2('0x47')]['attachments']){_0x2cc667['push']({'model':db[_0x41d2('0xde')],'as':_0x41d2('0xde'),'raw':!![]});}var _0x506504=[{'model':db['ChatMessage'],'as':_0x41d2('0xeb'),'attributes':['id','body',_0x41d2('0xf6'),_0x41d2('0x11d'),_0x41d2('0x10f'),_0x41d2('0x8c')],'include':_0x2cc667}];_0x506504[_0x41d2('0xba')]({'model':db['ChatWebsite'],'as':_0x41d2('0x11e'),'attributes':['id',_0x41d2('0x3b')]});_0x506504[_0x41d2('0xba')]({'model':db[_0x41d2('0x77')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction']['find']({'where':{'id':_0x269a13['params']['id']},'include':_0x506504})[_0x41d2('0x38')](handleEntityNotFound(_0x3afa63,null))['then'](function(_0x3cae90){if(_0x3cae90){var _0x5affc9=_0x3cae90[_0x41d2('0x11f')]({'plain':!![]});fs[_0x41d2('0x120')](_0x460ddb);var _0x2ba4cf={'channel':_0x41d2('0x121'),'account':_0x5affc9['Account'][_0x41d2('0x3b')],'agent':_0x5affc9[_0x41d2('0x122')]?_0x5affc9[_0x41d2('0x122')][_0x41d2('0x3e')]:_0x41d2('0x123'),'createdAt':moment(_0x5affc9[_0x41d2('0xf6')])['format'](_0x41d2('0x10b'))['toString'](),'closedAt':_0x5affc9['closed']?moment(_0x5affc9[_0x41d2('0x124')])['format'](_0x41d2('0x10b'))['toString']():'','disposition':_0x5affc9[_0x41d2('0x125')],'chatInfo':{'browser':_0x5affc9[_0x41d2('0x126')],'os':_0x5affc9[_0x41d2('0x127')],'referer':_0x5affc9['referer'],'customerIp':_0x5affc9[_0x41d2('0x128')],'customerPort':_0x5affc9[_0x41d2('0x129')]?_0x5affc9[_0x41d2('0x129')]:_0x41d2('0x123')},'messages':_(_0x5affc9['Messages'])['tail']()['filter']({'secret':![]})[_0x41d2('0x3d')](function(_0x1791f4){if(_0x1791f4[_0x41d2('0xde')]){var _0x534795=path['join'](_0x4cc45a,_0x1791f4[_0x41d2('0xde')]['basename']);if(fs[_0x41d2('0x12a')](_0x534795)){fs[_0x41d2('0x12b')](_0x534795)[_0x41d2('0x12c')](fs[_0x41d2('0x12d')](path['join'](_0x460ddb,_0x1791f4['Attachment'][_0x41d2('0xdb')])));}}return{'date':moment(_0x1791f4[_0x41d2('0xf6')])[_0x41d2('0xe8')](_0x41d2('0x10b'))[_0x41d2('0xa5')](),'sender':_0x1791f4['direction']===_0x41d2('0xcd')?_0x1791f4['User']?_0x1791f4[_0x41d2('0x77')][_0x41d2('0x3e')]:_0x41d2('0xed'):_0x1791f4[_0x41d2('0x6e')]['firstName']+(_0x1791f4[_0x41d2('0x6e')]['lastName']?'\x20'+_0x1791f4[_0x41d2('0x6e')][_0x41d2('0x11c')]:''),'body':_0x1791f4[_0x41d2('0xde')]?_0x1791f4[_0x41d2('0xde')][_0x41d2('0xdb')]:_0x1791f4['body'],'direction':_0x1791f4[_0x41d2('0x11d')]===_0x41d2('0xcd')?'A':'C','secret':_0x1791f4[_0x41d2('0x10f')],'read':_0x1791f4[_0x41d2('0x8c')],'attachment':_0x1791f4[_0x41d2('0xde')]};})[_0x41d2('0x6a')]()};return ejs[_0x41d2('0x12e')](path[_0x41d2('0xe1')](config[_0x41d2('0xe7')],_0x41d2('0x118'),_0x41d2('0x12f'),'downloadInteraction.html'),{'interaction':_0x2ba4cf})[_0x41d2('0x38')](function(_0x4d73ef){var _0x34422d=path[_0x41d2('0xe1')](_0x460ddb,_0x41d2('0x130')+_0x5affc9['id']+'-'+_0x31edb5+_0x41d2('0x131'));var _0x40f26c={'path':_0x34422d,'channel':_0x41d2('0x121'),'interactionId':_0x5affc9['id']};return pdf[_0x41d2('0x132')](_0x4d73ef,_0x40f26c);})['then'](function(){return new BPromise(function(_0x1e846c,_0x30a268){zipdir(_0x460ddb,{'saveTo':_0x3ad6a4},function(_0x3c9789,_0x512cc5){if(_0x3c9789)return _0x30a268(_0x3c9789);return _0x1e846c(_0x512cc5);});})[_0x41d2('0x38')](function(){return new BPromise(function(_0x26ce6a,_0x4e5810){rimraf(_0x460ddb,function(_0x4a209c){if(_0x4a209c)_0x4e5810(_0x4a209c);return _0x26ce6a();});});})['then'](function(){return _0x3afa63[_0x41d2('0xe4')](_0x3ad6a4,_0x4d60a1,function(_0x3fc418){if(_0x3fc418){console[_0x41d2('0x133')]('err',_0x3fc418);}else{fs[_0x41d2('0x134')](_0x3ad6a4);}});});});}else{return _0x3afa63[_0x41d2('0x39')](0xc8);}})['catch'](handleError(_0x3afa63,null));};
\ No newline at end of file
+var _0x5cc1=['compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','show','params','includeAll','include','create','body','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','closed','disposition','AbandonInteraction','file','originalname','basename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','firstName','direction','Account','Owner','get','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','views','downloadInteraction.html','transcript-','Chat','createPdfFromHTML','err','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','map','fullname','TagIds','Tags','split','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some'];(function(_0x1ac37a,_0x5e59e2){var _0x248e71=function(_0x2e4aee){while(--_0x2e4aee){_0x1ac37a['push'](_0x1ac37a['shift']());}};_0x248e71(++_0x5e59e2);}(_0x5cc1,0x1f3));var _0x15cc=function(_0x4017ba,_0x111e95){_0x4017ba=_0x4017ba-0x0;var _0x44a80e=_0x5cc1[_0x4017ba];return _0x44a80e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x15cc('0x0'));var jsonpatch=require(_0x15cc('0x1'));var rp=require('request-promise');var moment=require(_0x15cc('0x2'));var BPromise=require(_0x15cc('0x3'));var Mustache=require(_0x15cc('0x4'));var util=require('util');var path=require('path');var sox=require(_0x15cc('0x5'));var csv=require(_0x15cc('0x6'));var ejs=require(_0x15cc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15cc('0x8'));var squel=require(_0x15cc('0x9'));var crypto=require(_0x15cc('0xa'));var jsforce=require(_0x15cc('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x15cc('0xc'));var Papa=require(_0x15cc('0xd'));var Redis=require(_0x15cc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x15cc('0xf'));var as=require(_0x15cc('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x15cc('0x11'));var logger=require(_0x15cc('0x12'))(_0x15cc('0x13'));var utils=require(_0x15cc('0x14'));var config=require(_0x15cc('0x15'));var licenseUtil=require(_0x15cc('0x16'));var db=require(_0x15cc('0x17'))['db'];config[_0x15cc('0x18')]=_[_0x15cc('0x19')](config[_0x15cc('0x18')],{'host':_0x15cc('0x1a'),'port':0x18eb});var socket=require(_0x15cc('0x1b'))(new Redis(config[_0x15cc('0x18')]));require(_0x15cc('0x1c'))[_0x15cc('0x1d')](socket);var jayson=require(_0x15cc('0x1e'));var client=jayson[_0x15cc('0x1f')][_0x15cc('0x20')]({'port':0x232b});var client9004=jayson[_0x15cc('0x1f')][_0x15cc('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x249a07,_0x42c14f,_0x1f5e1d,_0x463d0f){return new BPromise(function(_0xf44d11,_0x5d0254){var _0x2bc280=_0x463d0f||client;return _0x2bc280[_0x15cc('0x21')](_0x249a07,_0x1f5e1d)['then'](function(_0x1a2b22){logger[_0x15cc('0x22')](_0x15cc('0x23'),_0x42c14f,_0x15cc('0x24'));logger[_0x15cc('0x25')](_0x15cc('0x26'),_0x42c14f,_0x15cc('0x24'),JSON[_0x15cc('0x27')](_0x1a2b22));if(_0x1a2b22[_0x15cc('0x28')]){if(_0x1a2b22[_0x15cc('0x28')][_0x15cc('0x29')]===0x1f4){logger[_0x15cc('0x28')](_0x15cc('0x23'),_0x42c14f,_0x1a2b22[_0x15cc('0x28')][_0x15cc('0x2a')]);return _0x5d0254(_0x1a2b22[_0x15cc('0x28')][_0x15cc('0x2a')]);}logger[_0x15cc('0x28')](_0x15cc('0x23'),_0x42c14f,_0x1a2b22[_0x15cc('0x28')][_0x15cc('0x2a')]);return _0xf44d11(_0x1a2b22['error'][_0x15cc('0x2a')]);}else{logger[_0x15cc('0x22')](_0x15cc('0x23'),_0x42c14f,_0x15cc('0x24'));_0xf44d11(_0x1a2b22['result'][_0x15cc('0x2a')]);}})[_0x15cc('0x2b')](function(_0x5f0f84){logger[_0x15cc('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x42c14f,_0x5f0f84);_0x5d0254(_0x5f0f84);});});}function respondWithStatusCode(_0x408899,_0x10de3c){_0x10de3c=_0x10de3c||0xcc;return function(_0x25264a){if(_0x25264a){return _0x408899['sendStatus'](_0x10de3c);}return _0x408899['status'](_0x10de3c)[_0x15cc('0x2c')]();};}function respondWithResult(_0x56eb51,_0x54df69){_0x54df69=_0x54df69||0xc8;return function(_0x40afa2){if(_0x40afa2){return _0x56eb51[_0x15cc('0x2d')](_0x54df69)['json'](_0x40afa2);}};}function respondWithFilteredResult(_0x761a66,_0xd34f9b){return function(_0x45b9cf){if(_0x45b9cf){var _0x130d35=_0x45b9cf[_0x15cc('0x2e')],_0x2ce269=_0xd34f9b['offset'],_0x555835=_0xd34f9b['offset']+_0xd34f9b['limit'],_0x493eca;if(_0x555835>=_0x130d35){_0x555835=_0x130d35;_0x493eca=0xc8;}else{_0x493eca=0xce;}_0x761a66[_0x15cc('0x2d')](_0x493eca);return _0x761a66[_0x15cc('0x2f')](_0x15cc('0x30'),_0x2ce269+'-'+_0x555835+'/'+_0x130d35)[_0x15cc('0x31')](_0x45b9cf);}return null;};}function patchUpdates(_0x553409){return function(_0x100cb7){try{jsonpatch['apply'](_0x100cb7,_0x553409,!![]);}catch(_0x944f1f){return BPromise[_0x15cc('0x32')](_0x944f1f);}return _0x100cb7[_0x15cc('0x33')]();};}function saveUpdates(_0x4e0d30,_0x5d6bf9){return function(_0x1e01aa){if(_0x1e01aa){return _0x1e01aa[_0x15cc('0x34')](_0x4e0d30)[_0x15cc('0x35')](function(_0x4e03ed){return _0x4e03ed;});}return null;};}function removeEntity(_0x1a1f92,_0x3d35c6){return function(_0x36f696){if(_0x36f696){return _0x36f696[_0x15cc('0x36')]()[_0x15cc('0x35')](function(){_0x1a1f92['status'](0xcc)[_0x15cc('0x2c')]();});}};}function handleEntityNotFound(_0x446c33,_0x3d6b54){return function(_0x5c4577){if(!_0x5c4577){_0x446c33[_0x15cc('0x37')](0x194);}return _0x5c4577;};}function handleError(_0x2674c4,_0xb7e409){_0xb7e409=_0xb7e409||0x1f4;return function(_0x248335){logger[_0x15cc('0x28')](_0x248335[_0x15cc('0x38')]);if(_0x248335[_0x15cc('0x39')]){delete _0x248335[_0x15cc('0x39')];}_0x2674c4[_0x15cc('0x2d')](_0xb7e409)[_0x15cc('0x3a')](_0x248335);};}function getInteractionUsers(_0x1a0377,_0x411533){return new BPromise(function(_0x1e5f41,_0x22a3c0){try{if(_0x411533[_0x1a0377['id']]){_0x1a0377[_0x15cc('0x3b')]=_[_0x15cc('0x3c')](_0x411533[_0x1a0377['id']],function(_0x59d02d){return{'id':_0x59d02d['id'],'fullname':_0x59d02d[_0x15cc('0x3d')]};});}}catch(_0xf293cc){_0x22a3c0(_0xf293cc);}_0x1e5f41(_0x1a0377);});}function getInteractionTags(_0x21af8c,_0x49fe93){return new BPromise(function(_0x15fe70,_0x35c4c5){try{if(_0x21af8c[_0x15cc('0x3e')]){_0x21af8c[_0x15cc('0x3f')]=[];_0x21af8c[_0x15cc('0x3e')][_0x15cc('0x40')](',')['forEach'](function(_0x3b7356){_0x21af8c['Tags']['push'](_0x49fe93[_0x3b7356]);});}delete _0x21af8c['TagIds'];}catch(_0x56cb7c){_0x35c4c5(_0x56cb7c);}_0x15fe70(_0x21af8c);});}function updateChatInteraction(_0x42a8d0,_0xcd0047,_0x50a8bb){return new BPromise(function(_0x47d911,_0x396fa0){return getInteractionUsers(_0x42a8d0,_0x50a8bb)[_0x15cc('0x35')](function(_0x2e959e){return getInteractionTags(_0x2e959e,_0xcd0047);})['then'](function(_0xf02d41){_0x47d911(_0xf02d41);})['catch'](function(_0x2ca396){_0x396fa0(_0x2ca396);});});}exports[_0x15cc('0x41')]=function(_0x515829,_0x53c2f3){var _0x26fe19={},_0x40c67c={},_0x4aad83={'count':0x0,'rows':[]};var _0x5f4660=_[_0x15cc('0x3c')](db[_0x15cc('0x42')][_0x15cc('0x43')],function(_0x400e93){return{'name':_0x400e93[_0x15cc('0x44')],'type':_0x400e93['type'][_0x15cc('0x45')]};});_0x40c67c[_0x15cc('0x46')]=_[_0x15cc('0x3c')](_0x5f4660,_0x15cc('0x39'));_0x40c67c[_0x15cc('0x47')]=_[_0x15cc('0x48')](_0x515829[_0x15cc('0x47')]);_0x40c67c[_0x15cc('0x49')]=_['intersection'](_0x40c67c[_0x15cc('0x46')],_0x40c67c['query']);_0x26fe19[_0x15cc('0x4a')]=_[_0x15cc('0x4b')](_0x40c67c[_0x15cc('0x46')],qs[_0x15cc('0x4c')](_0x515829['query'][_0x15cc('0x4c')]));_0x26fe19[_0x15cc('0x4a')]=_0x26fe19[_0x15cc('0x4a')][_0x15cc('0x4d')]?_0x26fe19[_0x15cc('0x4a')]:_0x40c67c[_0x15cc('0x46')];if(!_0x515829[_0x15cc('0x47')][_0x15cc('0x4e')](_0x15cc('0x4f'))){_0x26fe19[_0x15cc('0x50')]=qs['limit'](_0x515829[_0x15cc('0x47')]['limit']);_0x26fe19[_0x15cc('0x51')]=qs[_0x15cc('0x51')](_0x515829['query']['offset']);}_0x26fe19[_0x15cc('0x52')]=qs['sort'](_0x515829[_0x15cc('0x47')][_0x15cc('0x53')]);_0x26fe19[_0x15cc('0x54')]=qs[_0x15cc('0x49')](_[_0x15cc('0x55')](_0x515829['query'],_0x40c67c[_0x15cc('0x49')]),_0x5f4660);var _0x58f95e=[];var _0x362346=squel[_0x15cc('0x56')]()['field']('id')[_0x15cc('0x57')](_0x15cc('0x39'))['field'](_0x15cc('0x58'))[_0x15cc('0x59')](_0x15cc('0x5a'));var _0x2e911e=squel[_0x15cc('0x56')]()[_0x15cc('0x57')]('u.id')[_0x15cc('0x57')](_0x15cc('0x5b'))[_0x15cc('0x57')](_0x15cc('0x5c'))[_0x15cc('0x59')](_0x15cc('0x5d'),'ui')[_0x15cc('0x5e')]('users','u',_0x15cc('0x5f'));var _0x476ff3=squel['select']()[_0x15cc('0x59')](_0x15cc('0x60'),'i')[_0x15cc('0x5e')](_0x15cc('0x61'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x15cc('0x62'),'o',_0x15cc('0x63'))[_0x15cc('0x5e')]('chat_websites','a',_0x15cc('0x64'))[_0x15cc('0x5e')](_0x15cc('0x65'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x15cc('0x5e')](_0x15cc('0x66'),'it',_0x15cc('0x67'))[_0x15cc('0x5e')]('tools_tags','t',_0x15cc('0x68'));var _0x415cc4=squel[_0x15cc('0x69')]();var _0x2e3016=[];var _0x44b18e=squel[_0x15cc('0x69')]();var _0x162997;if(_0x515829[_0x15cc('0x47')][_0x15cc('0x6a')]){_0x162997=as[_0x15cc('0x6b')](_0x515829[_0x15cc('0x47')][_0x15cc('0x6a')]);var _0x1107b1=_0x162997[_0x15cc('0x6c')];for(var _0x41950c=0x0;_0x41950c<_0x162997[_0x15cc('0x6d')][_0x15cc('0x4d')];_0x41950c++){var _0x165f00=_0x162997[_0x15cc('0x6d')][_0x41950c];var _0x302acd='i';var _0x3659fc=_[_0x15cc('0x6e')](_0x5f4660,['name',_0x165f00['field']]);if(!_0x3659fc){switch(_0x165f00['field']){case _0x15cc('0x6f'):if(_0x165f00[_0x15cc('0x70')]==0x1){_0x476ff3[_0x15cc('0x71')]('`'+_0x165f00[_0x15cc('0x57')]+'`\x20=\x200');}else{_0x476ff3[_0x15cc('0x71')]('`'+_0x165f00[_0x15cc('0x57')]+_0x15cc('0x72'));}break;case _0x15cc('0x73'):if(_0x165f00[_0x15cc('0x74')]===_0x15cc('0x75')){if(_0x165f00['value'][_0x15cc('0x40')]('\x20')[_0x15cc('0x4d')]>0x1){_0x415cc4[_0x1107b1](_0x15cc('0x76'),qs[_0x15cc('0x77')](_0x165f00[_0x15cc('0x70')]),null);}else{var _0x2fe091='%'+_0x165f00[_0x15cc('0x70')]+'%';_0x415cc4[_0x1107b1](_0x15cc('0x78'),_0x2fe091,_0x2fe091,_0x2fe091);}}else{_0x3659fc=_['find'](_0x5f4660,['name',_0x15cc('0x79')]);_0x165f00[_0x15cc('0x57')]=_0x15cc('0x79');_0x52021e=as[_0x15cc('0x7a')](_0x302acd,_0x3659fc[_0x15cc('0x7b')],_0x165f00);_0x415cc4[_0x1107b1](_0x52021e[_0x15cc('0x7c')],_0x52021e[_0x15cc('0x70')][_0x15cc('0x7d')],_0x52021e[_0x15cc('0x70')]['end']);}break;case _0x15cc('0x7e'):var _0x3bc152=_0x165f00[_0x15cc('0x70')][_0x15cc('0x40')](',')[_0x15cc('0x3c')](function(_0x1595cd){return Number(_0x1595cd);});_0x3bc152[_0x15cc('0x7f')](function(_0x47b8f9){_0x44b18e['or'](_0x15cc('0x80'),'%,'+_0x47b8f9+',%');});_0x2e3016=_['union'](_0x2e3016,_0x3bc152);break;case _0x15cc('0x81'):if(_0x165f00['operator']==='$substring'){_0x415cc4[_0x1107b1](_0x15cc('0x82'),'%'+_0x165f00[_0x15cc('0x70')]+'%',null);}else{_0x3659fc=_[_0x15cc('0x6e')](_0x5f4660,[_0x15cc('0x39'),_0x15cc('0x83')]);_0x165f00['field']='UserId';_0x52021e=as[_0x15cc('0x7a')](_0x302acd,_0x3659fc[_0x15cc('0x7b')],_0x165f00);_0x415cc4[_0x1107b1](_0x52021e['text'],_0x52021e[_0x15cc('0x70')][_0x15cc('0x7d')],_0x52021e[_0x15cc('0x70')][_0x15cc('0x2c')]);}break;case'body':_0x52021e=as[_0x15cc('0x7a')]('me',null,_0x165f00);_0x415cc4[_0x1107b1](_0x52021e[_0x15cc('0x7c')],_0x52021e[_0x15cc('0x70')][_0x15cc('0x7d')],_0x52021e[_0x15cc('0x70')][_0x15cc('0x2c')]);break;}}else{var _0x52021e=as[_0x15cc('0x7a')](_0x302acd,_0x3659fc[_0x15cc('0x7b')],_0x165f00);_0x415cc4[_0x1107b1](_0x52021e['text'],_0x52021e[_0x15cc('0x70')][_0x15cc('0x7d')],_0x52021e[_0x15cc('0x70')][_0x15cc('0x2c')]);}}}else{var _0x50f204=_(_0x515829['query'])['keys']()[_0x15cc('0x3c')](function(_0x18f0bb){return _[_0x15cc('0x84')](_0x5f4660,[_0x15cc('0x39'),_0x18f0bb])?_0x18f0bb:undefined;})[_0x15cc('0x85')]()[_0x15cc('0x70')]();if(!_[_0x15cc('0x86')](_0x50f204)){_0x50f204[_0x15cc('0x7f')](function(_0x1f7b92){if(_0x1f7b92===_0x15cc('0x87')){_0x476ff3[_0x15cc('0x54')](_0x15cc('0x88'),[]['concat'](_0x515829['query'][_0x1f7b92]));}else if(_0x1f7b92===_0x15cc('0x89')){var _0x23a64a=JSON[_0x15cc('0x8a')](_0x515829[_0x15cc('0x47')][_0x1f7b92])[_0x15cc('0x8b')];var _0x59dd36=JSON[_0x15cc('0x8a')](_0x515829[_0x15cc('0x47')][_0x1f7b92])[_0x15cc('0x8c')];_0x476ff3[_0x15cc('0x54')](_0x15cc('0x8d'),_0x23a64a,_0x59dd36);}else{if(_0x515829['query'][_0x1f7b92]===_0x15cc('0x8e')){_0x476ff3[_0x15cc('0x54')]('i.'+_0x1f7b92+_0x15cc('0x8f'));}else{_0x476ff3[_0x15cc('0x54')]('i.'+_0x1f7b92+_0x15cc('0x90'),_0x515829['query'][_0x1f7b92]);}}});}if(_0x515829['query'][_0x15cc('0x91')]){if(_0x515829[_0x15cc('0x47')][_0x15cc('0x91')]==0x1){_0x476ff3['having'](_0x15cc('0x92'));}else{_0x476ff3[_0x15cc('0x71')](_0x15cc('0x93'));}}if(_0x515829['query'][_0x15cc('0x94')]){_0x2e3016=_[_0x15cc('0x95')](_0x515829[_0x15cc('0x47')]['tag'])?_0x515829[_0x15cc('0x47')]['tag']:new Array(_0x515829[_0x15cc('0x47')][_0x15cc('0x94')]);_0x2e3016[_0x15cc('0x7f')](function(_0x58c9e0){_0x44b18e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58c9e0+',%');});}if(_0x515829[_0x15cc('0x47')]['filter']){var _0x363539=_0x515829[_0x15cc('0x47')][_0x15cc('0x96')][_0x15cc('0x97')]('\x5c','\x5c\x5c')[_0x15cc('0x97')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x363539)){_0x415cc4['or'](_0x15cc('0x98'),_0x363539+'%');}else{_0x415cc4['or'](_0x15cc('0x99'),qs[_0x15cc('0x77')](_0x363539))['or'](_0x15cc('0x9a'),_0x363539+'%');}}}_0x476ff3[_0x15cc('0x54')](_0x415cc4);_0x476ff3[_0x15cc('0x9b')](_0x15cc('0x9c'));var _0x2cbf18={'type':db['Sequelize'][_0x15cc('0x9d')]['SELECT'],'raw':!![]};var _0x3b1041=_0x476ff3['clone']();_0x3b1041[_0x15cc('0x57')](_0x15cc('0x9c'));_0x3b1041[_0x15cc('0x57')](_0x15cc('0x9e'),_0x15cc('0x6f'));if(_0x26fe19['order']){_0x26fe19['order'][_0x15cc('0x7f')](function(_0x22bbd2){var _0x45f247=_0x22bbd2[0x0]===_0x15cc('0x9f')?_0x22bbd2[0x0]:'i.'+_0x22bbd2[0x0];_0x476ff3[_0x15cc('0x52')](_0x45f247,_0x22bbd2[0x1]===_0x15cc('0xa0')?![]:!![]);});}if(!_[_0x15cc('0x86')](_0x2e3016)){_0x476ff3[_0x15cc('0x71')](_0x44b18e);_0x3b1041[_0x15cc('0x54')](_0x15cc('0xa1'),_0x2e3016);}BPromise[_0x15cc('0xa2')]()[_0x15cc('0x35')](function(){if(!_0x162997){if(_0x515829[_0x15cc('0x47')][_0x15cc('0x87')])return;_0x3b1041[_0x15cc('0x54')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x476ff3['where'](_0x15cc('0xa3'));return;}if(_0x515829[_0x15cc('0xa4')][_0x15cc('0xa5')]!==_0x15cc('0xa6'))return;return _0x515829['user'][_0x15cc('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x309f2e){if(_['isEmpty'](_0x309f2e)){_0x3b1041[_0x15cc('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');_0x476ff3[_0x15cc('0x54')](_0x15cc('0xa8'));}else{_0x3b1041[_0x15cc('0x54')](_0x15cc('0x88'),_['map'](_0x309f2e,'id'));_0x476ff3[_0x15cc('0x54')](_0x15cc('0x88'),_[_0x15cc('0x3c')](_0x309f2e,'id'));}});})[_0x15cc('0x35')](function(){if(_0x515829['user']['role']==='agent'&&!_0x162997&&!_0x515829[_0x15cc('0x47')][_0x15cc('0x87')])return[];return db['sequelize'][_0x15cc('0x47')](_0x3b1041[_0x15cc('0xa9')](),_0x2cbf18);})['then'](function(_0x1a0206){_0x4aad83[_0x15cc('0x2e')]=_0x1a0206[_0x15cc('0x4d')];if(_0x4aad83['count']===0x0)return[];return db[_0x15cc('0xaa')][_0x15cc('0x47')](_0x362346['toString'](),_0x2cbf18)['then'](function(_0x21af41){_0x58f95e=_[_0x15cc('0xab')](_0x21af41,'id');_0x2cbf18=_[_0x15cc('0xac')](_0x2cbf18,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x515829[_0x15cc('0x47')][_0x15cc('0x4c')]){_0x26fe19[_0x15cc('0x4a')][_0x15cc('0x7f')](function(_0x4cff1e){_0x476ff3['field']('i.'+_0x4cff1e);});}else{_0x476ff3['field'](_0x15cc('0x9e'),_0x15cc('0x6f'));_0x476ff3['field'](_0x15cc('0xad'),_0x15cc('0xae'));_0x476ff3['field']('a.mandatoryDisposition',_0x15cc('0xaf'));_0x476ff3[_0x15cc('0x57')](_0x15cc('0xb0'),'contactName');_0x476ff3[_0x15cc('0x57')]('i.*');_0x476ff3[_0x15cc('0x57')](_0x15cc('0xb1'),_0x15cc('0xb2'));_0x476ff3[_0x15cc('0x57')](_0x15cc('0xb3'),'Contact.lastName');_0x476ff3[_0x15cc('0x57')](_0x15cc('0xb4'),_0x15cc('0xb5'));_0x476ff3[_0x15cc('0x57')]('c.phone',_0x15cc('0xb6'));_0x476ff3['field'](_0x15cc('0xb7'),_0x15cc('0xb8'));_0x476ff3[_0x15cc('0x57')](_0x15cc('0xb9'),_0x15cc('0xba'));_0x476ff3[_0x15cc('0x57')](_0x15cc('0xbb'),_0x15cc('0xbc'));_0x476ff3[_0x15cc('0x57')](_0x15cc('0xbd'),_0x15cc('0xbe'));_0x476ff3['field'](_0x15cc('0xbf'),'TagIds');}if(_0x26fe19['limit'])_0x476ff3['limit'](_0x26fe19[_0x15cc('0x50')]);if(_0x26fe19[_0x15cc('0x51')])_0x476ff3[_0x15cc('0x51')](_0x26fe19[_0x15cc('0x51')]);return db['sequelize'][_0x15cc('0x47')](_0x476ff3[_0x15cc('0xa9')](),_0x2cbf18);})[_0x15cc('0x35')](function(_0x48ac9d){_0x2e911e['where'](_0x15cc('0xc0'),_[_0x15cc('0x3c')](_0x48ac9d,'id'));return db[_0x15cc('0xaa')][_0x15cc('0x47')](_0x2e911e[_0x15cc('0xa9')](),_0x2cbf18)[_0x15cc('0x35')](function(_0x201144){var _0x33da92=_[_0x15cc('0xc1')](_0x201144,_0x15cc('0xc2'));var _0x4c1cbb=[];_0x48ac9d[_0x15cc('0x7f')](function(_0x129c6f){_0x4c1cbb[_0x15cc('0xc3')](updateChatInteraction(_0x129c6f,_0x58f95e,_0x33da92));});return BPromise[_0x15cc('0xc4')](_0x4c1cbb);});});})[_0x15cc('0x35')](function(_0x488bb1){_0x4aad83[_0x15cc('0xc5')]=_0x488bb1;return _0x4aad83;})['then'](respondWithFilteredResult(_0x53c2f3,_0x26fe19))[_0x15cc('0x2b')](handleError(_0x53c2f3,null));};exports[_0x15cc('0xc6')]=function(_0x40eedf,_0x273e93){var _0x244c39={'raw':![],'where':{'id':_0x40eedf[_0x15cc('0xc7')]['id']}},_0x1e0c3e={};_0x1e0c3e[_0x15cc('0x46')]=_[_0x15cc('0x48')](db[_0x15cc('0x42')][_0x15cc('0x43')]);_0x1e0c3e[_0x15cc('0x47')]=_[_0x15cc('0x48')](_0x40eedf[_0x15cc('0x47')]);_0x1e0c3e[_0x15cc('0x49')]=_[_0x15cc('0x4b')](_0x1e0c3e[_0x15cc('0x46')],_0x1e0c3e[_0x15cc('0x47')]);_0x244c39['attributes']=_[_0x15cc('0x4b')](_0x1e0c3e[_0x15cc('0x46')],qs['fields'](_0x40eedf[_0x15cc('0x47')][_0x15cc('0x4c')]));_0x244c39[_0x15cc('0x4a')]=_0x244c39[_0x15cc('0x4a')]['length']?_0x244c39[_0x15cc('0x4a')]:_0x1e0c3e[_0x15cc('0x46')];if(_0x40eedf[_0x15cc('0x47')][_0x15cc('0xc8')]){_0x244c39[_0x15cc('0xc9')]=[{'all':!![]}];}_0x244c39=_['merge']({},_0x244c39,_0x40eedf['options']);return db[_0x15cc('0x42')][_0x15cc('0x6e')](_0x244c39)[_0x15cc('0x35')](handleEntityNotFound(_0x273e93,null))['then'](respondWithResult(_0x273e93,null))[_0x15cc('0x2b')](handleError(_0x273e93,null));};exports[_0x15cc('0xca')]=function(_0x3bb012,_0x19abe3){return db[_0x15cc('0x42')][_0x15cc('0xca')](_0x3bb012[_0x15cc('0xcb')],{})['then'](respondWithResult(_0x19abe3,0xc9))[_0x15cc('0x2b')](handleError(_0x19abe3,null));};exports[_0x15cc('0x34')]=function(_0x190318,_0x19281c){if(_0x190318['body']['id']){delete _0x190318['body']['id'];}return db[_0x15cc('0x42')][_0x15cc('0x6e')]({'where':{'id':_0x190318[_0x15cc('0xc7')]['id']}})['then'](handleEntityNotFound(_0x19281c,null))[_0x15cc('0x35')](saveUpdates(_0x190318[_0x15cc('0xcb')],null))['then'](respondWithResult(_0x19281c,null))['catch'](handleError(_0x19281c,null));};exports['destroy']=function(_0x4cee4b,_0x3b0d65){return db['ChatInteraction'][_0x15cc('0x6e')]({'where':{'id':_0x4cee4b[_0x15cc('0xc7')]['id']}})['then'](handleEntityNotFound(_0x3b0d65,null))['then'](removeEntity(_0x3b0d65,null))[_0x15cc('0x2b')](handleError(_0x3b0d65,null));};exports[_0x15cc('0xcc')]=function(_0xe255ce,_0x49f73e){return db[_0x15cc('0x42')]['describe']()[_0x15cc('0x35')](respondWithResult(_0x49f73e,null))['catch'](handleError(_0x49f73e,null));};exports[_0x15cc('0xcd')]=function(_0xfe1f0a,_0xba51f7){var _0x134360=_0xfe1f0a[_0x15cc('0xc7')]['id'];var _0x3fa979;var _0x252dc0;var _0x4fb915;return db['ChatInteraction'][_0x15cc('0xce')]({'where':{'id':_0x134360}})[_0x15cc('0x35')](function(_0x3d973c){_0x3fa979=_0x3d973c;return db[_0x15cc('0xcf')][_0x15cc('0xce')]({'where':{'id':_0x3d973c[_0x15cc('0x87')]},'attributes':['id',_0x15cc('0xd0'),_0x15cc('0xd1')],'raw':!![]});})['then'](function(_0x38c2c5){if(_0x38c2c5&&_0x38c2c5[_0x15cc('0xd0')]&&_0x38c2c5[_0x15cc('0xd1')]){_0x252dc0=_0x38c2c5;var _0x5c82f6={'rejectUnauthorized':![],'method':_0x15cc('0xd2'),'uri':_0x15cc('0xd3'),'headers':{'X-APIKEY':_0x38c2c5[_0x15cc('0xd0')]},'body':{'name':_0x15cc('0xd4')+_0x134360},'redirect':_0x15cc('0xd5'),'json':!![]};return rp(_0x5c82f6);}else{throw new db[(_0x15cc('0xd6'))][(_0x15cc('0xd7'))](_0x15cc('0xd8'));}})['then'](function(_0x4f0517){_0x4fb915=_0x4f0517;if(_0x4fb915['id']){var _0x47b2f8={'body':_0x4fb915[_0x15cc('0xd9')],'ChatWebsiteId':_0x252dc0['id'],'ChatInteractionId':_0x3fa979['id'],'direction':_0x15cc('0xda'),'UserId':_0xfe1f0a[_0x15cc('0xa4')]['id']};return db[_0x15cc('0xdb')][_0x15cc('0xca')](_0x47b2f8,{});}else{throw new db[(_0x15cc('0xd6'))]['ValidationError'](_0x15cc('0xdc'));}})[_0x15cc('0x35')](function(){return _0x3fa979[_0x15cc('0xdd')]({'vidaooSessionId':_0x4fb915['id']});})['then'](respondWithResult(_0xba51f7,null))[_0x15cc('0x2b')](handleError(_0xba51f7,null));};exports[_0x15cc('0xde')]=function(_0x379cab,_0xf30e95){if(_0x379cab[_0x15cc('0xcb')]['id']){delete _0x379cab[_0x15cc('0xcb')]['id'];}return db['ChatInteraction'][_0x15cc('0x6e')]({'where':{'id':_0x379cab[_0x15cc('0xc7')]['id']},'include':[{'model':db[_0x15cc('0xdf')],'as':_0x15cc('0x73')}]})[_0x15cc('0x35')](handleEntityNotFound(_0xf30e95,null))[_0x15cc('0x35')](saveUpdates(_0x379cab[_0x15cc('0xcb')],null))[_0x15cc('0x35')](respondWithResult(_0xf30e95,null))[_0x15cc('0x2b')](handleError(_0xf30e95,null));};exports[_0x15cc('0xe0')]=function(_0x17dd54,_0x5018aa,_0x3f18a7){if(_0x17dd54[_0x15cc('0xcb')]['id']){delete _0x17dd54[_0x15cc('0xcb')]['id'];}return db['ChatInteraction'][_0x15cc('0x6e')]({'where':{'id':_0x17dd54[_0x15cc('0xc7')]['id']}})['then'](function(_0x389874){if(!_0x389874){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x15cc('0xe0'),0x194,_0x15cc('0xe1'));_0x5018aa[_0x15cc('0x37')](0x194);}else{if(_0x389874[_0x15cc('0x83')]){throw new db['Sequelize'][(_0x15cc('0xd7'))]('Interaction\x20already\x20assigned');}}return _0x389874;})[_0x15cc('0x35')](function(_0x2cb599){if(_0x2cb599){return _0x2cb599['update']({'closed':_0x17dd54[_0x15cc('0xcb')][_0x15cc('0xe2')],'disposition':_0x17dd54[_0x15cc('0xcb')][_0x15cc('0xe3')]})['then'](function(_0x9bd614){return _0x9bd614;});}})['then'](function(_0x1da5b5){return respondWithRpcPromise(_0x15cc('0xe4'),_0x15cc('0xe0'),_0x17dd54['body'],client9004);})[_0x15cc('0x35')](respondWithResult(_0x5018aa,null))[_0x15cc('0x2b')](handleError(_0x5018aa,null));};exports['attachmentUpload']=function(_0xae1745,_0x4a7a03,_0xeecddc){_0xae1745[_0x15cc('0xcb')][_0x15cc('0x39')]=_0xae1745[_0x15cc('0xe5')][_0x15cc('0xe6')];_0xae1745['body'][_0x15cc('0xe7')]=_0xae1745[_0x15cc('0xe5')]['filename'];_0xae1745[_0x15cc('0xcb')][_0x15cc('0x7b')]=_0xae1745[_0x15cc('0xe5')]['mimetype'];return db[_0x15cc('0xe8')][_0x15cc('0xca')](_0xae1745['body'])[_0x15cc('0x35')](respondWithResult(_0x4a7a03,0xc9))[_0x15cc('0x2b')](handleError(_0x4a7a03,null));};exports[_0x15cc('0xe9')]=function(_0x4cfdcc,_0x3c0581,_0x3e0420){return db['ChatInteraction'][_0x15cc('0xce')]({'where':{'id':_0x4cfdcc[_0x15cc('0xc7')]['id']},'raw':!![]})[_0x15cc('0x35')](handleEntityNotFound(_0x3c0581,null))['then'](function(_0x2a6302){if(_0x2a6302){if(_0x2a6302['closed']){return _0x3c0581[_0x15cc('0x2d')](0x193)[_0x15cc('0x31')]({'status':0x193,'message':'Unauthorized'});}return db[_0x15cc('0xe8')][_0x15cc('0xce')]({'where':{'id':_0x4cfdcc[_0x15cc('0x47')][_0x15cc('0xea')]},'raw':!![]})[_0x15cc('0x35')](handleEntityNotFound(_0x3c0581,null));}})['then'](function(_0x2a06d9){if(_0x2a06d9){var _0x3ed841=_0x2a06d9[_0x15cc('0xeb')]!==null;var _0x1188fe=path[_0x15cc('0xec')](config[_0x15cc('0xed')],'server/files/attachments/');if(_0x3ed841){_0x1188fe=path['join'](_0x1188fe,_0x15cc('0xee'));}var _0x1e6c34=path[_0x15cc('0xec')](_0x1188fe,_0x2a06d9[_0x15cc('0xe7')]);return _0x3c0581[_0x15cc('0xef')](_0x1e6c34);}})[_0x15cc('0x2b')](handleError(_0x3c0581,null));};exports[_0x15cc('0xf0')]=function(_0x4437e1,_0xf793e4){var _0x3fa331=null;var _0x551dcb=null;var _0x2ddf3f=null;var _0x4a91dc=null;if(_0x4437e1[_0x15cc('0xcb')]['id']){delete _0x4437e1[_0x15cc('0xcb')]['id'];}if(_0x4437e1[_0x15cc('0xcb')][_0x15cc('0xf1')]){_0x4a91dc=path[_0x15cc('0xec')](config[_0x15cc('0xed')],_0x15cc('0xf2'),util[_0x15cc('0xf3')](_0x15cc('0xf4'),Date['now']()));_0x4437e1[_0x15cc('0xcb')][_0x15cc('0xf5')]=_0x4a91dc;}return db['ChatInteraction'][_0x15cc('0x6e')]({'where':{'id':_0x4437e1[_0x15cc('0xc7')]['id']},'include':[{'model':db[_0x15cc('0xdb')],'as':_0x15cc('0xf6'),'include':[{'model':db['User'],'as':_0x15cc('0x81')}]}]})[_0x15cc('0x35')](handleEntityNotFound(_0xf793e4,null))[_0x15cc('0x35')](saveUpdates(_0x4437e1[_0x15cc('0xcb')],null))[_0x15cc('0x35')](function(_0xf99bbb){if(_0xf99bbb){_0x3fa331=_0xf99bbb;return db[_0x15cc('0xcf')][_0x15cc('0x6e')]({'where':{'id':_0x3fa331[_0x15cc('0x87')]}});}})[_0x15cc('0x35')](function(_0x2f417a){if(_0x2f417a){_0x2ddf3f=_0x2f417a;return db[_0x15cc('0xdf')]['find']({'where':{'id':_0x3fa331['ContactId']}});}})[_0x15cc('0x35')](function(_0x550d63){if(_0x550d63){_0x551dcb=_0x550d63;if(_0x4a91dc){var _0x29dc0e=null;for(var _0x175b87=0x1;_0x175b87<_0x3fa331[_0x15cc('0xf6')]['length'];++_0x175b87){_0x29dc0e=_0x3fa331[_0x15cc('0xf6')][_0x175b87];var _0x4dc110=_0x29dc0e['UserId']?util['format'](_0x15cc('0xf7'),_0x2ddf3f[_0x15cc('0xf8')],_0x29dc0e[_0x15cc('0x83')]):_0x15cc('0xf9');var _0x1ead7b=_0x4437e1[_0x15cc('0xcb')][_0x15cc('0xfa')]||util['format']('%s%d',_0x15cc('0xfb'),_0x29dc0e[_0x15cc('0x79')]);switch(_0x2ddf3f[_0x15cc('0xfc')]){case'website_alias':_0x4dc110=_0x29dc0e[_0x15cc('0x83')]?util[_0x15cc('0xf3')](_0x15cc('0xf7'),_0x2ddf3f[_0x15cc('0xf8')],_0x29dc0e[_0x15cc('0x83')]):_0x15cc('0xf9');break;case _0x15cc('0xfd'):_0x4dc110=_0x29dc0e['UserId']?_0x29dc0e[_0x15cc('0x81')][_0x15cc('0xfe')]||_0x29dc0e[_0x15cc('0x81')][_0x15cc('0x3d')]:_0x15cc('0xf9');break;case _0x15cc('0xff'):_0x4dc110=_0x29dc0e[_0x15cc('0x83')]?_0x29dc0e[_0x15cc('0x81')][_0x15cc('0x3d')]:_0x15cc('0xf9');break;default:_0x4dc110=_0x29dc0e['UserId']?util[_0x15cc('0xf3')](_0x15cc('0xf7'),_0x2ddf3f[_0x15cc('0xf8')],_0x29dc0e[_0x15cc('0x83')]):_0x15cc('0xf9');}var _0x1745ee=util[_0x15cc('0xf3')](_0x15cc('0x100'),moment(_0x29dc0e[_0x15cc('0x89')])[_0x15cc('0xf3')](_0x15cc('0x101')),_0x29dc0e['direction']==='in'?_0x1ead7b:_0x4dc110,_0x29dc0e[_0x15cc('0xcb')]);if(!_0x29dc0e[_0x15cc('0x102')]){fs[_0x15cc('0x103')](_0x4a91dc,_0x1745ee);}}return db['MailAccount'][_0x15cc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x15cc('0x104')],'as':_0x15cc('0x105'),'raw':!![]}]});}}})[_0x15cc('0x35')](function(_0x3e5af0){if(_0x3e5af0&&_0x3e5af0[_0x15cc('0x105')]&&_0x4437e1['body']){var _0x34db5a={'tls':{'rejectUnauthorized':![]}};if(_0x3e5af0[_0x15cc('0x105')]['service']){_0x34db5a[_0x15cc('0x106')]=_0x3e5af0[_0x15cc('0x105')][_0x15cc('0x106')];}else{_0x34db5a[_0x15cc('0x107')]=_0x3e5af0[_0x15cc('0x105')]['host'];_0x34db5a[_0x15cc('0x108')]=_0x3e5af0['Smtp'][_0x15cc('0x108')];_0x34db5a[_0x15cc('0x109')]=_0x3e5af0['Smtp']['secure'];}if(_0x3e5af0[_0x15cc('0x105')]['authentication']){_0x34db5a[_0x15cc('0x10a')]={'user':_0x3e5af0[_0x15cc('0x105')][_0x15cc('0xa4')],'pass':_0x3e5af0[_0x15cc('0x105')][_0x15cc('0x10b')]};}return respondWithRpcPromise(_0x15cc('0x10c'),_0x15cc('0x10d'),{'account':_0x34db5a,'message':{'from':util[_0x15cc('0xf3')](_0x15cc('0x10e'),_0x3e5af0[_0x15cc('0x39')],_0x3e5af0[_0x15cc('0x10f')]||_0x3e5af0[_0x15cc('0x105')][_0x15cc('0xa4')]),'to':_0x4437e1[_0x15cc('0xcb')][_0x15cc('0xf1')],'subject':_0x15cc('0x110'),'text':util[_0x15cc('0xf3')](_0x15cc('0x111'),_0x4437e1['body'][_0x15cc('0xf1')]),'attachments':[{'path':_0x4a91dc}]}})[_0x15cc('0x35')](function(){return _0x3fa331;})[_0x15cc('0x2b')](function(_0x4b788c){console['error'](_0x4b788c);});}else{return _0x3fa331;}})[_0x15cc('0x35')](respondWithStatusCode(_0xf793e4,0xc8))[_0x15cc('0x2b')](handleError(_0xf793e4,null));};exports[_0x15cc('0x112')]=function(_0x146967,_0x30c961,_0x4dbe99){return db[_0x15cc('0xdb')][_0x15cc('0x6e')]({'where':{'id':_0x146967[_0x15cc('0xc7')]['id']}})['then'](handleEntityNotFound(_0x30c961,null))[_0x15cc('0x35')](function(_0x934537){if(_0x934537){return _0x934537[_0x15cc('0x112')](_0x146967[_0x15cc('0xcb')][_0x15cc('0x113')],_[_0x15cc('0x114')](_0x146967['body'],[_0x15cc('0x113'),'id'])||{});}})['then'](respondWithResult(_0x30c961,null))[_0x15cc('0x2b')](handleError(_0x30c961,null));};exports[_0x15cc('0x115')]=function(_0x261a6c,_0x26ab78,_0x4760e7){var _0x528459={'raw':![],'where':{}};var _0x150cf9={};var _0x5b7b9e={'count':0x0,'rows':[]};return db[_0x15cc('0x42')][_0x15cc('0xce')]({'where':{'id':_0x261a6c[_0x15cc('0xc7')]['id']}})['then'](handleEntityNotFound(_0x26ab78,null))[_0x15cc('0x35')](function(_0x11028f){if(_0x11028f){_0x150cf9[_0x15cc('0x46')]=_[_0x15cc('0x48')](db['ChatMessage'][_0x15cc('0x43')]);_0x150cf9[_0x15cc('0x47')]=_['keys'](_0x261a6c['query']);_0x150cf9[_0x15cc('0x49')]=_[_0x15cc('0x4b')](_0x150cf9[_0x15cc('0x46')],_0x150cf9[_0x15cc('0x47')]);_0x528459[_0x15cc('0x4a')]=_['intersection'](_0x150cf9['model'],qs[_0x15cc('0x4c')](_0x261a6c['query'][_0x15cc('0x4c')]));_0x528459['attributes']=_0x528459[_0x15cc('0x4a')][_0x15cc('0x4d')]?_0x528459['attributes']:_0x150cf9[_0x15cc('0x46')];if(!_0x261a6c[_0x15cc('0x47')]['hasOwnProperty'](_0x15cc('0x4f'))){_0x528459[_0x15cc('0x50')]=qs[_0x15cc('0x50')](_0x261a6c[_0x15cc('0x47')][_0x15cc('0x50')]);_0x528459[_0x15cc('0x51')]=qs[_0x15cc('0x51')](_0x261a6c[_0x15cc('0x47')][_0x15cc('0x51')]);}_0x528459['order']=qs[_0x15cc('0x53')](_0x261a6c['query']['sort']);_0x528459['where']=qs[_0x15cc('0x49')](_[_0x15cc('0x55')](_0x261a6c['query'],_0x150cf9[_0x15cc('0x49')]));_0x528459['where'][_0x15cc('0xc2')]=_0x11028f['id'];if(_0x261a6c[_0x15cc('0x47')][_0x15cc('0x96')]){_0x528459[_0x15cc('0x54')]=_[_0x15cc('0xac')](_0x528459['where'],{'$or':_[_0x15cc('0x3c')](_0x528459[_0x15cc('0x4a')],function(_0x45bdd7){var _0x172936={};_0x172936[_0x45bdd7]={'$like':'%'+_0x261a6c[_0x15cc('0x47')]['filter']+'%'};return _0x172936;})});}if(_0x261a6c[_0x15cc('0x47')][_0x15cc('0x8b')]){var _0xcefcc2=_0x261a6c[_0x15cc('0x47')]['$gte'][_0x15cc('0x40')](',');var _0x494d82={};_0x494d82[_0xcefcc2[0x0]]={'$gte':moment(_0xcefcc2[0x1])[_0x15cc('0xf3')](_0x15cc('0x116'))};_0x528459[_0x15cc('0x54')]=_[_0x15cc('0xac')](_0x528459[_0x15cc('0x54')],_0x494d82);}_0x528459=_[_0x15cc('0xac')]({},_0x528459,_0x261a6c[_0x15cc('0x117')]);return db[_0x15cc('0xdb')][_0x15cc('0x2e')]({'where':_0x528459[_0x15cc('0x54')]})[_0x15cc('0x35')](function(_0xa61511){_0x5b7b9e['count']=_0xa61511;if(_0x261a6c[_0x15cc('0x47')][_0x15cc('0xc8')]){_0x528459[_0x15cc('0xc9')]=[{'all':!![]}];}return db[_0x15cc('0xdb')][_0x15cc('0x118')](_0x528459);})[_0x15cc('0x35')](function(_0x54517d){_0x5b7b9e[_0x15cc('0xc5')]=_0x54517d;return _0x5b7b9e;});}})[_0x15cc('0x35')](respondWithFilteredResult(_0x26ab78,_0x528459))[_0x15cc('0x2b')](handleError(_0x26ab78,null));};exports[_0x15cc('0x119')]=function(_0x3e793e,_0x2795f9,_0x4d1ebf){var _0x4d887d={'where':{}},_0x461e95={},_0x21b15e={'count':0x0,'rows':[]};return db[_0x15cc('0x42')]['findOne']({'where':{'id':_0x3e793e[_0x15cc('0xc7')]['id']}})[_0x15cc('0x35')](handleEntityNotFound(_0x2795f9,null))[_0x15cc('0x35')](function(_0x521e28){if(_0x521e28){_0x461e95[_0x15cc('0x46')]=_['keys'](db[_0x15cc('0xdb')]['rawAttributes']);_0x461e95[_0x15cc('0x47')]=_[_0x15cc('0x48')](_0x3e793e[_0x15cc('0x47')]);_0x461e95[_0x15cc('0x49')]=_[_0x15cc('0x4b')](_0x461e95['model'],_0x461e95[_0x15cc('0x47')]);_0x4d887d[_0x15cc('0x4a')]=_[_0x15cc('0x4b')](_0x461e95[_0x15cc('0x46')],qs['fields'](_0x3e793e[_0x15cc('0x47')][_0x15cc('0x4c')]));_0x4d887d['attributes']=_0x4d887d[_0x15cc('0x4a')][_0x15cc('0x4d')]?_0x4d887d[_0x15cc('0x4a')]:_0x461e95[_0x15cc('0x46')];if(!_0x3e793e[_0x15cc('0x47')][_0x15cc('0x4e')](_0x15cc('0x4f'))){_0x4d887d[_0x15cc('0x50')]=qs[_0x15cc('0x50')](_0x3e793e['query'][_0x15cc('0x50')]);_0x4d887d[_0x15cc('0x51')]=qs[_0x15cc('0x51')](_0x3e793e[_0x15cc('0x47')]['offset']);}_0x4d887d[_0x15cc('0x52')]=qs[_0x15cc('0x53')](_0x3e793e[_0x15cc('0x47')][_0x15cc('0x53')]);_0x4d887d[_0x15cc('0x54')]=qs['filters'](_[_0x15cc('0x55')](_0x3e793e[_0x15cc('0x47')],_0x461e95[_0x15cc('0x49')]));_0x4d887d['where'][_0x15cc('0xc2')]=_0x521e28['id'];if(_0x3e793e[_0x15cc('0x47')]['filter']){_0x4d887d['where']=_[_0x15cc('0xac')](_0x4d887d[_0x15cc('0x54')],{'$or':_[_0x15cc('0x3c')](_0x4d887d['attributes'],function(_0x2c438f){var _0x135c4a={};_0x135c4a[_0x2c438f]={'$like':'%'+_0x3e793e[_0x15cc('0x47')][_0x15cc('0x96')]+'%'};return _0x135c4a;})});}_0x4d887d[_0x15cc('0x54')][_0x15cc('0x102')]=![];if(_0x3e793e[_0x15cc('0x47')]['id']){_0x4d887d[_0x15cc('0x54')]['id']={'$gt':_0x3e793e[_0x15cc('0x47')]['id']};}_0x4d887d=_[_0x15cc('0xac')]({},_0x4d887d,_0x3e793e[_0x15cc('0x117')]);return db[_0x15cc('0xdb')]['count']({'where':_0x4d887d[_0x15cc('0x54')]})[_0x15cc('0x35')](function(_0x507c8d){_0x21b15e[_0x15cc('0x2e')]=_0x507c8d;_0x4d887d['include']=[];if(_0x3e793e[_0x15cc('0x47')]['includeAgent']){_0x4d887d[_0x15cc('0xc9')][_0x15cc('0xc3')]({'model':db[_0x15cc('0x81')],'as':_0x15cc('0x81'),'attributes':['id',_0x15cc('0x3d'),_0x15cc('0xfe')]});}if(_0x3e793e[_0x15cc('0x47')][_0x15cc('0xc8')]){_0x4d887d['include']=[{'all':!![]}];}return db['ChatMessage'][_0x15cc('0x118')](_0x4d887d);})[_0x15cc('0x35')](function(_0x10d8b7){_0x21b15e[_0x15cc('0xc5')]=_0x10d8b7;return _0x21b15e;});}})[_0x15cc('0x35')](respondWithFilteredResult(_0x2795f9,_0x4d887d))[_0x15cc('0x2b')](handleError(_0x2795f9,null));};exports[_0x15cc('0x11a')]=function(_0xa92a0b,_0x3f37a1,_0x427a82){return db[_0x15cc('0x42')][_0x15cc('0x6e')]({'where':{'id':_0xa92a0b[_0x15cc('0xc7')]['id']}})['then'](handleEntityNotFound(_0x3f37a1,null))['then'](function(_0x3daeaa){if(_0x3daeaa){return _0x3daeaa[_0x15cc('0x11b')](_0xa92a0b['body'][_0x15cc('0x113')],_[_0x15cc('0x114')](_0xa92a0b[_0x15cc('0xcb')],['ids','id'])||{})[_0x15cc('0x11c')](function(){return db[_0x15cc('0x7e')][_0x15cc('0x118')]({'attributes':['id','name',_0x15cc('0x58')],'where':{'id':_0xa92a0b['body']['ids']}});})[_0x15cc('0x35')](function(_0x139013){socket[_0x15cc('0x11d')](_0x15cc('0x11e'),{'id':Number(_0xa92a0b[_0x15cc('0xc7')]['id']),'tags':_0x139013||[]});return{'id':Number(_0xa92a0b['params']['id']),'tags':_0x139013||[]};});}})['then'](respondWithResult(_0x3f37a1,null))[_0x15cc('0x2b')](handleError(_0x3f37a1,null));};exports[_0x15cc('0x11f')]=function(_0x2d0f34,_0x4b1e76,_0x265713){return db[_0x15cc('0x42')][_0x15cc('0x6e')]({'where':{'id':_0x2d0f34['params']['id']}})[_0x15cc('0x35')](handleEntityNotFound(_0x4b1e76,null))[_0x15cc('0x35')](function(_0x589160){if(_0x589160){return _0x589160[_0x15cc('0x11f')](_0x2d0f34[_0x15cc('0x47')][_0x15cc('0x113')]);}})[_0x15cc('0x35')](respondWithStatusCode(_0x4b1e76,null))[_0x15cc('0x2b')](handleError(_0x4b1e76,null));};exports[_0x15cc('0xef')]=function(_0x2ef957,_0x12a0d1){var _0x5b948d=moment()[_0x15cc('0x120')]()[_0x15cc('0xa9')]();var _0x4d4128=path[_0x15cc('0xec')](config[_0x15cc('0xed')],_0x15cc('0x121'),_0x15cc('0x122'),_0x15cc('0x123'));var _0x2e92ea=path[_0x15cc('0xec')](config[_0x15cc('0xed')],_0x15cc('0x121'),_0x15cc('0x122'),_0x15cc('0x124'));var _0x526ead=path['join'](_0x4d4128,_0x5b948d);var _0x2f5b9a=util[_0x15cc('0xf3')]('transcript-%d-%s.zip',_0x2ef957[_0x15cc('0xc7')]['id'],_0x5b948d);var _0x56246e=path[_0x15cc('0xec')](_0x4d4128,_0x2f5b9a);var _0x519c98=[];_0x519c98[_0x15cc('0xc3')]({'model':db[_0x15cc('0x81')],'as':_0x15cc('0x81'),'attributes':['id',_0x15cc('0x3d')],'raw':!![]});_0x519c98[_0x15cc('0xc3')]({'model':db[_0x15cc('0xdf')],'as':_0x15cc('0x73'),'attributes':['id',_0x15cc('0x125'),'lastName'],'raw':!![]});if(_0x2ef957[_0x15cc('0x47')][_0x15cc('0x124')]){_0x519c98[_0x15cc('0xc3')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x50e346=[{'model':db['ChatMessage'],'as':_0x15cc('0xf6'),'attributes':['id','body',_0x15cc('0x89'),_0x15cc('0x126'),_0x15cc('0x102'),_0x15cc('0x91')],'include':_0x519c98}];_0x50e346[_0x15cc('0xc3')]({'model':db[_0x15cc('0xcf')],'as':_0x15cc('0x127'),'attributes':['id',_0x15cc('0x39')]});_0x50e346['push']({'model':db[_0x15cc('0x81')],'as':_0x15cc('0x128'),'attributes':['id',_0x15cc('0x3d')]});return db[_0x15cc('0x42')][_0x15cc('0x6e')]({'where':{'id':_0x2ef957[_0x15cc('0xc7')]['id']},'include':_0x50e346})[_0x15cc('0x35')](handleEntityNotFound(_0x12a0d1,null))[_0x15cc('0x35')](function(_0x4b2980){if(_0x4b2980){var _0x1aa0e4=_0x4b2980[_0x15cc('0x129')]({'plain':!![]});fs['mkdirSync'](_0x526ead);var _0x42669d={'channel':'Chat','account':_0x1aa0e4[_0x15cc('0x127')][_0x15cc('0x39')],'agent':_0x1aa0e4[_0x15cc('0x128')]?_0x1aa0e4[_0x15cc('0x128')]['fullname']:_0x15cc('0x12a'),'createdAt':moment(_0x1aa0e4[_0x15cc('0x89')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x1aa0e4[_0x15cc('0xe2')]?moment(_0x1aa0e4[_0x15cc('0x12b')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1aa0e4[_0x15cc('0xe3')],'chatInfo':{'browser':_0x1aa0e4[_0x15cc('0x12c')],'os':_0x1aa0e4[_0x15cc('0x12d')],'referer':_0x1aa0e4[_0x15cc('0x12e')],'customerIp':_0x1aa0e4['customerIp'],'customerPort':_0x1aa0e4[_0x15cc('0x12f')]?_0x1aa0e4['customerPort']:_0x15cc('0x12a')},'messages':_(_0x1aa0e4['Messages'])[_0x15cc('0x130')]()['filter']({'secret':![]})[_0x15cc('0x3c')](function(_0x31a0d3){if(_0x31a0d3[_0x15cc('0xe8')]){var _0x32ae91=path['join'](_0x2e92ea,_0x31a0d3['Attachment']['basename']);if(fs[_0x15cc('0x131')](_0x32ae91)){fs[_0x15cc('0x132')](_0x32ae91)[_0x15cc('0x133')](fs[_0x15cc('0x134')](path['join'](_0x526ead,_0x31a0d3[_0x15cc('0xe8')][_0x15cc('0xe7')])));}}return{'date':moment(_0x31a0d3['createdAt'])[_0x15cc('0xf3')](_0x15cc('0x116'))['toString'](),'sender':_0x31a0d3['direction']===_0x15cc('0xda')?_0x31a0d3['User']?_0x31a0d3[_0x15cc('0x81')]['fullname']:_0x15cc('0xf9'):_0x31a0d3[_0x15cc('0x73')]['firstName']+(_0x31a0d3[_0x15cc('0x73')][_0x15cc('0x135')]?'\x20'+_0x31a0d3[_0x15cc('0x73')][_0x15cc('0x135')]:''),'body':_0x31a0d3[_0x15cc('0xe8')]?_0x31a0d3['Attachment']['basename']:_0x31a0d3['body'],'direction':_0x31a0d3[_0x15cc('0x126')]===_0x15cc('0xda')?'A':'C','secret':_0x31a0d3[_0x15cc('0x102')],'read':_0x31a0d3[_0x15cc('0x91')],'attachment':_0x31a0d3[_0x15cc('0xe8')]};})[_0x15cc('0x70')]()};return ejs['renderFile'](path[_0x15cc('0xec')](config[_0x15cc('0xed')],_0x15cc('0x121'),_0x15cc('0x136'),_0x15cc('0x137')),{'interaction':_0x42669d})[_0x15cc('0x35')](function(_0xfa11a0){var _0x41796f=path[_0x15cc('0xec')](_0x526ead,_0x15cc('0x138')+_0x1aa0e4['id']+'-'+_0x5b948d+'.pdf');var _0x197eff={'path':_0x41796f,'channel':_0x15cc('0x139'),'interactionId':_0x1aa0e4['id']};return pdf[_0x15cc('0x13a')](_0xfa11a0,_0x197eff);})[_0x15cc('0x35')](function(){return new BPromise(function(_0x126247,_0x9d2cf7){zipdir(_0x526ead,{'saveTo':_0x56246e},function(_0xcbe1b9,_0x3a3efd){if(_0xcbe1b9)return _0x9d2cf7(_0xcbe1b9);return _0x126247(_0x3a3efd);});})[_0x15cc('0x35')](function(){return new BPromise(function(_0x3fe961,_0x1aa699){rimraf(_0x526ead,function(_0x1aceb9){if(_0x1aceb9)_0x1aa699(_0x1aceb9);return _0x3fe961();});});})['then'](function(){return _0x12a0d1[_0x15cc('0xef')](_0x56246e,_0x2f5b9a,function(_0x53c367){if(_0x53c367){console['log'](_0x15cc('0x13b'),_0x53c367);}else{fs['unlinkSync'](_0x56246e);}});});});}else{return _0x12a0d1[_0x15cc('0x37')](0xc8);}})[_0x15cc('0x2b')](handleError(_0x12a0d1,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 116b563..ee12c9c 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 _0x2854=['remove','then','setDataValue','map','unreadMessages','length','emit','catch','hook','exports','events','ChatInteraction','ChatMessage','setMaxListeners','save','update'];(function(_0x30eb76,_0xd96c8){var _0x348568=function(_0x24599f){while(--_0x24599f){_0x30eb76['push'](_0x30eb76['shift']());}};_0x348568(++_0xd96c8);}(_0x2854,0xaa));var _0x4285=function(_0x5374f6,_0x5e963b){_0x5374f6=_0x5374f6-0x0;var _0x5dbdc6=_0x2854[_0x5374f6];return _0x5dbdc6;};'use strict';var EventEmitter=require(_0x4285('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4285('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x4285('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4285('0x3')](0x0);var events={'afterCreate':_0x4285('0x4'),'afterUpdate':_0x4285('0x5'),'afterDestroy':_0x4285('0x6')};function emitEvent(_0x22b4a1){return function(_0x140897,_0x5bdca0,_0x4be056){_0x140897['getUsers']({'attributes':['id'],'raw':!![]})[_0x4285('0x7')](function(_0x317416){_0x140897[_0x4285('0x8')]('Users',_0x317416[_0x4285('0x9')](function(_0xa41538){return{'id':_0xa41538['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x140897['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4285('0x7')](function(_0x440880){_0x140897[_0x4285('0x8')](_0x4285('0xa'),_0x440880[_0x4285('0xb')]);ChatInteractionEvents[_0x4285('0xc')](_0x22b4a1+':'+_0x140897['id'],_0x140897);ChatInteractionEvents[_0x4285('0xc')](_0x22b4a1,_0x140897);_0x4be056(null);})[_0x4285('0xd')](_0x4be056(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x4285('0xe')](e,emitEvent(event));}}module[_0x4285('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xd237=['remove','then','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','update'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0xd237,0x12b));var _0x7d23=function(_0x316fd2,_0x23f025){_0x316fd2=_0x316fd2-0x0;var _0x6b8f86=_0xd237[_0x316fd2];return _0x6b8f86;};'use strict';var EventEmitter=require(_0x7d23('0x0'));var ChatInteraction=require(_0x7d23('0x1'))['db'][_0x7d23('0x2')];var ChatMessage=require(_0x7d23('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7d23('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d23('0x4'),'afterDestroy':_0x7d23('0x5')};function emitEvent(_0x2bc609){return function(_0x39ec94,_0x1975bb,_0x5f2a3e){_0x39ec94['getUsers']({'attributes':['id'],'raw':!![]})[_0x7d23('0x6')](function(_0x219ca4){_0x39ec94['setDataValue'](_0x7d23('0x7'),_0x219ca4[_0x7d23('0x8')](function(_0x1cf1a2){return{'id':_0x1cf1a2['id']};}));return ChatMessage[_0x7d23('0x9')]({'where':{'ChatInteractionId':_0x39ec94['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7d23('0x6')](function(_0x1d6f29){_0x39ec94['setDataValue'](_0x7d23('0xa'),_0x1d6f29[_0x7d23('0xb')]);ChatInteractionEvents[_0x7d23('0xc')](_0x2bc609+':'+_0x39ec94['id'],_0x39ec94);ChatInteractionEvents[_0x7d23('0xc')](_0x2bc609,_0x39ec94);_0x5f2a3e(null);})['catch'](_0x5f2a3e(null));};}for(var e in events){if(events[_0x7d23('0xd')](e)){var event=events[e];ChatInteraction[_0x7d23('0xe')](e,emitEvent(event));}}module[_0x7d23('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 4f18aa0..d1ede0e 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 _0xb46e=['bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api'];(function(_0x15fa77,_0x93eaff){var _0x1385ff=function(_0x165e02){while(--_0x165e02){_0x15fa77['push'](_0x15fa77['shift']());}};_0x1385ff(++_0x93eaff);}(_0xb46e,0x1bd));var _0xeb46=function(_0x110f07,_0x523a8d){_0x110f07=_0x110f07-0x0;var _0x390dec=_0xb46e[_0x110f07];return _0x390dec;};'use strict';var _=require('lodash');var util=require(_0xeb46('0x0'));var logger=require(_0xeb46('0x1'))(_0xeb46('0x2'));var moment=require('moment');var BPromise=require(_0xeb46('0x3'));var rp=require(_0xeb46('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb46('0x5'));var config=require(_0xeb46('0x6'));var attributes=require(_0xeb46('0x7'));module['exports']=function(_0x1b499c,_0xe90dbd){return _0x1b499c[_0xeb46('0x8')](_0xeb46('0x9'),attributes,{'tableName':_0xeb46('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d8c80,_0x7672cd,_0x37255f){if(_0x1d8c80['changed'](_0xeb46('0xb'))){_0x1d8c80[_0xeb46('0xc')]=moment()[_0xeb46('0xd')](_0xeb46('0xe'));}_0x37255f(null,_0x1d8c80);}},'charset':_0xeb46('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6322=['moment','request-promise','path','rimraf','exports','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x6322,0xed));var _0x2632=function(_0x317a71,_0x144975){_0x317a71=_0x317a71-0x0;var _0x48a19b=_0x6322[_0x317a71];return _0x48a19b;};'use strict';var _=require(_0x2632('0x0'));var util=require(_0x2632('0x1'));var logger=require(_0x2632('0x2'))('api');var moment=require(_0x2632('0x3'));var BPromise=require('bluebird');var rp=require(_0x2632('0x4'));var fs=require('fs');var path=require(_0x2632('0x5'));var rimraf=require(_0x2632('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x2632('0x7')]=function(_0x582eb2,_0x27b864){return _0x582eb2[_0x2632('0x8')](_0x2632('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36ab24,_0x4da80d,_0x324ce9){if(_0x36ab24[_0x2632('0xa')](_0x2632('0xb'))){_0x36ab24[_0x2632('0xc')]=moment()['format'](_0x2632('0xd'));}_0x324ce9(null,_0x36ab24);}},'charset':'utf8mb4','collate':_0x2632('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e3c0fe7..cb4bfbc 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 _0x6c69=['limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatInteraction','body','options','raw','where','attributes'];(function(_0x58b1fe,_0x14831e){var _0x552550=function(_0x491ad6){while(--_0x491ad6){_0x58b1fe['push'](_0x58b1fe['shift']());}};_0x552550(++_0x14831e);}(_0x6c69,0xfe));var _0x96c6=function(_0x4fab3f,_0x5b0e8a){_0x4fab3f=_0x4fab3f-0x0;var _0x27364e=_0x6c69[_0x4fab3f];return _0x27364e;};'use strict';var _=require(_0x96c6('0x0'));var util=require(_0x96c6('0x1'));var moment=require('moment');var BPromise=require(_0x96c6('0x2'));var rs=require(_0x96c6('0x3'));var fs=require('fs');var Redis=require(_0x96c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x96c6('0x5'));var logger=require(_0x96c6('0x6'))(_0x96c6('0x7'));var config=require('../../config/environment');var jayson=require(_0x96c6('0x8'));var client=jayson['client'][_0x96c6('0x9')]({'port':0x232a});config[_0x96c6('0xa')]=_[_0x96c6('0xb')](config[_0x96c6('0xa')],{'host':_0x96c6('0xc'),'port':0x18eb});var socket=require(_0x96c6('0xd'))(new Redis(config[_0x96c6('0xa')]));require(_0x96c6('0xe'))[_0x96c6('0xf')](socket);function respondWithRpcPromise(_0x5066bb,_0x2db2fb,_0x5c6a32){return new BPromise(function(_0x6f5f9b,_0x5b2ec0){return client['request'](_0x5066bb,_0x5c6a32)[_0x96c6('0x10')](function(_0x46598d){logger[_0x96c6('0x11')](_0x96c6('0x12'),_0x2db2fb,_0x96c6('0x13'));logger[_0x96c6('0x14')](_0x96c6('0x15'),_0x2db2fb,_0x96c6('0x13'),JSON['stringify'](_0x46598d));if(_0x46598d[_0x96c6('0x16')]){if(_0x46598d[_0x96c6('0x16')][_0x96c6('0x17')]===0x1f4){logger['error'](_0x96c6('0x12'),_0x2db2fb,_0x46598d['error']['message']);return _0x5b2ec0(_0x46598d[_0x96c6('0x16')][_0x96c6('0x18')]);}logger[_0x96c6('0x16')](_0x96c6('0x12'),_0x2db2fb,_0x46598d['error']['message']);return _0x6f5f9b(_0x46598d['error']['message']);}else{logger[_0x96c6('0x11')](_0x96c6('0x12'),_0x2db2fb,_0x96c6('0x13'));_0x6f5f9b(_0x46598d[_0x96c6('0x19')]['message']);}})[_0x96c6('0x1a')](function(_0x108051){logger[_0x96c6('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x2db2fb,_0x108051);_0x5b2ec0(_0x108051);});});}exports['UpdateChatInteraction']=function(_0x183cf6){var _0x3305a1=this;return new Promise(function(_0x56aca6,_0x117a18){return db[_0x96c6('0x1b')]['update'](_0x183cf6[_0x96c6('0x1c')],{'raw':_0x183cf6[_0x96c6('0x1d')]?_0x183cf6[_0x96c6('0x1d')][_0x96c6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x183cf6['options']?_0x183cf6['options'][_0x96c6('0x1f')]||null:null,'attributes':_0x183cf6['options']?_0x183cf6[_0x96c6('0x1d')][_0x96c6('0x20')]||null:null,'limit':_0x183cf6[_0x96c6('0x1d')]?_0x183cf6[_0x96c6('0x1d')][_0x96c6('0x21')]||null:null})[_0x96c6('0x10')](function(_0x1506d9){logger[_0x96c6('0x11')](_0x96c6('0x22'),_0x183cf6);logger[_0x96c6('0x14')](_0x96c6('0x22'),_0x183cf6,JSON[_0x96c6('0x23')](_0x1506d9));_0x56aca6(_0x1506d9);})[_0x96c6('0x1a')](function(_0x1d2919){logger['error'](_0x96c6('0x22'),_0x1d2919[_0x96c6('0x18')],_0x183cf6);_0x117a18(_0x3305a1[_0x96c6('0x16')](0x1f4,_0x1d2919[_0x96c6('0x18')]));});});};exports[_0x96c6('0x24')]=function(_0x41b4d3){return new Promise(function(_0x1b8ed9,_0x53e25f){return db[_0x96c6('0x1b')]['find']({'where':_0x41b4d3[_0x96c6('0x1d')]?_0x41b4d3[_0x96c6('0x1d')][_0x96c6('0x1f')]||null:null})[_0x96c6('0x10')](function(_0xe91e23){if(_0xe91e23){return _0xe91e23['addTags'](_0x41b4d3[_0x96c6('0x1c')]['ids'],_[_0x96c6('0x25')](_0x41b4d3[_0x96c6('0x1c')],[_0x96c6('0x26'),'id'])||{});}})[_0x96c6('0x27')](function(_0x1da85e){logger[_0x96c6('0x11')](_0x96c6('0x28'),_0x41b4d3);logger['debug'](_0x96c6('0x28'),_0x41b4d3,JSON[_0x96c6('0x23')](_0x1da85e));_0x1b8ed9(_0x1da85e);})['catch'](function(_0x481ebd){logger[_0x96c6('0x16')](_0x96c6('0x28'),_0x481ebd[_0x96c6('0x18')],_0x41b4d3);_0x53e25f(_this[_0x96c6('0x16')](0x1f4,_0x481ebd['message']));});});};
\ No newline at end of file
+var _0x009e=['rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x009e,0x1e4));var _0xe009=function(_0x5a9767,_0x5c008d){_0x5a9767=_0x5a9767-0x0;var _0x2d1a96=_0x009e[_0x5a9767];return _0x2d1a96;};'use strict';var _=require(_0xe009('0x0'));var util=require(_0xe009('0x1'));var moment=require('moment');var BPromise=require(_0xe009('0x2'));var rs=require(_0xe009('0x3'));var fs=require('fs');var Redis=require(_0xe009('0x4'));var db=require(_0xe009('0x5'))['db'];var utils=require(_0xe009('0x6'));var logger=require(_0xe009('0x7'))(_0xe009('0x8'));var config=require('../../config/environment');var jayson=require(_0xe009('0x9'));var client=jayson[_0xe009('0xa')][_0xe009('0xb')]({'port':0x232a});config['redis']=_[_0xe009('0xc')](config[_0xe009('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xe009('0xe'))(new Redis(config[_0xe009('0xd')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x37dcb5,_0x39d5a,_0x3affc6){return new BPromise(function(_0x4c426d,_0x390716){return client[_0xe009('0xf')](_0x37dcb5,_0x3affc6)[_0xe009('0x10')](function(_0x19168c){logger['info'](_0xe009('0x11'),_0x39d5a,_0xe009('0x12'));logger[_0xe009('0x13')](_0xe009('0x14'),_0x39d5a,'request\x20sent',JSON[_0xe009('0x15')](_0x19168c));if(_0x19168c['error']){if(_0x19168c[_0xe009('0x16')][_0xe009('0x17')]===0x1f4){logger[_0xe009('0x16')](_0xe009('0x11'),_0x39d5a,_0x19168c[_0xe009('0x16')][_0xe009('0x18')]);return _0x390716(_0x19168c['error'][_0xe009('0x18')]);}logger[_0xe009('0x16')](_0xe009('0x11'),_0x39d5a,_0x19168c['error']['message']);return _0x4c426d(_0x19168c[_0xe009('0x16')][_0xe009('0x18')]);}else{logger[_0xe009('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x39d5a,_0xe009('0x12'));_0x4c426d(_0x19168c[_0xe009('0x1a')]['message']);}})[_0xe009('0x1b')](function(_0xf1c1a3){logger[_0xe009('0x16')](_0xe009('0x11'),_0x39d5a,_0xf1c1a3);_0x390716(_0xf1c1a3);});});}exports[_0xe009('0x1c')]=function(_0x370297){var _0x2df869=this;return new Promise(function(_0x12446e,_0x2d9f0f){return db[_0xe009('0x1d')]['update'](_0x370297[_0xe009('0x1e')],{'raw':_0x370297[_0xe009('0x1f')]?_0x370297[_0xe009('0x1f')][_0xe009('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x370297['options']?_0x370297[_0xe009('0x1f')]['where']||null:null,'attributes':_0x370297['options']?_0x370297[_0xe009('0x1f')][_0xe009('0x21')]||null:null,'limit':_0x370297[_0xe009('0x1f')]?_0x370297[_0xe009('0x1f')][_0xe009('0x22')]||null:null})[_0xe009('0x10')](function(_0x49f39d){logger[_0xe009('0x19')]('UpdateChatInteraction',_0x370297);logger[_0xe009('0x13')](_0xe009('0x1c'),_0x370297,JSON[_0xe009('0x15')](_0x49f39d));_0x12446e(_0x49f39d);})[_0xe009('0x1b')](function(_0x4e3d5c){logger[_0xe009('0x16')]('UpdateChatInteraction',_0x4e3d5c[_0xe009('0x18')],_0x370297);_0x2d9f0f(_0x2df869[_0xe009('0x16')](0x1f4,_0x4e3d5c[_0xe009('0x18')]));});});};exports[_0xe009('0x23')]=function(_0x415759){return new Promise(function(_0x4e21cd,_0x381f60){return db[_0xe009('0x1d')][_0xe009('0x24')]({'where':_0x415759[_0xe009('0x1f')]?_0x415759[_0xe009('0x1f')][_0xe009('0x25')]||null:null})[_0xe009('0x10')](function(_0x4c4ebb){if(_0x4c4ebb){return _0x4c4ebb['addTags'](_0x415759[_0xe009('0x1e')][_0xe009('0x26')],_['omit'](_0x415759[_0xe009('0x1e')],['ids','id'])||{});}})[_0xe009('0x27')](function(_0xaea05e){logger['info'](_0xe009('0x28'),_0x415759);logger[_0xe009('0x13')](_0xe009('0x28'),_0x415759,JSON[_0xe009('0x15')](_0xaea05e));_0x4e21cd(_0xaea05e);})[_0xe009('0x1b')](function(_0x12bb89){logger[_0xe009('0x16')](_0xe009('0x28'),_0x12bb89[_0xe009('0x18')],_0x415759);_0x381f60(_this[_0xe009('0x16')](0x1f4,_0x12bb89['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index a1d7f83..43b3d80 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 _0x9b82=['register','./chatInteraction.events','save','remove'];(function(_0x4545e9,_0x156fbc){var _0x2e47da=function(_0x43ff31){while(--_0x43ff31){_0x4545e9['push'](_0x4545e9['shift']());}};_0x2e47da(++_0x156fbc);}(_0x9b82,0x111));var _0x29b8=function(_0x56da40,_0x29651a){_0x56da40=_0x56da40-0x0;var _0x3aea2b=_0x9b82[_0x56da40];return _0x3aea2b;};'use strict';var ChatInteractionEvents=require(_0x29b8('0x0'));var events=[_0x29b8('0x1'),_0x29b8('0x2'),'update'];function createListener(_0x2c83ed,_0x21a159){return function(_0x4ba660){_0x21a159['emit'](_0x2c83ed,_0x4ba660);};}function removeListener(_0x4ced74,_0x47ddaf){return function(){ChatInteractionEvents['removeListener'](_0x4ced74,_0x47ddaf);};}exports[_0x29b8('0x3')]=function(_0x6eaff1){for(var _0x12dede=0x0,_0x328c07=events['length'];_0x12dede<_0x328c07;_0x12dede++){var _0x26fd58=events[_0x12dede];var _0x38eae9=createListener('chatInteraction:'+_0x26fd58,_0x6eaff1);ChatInteractionEvents['on'](_0x26fd58,_0x38eae9);}};
\ No newline at end of file
+var _0x6048=['emit','removeListener','length','./chatInteraction.events','save','update'];(function(_0x15d2dc,_0x20a220){var _0x31d8b7=function(_0x23400d){while(--_0x23400d){_0x15d2dc['push'](_0x15d2dc['shift']());}};_0x31d8b7(++_0x20a220);}(_0x6048,0x19b));var _0x8604=function(_0x3fbf3d,_0x3a80f4){_0x3fbf3d=_0x3fbf3d-0x0;var _0x2ff7a8=_0x6048[_0x3fbf3d];return _0x2ff7a8;};'use strict';var ChatInteractionEvents=require(_0x8604('0x0'));var events=[_0x8604('0x1'),'remove',_0x8604('0x2')];function createListener(_0xb69c08,_0x2789e8){return function(_0x749c6c){_0x2789e8[_0x8604('0x3')](_0xb69c08,_0x749c6c);};}function removeListener(_0x59fa0a,_0x4ad36c){return function(){ChatInteractionEvents[_0x8604('0x4')](_0x59fa0a,_0x4ad36c);};}exports['register']=function(_0xe42d77){for(var _0x3a3e37=0x0,_0x34cd7f=events[_0x8604('0x5')];_0x3a3e37<_0x34cd7f;_0x3a3e37++){var _0x5ca559=events[_0x3a3e37];var _0x774fe4=createListener('chatInteraction:'+_0x5ca559,_0xe42d77);ChatInteractionEvents['on'](_0x5ca559,_0x774fe4);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 38c692d..b991489 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 _0x342f=['index','get','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','/:id/vidaoo','join','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','post','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','update','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated'];(function(_0x1a5b50,_0x178c12){var _0x1c325f=function(_0x21cc07){while(--_0x21cc07){_0x1a5b50['push'](_0x1a5b50['shift']());}};_0x1c325f(++_0x178c12);}(_0x342f,0x1b7));var _0xf342=function(_0x35d968,_0x13060f){_0x35d968=_0x35d968-0x0;var _0x4bec61=_0x342f[_0x35d968];return _0x4bec61;};'use strict';var multer=require(_0xf342('0x0'));var util=require(_0xf342('0x1'));var path=require(_0xf342('0x2'));var timeout=require(_0xf342('0x3'));var express=require('express');var router=express[_0xf342('0x4')]();var fs_extra=require(_0xf342('0x5'));var auth=require(_0xf342('0x6'));var interaction=require(_0xf342('0x7'));var config=require(_0xf342('0x8'));var controller=require(_0xf342('0x9'));router['get']('/',auth[_0xf342('0xa')](),controller[_0xf342('0xb')]);router[_0xf342('0xc')]('/describe',auth[_0xf342('0xa')](),controller['describe']);router[_0xf342('0xc')]('/:id',auth[_0xf342('0xd')](),controller[_0xf342('0xe')]);router[_0xf342('0xc')](_0xf342('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xf342('0x10')]);router['get'](_0xf342('0x11'),auth[_0xf342('0xa')](),controller[_0xf342('0x12')]);router['get'](_0xf342('0x13'),auth[_0xf342('0xd')](),controller[_0xf342('0x14')]);router['get'](_0xf342('0x15'),auth[_0xf342('0xa')](),controller['download']);router['post']('/',auth[_0xf342('0xa')](),controller['create']);router['post'](_0xf342('0x16'),auth[_0xf342('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56ea2c,_0x1231f7,_0x425055){_0x425055(null,path[_0xf342('0x17')](config['root'],'server/files/attachments/'));},'filename':function(_0x325ccf,_0x5b2946,_0x4765aa){_0x4765aa(null,util[_0xf342('0x18')](_0xf342('0x19'),Date[_0xf342('0x1a')](),_0x5b2946[_0xf342('0x1b')][_0xf342('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf342('0x1d'),upload[_0xf342('0x1e')]('file'),controller[_0xf342('0x1f')]);router[_0xf342('0x20')](_0xf342('0x11'),auth[_0xf342('0xd')](),controller[_0xf342('0x21')]);router[_0xf342('0x20')](_0xf342('0x22'),auth['isAuthenticated'](),interaction[_0xf342('0x23')](_0xf342('0x24'),_0xf342('0x25')),controller[_0xf342('0x26')]);router[_0xf342('0x27')](_0xf342('0x28'),auth[_0xf342('0xa')](),interaction[_0xf342('0x23')](_0xf342('0x24'),'chatinteraction:update'),controller[_0xf342('0x29')]);router[_0xf342('0x27')]('/:id/custom_update',controller['customUpdate']);router['put'](_0xf342('0x2a'),auth[_0xf342('0xd')](),controller[_0xf342('0x2b')]);router[_0xf342('0x27')](_0xf342('0x2c'),controller[_0xf342('0x2d')]);router[_0xf342('0x2e')](_0xf342('0x28'),auth['isAuthenticated'](),interaction[_0xf342('0x23')]('chat','chatinteraction:destroy'),controller[_0xf342('0x2f')]);router[_0xf342('0x2e')](_0xf342('0x22'),auth[_0xf342('0xa')](),controller[_0xf342('0x30')]);module[_0xf342('0x31')]=router;
\ No newline at end of file
+var _0x8697=['attachmentDownload','/:id/messages','getMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chat','/:id/custom_update','abandon','/:id/close','close','delete','destroy','removeTags','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0x8697,0x1d9));var _0x7869=function(_0x945d28,_0x552708){_0x945d28=_0x945d28-0x0;var _0x341b16=_0x8697[_0x945d28];return _0x341b16;};'use strict';var multer=require(_0x7869('0x0'));var util=require(_0x7869('0x1'));var path=require(_0x7869('0x2'));var timeout=require(_0x7869('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7869('0x4'));var auth=require(_0x7869('0x5'));var interaction=require(_0x7869('0x6'));var config=require('../../config/environment');var controller=require(_0x7869('0x7'));router['get']('/',auth[_0x7869('0x8')](),controller[_0x7869('0x9')]);router[_0x7869('0xa')](_0x7869('0xb'),auth[_0x7869('0x8')](),controller[_0x7869('0xc')]);router[_0x7869('0xa')](_0x7869('0xd'),auth[_0x7869('0xe')](),controller[_0x7869('0xf')]);router[_0x7869('0xa')](_0x7869('0x10'),auth[_0x7869('0xe')](),controller[_0x7869('0x11')]);router[_0x7869('0xa')](_0x7869('0x12'),auth[_0x7869('0x8')](),controller[_0x7869('0x13')]);router[_0x7869('0xa')]('/:id/my_messages',auth[_0x7869('0xe')](),controller['getMyMessages']);router['get'](_0x7869('0x14'),auth[_0x7869('0x8')](),controller[_0x7869('0x15')]);router[_0x7869('0x16')]('/',auth[_0x7869('0x8')](),controller[_0x7869('0x17')]);router[_0x7869('0x16')](_0x7869('0x18'),auth['isAuthenticated'](),controller[_0x7869('0x19')]);var upload=multer({'storage':multer[_0x7869('0x1a')]({'destination':function(_0x4464fe,_0x486d8b,_0x1d9d68){_0x1d9d68(null,path[_0x7869('0x1b')](config[_0x7869('0x1c')],_0x7869('0x1d')));},'filename':function(_0x196e11,_0x381f94,_0x2e249c){_0x2e249c(null,util[_0x7869('0x1e')](_0x7869('0x1f'),Date[_0x7869('0x20')](),_0x381f94[_0x7869('0x21')][_0x7869('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7869('0x16')]('/:id/attachment_upload',upload['single']('file'),controller[_0x7869('0x23')]);router['post']('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x7869('0x24')]);router[_0x7869('0x16')](_0x7869('0x25'),auth['isAuthenticated'](),interaction[_0x7869('0x26')]('chat','chatinteraction:addtags'),controller[_0x7869('0x27')]);router[_0x7869('0x28')]('/:id',auth[_0x7869('0x8')](),interaction[_0x7869('0x26')](_0x7869('0x29'),'chatinteraction:update'),controller['update']);router['put'](_0x7869('0x2a'),controller['customUpdate']);router[_0x7869('0x28')]('/:id/abandon',auth[_0x7869('0xe')](),controller[_0x7869('0x2b')]);router['put'](_0x7869('0x2c'),controller[_0x7869('0x2d')]);router[_0x7869('0x2e')](_0x7869('0xd'),auth[_0x7869('0x8')](),interaction[_0x7869('0x26')](_0x7869('0x29'),'chatinteraction:destroy'),controller[_0x7869('0x2f')]);router[_0x7869('0x2e')](_0x7869('0x25'),auth['isAuthenticated'](),controller[_0x7869('0x30')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 16ef467..24db6e7 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 _0x2ef3=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x1a4695,_0x688546){var _0x1eb46a=function(_0x9017c7){while(--_0x9017c7){_0x1a4695['push'](_0x1a4695['shift']());}};_0x1eb46a(++_0x688546);}(_0x2ef3,0xba));var _0x32ef=function(_0x50ff53,_0x2ab801){_0x50ff53=_0x50ff53-0x0;var _0x57febd=_0x2ef3[_0x50ff53];return _0x57febd;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'body':{'type':Sequelize[_0x32ef('0x2')](_0x32ef('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x32ef('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x32ef('0x5')]}};
\ No newline at end of file
+var _0x66fa=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x3780ee,_0xd73246){var _0x1573df=function(_0x61a1c1){while(--_0x61a1c1){_0x3780ee['push'](_0x3780ee['shift']());}};_0x1573df(++_0xd73246);}(_0x66fa,0x117));var _0xa66f=function(_0xbfa11d,_0x1ecfd9){_0xbfa11d=_0xbfa11d-0x0;var _0x46e57e=_0x66fa[_0xbfa11d];return _0x46e57e;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa66f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa66f('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa66f('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 6714749..909f6c1 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 _0x2786=['YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','fullname','role','userpic','online','allowmessenger','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','createdAt','FromId','read','-createdAt','all','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','get','messages','lastMessageAt','format'];(function(_0x34ba37,_0x4b8d89){var _0x54f273=function(_0x474cff){while(--_0x474cff){_0x34ba37['push'](_0x34ba37['shift']());}};_0x54f273(++_0x4b8d89);}(_0x2786,0x1c4));var _0x6278=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2786[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6278('0x0'));var zipdir=require(_0x6278('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6278('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6278('0x3'));var util=require(_0x6278('0x4'));var path=require(_0x6278('0x5'));var sox=require(_0x6278('0x6'));var csv=require(_0x6278('0x7'));var ejs=require(_0x6278('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6278('0x9'));var squel=require(_0x6278('0xa'));var crypto=require(_0x6278('0xb'));var jsforce=require(_0x6278('0xc'));var deskjs=require(_0x6278('0xd'));var toCsv=require(_0x6278('0x7'));var querystring=require(_0x6278('0xe'));var Papa=require(_0x6278('0xf'));var Redis=require(_0x6278('0x10'));var authService=require(_0x6278('0x11'));var qs=require(_0x6278('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6278('0x13'));var logger=require(_0x6278('0x14'))(_0x6278('0x15'));var utils=require('../../config/utils');var config=require(_0x6278('0x16'));var licenseUtil=require(_0x6278('0x17'));var db=require('../../mysqldb')['db'];config[_0x6278('0x18')]=_[_0x6278('0x19')](config['redis'],{'host':_0x6278('0x1a'),'port':0x18eb});var socket=require(_0x6278('0x1b'))(new Redis(config[_0x6278('0x18')]));require(_0x6278('0x1c'))['register'](socket);function respondWithStatusCode(_0x4f658e,_0xaf7f78){_0xaf7f78=_0xaf7f78||0xcc;return function(_0x3c923f){if(_0x3c923f){return _0x4f658e['sendStatus'](_0xaf7f78);}return _0x4f658e[_0x6278('0x1d')](_0xaf7f78)[_0x6278('0x1e')]();};}function respondWithResult(_0x29dab5,_0x583219){_0x583219=_0x583219||0xc8;return function(_0x2cb892){if(_0x2cb892){return _0x29dab5[_0x6278('0x1d')](_0x583219)[_0x6278('0x1f')](_0x2cb892);}};}function respondWithFilteredResult(_0x3830c9,_0x27979e){return function(_0x1bd87f){if(_0x1bd87f){var _0x298fda=_0x1bd87f[_0x6278('0x20')],_0x22ead3=_0x27979e[_0x6278('0x21')],_0x126dcb=_0x27979e[_0x6278('0x21')]+_0x27979e['limit'],_0x28f537;if(_0x126dcb>=_0x298fda){_0x126dcb=_0x298fda;_0x28f537=0xc8;}else{_0x28f537=0xce;}_0x3830c9[_0x6278('0x1d')](_0x28f537);return _0x3830c9[_0x6278('0x22')](_0x6278('0x23'),_0x22ead3+'-'+_0x126dcb+'/'+_0x298fda)[_0x6278('0x1f')](_0x1bd87f);}return null;};}function patchUpdates(_0x1b29e9){return function(_0x3cea21){try{jsonpatch[_0x6278('0x24')](_0x3cea21,_0x1b29e9,!![]);}catch(_0x3d5bac){return BPromise[_0x6278('0x25')](_0x3d5bac);}return _0x3cea21[_0x6278('0x26')]();};}function saveUpdates(_0x395c9f,_0x4ed32d){return function(_0x2c43e1){if(_0x2c43e1){return _0x2c43e1[_0x6278('0x27')](_0x395c9f)[_0x6278('0x28')](function(_0x23a3c8){return _0x23a3c8;});}return null;};}function removeEntity(_0x23ff09,_0x55bb43){return function(_0x2cffb6){if(_0x2cffb6){return _0x2cffb6['destroy']()[_0x6278('0x28')](function(){_0x23ff09[_0x6278('0x1d')](0xcc)[_0x6278('0x1e')]();});}};}function handleEntityNotFound(_0x28a583,_0x5a4e15){return function(_0x192a59){if(!_0x192a59){_0x28a583[_0x6278('0x29')](0x194);}return _0x192a59;};}function handleError(_0x345954,_0x4b437e){_0x4b437e=_0x4b437e||0x1f4;return function(_0x521a37){logger[_0x6278('0x2a')](_0x521a37[_0x6278('0x2b')]);if(_0x521a37['name']){delete _0x521a37[_0x6278('0x2c')];}_0x345954['status'](_0x4b437e)[_0x6278('0x2d')](_0x521a37);};}exports[_0x6278('0x2e')]=function(_0x5e7751,_0x5585ff){var _0x2d7a37={},_0x2611cd={},_0x16a78a={'count':0x0,'rows':[]};var _0x124e10=_[_0x6278('0x2f')](db[_0x6278('0x30')][_0x6278('0x31')],function(_0x27f967){return{'name':_0x27f967[_0x6278('0x32')],'type':_0x27f967[_0x6278('0x33')][_0x6278('0x34')]};});_0x2611cd['model']=_[_0x6278('0x2f')](_0x124e10,'name');_0x2611cd[_0x6278('0x35')]=_[_0x6278('0x36')](_0x5e7751['query']);_0x2611cd[_0x6278('0x37')]=_[_0x6278('0x38')](_0x2611cd[_0x6278('0x39')],_0x2611cd[_0x6278('0x35')]);_0x2d7a37[_0x6278('0x3a')]=_[_0x6278('0x38')](_0x2611cd[_0x6278('0x39')],qs[_0x6278('0x3b')](_0x5e7751[_0x6278('0x35')][_0x6278('0x3b')]));_0x2d7a37[_0x6278('0x3a')]=_0x2d7a37[_0x6278('0x3a')][_0x6278('0x3c')]?_0x2d7a37['attributes']:_0x2611cd[_0x6278('0x39')];if(!_0x5e7751['query']['hasOwnProperty']('nolimit')){_0x2d7a37[_0x6278('0x3d')]=qs[_0x6278('0x3d')](_0x5e7751[_0x6278('0x35')]['limit']);_0x2d7a37[_0x6278('0x21')]=qs[_0x6278('0x21')](_0x5e7751[_0x6278('0x35')]['offset']);}_0x2d7a37[_0x6278('0x3e')]=qs[_0x6278('0x3f')](_0x5e7751[_0x6278('0x35')][_0x6278('0x3f')]);_0x2d7a37['where']=qs[_0x6278('0x37')](_['pick'](_0x5e7751[_0x6278('0x35')],_0x2611cd[_0x6278('0x37')]),_0x124e10);if(_0x5e7751[_0x6278('0x35')][_0x6278('0x40')]){_0x2d7a37[_0x6278('0x41')]=_[_0x6278('0x42')](_0x2d7a37[_0x6278('0x41')],{'$or':_[_0x6278('0x2f')](_0x124e10,function(_0x186c0a){if(_0x186c0a[_0x6278('0x33')]!=='VIRTUAL'){var _0x18f860={};_0x18f860[_0x186c0a['name']]={'$like':'%'+_0x5e7751['query'][_0x6278('0x40')]+'%'};return _0x18f860;}})});}_0x2d7a37=_[_0x6278('0x42')]({},_0x2d7a37,_0x5e7751[_0x6278('0x43')]);var _0x2a210e={'where':_0x2d7a37['where']};return db['ChatInternalMessage'][_0x6278('0x20')](_0x2a210e)['then'](function(_0x3a532d){_0x16a78a[_0x6278('0x20')]=_0x3a532d;if(_0x5e7751[_0x6278('0x35')][_0x6278('0x44')]){_0x2d7a37[_0x6278('0x45')]=[{'all':!![]}];}return db[_0x6278('0x30')][_0x6278('0x46')](_0x2d7a37);})[_0x6278('0x28')](function(_0x383d34){_0x16a78a[_0x6278('0x47')]=_0x383d34;return _0x16a78a;})[_0x6278('0x28')](respondWithFilteredResult(_0x5585ff,_0x2d7a37))[_0x6278('0x48')](handleError(_0x5585ff,null));};exports['show']=function(_0x4e4a5e,_0xd41ad2){var _0x17a416={'raw':!![],'where':{'id':_0x4e4a5e[_0x6278('0x49')]['id']}},_0x1fcb61={};_0x1fcb61[_0x6278('0x39')]=_[_0x6278('0x36')](db[_0x6278('0x30')][_0x6278('0x31')]);_0x1fcb61['query']=_['keys'](_0x4e4a5e[_0x6278('0x35')]);_0x1fcb61[_0x6278('0x37')]=_[_0x6278('0x38')](_0x1fcb61[_0x6278('0x39')],_0x1fcb61[_0x6278('0x35')]);_0x17a416[_0x6278('0x3a')]=_[_0x6278('0x38')](_0x1fcb61['model'],qs['fields'](_0x4e4a5e[_0x6278('0x35')][_0x6278('0x3b')]));_0x17a416['attributes']=_0x17a416[_0x6278('0x3a')][_0x6278('0x3c')]?_0x17a416[_0x6278('0x3a')]:_0x1fcb61[_0x6278('0x39')];if(_0x4e4a5e[_0x6278('0x35')][_0x6278('0x44')]){_0x17a416[_0x6278('0x45')]=[{'all':!![]}];}_0x17a416=_[_0x6278('0x42')]({},_0x17a416,_0x4e4a5e['options']);return db[_0x6278('0x30')][_0x6278('0x4a')](_0x17a416)[_0x6278('0x28')](handleEntityNotFound(_0xd41ad2,null))[_0x6278('0x28')](respondWithResult(_0xd41ad2,null))['catch'](handleError(_0xd41ad2,null));};exports[_0x6278('0x4b')]=function(_0x4ae9ca,_0x5ce215){return db[_0x6278('0x30')][_0x6278('0x4b')](_0x4ae9ca[_0x6278('0x4c')],{})[_0x6278('0x28')](respondWithResult(_0x5ce215,0xc9))['catch'](handleError(_0x5ce215,null));};exports[_0x6278('0x27')]=function(_0x175c6e,_0x5c83e5){if(_0x175c6e[_0x6278('0x4c')]['id']){delete _0x175c6e[_0x6278('0x4c')]['id'];}return db['ChatInternalMessage'][_0x6278('0x4a')]({'where':{'id':_0x175c6e[_0x6278('0x49')]['id']}})[_0x6278('0x28')](handleEntityNotFound(_0x5c83e5,null))[_0x6278('0x28')](saveUpdates(_0x175c6e[_0x6278('0x4c')],null))['then'](respondWithResult(_0x5c83e5,null))['catch'](handleError(_0x5c83e5,null));};exports[_0x6278('0x4d')]=function(_0x5859f8,_0x3f9cb1){return db['ChatInternalMessage'][_0x6278('0x4a')]({'where':{'id':_0x5859f8[_0x6278('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f9cb1,null))[_0x6278('0x28')](removeEntity(_0x3f9cb1,null))[_0x6278('0x48')](handleError(_0x3f9cb1,null));};exports[_0x6278('0x4e')]=function(_0x2befd7,_0x526cc5){return db[_0x6278('0x30')][_0x6278('0x4e')]()['then'](respondWithResult(_0x526cc5,null))[_0x6278('0x48')](handleError(_0x526cc5,null));};function wrapUser(_0x39620f){return function(_0x4cb796){var _0x447b58=_0x39620f[_0x6278('0x4f')]({'plain':!![]});_0x447b58[_0x6278('0x50')]=[];if(_0x4cb796){_0x447b58[_0x6278('0x51')]=_0x4cb796['createdAt'];_0x447b58['lastMessage']=_0x4cb796;}else{_0x447b58['lastMessageAt']=moment(0x0)[_0x6278('0x52')](_0x6278('0x53'));_0x447b58['lastMessage']={};}return _0x447b58;};}exports[_0x6278('0x54')]=function(_0x565325,_0x2a580b,_0x2b7448){var _0x48cfdd=[];return db[_0x6278('0x55')]['findAll']({'where':{'role':[_0x6278('0x56'),'admin','user']},'attributes':['id',_0x6278('0x57'),_0x6278('0x2c'),_0x6278('0x58'),_0x6278('0x59'),'internal',_0x6278('0x5a'),'lastLoginAt',_0x6278('0x5b'),'showWebBar'],'order':qs[_0x6278('0x3f')]('-online'),'include':[{'model':db[_0x6278('0x5c')],'as':'VoiceQueues','attributes':['id','name',_0x6278('0x33')],'through':{'attributes':[]}}]})['then'](function(_0xa661e){if(_0xa661e){var _0x24e500=_0x565325[_0x6278('0x5d')]['get']({'plain':!![]});if(!_0x24e500)throw new Error(_0x6278('0x5e'));if(_0x24e500[_0x6278('0x58')]===_0x6278('0x5d')){return db[_0x6278('0x5f')]['find']({'where':{'name':_0x6278('0x60'),'userProfileId':_0x24e500[_0x6278('0x61')]},'raw':!![]})['then'](function(_0x10e3d5){if(_0x10e3d5){if(_0x10e3d5[_0x6278('0x62')]===0x0){return db['UserProfileResource'][_0x6278('0x46')]({'where':{'sectionId':_0x10e3d5['id']},'raw':!![]})[_0x6278('0x28')](function(_0x512498){var _0x263ff7=[];if(_[_0x6278('0x63')](_0x512498)){_0x263ff7=_[_0x6278('0x40')](_0xa661e,function(_0x4dae93){if(_0x4dae93[_0x6278('0x58')]!=='agent'){return _0x4dae93;}});return _0x263ff7;}else{for(var _0x3646b6=0x0;_0x3646b6<_0xa661e[_0x6278('0x3c')];_0x3646b6++){var _0x3b65df=_0xa661e[_0x3646b6];if(_0x3b65df['role']==='agent'){var _0x35fa9d=_[_0x6278('0x4a')](_0x512498,function(_0x3509a5){return _0x3509a5[_0x6278('0x64')]===_0x3b65df['id'];});if(_0x35fa9d)_0x263ff7[_0x6278('0x65')](_0x3b65df);}else{_0x263ff7[_0x6278('0x65')](_0x3b65df);}}return _0x263ff7;}});}else{return _0xa661e;}}else{var _0x52add3=_[_0x6278('0x40')](_0xa661e,function(_0x3db8aa){if(_0x3db8aa[_0x6278('0x58')]!=='agent'){return _0x3db8aa;}});return _0x52add3;}});}else{return _0xa661e;}}})[_0x6278('0x28')](function(_0x34f64a){var _0x406b2b=[];if(_0x34f64a){_0x48cfdd=_0x34f64a;for(var _0x3c3467=0x0;_0x3c3467<_0x34f64a['length'];_0x3c3467+=0x1){_0x48cfdd[_0x3c3467][_0x6278('0x50')]=[];_0x406b2b['push'](db[_0x6278('0x30')][_0x6278('0x4a')]({'where':{'FromId':[_0x565325['user']['id'],_0x34f64a[_0x3c3467]['id']],'ToId':[_0x565325[_0x6278('0x5d')]['id'],_0x34f64a[_0x3c3467]['id']],'ChatGroupId':null},'attributes':['id',_0x6278('0x66'),_0x6278('0x67'),'ToId',_0x6278('0x68'),'body'],'order':qs[_0x6278('0x3f')](_0x6278('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x34f64a[_0x3c3467])));}return BPromise[_0x6278('0x6a')](_0x406b2b);}return[];})[_0x6278('0x28')](function(_0x25653e){return{'rows':_0x25653e,'count':_0x25653e[_0x6278('0x3c')]};})[_0x6278('0x28')](respondWithResult(_0x2a580b,null))[_0x6278('0x48')](handleError(_0x2a580b,null));};
\ No newline at end of file
+var _0xa59c=['request-promise','moment','bluebird','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','count','offset','limit','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','ChatInternalMessage','includeAll','findAll','rows','params','include','find','catch','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','user','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch'];(function(_0x4c81b6,_0x589386){var _0x41058a=function(_0x1bb599){while(--_0x1bb599){_0x4c81b6['push'](_0x4c81b6['shift']());}};_0x41058a(++_0x589386);}(_0xa59c,0x13e));var _0xca59=function(_0x18958a,_0x1d1e33){_0x18958a=_0x18958a-0x0;var _0x583740=_0xa59c[_0x18958a];return _0x583740;};'use strict';var emlformat=require(_0xca59('0x0'));var rimraf=require(_0xca59('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca59('0x2'));var rp=require(_0xca59('0x3'));var moment=require(_0xca59('0x4'));var BPromise=require(_0xca59('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xca59('0x6'));var csv=require('to-csv');var ejs=require(_0xca59('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca59('0x8'));var squel=require(_0xca59('0x9'));var crypto=require('crypto');var jsforce=require(_0xca59('0xa'));var deskjs=require(_0xca59('0xb'));var toCsv=require(_0xca59('0xc'));var querystring=require(_0xca59('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca59('0xe'));var as=require(_0xca59('0xf'));var hardwareService=require(_0xca59('0x10'));var logger=require('../../config/logger')(_0xca59('0x11'));var utils=require(_0xca59('0x12'));var config=require(_0xca59('0x13'));var licenseUtil=require(_0xca59('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xca59('0x15')](config[_0xca59('0x16')],{'host':_0xca59('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca59('0x16')]));require(_0xca59('0x18'))[_0xca59('0x19')](socket);function respondWithStatusCode(_0xf71ce6,_0x3aa2b5){_0x3aa2b5=_0x3aa2b5||0xcc;return function(_0x4d3bea){if(_0x4d3bea){return _0xf71ce6[_0xca59('0x1a')](_0x3aa2b5);}return _0xf71ce6['status'](_0x3aa2b5)['end']();};}function respondWithResult(_0x4138fc,_0x32f93d){_0x32f93d=_0x32f93d||0xc8;return function(_0x2cc2e2){if(_0x2cc2e2){return _0x4138fc[_0xca59('0x1b')](_0x32f93d)['json'](_0x2cc2e2);}};}function respondWithFilteredResult(_0x501107,_0x433aaf){return function(_0x3bee48){if(_0x3bee48){var _0x3af1a3=_0x3bee48[_0xca59('0x1c')],_0x592fcb=_0x433aaf[_0xca59('0x1d')],_0x3624cd=_0x433aaf[_0xca59('0x1d')]+_0x433aaf[_0xca59('0x1e')],_0x365fd2;if(_0x3624cd>=_0x3af1a3){_0x3624cd=_0x3af1a3;_0x365fd2=0xc8;}else{_0x365fd2=0xce;}_0x501107[_0xca59('0x1b')](_0x365fd2);return _0x501107['set'](_0xca59('0x1f'),_0x592fcb+'-'+_0x3624cd+'/'+_0x3af1a3)[_0xca59('0x20')](_0x3bee48);}return null;};}function patchUpdates(_0x5571df){return function(_0x4ca849){try{jsonpatch['apply'](_0x4ca849,_0x5571df,!![]);}catch(_0x50c31d){return BPromise['reject'](_0x50c31d);}return _0x4ca849[_0xca59('0x21')]();};}function saveUpdates(_0x110d56,_0x52f314){return function(_0x418f33){if(_0x418f33){return _0x418f33[_0xca59('0x22')](_0x110d56)[_0xca59('0x23')](function(_0x4e4d80){return _0x4e4d80;});}return null;};}function removeEntity(_0x50254c,_0x23d648){return function(_0xac0eda){if(_0xac0eda){return _0xac0eda[_0xca59('0x24')]()[_0xca59('0x23')](function(){_0x50254c[_0xca59('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b0a2,_0x412e6c){return function(_0x413547){if(!_0x413547){_0x35b0a2['sendStatus'](0x194);}return _0x413547;};}function handleError(_0x28ba8b,_0x540ccb){_0x540ccb=_0x540ccb||0x1f4;return function(_0x45aec4){logger[_0xca59('0x25')](_0x45aec4[_0xca59('0x26')]);if(_0x45aec4['name']){delete _0x45aec4[_0xca59('0x27')];}_0x28ba8b[_0xca59('0x1b')](_0x540ccb)[_0xca59('0x28')](_0x45aec4);};}exports[_0xca59('0x29')]=function(_0x2f6bdf,_0x5da5fd){var _0x4be1e8={},_0x5f0906={},_0x446557={'count':0x0,'rows':[]};var _0x257c2d=_[_0xca59('0x2a')](db['ChatInternalMessage'][_0xca59('0x2b')],function(_0x515eb3){return{'name':_0x515eb3[_0xca59('0x2c')],'type':_0x515eb3[_0xca59('0x2d')][_0xca59('0x2e')]};});_0x5f0906['model']=_[_0xca59('0x2a')](_0x257c2d,_0xca59('0x27'));_0x5f0906[_0xca59('0x2f')]=_[_0xca59('0x30')](_0x2f6bdf[_0xca59('0x2f')]);_0x5f0906['filters']=_[_0xca59('0x31')](_0x5f0906[_0xca59('0x32')],_0x5f0906[_0xca59('0x2f')]);_0x4be1e8['attributes']=_['intersection'](_0x5f0906['model'],qs[_0xca59('0x33')](_0x2f6bdf['query'][_0xca59('0x33')]));_0x4be1e8[_0xca59('0x34')]=_0x4be1e8[_0xca59('0x34')][_0xca59('0x35')]?_0x4be1e8['attributes']:_0x5f0906[_0xca59('0x32')];if(!_0x2f6bdf[_0xca59('0x2f')][_0xca59('0x36')]('nolimit')){_0x4be1e8[_0xca59('0x1e')]=qs[_0xca59('0x1e')](_0x2f6bdf['query']['limit']);_0x4be1e8[_0xca59('0x1d')]=qs['offset'](_0x2f6bdf[_0xca59('0x2f')][_0xca59('0x1d')]);}_0x4be1e8[_0xca59('0x37')]=qs['sort'](_0x2f6bdf[_0xca59('0x2f')][_0xca59('0x38')]);_0x4be1e8['where']=qs[_0xca59('0x39')](_[_0xca59('0x3a')](_0x2f6bdf[_0xca59('0x2f')],_0x5f0906[_0xca59('0x39')]),_0x257c2d);if(_0x2f6bdf[_0xca59('0x2f')][_0xca59('0x3b')]){_0x4be1e8['where']=_['merge'](_0x4be1e8[_0xca59('0x3c')],{'$or':_[_0xca59('0x2a')](_0x257c2d,function(_0x2fd494){if(_0x2fd494[_0xca59('0x2d')]!=='VIRTUAL'){var _0x5d90e1={};_0x5d90e1[_0x2fd494['name']]={'$like':'%'+_0x2f6bdf[_0xca59('0x2f')][_0xca59('0x3b')]+'%'};return _0x5d90e1;}})});}_0x4be1e8=_[_0xca59('0x3d')]({},_0x4be1e8,_0x2f6bdf[_0xca59('0x3e')]);var _0x3ec087={'where':_0x4be1e8['where']};return db[_0xca59('0x3f')][_0xca59('0x1c')](_0x3ec087)[_0xca59('0x23')](function(_0x2d70f4){_0x446557[_0xca59('0x1c')]=_0x2d70f4;if(_0x2f6bdf['query'][_0xca59('0x40')]){_0x4be1e8['include']=[{'all':!![]}];}return db[_0xca59('0x3f')][_0xca59('0x41')](_0x4be1e8);})[_0xca59('0x23')](function(_0x3320d1){_0x446557[_0xca59('0x42')]=_0x3320d1;return _0x446557;})[_0xca59('0x23')](respondWithFilteredResult(_0x5da5fd,_0x4be1e8))['catch'](handleError(_0x5da5fd,null));};exports['show']=function(_0x444734,_0x4d2968){var _0x24542a={'raw':!![],'where':{'id':_0x444734[_0xca59('0x43')]['id']}},_0x3b9746={};_0x3b9746[_0xca59('0x32')]=_[_0xca59('0x30')](db[_0xca59('0x3f')]['rawAttributes']);_0x3b9746[_0xca59('0x2f')]=_['keys'](_0x444734['query']);_0x3b9746[_0xca59('0x39')]=_[_0xca59('0x31')](_0x3b9746[_0xca59('0x32')],_0x3b9746[_0xca59('0x2f')]);_0x24542a['attributes']=_[_0xca59('0x31')](_0x3b9746[_0xca59('0x32')],qs[_0xca59('0x33')](_0x444734[_0xca59('0x2f')]['fields']));_0x24542a['attributes']=_0x24542a['attributes']['length']?_0x24542a[_0xca59('0x34')]:_0x3b9746['model'];if(_0x444734['query'][_0xca59('0x40')]){_0x24542a[_0xca59('0x44')]=[{'all':!![]}];}_0x24542a=_[_0xca59('0x3d')]({},_0x24542a,_0x444734[_0xca59('0x3e')]);return db['ChatInternalMessage'][_0xca59('0x45')](_0x24542a)[_0xca59('0x23')](handleEntityNotFound(_0x4d2968,null))[_0xca59('0x23')](respondWithResult(_0x4d2968,null))[_0xca59('0x46')](handleError(_0x4d2968,null));};exports[_0xca59('0x47')]=function(_0x2f02a1,_0x4935b3){return db[_0xca59('0x3f')][_0xca59('0x47')](_0x2f02a1[_0xca59('0x48')],{})[_0xca59('0x23')](respondWithResult(_0x4935b3,0xc9))['catch'](handleError(_0x4935b3,null));};exports[_0xca59('0x22')]=function(_0x911145,_0x2eeae6){if(_0x911145[_0xca59('0x48')]['id']){delete _0x911145[_0xca59('0x48')]['id'];}return db['ChatInternalMessage'][_0xca59('0x45')]({'where':{'id':_0x911145[_0xca59('0x43')]['id']}})[_0xca59('0x23')](handleEntityNotFound(_0x2eeae6,null))[_0xca59('0x23')](saveUpdates(_0x911145[_0xca59('0x48')],null))[_0xca59('0x23')](respondWithResult(_0x2eeae6,null))[_0xca59('0x46')](handleError(_0x2eeae6,null));};exports[_0xca59('0x24')]=function(_0x59fb66,_0xc820fc){return db[_0xca59('0x3f')][_0xca59('0x45')]({'where':{'id':_0x59fb66[_0xca59('0x43')]['id']}})['then'](handleEntityNotFound(_0xc820fc,null))[_0xca59('0x23')](removeEntity(_0xc820fc,null))['catch'](handleError(_0xc820fc,null));};exports[_0xca59('0x49')]=function(_0x39a7fa,_0x491ac4){return db[_0xca59('0x3f')][_0xca59('0x49')]()[_0xca59('0x23')](respondWithResult(_0x491ac4,null))[_0xca59('0x46')](handleError(_0x491ac4,null));};function wrapUser(_0x444ed8){return function(_0x11db31){var _0x15f303=_0x444ed8[_0xca59('0x4a')]({'plain':!![]});_0x15f303['messages']=[];if(_0x11db31){_0x15f303[_0xca59('0x4b')]=_0x11db31[_0xca59('0x4c')];_0x15f303[_0xca59('0x4d')]=_0x11db31;}else{_0x15f303[_0xca59('0x4b')]=moment(0x0)[_0xca59('0x4e')](_0xca59('0x4f'));_0x15f303[_0xca59('0x4d')]={};}return _0x15f303;};}exports[_0xca59('0x50')]=function(_0x305d7c,_0x4f5182,_0x28e085){var _0x4f8c72=[];return db[_0xca59('0x51')][_0xca59('0x41')]({'where':{'role':[_0xca59('0x52'),_0xca59('0x53'),'user']},'attributes':['id','fullname',_0xca59('0x27'),'role',_0xca59('0x54'),_0xca59('0x55'),_0xca59('0x56'),_0xca59('0x57'),'allowmessenger','showWebBar'],'order':qs[_0xca59('0x38')](_0xca59('0x58')),'include':[{'model':db[_0xca59('0x59')],'as':_0xca59('0x5a'),'attributes':['id','name',_0xca59('0x2d')],'through':{'attributes':[]}}]})['then'](function(_0x25c0d5){if(_0x25c0d5){var _0x1d79b1=_0x305d7c['user'][_0xca59('0x4a')]({'plain':!![]});if(!_0x1d79b1)throw new Error(_0xca59('0x5b'));if(_0x1d79b1[_0xca59('0x5c')]==='user'){return db['UserProfileSection']['find']({'where':{'name':_0xca59('0x5d'),'userProfileId':_0x1d79b1[_0xca59('0x5e')]},'raw':!![]})[_0xca59('0x23')](function(_0x41bb4c){if(_0x41bb4c){if(_0x41bb4c[_0xca59('0x5f')]===0x0){return db[_0xca59('0x60')][_0xca59('0x41')]({'where':{'sectionId':_0x41bb4c['id']},'raw':!![]})['then'](function(_0x2ac441){var _0x525cf9=[];if(_[_0xca59('0x61')](_0x2ac441)){_0x525cf9=_[_0xca59('0x3b')](_0x25c0d5,function(_0x57585e){if(_0x57585e[_0xca59('0x5c')]!=='agent'){return _0x57585e;}});return _0x525cf9;}else{for(var _0x20458a=0x0;_0x20458a<_0x25c0d5[_0xca59('0x35')];_0x20458a++){var _0x37d83f=_0x25c0d5[_0x20458a];if(_0x37d83f[_0xca59('0x5c')]===_0xca59('0x52')){var _0x21d229=_['find'](_0x2ac441,function(_0x320c61){return _0x320c61[_0xca59('0x62')]===_0x37d83f['id'];});if(_0x21d229)_0x525cf9[_0xca59('0x63')](_0x37d83f);}else{_0x525cf9[_0xca59('0x63')](_0x37d83f);}}return _0x525cf9;}});}else{return _0x25c0d5;}}else{var _0x130186=_[_0xca59('0x3b')](_0x25c0d5,function(_0x243323){if(_0x243323[_0xca59('0x5c')]!==_0xca59('0x52')){return _0x243323;}});return _0x130186;}});}else{return _0x25c0d5;}}})[_0xca59('0x23')](function(_0x33635f){var _0x17a138=[];if(_0x33635f){_0x4f8c72=_0x33635f;for(var _0x656fe4=0x0;_0x656fe4<_0x33635f['length'];_0x656fe4+=0x1){_0x4f8c72[_0x656fe4][_0xca59('0x64')]=[];_0x17a138['push'](db['ChatInternalMessage'][_0xca59('0x45')]({'where':{'FromId':[_0x305d7c[_0xca59('0x65')]['id'],_0x33635f[_0x656fe4]['id']],'ToId':[_0x305d7c[_0xca59('0x65')]['id'],_0x33635f[_0x656fe4]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xca59('0x66'),_0xca59('0x67'),_0xca59('0x68'),_0xca59('0x48')],'order':qs[_0xca59('0x38')](_0xca59('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xca59('0x23')](wrapUser(_0x33635f[_0x656fe4])));}return BPromise[_0xca59('0x6a')](_0x17a138);}return[];})[_0xca59('0x23')](function(_0x47bec4){return{'rows':_0x47bec4,'count':_0x47bec4[_0xca59('0x35')]};})['then'](respondWithResult(_0x4f5182,null))[_0xca59('0x46')](handleError(_0x4f5182,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 55c532b..6934ad6 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 _0x1cc7=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','remove'];(function(_0x386a04,_0x4b8694){var _0x433782=function(_0x5dd051){while(--_0x5dd051){_0x386a04['push'](_0x386a04['shift']());}};_0x433782(++_0x4b8694);}(_0x1cc7,0x15a));var _0x71cc=function(_0x4b4eb4,_0x21d7af){_0x4b4eb4=_0x4b4eb4-0x0;var _0xe9260c=_0x1cc7[_0x4b4eb4];return _0xe9260c;};'use strict';var EventEmitter=require(_0x71cc('0x0'));var ChatInternalMessage=require(_0x71cc('0x1'))['db'][_0x71cc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x71cc('0x3')};function emitEvent(_0x1fac93){return function(_0x402191,_0x5431e1,_0x5dfed9){ChatInternalMessageEvents['emit'](_0x1fac93+':'+_0x402191['id'],_0x402191);ChatInternalMessageEvents[_0x71cc('0x4')](_0x1fac93,_0x402191);_0x5dfed9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x71cc('0x5')](e,emitEvent(event));}}module[_0x71cc('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x24cd=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x57933c,_0x361c10){var _0xdf54c1=function(_0xa47f25){while(--_0xa47f25){_0x57933c['push'](_0x57933c['shift']());}};_0xdf54c1(++_0x361c10);}(_0x24cd,0x83));var _0xd24c=function(_0x4221f6,_0x2ecdcd){_0x4221f6=_0x4221f6-0x0;var _0x5ebe92=_0x24cd[_0x4221f6];return _0x5ebe92;};'use strict';var EventEmitter=require(_0xd24c('0x0'));var ChatInternalMessage=require(_0xd24c('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd24c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd24c('0x3'),'afterDestroy':_0xd24c('0x4')};function emitEvent(_0x3bd534){return function(_0x4d515c,_0x21a58c,_0x32001a){ChatInternalMessageEvents['emit'](_0x3bd534+':'+_0x4d515c['id'],_0x4d515c);ChatInternalMessageEvents[_0xd24c('0x5')](_0x3bd534,_0x4d515c);_0x32001a(null);};}for(var e in events){if(events[_0xd24c('0x6')](e)){var event=events[e];ChatInternalMessage[_0xd24c('0x7')](e,emitEvent(event));}}module[_0xd24c('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 3a25fad..68ff7e9 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 _0xb7e7=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x35841f,_0x3c96c7){var _0x1604ad=function(_0x4a9a57){while(--_0x4a9a57){_0x35841f['push'](_0x35841f['shift']());}};_0x1604ad(++_0x3c96c7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xb7e7[_0x186376];return _0x2dbdd9;};'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':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});};
\ No newline at end of file
+var _0x0713=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3071('0xc'),'collate':_0x3071('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 3440787..db3b59c 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 _0x540a=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','request','then','info'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x540a,0xa4));var _0xa540=function(_0x4b03e1,_0x25768f){_0x4b03e1=_0x4b03e1-0x0;var _0x41cbe6=_0x540a[_0x4b03e1];return _0x41cbe6;};'use strict';var _=require(_0xa540('0x0'));var util=require(_0xa540('0x1'));var moment=require(_0xa540('0x2'));var BPromise=require(_0xa540('0x3'));var rs=require(_0xa540('0x4'));var fs=require('fs');var Redis=require(_0xa540('0x5'));var db=require(_0xa540('0x6'))['db'];var utils=require(_0xa540('0x7'));var logger=require('../../config/logger')(_0xa540('0x8'));var config=require(_0xa540('0x9'));var jayson=require(_0xa540('0xa'));var client=jayson[_0xa540('0xb')][_0xa540('0xc')]({'port':0x232a});config['redis']=_[_0xa540('0xd')](config['redis'],{'host':_0xa540('0xe'),'port':0x18eb});var socket=require(_0xa540('0xf'))(new Redis(config[_0xa540('0x10')]));require(_0xa540('0x11'))[_0xa540('0x12')](socket);function respondWithRpcPromise(_0x2b9dc4,_0x146d91,_0x185e24){return new BPromise(function(_0x4db462,_0x426353){return client[_0xa540('0x13')](_0x2b9dc4,_0x185e24)[_0xa540('0x14')](function(_0x49e108){logger[_0xa540('0x15')](_0xa540('0x16'),_0x146d91,_0xa540('0x17'));logger[_0xa540('0x18')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x146d91,_0xa540('0x17'),JSON[_0xa540('0x19')](_0x49e108));if(_0x49e108[_0xa540('0x1a')]){if(_0x49e108['error'][_0xa540('0x1b')]===0x1f4){logger['error'](_0xa540('0x16'),_0x146d91,_0x49e108[_0xa540('0x1a')][_0xa540('0x1c')]);return _0x426353(_0x49e108[_0xa540('0x1a')][_0xa540('0x1c')]);}logger[_0xa540('0x1a')](_0xa540('0x16'),_0x146d91,_0x49e108[_0xa540('0x1a')][_0xa540('0x1c')]);return _0x4db462(_0x49e108['error']['message']);}else{logger[_0xa540('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x146d91,'request\x20sent');_0x4db462(_0x49e108[_0xa540('0x1d')]['message']);}})[_0xa540('0x1e')](function(_0x4b7b3d){logger['error'](_0xa540('0x16'),_0x146d91,_0x4b7b3d);_0x426353(_0x4b7b3d);});});}
\ No newline at end of file
+var _0x5fb2=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','register','request'];(function(_0x56331d,_0x25548c){var _0x2249fc=function(_0xf90453){while(--_0xf90453){_0x56331d['push'](_0x56331d['shift']());}};_0x2249fc(++_0x25548c);}(_0x5fb2,0x96));var _0x25fb=function(_0x4cadd2,_0x33c671){_0x4cadd2=_0x4cadd2-0x0;var _0x147334=_0x5fb2[_0x4cadd2];return _0x147334;};'use strict';var _=require('lodash');var util=require(_0x25fb('0x0'));var moment=require(_0x25fb('0x1'));var BPromise=require(_0x25fb('0x2'));var rs=require(_0x25fb('0x3'));var fs=require('fs');var Redis=require(_0x25fb('0x4'));var db=require(_0x25fb('0x5'))['db'];var utils=require(_0x25fb('0x6'));var logger=require(_0x25fb('0x7'))(_0x25fb('0x8'));var config=require(_0x25fb('0x9'));var jayson=require(_0x25fb('0xa'));var client=jayson[_0x25fb('0xb')][_0x25fb('0xc')]({'port':0x232a});config['redis']=_[_0x25fb('0xd')](config['redis'],{'host':_0x25fb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25fb('0xf')]));require('./chatInternalMessage.socket')[_0x25fb('0x10')](socket);function respondWithRpcPromise(_0x2a6d51,_0xd7051d,_0x398719){return new BPromise(function(_0x135e47,_0x3a3aec){return client[_0x25fb('0x11')](_0x2a6d51,_0x398719)[_0x25fb('0x12')](function(_0x21621c){logger[_0x25fb('0x13')](_0x25fb('0x14'),_0xd7051d,_0x25fb('0x15'));logger[_0x25fb('0x16')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xd7051d,_0x25fb('0x15'),JSON[_0x25fb('0x17')](_0x21621c));if(_0x21621c['error']){if(_0x21621c[_0x25fb('0x18')][_0x25fb('0x19')]===0x1f4){logger[_0x25fb('0x18')](_0x25fb('0x14'),_0xd7051d,_0x21621c['error'][_0x25fb('0x1a')]);return _0x3a3aec(_0x21621c['error'][_0x25fb('0x1a')]);}logger[_0x25fb('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0xd7051d,_0x21621c[_0x25fb('0x18')][_0x25fb('0x1a')]);return _0x135e47(_0x21621c[_0x25fb('0x18')][_0x25fb('0x1a')]);}else{logger[_0x25fb('0x13')](_0x25fb('0x14'),_0xd7051d,_0x25fb('0x15'));_0x135e47(_0x21621c['result'][_0x25fb('0x1a')]);}})[_0x25fb('0x1b')](function(_0x34bea8){logger[_0x25fb('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0xd7051d,_0x34bea8);_0x3a3aec(_0x34bea8);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 6f175f1..27d121a 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 _0x4d9e=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','update','emit'];(function(_0x3ad63f,_0x57c4d5){var _0x2ff1f5=function(_0x1854c9){while(--_0x1854c9){_0x3ad63f['push'](_0x3ad63f['shift']());}};_0x2ff1f5(++_0x57c4d5);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x4724c2,_0x154258){_0x4724c2=_0x4724c2-0x0;var _0x3f6ea1=_0x4d9e[_0x4724c2];return _0x3f6ea1;};'use strict';var ChatInternalMessageEvents=require(_0xe4d9('0x0'));var events=['save','remove',_0xe4d9('0x1')];function createListener(_0x574c1d,_0x36adac){return function(_0x4d7687){_0x36adac[_0xe4d9('0x2')](_0x574c1d,_0x4d7687);};}function removeListener(_0x2deaef,_0x47a09f){return function(){ChatInternalMessageEvents[_0xe4d9('0x3')](_0x2deaef,_0x47a09f);};}exports[_0xe4d9('0x4')]=function(_0x278035){for(var _0x34c2a2=0x0,_0x125dbc=events[_0xe4d9('0x5')];_0x34c2a2<_0x125dbc;_0x34c2a2++){var _0x54a63a=events[_0x34c2a2];var _0x36316f=createListener(_0xe4d9('0x6')+_0x54a63a,_0x278035);ChatInternalMessageEvents['on'](_0x54a63a,_0x36316f);}};
\ No newline at end of file
+var _0xdfcc=['chatInternalMessage:','./chatInternalMessage.events','save','remove','length'];(function(_0x55054d,_0x35adc6){var _0x5324fa=function(_0x348b0c){while(--_0x348b0c){_0x55054d['push'](_0x55054d['shift']());}};_0x5324fa(++_0x35adc6);}(_0xdfcc,0x8d));var _0xcdfc=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xdfcc[_0x296897];return _0x2b44ab;};'use strict';var ChatInternalMessageEvents=require(_0xcdfc('0x0'));var events=[_0xcdfc('0x1'),_0xcdfc('0x2'),'update'];function createListener(_0x133c72,_0x851248){return function(_0x54bd16){_0x851248['emit'](_0x133c72,_0x54bd16);};}function removeListener(_0x468275,_0x4e9e63){return function(){ChatInternalMessageEvents['removeListener'](_0x468275,_0x4e9e63);};}exports['register']=function(_0xa928f6){for(var _0x155d4c=0x0,_0x4f942c=events[_0xcdfc('0x3')];_0x155d4c<_0x4f942c;_0x155d4c++){var _0x35a524=events[_0x155d4c];var _0x462f04=createListener(_0xcdfc('0x4')+_0x35a524,_0xa928f6);ChatInternalMessageEvents['on'](_0x35a524,_0x462f04);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index d9dbf0f..ac27413 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 _0xf44a=['../../config/environment','get','isAuthenticated','/describe','/users','getUsers','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf44a,0xcc));var _0xaf44=function(_0xc87f63,_0x451f43){_0xc87f63=_0xc87f63-0x0;var _0x551bbe=_0xf44a[_0xc87f63];return _0x551bbe;};'use strict';var multer=require(_0xaf44('0x0'));var util=require(_0xaf44('0x1'));var path=require(_0xaf44('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf44('0x3'));var router=express[_0xaf44('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf44('0x5'));var controller=require('./chatInternalMessage.controller');router[_0xaf44('0x6')]('/',auth[_0xaf44('0x7')](),controller['index']);router['get'](_0xaf44('0x8'),auth[_0xaf44('0x7')](),controller['describe']);router[_0xaf44('0x6')](_0xaf44('0x9'),auth[_0xaf44('0x7')](),controller[_0xaf44('0xa')]);router[_0xaf44('0x6')]('/:id',auth[_0xaf44('0x7')](),controller['show']);router[_0xaf44('0xb')]('/',auth[_0xaf44('0x7')](),controller[_0xaf44('0xc')]);router[_0xaf44('0xd')](_0xaf44('0xe'),controller[_0xaf44('0xf')]);router[_0xaf44('0x10')](_0xaf44('0xe'),auth['isAuthenticated'](),controller[_0xaf44('0x11')]);module[_0xaf44('0x12')]=router;
\ No newline at end of file
+var _0x149e=['../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','getUsers','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x149e,0x9b));var _0xe149=function(_0x156c68,_0x3885f6){_0x156c68=_0x156c68-0x0;var _0x559146=_0x149e[_0x156c68];return _0x559146;};'use strict';var multer=require(_0xe149('0x0'));var util=require(_0xe149('0x1'));var path=require('path');var timeout=require(_0xe149('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe149('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe149('0x4'));var config=require(_0xe149('0x5'));var controller=require(_0xe149('0x6'));router[_0xe149('0x7')]('/',auth[_0xe149('0x8')](),controller[_0xe149('0x9')]);router['get'](_0xe149('0xa'),auth[_0xe149('0x8')](),controller['describe']);router['get']('/users',auth[_0xe149('0x8')](),controller[_0xe149('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe149('0xc')]);router[_0xe149('0xd')]('/',auth[_0xe149('0x8')](),controller[_0xe149('0xe')]);router[_0xe149('0xf')](_0xe149('0x10'),controller[_0xe149('0x11')]);router['delete']('/:id',auth[_0xe149('0x8')](),controller[_0xe149('0x12')]);module[_0xe149('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 295a848..d079525 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 _0xf3f9=['DATE','STRING','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x482f10,_0xe1c841){var _0x42e031=function(_0x15b381){while(--_0x15b381){_0x482f10['push'](_0x482f10['shift']());}};_0x42e031(++_0xe1c841);}(_0xf3f9,0x162));var _0x9f3f=function(_0x1826a9,_0x5703f){_0x1826a9=_0x1826a9-0x0;var _0x4bc0e6=_0xf3f9[_0x1826a9];return _0x4bc0e6;};'use strict';var Sequelize=require(_0x9f3f('0x0'));module['exports']={'body':{'type':Sequelize[_0x9f3f('0x1')](_0x9f3f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9f3f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9f3f('0x4')]('in','out'),'defaultValue':_0x9f3f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9f3f('0x6')]},'providerName':{'type':Sequelize[_0x9f3f('0x7')]},'providerResponse':{'type':Sequelize[_0x9f3f('0x1')]}};
\ No newline at end of file
+var _0x2f4d=['TEXT','BOOLEAN','out','STRING','sequelize'];(function(_0x273252,_0x24ba17){var _0x47d3ce=function(_0x54c538){while(--_0x54c538){_0x273252['push'](_0x273252['shift']());}};_0x47d3ce(++_0x24ba17);}(_0x2f4d,0xcc));var _0xd2f4=function(_0x19772d,_0x2d0b4c){_0x19772d=_0x19772d-0x0;var _0x290f70=_0x2f4d[_0x19772d];return _0x290f70;};'use strict';var Sequelize=require(_0xd2f4('0x0'));module['exports']={'body':{'type':Sequelize[_0xd2f4('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd2f4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd2f4('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd2f4('0x4')]},'providerResponse':{'type':Sequelize[_0xd2f4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 898d4a1..d8bd227 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 _0x7584=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteraction','update','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','SIP/%s','channel','event','EventManager','reject','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','end','offset','limit','Content-Range','json','apply','save','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','count','include','ChatMessage','findAll','rows','params','includeAll','options','find','create','body','destroy','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format'];(function(_0x56e9fb,_0x11b179){var _0x3008a4=function(_0xaa7a00){while(--_0xaa7a00){_0x56e9fb['push'](_0x56e9fb['shift']());}};_0x3008a4(++_0x11b179);}(_0x7584,0x10e));var _0x4758=function(_0x17896e,_0x37e540){_0x17896e=_0x17896e-0x0;var _0x5562e6=_0x7584[_0x17896e];return _0x5562e6;};'use strict';var emlformat=require(_0x4758('0x0'));var rimraf=require(_0x4758('0x1'));var zipdir=require(_0x4758('0x2'));var jsonpatch=require(_0x4758('0x3'));var rp=require(_0x4758('0x4'));var moment=require(_0x4758('0x5'));var BPromise=require(_0x4758('0x6'));var Mustache=require(_0x4758('0x7'));var util=require(_0x4758('0x8'));var path=require(_0x4758('0x9'));var sox=require('sox');var csv=require(_0x4758('0xa'));var ejs=require(_0x4758('0xb'));var fs=require('fs');var fs_extra=require(_0x4758('0xc'));var _=require('lodash');var squel=require(_0x4758('0xd'));var crypto=require(_0x4758('0xe'));var jsforce=require(_0x4758('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4758('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4758('0x10'));var as=require(_0x4758('0x11'));var hardwareService=require(_0x4758('0x12'));var logger=require('../../config/logger')(_0x4758('0x13'));var utils=require('../../config/utils');var config=require(_0x4758('0x14'));var licenseUtil=require(_0x4758('0x15'));var db=require(_0x4758('0x16'))['db'];config[_0x4758('0x17')]=_[_0x4758('0x18')](config[_0x4758('0x17')],{'host':_0x4758('0x19'),'port':0x18eb});var socket=require(_0x4758('0x1a'))(new Redis(config[_0x4758('0x17')]));require(_0x4758('0x1b'))[_0x4758('0x1c')](socket);var jayson=require(_0x4758('0x1d'));var client=jayson[_0x4758('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x4758('0x1e')][_0x4758('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1b7a3c,_0x1abdd0,_0x5124fc,_0x3d5780){return new BPromise(function(_0x36347e,_0x26400a){var _0x110207=_0x3d5780||client;return _0x110207[_0x4758('0x20')](_0x1b7a3c,_0x5124fc)[_0x4758('0x21')](function(_0x5a0edf){logger[_0x4758('0x22')]('ChatMessage,\x20%s,\x20%s',_0x1abdd0,_0x4758('0x23'));logger[_0x4758('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1abdd0,_0x4758('0x23'),JSON['stringify'](_0x5a0edf));if(_0x5a0edf[_0x4758('0x25')]){if(_0x5a0edf[_0x4758('0x25')][_0x4758('0x26')]===0x1f4){logger[_0x4758('0x25')](_0x4758('0x27'),_0x1abdd0,_0x5a0edf[_0x4758('0x25')]['message']);return _0x26400a(_0x5a0edf['error'][_0x4758('0x28')]);}logger[_0x4758('0x25')]('ChatMessage,\x20%s,\x20%s',_0x1abdd0,_0x5a0edf[_0x4758('0x25')][_0x4758('0x28')]);return _0x36347e(_0x5a0edf[_0x4758('0x25')][_0x4758('0x28')]);}else{logger[_0x4758('0x22')](_0x4758('0x27'),_0x1abdd0,'request\x20sent');_0x36347e(_0x5a0edf[_0x4758('0x29')][_0x4758('0x28')]);}})[_0x4758('0x2a')](function(_0x532cc5){logger[_0x4758('0x25')]('ChatMessage,\x20%s,\x20%s',_0x1abdd0,_0x532cc5);_0x26400a(_0x532cc5);});});}function respondWithStatusCode(_0x2f8924,_0x1f3469){_0x1f3469=_0x1f3469||0xcc;return function(_0x27233d){if(_0x27233d){return _0x2f8924['sendStatus'](_0x1f3469);}return _0x2f8924[_0x4758('0x2b')](_0x1f3469)[_0x4758('0x2c')]();};}function respondWithResult(_0xfdafe2,_0x38ab22){_0x38ab22=_0x38ab22||0xc8;return function(_0x2287b5){if(_0x2287b5){return _0xfdafe2[_0x4758('0x2b')](_0x38ab22)['json'](_0x2287b5);}};}function respondWithFilteredResult(_0x390b9f,_0x43c3e8){return function(_0x255c88){if(_0x255c88){var _0x755de0=_0x255c88['count'],_0x43365e=_0x43c3e8['offset'],_0x4867d0=_0x43c3e8[_0x4758('0x2d')]+_0x43c3e8[_0x4758('0x2e')],_0x105039;if(_0x4867d0>=_0x755de0){_0x4867d0=_0x755de0;_0x105039=0xc8;}else{_0x105039=0xce;}_0x390b9f[_0x4758('0x2b')](_0x105039);return _0x390b9f['set'](_0x4758('0x2f'),_0x43365e+'-'+_0x4867d0+'/'+_0x755de0)[_0x4758('0x30')](_0x255c88);}return null;};}function patchUpdates(_0x505467){return function(_0x420449){try{jsonpatch[_0x4758('0x31')](_0x420449,_0x505467,!![]);}catch(_0x4d850d){return BPromise['reject'](_0x4d850d);}return _0x420449[_0x4758('0x32')]();};}function saveUpdates(_0x1ce7f9,_0x65a90d){return function(_0x502705){if(_0x502705){return _0x502705['update'](_0x1ce7f9)['then'](function(_0x3a6c44){return _0x3a6c44;});}return null;};}function removeEntity(_0x36cc27,_0x55c54f){return function(_0x262f64){if(_0x262f64){return _0x262f64['destroy']()[_0x4758('0x21')](function(){_0x36cc27[_0x4758('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10d749,_0x5760fa){return function(_0x4408ee){if(!_0x4408ee){_0x10d749[_0x4758('0x33')](0x194);}return _0x4408ee;};}function handleError(_0x4e1a52,_0x42f032){_0x42f032=_0x42f032||0x1f4;return function(_0xd69a92){logger[_0x4758('0x25')](_0xd69a92[_0x4758('0x34')]);if(_0xd69a92[_0x4758('0x35')]){delete _0xd69a92[_0x4758('0x35')];}_0x4e1a52[_0x4758('0x2b')](_0x42f032)[_0x4758('0x36')](_0xd69a92);};}exports[_0x4758('0x37')]=function(_0x2d6063,_0x56716d){var _0xc73574={},_0x2a3516={},_0x4d1143={'count':0x0,'rows':[]};var _0x5de4d6=_['map'](db['ChatMessage'][_0x4758('0x38')],function(_0x4b778c){return{'name':_0x4b778c[_0x4758('0x39')],'type':_0x4b778c[_0x4758('0x3a')]['key']};});_0x2a3516[_0x4758('0x3b')]=_[_0x4758('0x3c')](_0x5de4d6,'name');_0x2a3516[_0x4758('0x3d')]=_[_0x4758('0x3e')](_0x2d6063[_0x4758('0x3d')]);_0x2a3516[_0x4758('0x3f')]=_[_0x4758('0x40')](_0x2a3516[_0x4758('0x3b')],_0x2a3516[_0x4758('0x3d')]);_0xc73574[_0x4758('0x41')]=_['intersection'](_0x2a3516[_0x4758('0x3b')],qs[_0x4758('0x42')](_0x2d6063['query'][_0x4758('0x42')]));_0xc73574[_0x4758('0x41')]=_0xc73574[_0x4758('0x41')][_0x4758('0x43')]?_0xc73574['attributes']:_0x2a3516[_0x4758('0x3b')];if(!_0x2d6063['query'][_0x4758('0x44')](_0x4758('0x45'))){_0xc73574[_0x4758('0x2e')]=qs[_0x4758('0x2e')](_0x2d6063[_0x4758('0x3d')]['limit']);_0xc73574['offset']=qs[_0x4758('0x2d')](_0x2d6063[_0x4758('0x3d')][_0x4758('0x2d')]);}_0xc73574[_0x4758('0x46')]=qs[_0x4758('0x47')](_0x2d6063[_0x4758('0x3d')][_0x4758('0x47')]);_0xc73574[_0x4758('0x48')]=qs[_0x4758('0x3f')](_['pick'](_0x2d6063['query'],_0x2a3516[_0x4758('0x3f')]),_0x5de4d6);if(_0x2d6063[_0x4758('0x3d')][_0x4758('0x49')]){_0xc73574[_0x4758('0x48')]=_[_0x4758('0x4a')](_0xc73574[_0x4758('0x48')],{'$or':_[_0x4758('0x3c')](_0x5de4d6,function(_0x44035d){if(_0x44035d[_0x4758('0x3a')]!==_0x4758('0x4b')){var _0x12cbab={};_0x12cbab[_0x44035d['name']]={'$like':'%'+_0x2d6063[_0x4758('0x3d')][_0x4758('0x49')]+'%'};return _0x12cbab;}})});}_0xc73574=_[_0x4758('0x4a')]({},_0xc73574,_0x2d6063['options']);var _0x2bf84e={'where':_0xc73574[_0x4758('0x48')]};return db['ChatMessage']['count'](_0x2bf84e)[_0x4758('0x21')](function(_0x320e9c){_0x4d1143[_0x4758('0x4c')]=_0x320e9c;if(_0x2d6063['query']['includeAll']){_0xc73574[_0x4758('0x4d')]=[{'all':!![]}];}return db[_0x4758('0x4e')][_0x4758('0x4f')](_0xc73574);})[_0x4758('0x21')](function(_0x285498){_0x4d1143[_0x4758('0x50')]=_0x285498;return _0x4d1143;})[_0x4758('0x21')](respondWithFilteredResult(_0x56716d,_0xc73574))[_0x4758('0x2a')](handleError(_0x56716d,null));};exports['show']=function(_0x8fe42,_0x3b3e26){var _0x3e4e62={'raw':!![],'where':{'id':_0x8fe42[_0x4758('0x51')]['id']}},_0x35be8a={};_0x35be8a[_0x4758('0x3b')]=_[_0x4758('0x3e')](db['ChatMessage'][_0x4758('0x38')]);_0x35be8a[_0x4758('0x3d')]=_['keys'](_0x8fe42[_0x4758('0x3d')]);_0x35be8a[_0x4758('0x3f')]=_[_0x4758('0x40')](_0x35be8a['model'],_0x35be8a['query']);_0x3e4e62['attributes']=_[_0x4758('0x40')](_0x35be8a[_0x4758('0x3b')],qs[_0x4758('0x42')](_0x8fe42['query'][_0x4758('0x42')]));_0x3e4e62['attributes']=_0x3e4e62[_0x4758('0x41')][_0x4758('0x43')]?_0x3e4e62['attributes']:_0x35be8a[_0x4758('0x3b')];if(_0x8fe42[_0x4758('0x3d')][_0x4758('0x52')]){_0x3e4e62['include']=[{'all':!![]}];}_0x3e4e62=_[_0x4758('0x4a')]({},_0x3e4e62,_0x8fe42[_0x4758('0x53')]);return db[_0x4758('0x4e')][_0x4758('0x54')](_0x3e4e62)[_0x4758('0x21')](handleEntityNotFound(_0x3b3e26,null))[_0x4758('0x21')](respondWithResult(_0x3b3e26,null))['catch'](handleError(_0x3b3e26,null));};exports[_0x4758('0x55')]=function(_0x214fa7,_0xb9e05a){return db[_0x4758('0x4e')][_0x4758('0x55')](_0x214fa7[_0x4758('0x56')],{})[_0x4758('0x21')](respondWithResult(_0xb9e05a,0xc9))[_0x4758('0x2a')](handleError(_0xb9e05a,null));};exports['update']=function(_0xc15123,_0x4e57a3){if(_0xc15123[_0x4758('0x56')]['id']){delete _0xc15123['body']['id'];}return db['ChatMessage'][_0x4758('0x54')]({'where':{'id':_0xc15123[_0x4758('0x51')]['id']}})[_0x4758('0x21')](handleEntityNotFound(_0x4e57a3,null))[_0x4758('0x21')](saveUpdates(_0xc15123['body'],null))['then'](respondWithResult(_0x4e57a3,null))['catch'](handleError(_0x4e57a3,null));};exports[_0x4758('0x57')]=function(_0x1a9450,_0x507611){return db['ChatMessage'][_0x4758('0x54')]({'where':{'id':_0x1a9450[_0x4758('0x51')]['id']}})['then'](handleEntityNotFound(_0x507611,null))[_0x4758('0x21')](removeEntity(_0x507611,null))[_0x4758('0x2a')](handleError(_0x507611,null));};exports[_0x4758('0x58')]=function(_0x311baf,_0x2632e7){return db[_0x4758('0x4e')][_0x4758('0x58')]()[_0x4758('0x21')](respondWithResult(_0x2632e7,null))[_0x4758('0x2a')](handleError(_0x2632e7,null));};var interaction_log=require(_0x4758('0x59'))(_0x4758('0x5a'));exports[_0x4758('0x5b')]=function(_0x4c5151,_0x42a15b,_0x2dbf30){var _0x2f516a={'agent':{},'channel':_0x4758('0x5c')};if(_0x4c5151['body']['id']){delete _0x4c5151[_0x4758('0x56')]['id'];}_0x4c5151[_0x4758('0x56')][_0x4758('0x5d')]=!![];_0x4c5151[_0x4758('0x56')][_0x4758('0x5e')]=moment()[_0x4758('0x5f')](_0x4758('0x60'));_0x4c5151['body'][_0x4758('0x61')]=_0x4c5151[_0x4758('0x56')][_0x4758('0x61')]||_0x4c5151[_0x4758('0x62')]['id'];_0x2f516a['agent']['id']=_0x4c5151[_0x4758('0x56')]['UserId'];return db[_0x4758('0x4e')][_0x4758('0x54')]({'where':{'id':_0x4c5151[_0x4758('0x51')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x4758('0x63')}]})[_0x4758('0x21')](handleEntityNotFound(_0x42a15b,null))[_0x4758('0x21')](saveUpdates(_0x4c5151[_0x4758('0x56')],null))[_0x4758('0x21')](function(_0x49935e){if(_0x49935e){_0x2f516a['message']=_0x49935e[_0x4758('0x64')]({'plain':!![]});return db[_0x4758('0x65')]['find']({'where':{'id':_0x49935e['ChatInteractionId']}});}return null;})[_0x4758('0x21')](handleEntityNotFound(_0x42a15b,null))[_0x4758('0x21')](function(_0xe9a5c6){if(_0xe9a5c6){return _0xe9a5c6[_0x4758('0x66')]({'UserId':_0x4c5151[_0x4758('0x56')][_0x4758('0x61')],'read1stAt':_[_0x4758('0x67')](_0xe9a5c6[_0x4758('0x68')])?moment()[_0x4758('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4758('0x21')](function(_0x5c8821){if(_0x5c8821){_0x2f516a['interaction']=_0x5c8821[_0x4758('0x64')]({'plain':!![]});interaction_log['info'](_0x4758('0x69'),_0x4c5151[_0x4758('0x62')]['id'],_0x4c5151['user'][_0x4758('0x35')],_0x4c5151[_0x4758('0x62')]['role'],_0x2f516a[_0x4758('0x6a')]['id'],_0x4c5151[_0x4758('0x56')]?JSON[_0x4758('0x6b')](_0x4c5151[_0x4758('0x56')]):_0x4758('0x6c'));return respondWithRpcPromise(_0x4758('0x6d'),'acceptMessage',_0x2f516a);}return null;})['then'](function(_0x177c56){if(_0x177c56){if(_0x4c5151[_0x4758('0x56')]['manual']){_0x2f516a[_0x4758('0x28')]['interface']=util[_0x4758('0x5f')](_0x4758('0x6e'),_0x4c5151[_0x4758('0x62')][_0x4758('0x35')]);_0x2f516a[_0x4758('0x28')][_0x4758('0x6f')]=_0x2f516a['channel'];_0x2f516a['message'][_0x4758('0x70')]=_0x4758('0x5b');return respondWithRpcPromise(_0x4758('0x71'),_0x4758('0x71'),{'event':'acceptmessage','message':_[_0x4758('0x4a')](_0x2f516a['message'],JSON['parse'](_0x2f516a[_0x4758('0x6a')]['formData']))},client9002)[_0x4758('0x21')](function(){return _0x2f516a;});}return _0x2f516a;}return null;})[_0x4758('0x21')](respondWithResult(_0x42a15b,null))[_0x4758('0x2a')](handleError(_0x42a15b,null));};var interaction_log=require(_0x4758('0x59'))(_0x4758('0x5a'));exports[_0x4758('0x72')]=function(_0x57d405,_0x3e093d,_0x579185){var _0x94b7c5={'agent':{},'channel':_0x4758('0x5c')};if(_0x57d405[_0x4758('0x56')]['id']){delete _0x57d405[_0x4758('0x56')]['id'];}_0x57d405[_0x4758('0x56')]['UserId']=_0x57d405[_0x4758('0x56')][_0x4758('0x61')]||_0x57d405[_0x4758('0x62')]['id'];_0x94b7c5[_0x4758('0x73')]['id']=_0x57d405[_0x4758('0x56')][_0x4758('0x61')];return db['ChatMessage'][_0x4758('0x54')]({'where':{'id':_0x57d405[_0x4758('0x51')]['id'],'UserId':null}})[_0x4758('0x21')](handleEntityNotFound(_0x3e093d,null))[_0x4758('0x21')](function(_0xe306a4){if(_0xe306a4){_0x94b7c5[_0x4758('0x28')]=_0xe306a4[_0x4758('0x64')]({'plain':!![]});return db[_0x4758('0x65')]['find']({'where':{'id':_0xe306a4['ChatInteractionId']}});}return null;})[_0x4758('0x21')](handleEntityNotFound(_0x3e093d,null))['then'](function(_0x4ab45d){if(_0x4ab45d){_0x94b7c5[_0x4758('0x6a')]=_0x4ab45d['get']({'plain':!![]});interaction_log[_0x4758('0x22')](_0x4758('0x74'),_0x57d405['user']['id'],_0x57d405[_0x4758('0x62')][_0x4758('0x35')],_0x57d405[_0x4758('0x62')][_0x4758('0x75')],_0x94b7c5[_0x4758('0x6a')]['id'],_0x57d405['body']?JSON[_0x4758('0x6b')](_0x57d405['body']):_0x4758('0x6c'));return respondWithRpcPromise(_0x4758('0x76'),_0x4758('0x77'),_0x94b7c5);}return null;})['then'](function(_0x31ddf3){if(_0x31ddf3){_0x31ddf3[_0x4758('0x28')][_0x4758('0x78')]=util[_0x4758('0x5f')](_0x4758('0x6e'),_0x57d405['user'][_0x4758('0x35')]);_0x31ddf3[_0x4758('0x28')][_0x4758('0x6f')]=_0x94b7c5[_0x4758('0x6f')];_0x31ddf3[_0x4758('0x28')][_0x4758('0x70')]=_0x4758('0x72');respondWithRpcPromise(_0x4758('0x71'),_0x4758('0x71'),{'event':_0x4758('0x79'),'message':_0x31ddf3[_0x4758('0x28')]},client9002);return _0x94b7c5;}return null;})['then'](respondWithResult(_0x3e093d,null))['catch'](handleError(_0x3e093d,null));};
\ No newline at end of file
+var _0x77a4=['set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','find','create','body','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','CmContact','Contact','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','formData','ChatInteraction','RejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','status','end','json','count','offset','limit'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x77a4,0xc3));var _0x477a=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x77a4[_0x35007a];return _0x574f68;};'use strict';var emlformat=require(_0x477a('0x0'));var rimraf=require(_0x477a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x477a('0x2'));var rp=require(_0x477a('0x3'));var moment=require(_0x477a('0x4'));var BPromise=require(_0x477a('0x5'));var Mustache=require(_0x477a('0x6'));var util=require(_0x477a('0x7'));var path=require(_0x477a('0x8'));var sox=require(_0x477a('0x9'));var csv=require(_0x477a('0xa'));var ejs=require(_0x477a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x477a('0xc'));var crypto=require('crypto');var jsforce=require(_0x477a('0xd'));var deskjs=require(_0x477a('0xe'));var toCsv=require(_0x477a('0xa'));var querystring=require(_0x477a('0xf'));var Papa=require('papaparse');var Redis=require(_0x477a('0x10'));var authService=require(_0x477a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x477a('0x12'));var hardwareService=require(_0x477a('0x13'));var logger=require(_0x477a('0x14'))(_0x477a('0x15'));var utils=require(_0x477a('0x16'));var config=require(_0x477a('0x17'));var licenseUtil=require(_0x477a('0x18'));var db=require(_0x477a('0x19'))['db'];config[_0x477a('0x1a')]=_[_0x477a('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x477a('0x1c'))(new Redis(config[_0x477a('0x1a')]));require(_0x477a('0x1d'))[_0x477a('0x1e')](socket);var jayson=require(_0x477a('0x1f'));var client=jayson[_0x477a('0x20')][_0x477a('0x21')]({'port':0x232c});var client9002=jayson[_0x477a('0x20')][_0x477a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x141f60,_0x51bb32,_0x58ba80,_0x4b741a){return new BPromise(function(_0x504757,_0x4d94b4){var _0x4503b4=_0x4b741a||client;return _0x4503b4[_0x477a('0x22')](_0x141f60,_0x58ba80)[_0x477a('0x23')](function(_0x2394bb){logger['info'](_0x477a('0x24'),_0x51bb32,_0x477a('0x25'));logger[_0x477a('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x51bb32,_0x477a('0x25'),JSON[_0x477a('0x27')](_0x2394bb));if(_0x2394bb[_0x477a('0x28')]){if(_0x2394bb[_0x477a('0x28')]['code']===0x1f4){logger[_0x477a('0x28')](_0x477a('0x24'),_0x51bb32,_0x2394bb[_0x477a('0x28')][_0x477a('0x29')]);return _0x4d94b4(_0x2394bb[_0x477a('0x28')][_0x477a('0x29')]);}logger['error'](_0x477a('0x24'),_0x51bb32,_0x2394bb['error']['message']);return _0x504757(_0x2394bb[_0x477a('0x28')]['message']);}else{logger[_0x477a('0x2a')](_0x477a('0x24'),_0x51bb32,_0x477a('0x25'));_0x504757(_0x2394bb[_0x477a('0x2b')][_0x477a('0x29')]);}})[_0x477a('0x2c')](function(_0x4ab2f7){logger[_0x477a('0x28')]('ChatMessage,\x20%s,\x20%s',_0x51bb32,_0x4ab2f7);_0x4d94b4(_0x4ab2f7);});});}function respondWithStatusCode(_0x2265ab,_0x1973d0){_0x1973d0=_0x1973d0||0xcc;return function(_0x2587c3){if(_0x2587c3){return _0x2265ab['sendStatus'](_0x1973d0);}return _0x2265ab[_0x477a('0x2d')](_0x1973d0)[_0x477a('0x2e')]();};}function respondWithResult(_0x43fc61,_0x204e93){_0x204e93=_0x204e93||0xc8;return function(_0x26aa55){if(_0x26aa55){return _0x43fc61[_0x477a('0x2d')](_0x204e93)[_0x477a('0x2f')](_0x26aa55);}};}function respondWithFilteredResult(_0x10e1ea,_0x53dc50){return function(_0x54b2a3){if(_0x54b2a3){var _0x290ee5=_0x54b2a3[_0x477a('0x30')],_0x411f9a=_0x53dc50[_0x477a('0x31')],_0x2222b0=_0x53dc50[_0x477a('0x31')]+_0x53dc50[_0x477a('0x32')],_0x287079;if(_0x2222b0>=_0x290ee5){_0x2222b0=_0x290ee5;_0x287079=0xc8;}else{_0x287079=0xce;}_0x10e1ea[_0x477a('0x2d')](_0x287079);return _0x10e1ea[_0x477a('0x33')](_0x477a('0x34'),_0x411f9a+'-'+_0x2222b0+'/'+_0x290ee5)[_0x477a('0x2f')](_0x54b2a3);}return null;};}function patchUpdates(_0x6014bb){return function(_0x2564ee){try{jsonpatch[_0x477a('0x35')](_0x2564ee,_0x6014bb,!![]);}catch(_0x1675f3){return BPromise[_0x477a('0x36')](_0x1675f3);}return _0x2564ee[_0x477a('0x37')]();};}function saveUpdates(_0x4dd4de,_0x13e8be){return function(_0x554df5){if(_0x554df5){return _0x554df5[_0x477a('0x38')](_0x4dd4de)['then'](function(_0x17d670){return _0x17d670;});}return null;};}function removeEntity(_0x38321a,_0x363105){return function(_0x349633){if(_0x349633){return _0x349633[_0x477a('0x39')]()[_0x477a('0x23')](function(){_0x38321a[_0x477a('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f039,_0x3ec34c){return function(_0x318053){if(!_0x318053){_0x22f039[_0x477a('0x3a')](0x194);}return _0x318053;};}function handleError(_0x3a4644,_0x8dfcab){_0x8dfcab=_0x8dfcab||0x1f4;return function(_0x12556d){logger[_0x477a('0x28')](_0x12556d[_0x477a('0x3b')]);if(_0x12556d[_0x477a('0x3c')]){delete _0x12556d[_0x477a('0x3c')];}_0x3a4644[_0x477a('0x2d')](_0x8dfcab)[_0x477a('0x3d')](_0x12556d);};}exports['index']=function(_0x1fc8ec,_0x3d31ae){var _0x351a8c={},_0x18bd6c={},_0x1074ba={'count':0x0,'rows':[]};var _0x119616=_[_0x477a('0x3e')](db[_0x477a('0x3f')][_0x477a('0x40')],function(_0x1c0ef3){return{'name':_0x1c0ef3['fieldName'],'type':_0x1c0ef3[_0x477a('0x41')][_0x477a('0x42')]};});_0x18bd6c[_0x477a('0x43')]=_[_0x477a('0x3e')](_0x119616,_0x477a('0x3c'));_0x18bd6c[_0x477a('0x44')]=_[_0x477a('0x45')](_0x1fc8ec[_0x477a('0x44')]);_0x18bd6c[_0x477a('0x46')]=_['intersection'](_0x18bd6c[_0x477a('0x43')],_0x18bd6c['query']);_0x351a8c[_0x477a('0x47')]=_[_0x477a('0x48')](_0x18bd6c[_0x477a('0x43')],qs[_0x477a('0x49')](_0x1fc8ec[_0x477a('0x44')]['fields']));_0x351a8c[_0x477a('0x47')]=_0x351a8c[_0x477a('0x47')][_0x477a('0x4a')]?_0x351a8c['attributes']:_0x18bd6c[_0x477a('0x43')];if(!_0x1fc8ec[_0x477a('0x44')][_0x477a('0x4b')](_0x477a('0x4c'))){_0x351a8c['limit']=qs[_0x477a('0x32')](_0x1fc8ec[_0x477a('0x44')][_0x477a('0x32')]);_0x351a8c[_0x477a('0x31')]=qs[_0x477a('0x31')](_0x1fc8ec['query'][_0x477a('0x31')]);}_0x351a8c[_0x477a('0x4d')]=qs['sort'](_0x1fc8ec[_0x477a('0x44')][_0x477a('0x4e')]);_0x351a8c[_0x477a('0x4f')]=qs[_0x477a('0x46')](_['pick'](_0x1fc8ec[_0x477a('0x44')],_0x18bd6c['filters']),_0x119616);if(_0x1fc8ec[_0x477a('0x44')]['filter']){_0x351a8c[_0x477a('0x4f')]=_['merge'](_0x351a8c[_0x477a('0x4f')],{'$or':_[_0x477a('0x3e')](_0x119616,function(_0x460161){if(_0x460161['type']!=='VIRTUAL'){var _0x506030={};_0x506030[_0x460161[_0x477a('0x3c')]]={'$like':'%'+_0x1fc8ec[_0x477a('0x44')][_0x477a('0x50')]+'%'};return _0x506030;}})});}_0x351a8c=_[_0x477a('0x51')]({},_0x351a8c,_0x1fc8ec[_0x477a('0x52')]);var _0x33c07a={'where':_0x351a8c[_0x477a('0x4f')]};return db[_0x477a('0x3f')]['count'](_0x33c07a)[_0x477a('0x23')](function(_0x4ab1f0){_0x1074ba['count']=_0x4ab1f0;if(_0x1fc8ec[_0x477a('0x44')][_0x477a('0x53')]){_0x351a8c[_0x477a('0x54')]=[{'all':!![]}];}return db[_0x477a('0x3f')][_0x477a('0x55')](_0x351a8c);})[_0x477a('0x23')](function(_0x358f12){_0x1074ba[_0x477a('0x56')]=_0x358f12;return _0x1074ba;})[_0x477a('0x23')](respondWithFilteredResult(_0x3d31ae,_0x351a8c))[_0x477a('0x2c')](handleError(_0x3d31ae,null));};exports['show']=function(_0x2d4dc8,_0x5382a9){var _0x5e0083={'raw':!![],'where':{'id':_0x2d4dc8[_0x477a('0x57')]['id']}},_0x3eaf62={};_0x3eaf62[_0x477a('0x43')]=_[_0x477a('0x45')](db[_0x477a('0x3f')][_0x477a('0x40')]);_0x3eaf62[_0x477a('0x44')]=_[_0x477a('0x45')](_0x2d4dc8[_0x477a('0x44')]);_0x3eaf62[_0x477a('0x46')]=_[_0x477a('0x48')](_0x3eaf62['model'],_0x3eaf62['query']);_0x5e0083['attributes']=_['intersection'](_0x3eaf62[_0x477a('0x43')],qs['fields'](_0x2d4dc8[_0x477a('0x44')][_0x477a('0x49')]));_0x5e0083['attributes']=_0x5e0083[_0x477a('0x47')][_0x477a('0x4a')]?_0x5e0083[_0x477a('0x47')]:_0x3eaf62[_0x477a('0x43')];if(_0x2d4dc8['query']['includeAll']){_0x5e0083[_0x477a('0x54')]=[{'all':!![]}];}_0x5e0083=_[_0x477a('0x51')]({},_0x5e0083,_0x2d4dc8[_0x477a('0x52')]);return db[_0x477a('0x3f')][_0x477a('0x58')](_0x5e0083)['then'](handleEntityNotFound(_0x5382a9,null))[_0x477a('0x23')](respondWithResult(_0x5382a9,null))['catch'](handleError(_0x5382a9,null));};exports[_0x477a('0x59')]=function(_0xa8e3bb,_0x6ad8b5){return db[_0x477a('0x3f')]['create'](_0xa8e3bb[_0x477a('0x5a')],{})[_0x477a('0x23')](respondWithResult(_0x6ad8b5,0xc9))[_0x477a('0x2c')](handleError(_0x6ad8b5,null));};exports[_0x477a('0x38')]=function(_0xfb03e8,_0x35da28){if(_0xfb03e8['body']['id']){delete _0xfb03e8[_0x477a('0x5a')]['id'];}return db[_0x477a('0x3f')][_0x477a('0x58')]({'where':{'id':_0xfb03e8[_0x477a('0x57')]['id']}})[_0x477a('0x23')](handleEntityNotFound(_0x35da28,null))['then'](saveUpdates(_0xfb03e8['body'],null))['then'](respondWithResult(_0x35da28,null))[_0x477a('0x2c')](handleError(_0x35da28,null));};exports[_0x477a('0x39')]=function(_0x1f5ac1,_0x2104ea){return db[_0x477a('0x3f')][_0x477a('0x58')]({'where':{'id':_0x1f5ac1[_0x477a('0x57')]['id']}})[_0x477a('0x23')](handleEntityNotFound(_0x2104ea,null))[_0x477a('0x23')](removeEntity(_0x2104ea,null))[_0x477a('0x2c')](handleError(_0x2104ea,null));};exports[_0x477a('0x5b')]=function(_0x3f6a31,_0x492c44){return db['ChatMessage']['describe']()[_0x477a('0x23')](respondWithResult(_0x492c44,null))[_0x477a('0x2c')](handleError(_0x492c44,null));};var interaction_log=require(_0x477a('0x14'))(_0x477a('0x5c'));exports['accept']=function(_0xd73371,_0x3aea97,_0x360176){var _0x44afb0={'agent':{},'channel':_0x477a('0x5d')};if(_0xd73371[_0x477a('0x5a')]['id']){delete _0xd73371[_0x477a('0x5a')]['id'];}_0xd73371[_0x477a('0x5a')]['read']=!![];_0xd73371[_0x477a('0x5a')][_0x477a('0x5e')]=moment()[_0x477a('0x5f')](_0x477a('0x60'));_0xd73371[_0x477a('0x5a')][_0x477a('0x61')]=_0xd73371[_0x477a('0x5a')][_0x477a('0x61')]||_0xd73371[_0x477a('0x62')]['id'];_0x44afb0[_0x477a('0x63')]['id']=_0xd73371['body'][_0x477a('0x61')];return db[_0x477a('0x3f')]['find']({'where':{'id':_0xd73371[_0x477a('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x477a('0x64')],'as':_0x477a('0x65')}]})['then'](handleEntityNotFound(_0x3aea97,null))[_0x477a('0x23')](saveUpdates(_0xd73371['body'],null))['then'](function(_0x4e5fc4){if(_0x4e5fc4){_0x44afb0[_0x477a('0x29')]=_0x4e5fc4['get']({'plain':!![]});return db['ChatInteraction'][_0x477a('0x58')]({'where':{'id':_0x4e5fc4[_0x477a('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x3aea97,null))['then'](function(_0x1bffc4){if(_0x1bffc4){return _0x1bffc4[_0x477a('0x38')]({'UserId':_0xd73371[_0x477a('0x5a')][_0x477a('0x61')],'read1stAt':_[_0x477a('0x67')](_0x1bffc4[_0x477a('0x68')])?moment()[_0x477a('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x477a('0x23')](function(_0x312bd2){if(_0x312bd2){_0x44afb0[_0x477a('0x69')]=_0x312bd2[_0x477a('0x6a')]({'plain':!![]});interaction_log['info'](_0x477a('0x6b'),_0xd73371[_0x477a('0x62')]['id'],_0xd73371[_0x477a('0x62')][_0x477a('0x3c')],_0xd73371['user'][_0x477a('0x6c')],_0x44afb0[_0x477a('0x69')]['id'],_0xd73371[_0x477a('0x5a')]?JSON[_0x477a('0x27')](_0xd73371['body']):_0x477a('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x477a('0x6e'),_0x44afb0);}return null;})[_0x477a('0x23')](function(_0x1517e5){if(_0x1517e5){if(_0xd73371[_0x477a('0x5a')][_0x477a('0x6f')]){_0x44afb0[_0x477a('0x29')][_0x477a('0x70')]=util['format'](_0x477a('0x71'),_0xd73371[_0x477a('0x62')][_0x477a('0x3c')]);_0x44afb0[_0x477a('0x29')]['channel']=_0x44afb0[_0x477a('0x72')];_0x44afb0[_0x477a('0x29')][_0x477a('0x73')]=_0x477a('0x74');return respondWithRpcPromise(_0x477a('0x75'),_0x477a('0x75'),{'event':_0x477a('0x76'),'message':_[_0x477a('0x51')](_0x44afb0['message'],JSON['parse'](_0x44afb0[_0x477a('0x69')][_0x477a('0x77')]))},client9002)[_0x477a('0x23')](function(){return _0x44afb0;});}return _0x44afb0;}return null;})[_0x477a('0x23')](respondWithResult(_0x3aea97,null))[_0x477a('0x2c')](handleError(_0x3aea97,null));};var interaction_log=require('../../config/logger')(_0x477a('0x5c'));exports['reject']=function(_0x6363e4,_0x4c60ed,_0x67ae12){var _0x5798c4={'agent':{},'channel':'chat'};if(_0x6363e4[_0x477a('0x5a')]['id']){delete _0x6363e4[_0x477a('0x5a')]['id'];}_0x6363e4[_0x477a('0x5a')][_0x477a('0x61')]=_0x6363e4['body'][_0x477a('0x61')]||_0x6363e4[_0x477a('0x62')]['id'];_0x5798c4[_0x477a('0x63')]['id']=_0x6363e4[_0x477a('0x5a')][_0x477a('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x6363e4[_0x477a('0x57')]['id'],'UserId':null}})[_0x477a('0x23')](handleEntityNotFound(_0x4c60ed,null))[_0x477a('0x23')](function(_0x1f4f68){if(_0x1f4f68){_0x5798c4[_0x477a('0x29')]=_0x1f4f68[_0x477a('0x6a')]({'plain':!![]});return db[_0x477a('0x78')][_0x477a('0x58')]({'where':{'id':_0x1f4f68[_0x477a('0x66')]}});}return null;})[_0x477a('0x23')](handleEntityNotFound(_0x4c60ed,null))['then'](function(_0x50a78b){if(_0x50a78b){_0x5798c4[_0x477a('0x69')]=_0x50a78b['get']({'plain':!![]});interaction_log[_0x477a('0x2a')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x6363e4[_0x477a('0x62')]['id'],_0x6363e4['user'][_0x477a('0x3c')],_0x6363e4[_0x477a('0x62')]['role'],_0x5798c4[_0x477a('0x69')]['id'],_0x6363e4[_0x477a('0x5a')]?JSON['stringify'](_0x6363e4[_0x477a('0x5a')]):_0x477a('0x6d'));return respondWithRpcPromise(_0x477a('0x79'),'rejectMessage',_0x5798c4);}return null;})['then'](function(_0x37039c){if(_0x37039c){_0x37039c[_0x477a('0x29')][_0x477a('0x70')]=util['format'](_0x477a('0x71'),_0x6363e4['user'][_0x477a('0x3c')]);_0x37039c[_0x477a('0x29')]['channel']=_0x5798c4['channel'];_0x37039c[_0x477a('0x29')][_0x477a('0x73')]=_0x477a('0x36');respondWithRpcPromise(_0x477a('0x75'),'EventManager',{'event':_0x477a('0x7a'),'message':_0x37039c[_0x477a('0x29')]},client9002);return _0x5798c4;}return null;})[_0x477a('0x23')](respondWithResult(_0x4c60ed,null))[_0x477a('0x2c')](handleError(_0x4c60ed,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 4d24b5b..e922337 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 _0xd02b=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xd02b,0x148));var _0xbd02=function(_0x5ecf3a,_0x2efd35){_0x5ecf3a=_0x5ecf3a-0x0;var _0x176611=_0xd02b[_0x5ecf3a];return _0x176611;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xbd02('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbd02('0x1')](0x0);var events={'afterCreate':_0xbd02('0x2'),'afterUpdate':_0xbd02('0x3'),'afterDestroy':_0xbd02('0x4')};function emitEvent(_0x22ee4d){return function(_0x12f1b5,_0x472b19,_0x301249){ChatMessageEvents[_0xbd02('0x5')](_0x22ee4d+':'+_0x12f1b5['id'],_0x12f1b5);ChatMessageEvents[_0xbd02('0x5')](_0x22ee4d,_0x12f1b5);_0x301249(null);};}for(var e in events){if(events[_0xbd02('0x6')](e)){var event=events[e];ChatMessage[_0xbd02('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xf241=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5657c1,_0x11a1fd){var _0x890744=function(_0x30ac4e){while(--_0x30ac4e){_0x5657c1['push'](_0x5657c1['shift']());}};_0x890744(++_0x11a1fd);}(_0xf241,0x14b));var _0x1f24=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf241[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x1f24('0x0'));var ChatMessage=require(_0x1f24('0x1'))['db'][_0x1f24('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1f24('0x3')](0x0);var events={'afterCreate':_0x1f24('0x4'),'afterUpdate':_0x1f24('0x5'),'afterDestroy':_0x1f24('0x6')};function emitEvent(_0x54f3ed){return function(_0x338f6f,_0x4f5dba,_0x529894){ChatMessageEvents[_0x1f24('0x7')](_0x54f3ed+':'+_0x338f6f['id'],_0x338f6f);ChatMessageEvents['emit'](_0x54f3ed,_0x338f6f);_0x529894(null);};}for(var e in events){if(events[_0x1f24('0x8')](e)){var event=events[e];ChatMessage[_0x1f24('0x9')](e,emitEvent(event));}}module[_0x1f24('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 5e46355..fd1965c 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 _0xf006=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','path','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xf006,0x146));var _0x6f00=function(_0x5ccb93,_0x2455a5){_0x5ccb93=_0x5ccb93-0x0;var _0x7cbacf=_0xf006[_0x5ccb93];return _0x7cbacf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('ChatMessage',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[{'name':_0x6f00('0x8'),'fields':[_0x6f00('0x9')],'type':_0x6f00('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x286d32,_0x3001c6,_0x44b63c){var _0x1e0720=_0x141e71[_0x6f00('0xb')];var _0x3e6a41=_0x286d32[_0x6f00('0xc')]({'plain':!![]});if(_0x3e6a41[_0x6f00('0xd')][_0x6f00('0xe')]()==='in'||_0x3e6a41['direction'][_0x6f00('0xe')]()===_0x6f00('0xf')&&!_0x3e6a41[_0x6f00('0x10')]&&!_[_0x6f00('0x11')](_0x3e6a41[_0x6f00('0x12')])){_0x1e0720['ChatInteraction'][_0x6f00('0x13')]({'where':{'id':_0x3e6a41['ChatInteractionId']}})[_0x6f00('0x14')](function(_0x5047f5){if(_0x5047f5){_0x5047f5[_0x6f00('0x15')]({'lastMsgAt':_0x3e6a41[_0x6f00('0x16')],'lastMsgDirection':_0x3e6a41[_0x6f00('0xd')][_0x6f00('0xe')]()});}})[_0x6f00('0x17')](function(_0x411203){console[_0x6f00('0x18')](_0x411203);});}_0x44b63c();}},'charset':_0x6f00('0x19'),'collate':_0x6f00('0x1a')});};
\ No newline at end of file
+var _0x5fd1=['fti_chat_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','findOne','update','createdAt','catch','error','utf8mb4','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatMessage'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5fd1,0x155));var _0x15fd=function(_0x2e71df,_0xe3a95e){_0x2e71df=_0x2e71df-0x0;var _0x257fe6=_0x5fd1[_0x2e71df];return _0x257fe6;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./chatMessage.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x15fd('0xa'),'fields':[_0x15fd('0xb')],'type':_0x15fd('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c861f,_0x2d2fbb,_0x5c9c63){var _0x3dfdbb=_0x386441[_0x15fd('0xd')];var _0x4c226a=_0x4c861f['get']({'plain':!![]});if(_0x4c226a['direction'][_0x15fd('0xe')]()==='in'||_0x4c226a[_0x15fd('0xf')][_0x15fd('0xe')]()===_0x15fd('0x10')&&!_0x4c226a[_0x15fd('0x11')]&&!_[_0x15fd('0x12')](_0x4c226a[_0x15fd('0x13')])){_0x3dfdbb[_0x15fd('0x14')][_0x15fd('0x15')]({'where':{'id':_0x4c226a['ChatInteractionId']}})['then'](function(_0x5784a3){if(_0x5784a3){_0x5784a3[_0x15fd('0x16')]({'lastMsgAt':_0x4c226a[_0x15fd('0x17')],'lastMsgDirection':_0x4c226a[_0x15fd('0xf')][_0x15fd('0xe')]()});}})[_0x15fd('0x18')](function(_0x2ffa03){console[_0x15fd('0x19')](_0x2ffa03);});}_0x5c9c63();}},'charset':_0x15fd('0x1a'),'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 6ce9ef2..2abf0ae 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 _0x5b69=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','CreateChatMessage','ChatMessage','body','options','raw','stringify','lodash','util','bluebird'];(function(_0x5ce2b9,_0x31f8ff){var _0x70b5c1=function(_0x2058a4){while(--_0x2058a4){_0x5ce2b9['push'](_0x5ce2b9['shift']());}};_0x70b5c1(++_0x31f8ff);}(_0x5b69,0x15b));var _0x95b6=function(_0xe2c665,_0x5467a0){_0xe2c665=_0xe2c665-0x0;var _0x5bcbb7=_0x5b69[_0xe2c665];return _0x5bcbb7;};'use strict';var _=require(_0x95b6('0x0'));var util=require(_0x95b6('0x1'));var moment=require('moment');var BPromise=require(_0x95b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95b6('0x3'));var db=require(_0x95b6('0x4'))['db'];var utils=require(_0x95b6('0x5'));var logger=require(_0x95b6('0x6'))(_0x95b6('0x7'));var config=require(_0x95b6('0x8'));var jayson=require(_0x95b6('0x9'));var client=jayson[_0x95b6('0xa')][_0x95b6('0xb')]({'port':0x232a});config['redis']=_[_0x95b6('0xc')](config[_0x95b6('0xd')],{'host':_0x95b6('0xe'),'port':0x18eb});var socket=require(_0x95b6('0xf'))(new Redis(config[_0x95b6('0xd')]));require(_0x95b6('0x10'))[_0x95b6('0x11')](socket);function respondWithRpcPromise(_0x253f22,_0x3e9f7e,_0x44209d){return new BPromise(function(_0x185df9,_0x36a44b){return client['request'](_0x253f22,_0x44209d)[_0x95b6('0x12')](function(_0x4483a7){logger[_0x95b6('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3e9f7e,'request\x20sent');logger[_0x95b6('0x14')](_0x95b6('0x15'),_0x3e9f7e,_0x95b6('0x16'),JSON['stringify'](_0x4483a7));if(_0x4483a7[_0x95b6('0x17')]){if(_0x4483a7[_0x95b6('0x17')][_0x95b6('0x18')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3e9f7e,_0x4483a7['error'][_0x95b6('0x19')]);return _0x36a44b(_0x4483a7[_0x95b6('0x17')][_0x95b6('0x19')]);}logger[_0x95b6('0x17')](_0x95b6('0x1a'),_0x3e9f7e,_0x4483a7[_0x95b6('0x17')]['message']);return _0x185df9(_0x4483a7[_0x95b6('0x17')][_0x95b6('0x19')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3e9f7e,'request\x20sent');_0x185df9(_0x4483a7[_0x95b6('0x1b')][_0x95b6('0x19')]);}})[_0x95b6('0x1c')](function(_0xeaab74){logger[_0x95b6('0x17')](_0x95b6('0x1a'),_0x3e9f7e,_0xeaab74);_0x36a44b(_0xeaab74);});});}exports[_0x95b6('0x1d')]=function(_0x353355){var _0x404981=this;return new Promise(function(_0x1dfe00,_0x5f29ad){return db[_0x95b6('0x1e')]['create'](_0x353355[_0x95b6('0x1f')],{'raw':_0x353355[_0x95b6('0x20')]?_0x353355[_0x95b6('0x20')][_0x95b6('0x21')]===undefined?!![]:![]:!![]})[_0x95b6('0x12')](function(_0x4fbe8a){logger[_0x95b6('0x13')]('CreateChatMessage',_0x353355);logger['debug'](_0x95b6('0x1d'),_0x353355,JSON[_0x95b6('0x22')](_0x4fbe8a));_0x1dfe00(_0x4fbe8a);})[_0x95b6('0x1c')](function(_0x3b31ae){logger[_0x95b6('0x17')]('CreateChatMessage',_0x3b31ae['message'],_0x353355);_0x5f29ad(_0x404981[_0x95b6('0x17')](0x1f4,_0x3b31ae['message']));});});};
\ No newline at end of file
+var _0x1e63=['ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ChatMessage','body','options','raw','then','CreateChatMessage','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','info'];(function(_0x27cbfc,_0x20c4d5){var _0x4616c6=function(_0x15b5c8){while(--_0x15b5c8){_0x27cbfc['push'](_0x27cbfc['shift']());}};_0x4616c6(++_0x20c4d5);}(_0x1e63,0xb0));var _0x31e6=function(_0x29da65,_0xdcbf95){_0x29da65=_0x29da65-0x0;var _0x241a9b=_0x1e63[_0x29da65];return _0x241a9b;};'use strict';var _=require('lodash');var util=require(_0x31e6('0x0'));var moment=require('moment');var BPromise=require(_0x31e6('0x1'));var rs=require(_0x31e6('0x2'));var fs=require('fs');var Redis=require(_0x31e6('0x3'));var db=require(_0x31e6('0x4'))['db'];var utils=require(_0x31e6('0x5'));var logger=require(_0x31e6('0x6'))('rpc');var config=require(_0x31e6('0x7'));var jayson=require(_0x31e6('0x8'));var client=jayson['client'][_0x31e6('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x31e6('0xa')],{'host':_0x31e6('0xb'),'port':0x18eb});var socket=require(_0x31e6('0xc'))(new Redis(config[_0x31e6('0xa')]));require(_0x31e6('0xd'))[_0x31e6('0xe')](socket);function respondWithRpcPromise(_0x3db954,_0xb7bb5d,_0x46b814){return new BPromise(function(_0xffadd8,_0x4c360e){return client['request'](_0x3db954,_0x46b814)['then'](function(_0x1896da){logger[_0x31e6('0xf')](_0x31e6('0x10'),_0xb7bb5d,'request\x20sent');logger[_0x31e6('0x11')](_0x31e6('0x12'),_0xb7bb5d,_0x31e6('0x13'),JSON['stringify'](_0x1896da));if(_0x1896da['error']){if(_0x1896da[_0x31e6('0x14')][_0x31e6('0x15')]===0x1f4){logger[_0x31e6('0x14')](_0x31e6('0x10'),_0xb7bb5d,_0x1896da[_0x31e6('0x14')][_0x31e6('0x16')]);return _0x4c360e(_0x1896da[_0x31e6('0x14')][_0x31e6('0x16')]);}logger[_0x31e6('0x14')](_0x31e6('0x10'),_0xb7bb5d,_0x1896da[_0x31e6('0x14')]['message']);return _0xffadd8(_0x1896da[_0x31e6('0x14')][_0x31e6('0x16')]);}else{logger['info'](_0x31e6('0x10'),_0xb7bb5d,_0x31e6('0x13'));_0xffadd8(_0x1896da[_0x31e6('0x17')]['message']);}})[_0x31e6('0x18')](function(_0x5b9850){logger[_0x31e6('0x14')]('ChatMessage,\x20%s,\x20%s',_0xb7bb5d,_0x5b9850);_0x4c360e(_0x5b9850);});});}exports['CreateChatMessage']=function(_0x1538a7){var _0x35fd53=this;return new Promise(function(_0x24a378,_0x565ace){return db[_0x31e6('0x19')]['create'](_0x1538a7[_0x31e6('0x1a')],{'raw':_0x1538a7[_0x31e6('0x1b')]?_0x1538a7[_0x31e6('0x1b')][_0x31e6('0x1c')]===undefined?!![]:![]:!![]})[_0x31e6('0x1d')](function(_0x4b89d6){logger['info'](_0x31e6('0x1e'),_0x1538a7);logger['debug'](_0x31e6('0x1e'),_0x1538a7,JSON[_0x31e6('0x1f')](_0x4b89d6));_0x24a378(_0x4b89d6);})[_0x31e6('0x18')](function(_0x307983){logger[_0x31e6('0x14')](_0x31e6('0x1e'),_0x307983[_0x31e6('0x16')],_0x1538a7);_0x565ace(_0x35fd53['error'](0x1f4,_0x307983[_0x31e6('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 93a5fa1..d36d128 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 _0xd8fb=['./chatMessage.events','save','remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0xebe37,_0x1ef514){var _0x1e492f=function(_0x4ad8cd){while(--_0x4ad8cd){_0xebe37['push'](_0xebe37['shift']());}};_0x1e492f(++_0x1ef514);}(_0xd8fb,0x99));var _0xbd8f=function(_0x111da3,_0x15faec){_0x111da3=_0x111da3-0x0;var _0x2c74c1=_0xd8fb[_0x111da3];return _0x2c74c1;};'use strict';var ChatMessageEvents=require(_0xbd8f('0x0'));var events=[_0xbd8f('0x1'),_0xbd8f('0x2'),_0xbd8f('0x3')];function createListener(_0x52724c,_0x5ea933){return function(_0x4e9545){_0x5ea933[_0xbd8f('0x4')](_0x52724c,_0x4e9545);};}function removeListener(_0x43d177,_0x53cccc){return function(){ChatMessageEvents[_0xbd8f('0x5')](_0x43d177,_0x53cccc);};}exports[_0xbd8f('0x6')]=function(_0x5543b2){for(var _0x33d541=0x0,_0x4e97cf=events[_0xbd8f('0x7')];_0x33d541<_0x4e97cf;_0x33d541++){var _0x578499=events[_0x33d541];var _0x197827=createListener(_0xbd8f('0x8')+_0x578499,_0x5543b2);ChatMessageEvents['on'](_0x578499,_0x197827);}};
\ No newline at end of file
+var _0xba34=['chatMessage:','./chatMessage.events','save','remove','update','removeListener','register'];(function(_0x58cbb9,_0x57ad6b){var _0x433c53=function(_0x4be101){while(--_0x4be101){_0x58cbb9['push'](_0x58cbb9['shift']());}};_0x433c53(++_0x57ad6b);}(_0xba34,0x119));var _0x4ba3=function(_0x4c4b4d,_0x459430){_0x4c4b4d=_0x4c4b4d-0x0;var _0xccfb6c=_0xba34[_0x4c4b4d];return _0xccfb6c;};'use strict';var ChatMessageEvents=require(_0x4ba3('0x0'));var events=[_0x4ba3('0x1'),_0x4ba3('0x2'),_0x4ba3('0x3')];function createListener(_0xeb0ac4,_0x4d6e75){return function(_0x5aa88e){_0x4d6e75['emit'](_0xeb0ac4,_0x5aa88e);};}function removeListener(_0x4592fc,_0x2947f2){return function(){ChatMessageEvents[_0x4ba3('0x4')](_0x4592fc,_0x2947f2);};}exports[_0x4ba3('0x5')]=function(_0x3590a1){for(var _0xb88621=0x0,_0xe5f99a=events['length'];_0xb88621<_0xe5f99a;_0xb88621++){var _0x6254fb=events[_0xb88621];var _0x368eee=createListener(_0x4ba3('0x6')+_0x6254fb,_0x3590a1);ChatMessageEvents['on'](_0x6254fb,_0x368eee);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 37304bd..4158c1b 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 _0x878f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','/describe','/:id','post','isAuthenticated','tracked','chatmessage:create','create','put','/:id/accept','/:id/reject','delete','util','path','connect-timeout'];(function(_0x38662b,_0x207ae1){var _0x55f4d7=function(_0x37b7c9){while(--_0x37b7c9){_0x38662b['push'](_0x38662b['shift']());}};_0x55f4d7(++_0x207ae1);}(_0x878f,0x173));var _0xf878=function(_0x5487bb,_0x117bd7){_0x5487bb=_0x5487bb-0x0;var _0x3b929e=_0x878f[_0x5487bb];return _0x3b929e;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),interaction[_0xf878('0xf')]('chat',_0xf878('0x10')),controller[_0xf878('0x11')]);router['put'](_0xf878('0xc'),controller['update']);router[_0xf878('0x12')](_0xf878('0x13'),auth[_0xf878('0xe')](),controller['accept']);router[_0xf878('0x12')](_0xf878('0x14'),auth[_0xf878('0xe')](),controller['reject']);router[_0xf878('0x15')](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0db9=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put'];(function(_0x4614e8,_0x6ff01f){var _0xbc235d=function(_0x222d05){while(--_0x222d05){_0x4614e8['push'](_0x4614e8['shift']());}};_0xbc235d(++_0x6ff01f);}(_0x0db9,0xa3));var _0x90db=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0x0db9[_0x289a67];return _0x572b49;};'use strict';var multer=require(_0x90db('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x90db('0x1'));var router=express[_0x90db('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x90db('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x90db('0x4'));var controller=require(_0x90db('0x5'));router['get']('/',auth[_0x90db('0x6')](),controller[_0x90db('0x7')]);router[_0x90db('0x8')](_0x90db('0x9'),auth[_0x90db('0x6')](),controller[_0x90db('0xa')]);router['get'](_0x90db('0xb'),auth[_0x90db('0x6')](),controller[_0x90db('0xc')]);router[_0x90db('0xd')]('/',auth[_0x90db('0x6')](),interaction[_0x90db('0xe')](_0x90db('0xf'),_0x90db('0x10')),controller[_0x90db('0x11')]);router[_0x90db('0x12')](_0x90db('0xb'),controller['update']);router[_0x90db('0x12')](_0x90db('0x13'),auth[_0x90db('0x6')](),controller[_0x90db('0x14')]);router[_0x90db('0x12')](_0x90db('0x15'),auth[_0x90db('0x6')](),controller[_0x90db('0x16')]);router[_0x90db('0x17')](_0x90db('0xb'),auth[_0x90db('0x6')](),controller[_0x90db('0x18')]);module[_0x90db('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 902759d..527a768 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 _0x49cf=['exports','medium'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x49cf,0x134));var _0xf49c=function(_0x5179a9,_0x113275){_0x5179a9=_0x5179a9-0x0;var _0x2a6a02=_0x49cf[_0x5179a9];return _0x2a6a02;};'use strict';var Sequelize=require('sequelize');module[_0xf49c('0x0')]={'body':{'type':Sequelize['TEXT'](_0xf49c('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x3833=['sequelize','TEXT','medium'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3833,0xd2));var _0x3383=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x3833[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require(_0x3383('0x0'));module['exports']={'body':{'type':Sequelize[_0x3383('0x1')](_0x3383('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 18932ae..668a1cd 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 _0x043b=['destroy','sendStatus','error','name','send','index','map','ChatOfflineMessage','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','create','body','Attachment','findAll','forEach','join','files','attachments','offline-chat','basename','existsSync','remove','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','count','offset','limit','Content-Range','json','apply','reject','update','then'];(function(_0x52fb98,_0x53e6f4){var _0x5e1098=function(_0x28ef9b){while(--_0x28ef9b){_0x52fb98['push'](_0x52fb98['shift']());}};_0x5e1098(++_0x53e6f4);}(_0x043b,0xd5));var _0xb043=function(_0x1d9b95,_0x19918e){_0x1d9b95=_0x1d9b95-0x0;var _0x53321d=_0x043b[_0x1d9b95];return _0x53321d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb043('0x0'));var zipdir=require(_0xb043('0x1'));var jsonpatch=require(_0xb043('0x2'));var rp=require(_0xb043('0x3'));var moment=require(_0xb043('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb043('0x5'));var util=require(_0xb043('0x6'));var path=require(_0xb043('0x7'));var sox=require(_0xb043('0x8'));var csv=require('to-csv');var ejs=require(_0xb043('0x9'));var fs=require('fs');var fs_extra=require(_0xb043('0xa'));var _=require(_0xb043('0xb'));var squel=require(_0xb043('0xc'));var crypto=require(_0xb043('0xd'));var jsforce=require(_0xb043('0xe'));var deskjs=require(_0xb043('0xf'));var toCsv=require(_0xb043('0x10'));var querystring=require(_0xb043('0x11'));var Papa=require(_0xb043('0x12'));var Redis=require('ioredis');var authService=require(_0xb043('0x13'));var qs=require(_0xb043('0x14'));var as=require(_0xb043('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb043('0x16'))(_0xb043('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb043('0x18'));var db=require(_0xb043('0x19'))['db'];function respondWithStatusCode(_0x4dc147,_0x14cfd1){_0x14cfd1=_0x14cfd1||0xcc;return function(_0x2977be){if(_0x2977be){return _0x4dc147['sendStatus'](_0x14cfd1);}return _0x4dc147['status'](_0x14cfd1)['end']();};}function respondWithResult(_0x1f1c16,_0x2b0aa3){_0x2b0aa3=_0x2b0aa3||0xc8;return function(_0x3dc40f){if(_0x3dc40f){return _0x1f1c16[_0xb043('0x1a')](_0x2b0aa3)['json'](_0x3dc40f);}};}function respondWithFilteredResult(_0x50505a,_0x2ee63a){return function(_0x25b38d){if(_0x25b38d){var _0x20faee=_0x25b38d[_0xb043('0x1b')],_0x1f9f0d=_0x2ee63a[_0xb043('0x1c')],_0x67af5=_0x2ee63a[_0xb043('0x1c')]+_0x2ee63a[_0xb043('0x1d')],_0x3f6d55;if(_0x67af5>=_0x20faee){_0x67af5=_0x20faee;_0x3f6d55=0xc8;}else{_0x3f6d55=0xce;}_0x50505a['status'](_0x3f6d55);return _0x50505a['set'](_0xb043('0x1e'),_0x1f9f0d+'-'+_0x67af5+'/'+_0x20faee)[_0xb043('0x1f')](_0x25b38d);}return null;};}function patchUpdates(_0x23e39a){return function(_0x11c4ed){try{jsonpatch[_0xb043('0x20')](_0x11c4ed,_0x23e39a,!![]);}catch(_0xbac9f7){return BPromise[_0xb043('0x21')](_0xbac9f7);}return _0x11c4ed['save']();};}function saveUpdates(_0xd6ec0c,_0x3ce815){return function(_0x4719ca){if(_0x4719ca){return _0x4719ca[_0xb043('0x22')](_0xd6ec0c)[_0xb043('0x23')](function(_0x40a10b){return _0x40a10b;});}return null;};}function removeEntity(_0x3d200d,_0x4f11d4){return function(_0x5c558c){if(_0x5c558c){return _0x5c558c[_0xb043('0x24')]()[_0xb043('0x23')](function(){_0x3d200d[_0xb043('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26a777,_0x5029da){return function(_0x1c1e18){if(!_0x1c1e18){_0x26a777[_0xb043('0x25')](0x194);}return _0x1c1e18;};}function handleError(_0x47efe4,_0x484581){_0x484581=_0x484581||0x1f4;return function(_0x47e8d3){logger[_0xb043('0x26')](_0x47e8d3['stack']);if(_0x47e8d3[_0xb043('0x27')]){delete _0x47e8d3['name'];}_0x47efe4[_0xb043('0x1a')](_0x484581)[_0xb043('0x28')](_0x47e8d3);};}exports[_0xb043('0x29')]=function(_0x5a8bf8,_0x4570b4){var _0x3cc770={},_0x1aea1f={},_0x278f4f={'count':0x0,'rows':[]};var _0x479e25=_[_0xb043('0x2a')](db[_0xb043('0x2b')]['rawAttributes'],function(_0x2d5d83){return{'name':_0x2d5d83[_0xb043('0x2c')],'type':_0x2d5d83[_0xb043('0x2d')][_0xb043('0x2e')]};});_0x1aea1f[_0xb043('0x2f')]=_[_0xb043('0x2a')](_0x479e25,_0xb043('0x27'));_0x1aea1f[_0xb043('0x30')]=_[_0xb043('0x31')](_0x5a8bf8[_0xb043('0x30')]);_0x1aea1f[_0xb043('0x32')]=_['intersection'](_0x1aea1f[_0xb043('0x2f')],_0x1aea1f[_0xb043('0x30')]);_0x3cc770[_0xb043('0x33')]=_[_0xb043('0x34')](_0x1aea1f[_0xb043('0x2f')],qs[_0xb043('0x35')](_0x5a8bf8[_0xb043('0x30')]['fields']));_0x3cc770[_0xb043('0x33')]=_0x3cc770[_0xb043('0x33')]['length']?_0x3cc770[_0xb043('0x33')]:_0x1aea1f[_0xb043('0x2f')];if(!_0x5a8bf8[_0xb043('0x30')][_0xb043('0x36')](_0xb043('0x37'))){_0x3cc770['limit']=qs[_0xb043('0x1d')](_0x5a8bf8[_0xb043('0x30')]['limit']);_0x3cc770[_0xb043('0x1c')]=qs[_0xb043('0x1c')](_0x5a8bf8[_0xb043('0x30')][_0xb043('0x1c')]);}_0x3cc770['order']=qs[_0xb043('0x38')](_0x5a8bf8['query']['sort']);_0x3cc770[_0xb043('0x39')]=qs[_0xb043('0x32')](_[_0xb043('0x3a')](_0x5a8bf8[_0xb043('0x30')],_0x1aea1f[_0xb043('0x32')]),_0x479e25);if(_0x5a8bf8[_0xb043('0x30')][_0xb043('0x3b')]){_0x3cc770['where']=_[_0xb043('0x3c')](_0x3cc770[_0xb043('0x39')],{'$or':_[_0xb043('0x2a')](_0x479e25,function(_0x293fbd){if(_0x293fbd[_0xb043('0x2d')]!==_0xb043('0x3d')){var _0x2246f6={};_0x2246f6[_0x293fbd['name']]={'$like':'%'+_0x5a8bf8['query'][_0xb043('0x3b')]+'%'};return _0x2246f6;}})});}_0x3cc770=_[_0xb043('0x3c')]({},_0x3cc770,_0x5a8bf8[_0xb043('0x3e')]);var _0x1de540={'where':_0x3cc770[_0xb043('0x39')]};return db['ChatOfflineMessage']['count'](_0x1de540)[_0xb043('0x23')](function(_0x3723e3){_0x278f4f[_0xb043('0x1b')]=_0x3723e3;if(_0x5a8bf8['query'][_0xb043('0x3f')]){_0x3cc770['include']=[{'all':!![]}];}return db['ChatOfflineMessage']['findAll'](_0x3cc770);})[_0xb043('0x23')](function(_0x3ed9d2){_0x278f4f[_0xb043('0x40')]=_0x3ed9d2;return _0x278f4f;})[_0xb043('0x23')](respondWithFilteredResult(_0x4570b4,_0x3cc770))[_0xb043('0x41')](handleError(_0x4570b4,null));};exports[_0xb043('0x42')]=function(_0x25d19a,_0x77fd6b){var _0x3ce0fa={'raw':!![],'where':{'id':_0x25d19a[_0xb043('0x43')]['id']}},_0x17e5ef={};_0x17e5ef[_0xb043('0x2f')]=_['keys'](db[_0xb043('0x2b')]['rawAttributes']);_0x17e5ef[_0xb043('0x30')]=_[_0xb043('0x31')](_0x25d19a['query']);_0x17e5ef[_0xb043('0x32')]=_[_0xb043('0x34')](_0x17e5ef[_0xb043('0x2f')],_0x17e5ef[_0xb043('0x30')]);_0x3ce0fa[_0xb043('0x33')]=_[_0xb043('0x34')](_0x17e5ef[_0xb043('0x2f')],qs['fields'](_0x25d19a[_0xb043('0x30')][_0xb043('0x35')]));_0x3ce0fa['attributes']=_0x3ce0fa['attributes'][_0xb043('0x44')]?_0x3ce0fa[_0xb043('0x33')]:_0x17e5ef[_0xb043('0x2f')];if(_0x25d19a[_0xb043('0x30')][_0xb043('0x3f')]){_0x3ce0fa[_0xb043('0x45')]=[{'all':!![]}];}_0x3ce0fa=_[_0xb043('0x3c')]({},_0x3ce0fa,_0x25d19a[_0xb043('0x3e')]);return db['ChatOfflineMessage']['find'](_0x3ce0fa)[_0xb043('0x23')](handleEntityNotFound(_0x77fd6b,null))[_0xb043('0x23')](respondWithResult(_0x77fd6b,null))[_0xb043('0x41')](handleError(_0x77fd6b,null));};exports[_0xb043('0x46')]=function(_0x1c7c81,_0x35a872){return db['ChatOfflineMessage'][_0xb043('0x46')](_0x1c7c81[_0xb043('0x47')],{})[_0xb043('0x23')](respondWithResult(_0x35a872,0xc9))[_0xb043('0x41')](handleError(_0x35a872,null));};exports[_0xb043('0x22')]=function(_0x193ad8,_0x36c129){if(_0x193ad8[_0xb043('0x47')]['id']){delete _0x193ad8[_0xb043('0x47')]['id'];}return db['ChatOfflineMessage']['find']({'where':{'id':_0x193ad8[_0xb043('0x43')]['id']}})[_0xb043('0x23')](handleEntityNotFound(_0x36c129,null))[_0xb043('0x23')](saveUpdates(_0x193ad8['body'],null))['then'](respondWithResult(_0x36c129,null))[_0xb043('0x41')](handleError(_0x36c129,null));};exports[_0xb043('0x24')]=function(_0xff007e,_0x4c8958){return db[_0xb043('0x48')][_0xb043('0x49')]({'where':{'ChatOfflineMessageId':_0xff007e['params']['id']},'raw':!![]})[_0xb043('0x23')](function(_0x4c435a){_0x4c435a[_0xb043('0x4a')](function(_0x41ffde){var _0x67586e=path[_0xb043('0x4b')](config['root'],'server',_0xb043('0x4c'),_0xb043('0x4d'),_0xb043('0x4e'),_0x41ffde[_0xb043('0x4f')]);var _0x4d93bb=fs[_0xb043('0x50')](_0x67586e);if(_0x4d93bb)fs_extra[_0xb043('0x51')](_0x67586e);});})['then'](function(){return db[_0xb043('0x2b')]['find']({'where':{'id':_0xff007e[_0xb043('0x43')]['id']},'individualHooks':!![]});})[_0xb043('0x23')](handleEntityNotFound(_0x4c8958,null))[_0xb043('0x23')](removeEntity(_0x4c8958,null))[_0xb043('0x41')](handleError(_0x4c8958,null));};exports['describe']=function(_0x5c729e,_0x22df01){return db[_0xb043('0x2b')][_0xb043('0x52')]()[_0xb043('0x23')](respondWithResult(_0x22df01,null))['catch'](handleError(_0x22df01,null));};
\ No newline at end of file
+var _0x2b43=['options','includeAll','include','findAll','show','params','catch','create','body','find','Attachment','forEach','join','root','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','ChatOfflineMessage','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x48a2e2,_0x46d3a5){var _0xcc3349=function(_0x232fa0){while(--_0x232fa0){_0x48a2e2['push'](_0x48a2e2['shift']());}};_0xcc3349(++_0x46d3a5);}(_0x2b43,0x66));var _0x32b4=function(_0x3199af,_0x339560){_0x3199af=_0x3199af-0x0;var _0x5aa4d0=_0x2b43[_0x3199af];return _0x5aa4d0;};'use strict';var emlformat=require(_0x32b4('0x0'));var rimraf=require(_0x32b4('0x1'));var zipdir=require(_0x32b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b4('0x3'));var moment=require(_0x32b4('0x4'));var BPromise=require(_0x32b4('0x5'));var Mustache=require(_0x32b4('0x6'));var util=require('util');var path=require(_0x32b4('0x7'));var sox=require(_0x32b4('0x8'));var csv=require('to-csv');var ejs=require(_0x32b4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x32b4('0xa'));var crypto=require(_0x32b4('0xb'));var jsforce=require(_0x32b4('0xc'));var deskjs=require(_0x32b4('0xd'));var toCsv=require(_0x32b4('0xe'));var querystring=require('querystring');var Papa=require(_0x32b4('0xf'));var Redis=require(_0x32b4('0x10'));var authService=require(_0x32b4('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32b4('0x12'));var logger=require(_0x32b4('0x13'))(_0x32b4('0x14'));var utils=require(_0x32b4('0x15'));var config=require(_0x32b4('0x16'));var licenseUtil=require(_0x32b4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dec51,_0x6c18e4){_0x6c18e4=_0x6c18e4||0xcc;return function(_0x1e26d1){if(_0x1e26d1){return _0x2dec51[_0x32b4('0x18')](_0x6c18e4);}return _0x2dec51[_0x32b4('0x19')](_0x6c18e4)[_0x32b4('0x1a')]();};}function respondWithResult(_0xb1f5fc,_0x46c198){_0x46c198=_0x46c198||0xc8;return function(_0x5a95aa){if(_0x5a95aa){return _0xb1f5fc[_0x32b4('0x19')](_0x46c198)[_0x32b4('0x1b')](_0x5a95aa);}};}function respondWithFilteredResult(_0x3550fb,_0x28fc8c){return function(_0x4836db){if(_0x4836db){var _0x1c5f5b=_0x4836db[_0x32b4('0x1c')],_0x14a1c8=_0x28fc8c['offset'],_0x653d81=_0x28fc8c['offset']+_0x28fc8c['limit'],_0x4e7fb6;if(_0x653d81>=_0x1c5f5b){_0x653d81=_0x1c5f5b;_0x4e7fb6=0xc8;}else{_0x4e7fb6=0xce;}_0x3550fb['status'](_0x4e7fb6);return _0x3550fb[_0x32b4('0x1d')](_0x32b4('0x1e'),_0x14a1c8+'-'+_0x653d81+'/'+_0x1c5f5b)[_0x32b4('0x1b')](_0x4836db);}return null;};}function patchUpdates(_0x59fe9e){return function(_0x4e8277){try{jsonpatch[_0x32b4('0x1f')](_0x4e8277,_0x59fe9e,!![]);}catch(_0x407138){return BPromise[_0x32b4('0x20')](_0x407138);}return _0x4e8277[_0x32b4('0x21')]();};}function saveUpdates(_0xb870f8,_0x14ad4e){return function(_0x2ef9ec){if(_0x2ef9ec){return _0x2ef9ec[_0x32b4('0x22')](_0xb870f8)[_0x32b4('0x23')](function(_0x7e06a7){return _0x7e06a7;});}return null;};}function removeEntity(_0x2b7a77,_0x4803cd){return function(_0x428d3b){if(_0x428d3b){return _0x428d3b[_0x32b4('0x24')]()[_0x32b4('0x23')](function(){_0x2b7a77['status'](0xcc)[_0x32b4('0x1a')]();});}};}function handleEntityNotFound(_0x55e9db,_0x1eb951){return function(_0x541be6){if(!_0x541be6){_0x55e9db[_0x32b4('0x18')](0x194);}return _0x541be6;};}function handleError(_0x49159f,_0x25a92e){_0x25a92e=_0x25a92e||0x1f4;return function(_0x5dc045){logger['error'](_0x5dc045[_0x32b4('0x25')]);if(_0x5dc045[_0x32b4('0x26')]){delete _0x5dc045[_0x32b4('0x26')];}_0x49159f['status'](_0x25a92e)['send'](_0x5dc045);};}exports['index']=function(_0x583cc8,_0x4cba31){var _0x136382={},_0x5b0087={},_0x2b7624={'count':0x0,'rows':[]};var _0x55c878=_[_0x32b4('0x27')](db[_0x32b4('0x28')][_0x32b4('0x29')],function(_0x38bfa4){return{'name':_0x38bfa4['fieldName'],'type':_0x38bfa4[_0x32b4('0x2a')][_0x32b4('0x2b')]};});_0x5b0087['model']=_[_0x32b4('0x27')](_0x55c878,'name');_0x5b0087[_0x32b4('0x2c')]=_[_0x32b4('0x2d')](_0x583cc8['query']);_0x5b0087['filters']=_[_0x32b4('0x2e')](_0x5b0087[_0x32b4('0x2f')],_0x5b0087[_0x32b4('0x2c')]);_0x136382[_0x32b4('0x30')]=_[_0x32b4('0x2e')](_0x5b0087[_0x32b4('0x2f')],qs[_0x32b4('0x31')](_0x583cc8[_0x32b4('0x2c')][_0x32b4('0x31')]));_0x136382[_0x32b4('0x30')]=_0x136382['attributes'][_0x32b4('0x32')]?_0x136382['attributes']:_0x5b0087['model'];if(!_0x583cc8[_0x32b4('0x2c')][_0x32b4('0x33')](_0x32b4('0x34'))){_0x136382[_0x32b4('0x35')]=qs[_0x32b4('0x35')](_0x583cc8[_0x32b4('0x2c')][_0x32b4('0x35')]);_0x136382[_0x32b4('0x36')]=qs['offset'](_0x583cc8['query'][_0x32b4('0x36')]);}_0x136382['order']=qs[_0x32b4('0x37')](_0x583cc8[_0x32b4('0x2c')][_0x32b4('0x37')]);_0x136382[_0x32b4('0x38')]=qs[_0x32b4('0x39')](_[_0x32b4('0x3a')](_0x583cc8[_0x32b4('0x2c')],_0x5b0087[_0x32b4('0x39')]),_0x55c878);if(_0x583cc8[_0x32b4('0x2c')][_0x32b4('0x3b')]){_0x136382[_0x32b4('0x38')]=_[_0x32b4('0x3c')](_0x136382[_0x32b4('0x38')],{'$or':_[_0x32b4('0x27')](_0x55c878,function(_0x41c47c){if(_0x41c47c[_0x32b4('0x2a')]!==_0x32b4('0x3d')){var _0x4f38b3={};_0x4f38b3[_0x41c47c[_0x32b4('0x26')]]={'$like':'%'+_0x583cc8[_0x32b4('0x2c')][_0x32b4('0x3b')]+'%'};return _0x4f38b3;}})});}_0x136382=_['merge']({},_0x136382,_0x583cc8[_0x32b4('0x3e')]);var _0x583111={'where':_0x136382[_0x32b4('0x38')]};return db[_0x32b4('0x28')]['count'](_0x583111)['then'](function(_0xaa2a2f){_0x2b7624[_0x32b4('0x1c')]=_0xaa2a2f;if(_0x583cc8['query'][_0x32b4('0x3f')]){_0x136382[_0x32b4('0x40')]=[{'all':!![]}];}return db[_0x32b4('0x28')][_0x32b4('0x41')](_0x136382);})[_0x32b4('0x23')](function(_0x54a434){_0x2b7624['rows']=_0x54a434;return _0x2b7624;})[_0x32b4('0x23')](respondWithFilteredResult(_0x4cba31,_0x136382))['catch'](handleError(_0x4cba31,null));};exports[_0x32b4('0x42')]=function(_0x56698d,_0xba7648){var _0x2a48aa={'raw':!![],'where':{'id':_0x56698d[_0x32b4('0x43')]['id']}},_0x566ac1={};_0x566ac1[_0x32b4('0x2f')]=_[_0x32b4('0x2d')](db['ChatOfflineMessage'][_0x32b4('0x29')]);_0x566ac1[_0x32b4('0x2c')]=_[_0x32b4('0x2d')](_0x56698d[_0x32b4('0x2c')]);_0x566ac1[_0x32b4('0x39')]=_[_0x32b4('0x2e')](_0x566ac1[_0x32b4('0x2f')],_0x566ac1['query']);_0x2a48aa[_0x32b4('0x30')]=_[_0x32b4('0x2e')](_0x566ac1[_0x32b4('0x2f')],qs[_0x32b4('0x31')](_0x56698d[_0x32b4('0x2c')][_0x32b4('0x31')]));_0x2a48aa['attributes']=_0x2a48aa[_0x32b4('0x30')][_0x32b4('0x32')]?_0x2a48aa['attributes']:_0x566ac1[_0x32b4('0x2f')];if(_0x56698d[_0x32b4('0x2c')][_0x32b4('0x3f')]){_0x2a48aa[_0x32b4('0x40')]=[{'all':!![]}];}_0x2a48aa=_[_0x32b4('0x3c')]({},_0x2a48aa,_0x56698d[_0x32b4('0x3e')]);return db[_0x32b4('0x28')]['find'](_0x2a48aa)[_0x32b4('0x23')](handleEntityNotFound(_0xba7648,null))[_0x32b4('0x23')](respondWithResult(_0xba7648,null))[_0x32b4('0x44')](handleError(_0xba7648,null));};exports[_0x32b4('0x45')]=function(_0x7b4e4b,_0x5f3ce1){return db['ChatOfflineMessage'][_0x32b4('0x45')](_0x7b4e4b['body'],{})[_0x32b4('0x23')](respondWithResult(_0x5f3ce1,0xc9))[_0x32b4('0x44')](handleError(_0x5f3ce1,null));};exports[_0x32b4('0x22')]=function(_0x3acabb,_0x220b2b){if(_0x3acabb['body']['id']){delete _0x3acabb[_0x32b4('0x46')]['id'];}return db[_0x32b4('0x28')][_0x32b4('0x47')]({'where':{'id':_0x3acabb[_0x32b4('0x43')]['id']}})[_0x32b4('0x23')](handleEntityNotFound(_0x220b2b,null))['then'](saveUpdates(_0x3acabb[_0x32b4('0x46')],null))[_0x32b4('0x23')](respondWithResult(_0x220b2b,null))[_0x32b4('0x44')](handleError(_0x220b2b,null));};exports['destroy']=function(_0x1b6db0,_0x1b301b){return db[_0x32b4('0x48')]['findAll']({'where':{'ChatOfflineMessageId':_0x1b6db0[_0x32b4('0x43')]['id']},'raw':!![]})[_0x32b4('0x23')](function(_0x1d3e76){_0x1d3e76[_0x32b4('0x49')](function(_0xf7885c){var _0x45f333=path[_0x32b4('0x4a')](config[_0x32b4('0x4b')],'server',_0x32b4('0x4c'),_0x32b4('0x4d'),'offline-chat',_0xf7885c[_0x32b4('0x4e')]);var _0x425c2c=fs[_0x32b4('0x4f')](_0x45f333);if(_0x425c2c)fs_extra[_0x32b4('0x50')](_0x45f333);});})['then'](function(){return db['ChatOfflineMessage'][_0x32b4('0x47')]({'where':{'id':_0x1b6db0['params']['id']},'individualHooks':!![]});})[_0x32b4('0x23')](handleEntityNotFound(_0x1b301b,null))[_0x32b4('0x23')](removeEntity(_0x1b301b,null))['catch'](handleError(_0x1b301b,null));};exports[_0x32b4('0x51')]=function(_0x3d7952,_0x578fa0){return db['ChatOfflineMessage'][_0x32b4('0x51')]()['then'](respondWithResult(_0x578fa0,null))[_0x32b4('0x44')](handleError(_0x578fa0,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index a60f364..33aedc6 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 _0x524a=['./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x126eeb,_0x2608d7){var _0x5e0435=function(_0x69056e){while(--_0x69056e){_0x126eeb['push'](_0x126eeb['shift']());}};_0x5e0435(++_0x2608d7);}(_0x524a,0xf5));var _0xa524=function(_0x3ae7b9,_0xfcf3e0){_0x3ae7b9=_0x3ae7b9-0x0;var _0x1b8b39=_0x524a[_0x3ae7b9];return _0x1b8b39;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var logger=require(_0xa524('0x2'))(_0xa524('0x3'));var moment=require('moment');var BPromise=require(_0xa524('0x4'));var rp=require(_0xa524('0x5'));var fs=require('fs');var path=require(_0xa524('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa524('0x7'));module[_0xa524('0x8')]=function(_0x16227b,_0x5f472f){return _0x16227b[_0xa524('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0xa524('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa524('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2123=['bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x25da3c,_0x249618){var _0x3e61a2=function(_0x252963){while(--_0x252963){_0x25da3c['push'](_0x25da3c['shift']());}};_0x3e61a2(++_0x249618);}(_0x2123,0x190));var _0x3212=function(_0xd099b9,_0x1ae821){_0xd099b9=_0xd099b9-0x0;var _0x12a5bb=_0x2123[_0xd099b9];return _0x12a5bb;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var logger=require(_0x3212('0x2'))(_0x3212('0x3'));var moment=require(_0x3212('0x4'));var BPromise=require(_0x3212('0x5'));var rp=require(_0x3212('0x6'));var fs=require('fs');var path=require(_0x3212('0x7'));var rimraf=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var attributes=require(_0x3212('0xa'));module[_0x3212('0xb')]=function(_0x5d9d36,_0x3859e4){return _0x5d9d36[_0x3212('0xc')](_0x3212('0xd'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3212('0xe'),'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 e2ed7fd..d7d16e8 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 _0xe7b4=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xa1b5fb,_0x41a2bd){var _0x123597=function(_0x1b3157){while(--_0x1b3157){_0xa1b5fb['push'](_0xa1b5fb['shift']());}};_0x123597(++_0x41a2bd);}(_0xe7b4,0x11f));var _0x4e7b=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe7b4[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x4e7b('0x0'));var util=require(_0x4e7b('0x1'));var moment=require(_0x4e7b('0x2'));var BPromise=require(_0x4e7b('0x3'));var rs=require(_0x4e7b('0x4'));var fs=require('fs');var Redis=require(_0x4e7b('0x5'));var db=require(_0x4e7b('0x6'))['db'];var utils=require(_0x4e7b('0x7'));var logger=require(_0x4e7b('0x8'))(_0x4e7b('0x9'));var config=require(_0x4e7b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4e7b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x148146,_0x5417bb,_0x494d1c){return new BPromise(function(_0x566b2c,_0x224dc1){return client[_0x4e7b('0xc')](_0x148146,_0x494d1c)['then'](function(_0x374532){logger['info'](_0x4e7b('0xd'),_0x5417bb,_0x4e7b('0xe'));logger[_0x4e7b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5417bb,_0x4e7b('0xe'),JSON[_0x4e7b('0x10')](_0x374532));if(_0x374532[_0x4e7b('0x11')]){if(_0x374532[_0x4e7b('0x11')][_0x4e7b('0x12')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5417bb,_0x374532[_0x4e7b('0x11')]['message']);return _0x224dc1(_0x374532[_0x4e7b('0x11')][_0x4e7b('0x13')]);}logger[_0x4e7b('0x11')](_0x4e7b('0xd'),_0x5417bb,_0x374532[_0x4e7b('0x11')][_0x4e7b('0x13')]);return _0x566b2c(_0x374532[_0x4e7b('0x11')][_0x4e7b('0x13')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5417bb,_0x4e7b('0xe'));_0x566b2c(_0x374532[_0x4e7b('0x14')][_0x4e7b('0x13')]);}})[_0x4e7b('0x15')](function(_0x305567){logger['error'](_0x4e7b('0xd'),_0x5417bb,_0x305567);_0x224dc1(_0x305567);});});}
\ No newline at end of file
+var _0x9868=['../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x9868,0x178));var _0x8986=function(_0x3c7e64,_0x2edef3){_0x3c7e64=_0x3c7e64-0x0;var _0x268b16=_0x9868[_0x3c7e64];return _0x268b16;};'use strict';var _=require(_0x8986('0x0'));var util=require(_0x8986('0x1'));var moment=require('moment');var BPromise=require(_0x8986('0x2'));var rs=require(_0x8986('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8986('0x4'))['db'];var utils=require(_0x8986('0x5'));var logger=require(_0x8986('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8986('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25b204,_0x143b21,_0x3e5c2e){return new BPromise(function(_0x42c04b,_0x550509){return client[_0x8986('0x8')](_0x25b204,_0x3e5c2e)[_0x8986('0x9')](function(_0x214c46){logger[_0x8986('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x143b21,'request\x20sent');logger[_0x8986('0xb')](_0x8986('0xc'),_0x143b21,_0x8986('0xd'),JSON[_0x8986('0xe')](_0x214c46));if(_0x214c46[_0x8986('0xf')]){if(_0x214c46[_0x8986('0xf')][_0x8986('0x10')]===0x1f4){logger[_0x8986('0xf')](_0x8986('0x11'),_0x143b21,_0x214c46[_0x8986('0xf')][_0x8986('0x12')]);return _0x550509(_0x214c46[_0x8986('0xf')]['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x143b21,_0x214c46[_0x8986('0xf')][_0x8986('0x12')]);return _0x42c04b(_0x214c46['error'][_0x8986('0x12')]);}else{logger[_0x8986('0xa')](_0x8986('0x11'),_0x143b21,_0x8986('0xd'));_0x42c04b(_0x214c46[_0x8986('0x13')]['message']);}})['catch'](function(_0xba2428){logger[_0x8986('0xf')](_0x8986('0x11'),_0x143b21,_0xba2428);_0x550509(_0xba2428);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d356256..469d750 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 _0x4212=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','delete','multer','util'];(function(_0x590382,_0x4b7279){var _0x329c42=function(_0x26752c){while(--_0x26752c){_0x590382['push'](_0x590382['shift']());}};_0x329c42(++_0x4b7279);}(_0x4212,0x1ae));var _0x2421=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x4212[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x2421('0x0'));var util=require(_0x2421('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2421('0x2'));var router=express['Router']();var fs_extra=require(_0x2421('0x3'));var auth=require(_0x2421('0x4'));var interaction=require(_0x2421('0x5'));var config=require('../../config/environment');var controller=require(_0x2421('0x6'));router[_0x2421('0x7')]('/',auth[_0x2421('0x8')](),controller[_0x2421('0x9')]);router[_0x2421('0x7')](_0x2421('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2421('0x7')](_0x2421('0xb'),auth[_0x2421('0x8')](),controller['show']);router[_0x2421('0xc')]('/',auth[_0x2421('0x8')](),controller[_0x2421('0xd')]);router[_0x2421('0xe')](_0x2421('0xb'),auth[_0x2421('0x8')](),controller['update']);router[_0x2421('0xf')](_0x2421('0xb'),auth[_0x2421('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4604=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x227c59,_0x575c83){var _0x35aeac=function(_0x477179){while(--_0x477179){_0x227c59['push'](_0x227c59['shift']());}};_0x35aeac(++_0x575c83);}(_0x4604,0x1e1));var _0x4460=function(_0xea37f7,_0x1c492b){_0xea37f7=_0xea37f7-0x0;var _0x2f14d5=_0x4604[_0xea37f7];return _0x2f14d5;};'use strict';var multer=require(_0x4460('0x0'));var util=require(_0x4460('0x1'));var path=require(_0x4460('0x2'));var timeout=require(_0x4460('0x3'));var express=require(_0x4460('0x4'));var router=express[_0x4460('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4460('0x6'));var config=require(_0x4460('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x4460('0x8')]('/',auth[_0x4460('0x9')](),controller[_0x4460('0xa')]);router[_0x4460('0x8')]('/describe',auth[_0x4460('0x9')](),controller['describe']);router[_0x4460('0x8')](_0x4460('0xb'),auth[_0x4460('0x9')](),controller[_0x4460('0xc')]);router[_0x4460('0xd')]('/',auth[_0x4460('0x9')](),controller[_0x4460('0xe')]);router[_0x4460('0xf')](_0x4460('0xb'),auth[_0x4460('0x9')](),controller['update']);router[_0x4460('0x10')](_0x4460('0xb'),auth['isAuthenticated'](),controller[_0x4460('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index fa38f6b..d5dc183 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 _0x5990=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5990,0x107));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0599('0x0'));module[_0x0599('0x1')]={'name':{'type':Sequelize[_0x0599('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0599('0x3')](_0x0599('0x4'),_0x0599('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0599('0x2')]},'timeout':{'type':Sequelize[_0x0599('0x6')]}};
\ No newline at end of file
+var _0x8724=['mouseOver','timeout','INTEGER','exports','STRING','ENUM'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8724,0x8d));var _0x4872=function(_0x49710d,_0x527bd4){_0x49710d=_0x49710d-0x0;var _0x3ffb4b=_0x8724[_0x49710d];return _0x3ffb4b;};'use strict';var Sequelize=require('sequelize');module[_0x4872('0x0')]={'name':{'type':Sequelize[_0x4872('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4872('0x2')](_0x4872('0x3'),_0x4872('0x4')),'defaultValue':_0x4872('0x3')},'selector':{'type':Sequelize[_0x4872('0x1')]},'timeout':{'type':Sequelize[_0x4872('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index f15d199..c5730fc 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 _0x1836=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','status','count','offset','limit','Content-Range','json','reject','update','destroy','then','sendStatus','stack','name','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x4e3079,_0x2e48ea){var _0x4356fb=function(_0x3f31e0){while(--_0x3f31e0){_0x4e3079['push'](_0x4e3079['shift']());}};_0x4356fb(++_0x2e48ea);}(_0x1836,0x126));var _0x6183=function(_0x1c0bae,_0x575469){_0x1c0bae=_0x1c0bae-0x0;var _0x1a70e1=_0x1836[_0x1c0bae];return _0x1a70e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6183('0x0'));var zipdir=require(_0x6183('0x1'));var jsonpatch=require(_0x6183('0x2'));var rp=require(_0x6183('0x3'));var moment=require(_0x6183('0x4'));var BPromise=require(_0x6183('0x5'));var Mustache=require(_0x6183('0x6'));var util=require(_0x6183('0x7'));var path=require('path');var sox=require(_0x6183('0x8'));var csv=require('to-csv');var ejs=require(_0x6183('0x9'));var fs=require('fs');var fs_extra=require(_0x6183('0xa'));var _=require(_0x6183('0xb'));var squel=require(_0x6183('0xc'));var crypto=require(_0x6183('0xd'));var jsforce=require(_0x6183('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6183('0xf'));var querystring=require(_0x6183('0x10'));var Papa=require(_0x6183('0x11'));var Redis=require(_0x6183('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6183('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6183('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x6183('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f1635,_0x361be4){_0x361be4=_0x361be4||0xcc;return function(_0x38e4dc){if(_0x38e4dc){return _0x3f1635['sendStatus'](_0x361be4);}return _0x3f1635[_0x6183('0x16')](_0x361be4)['end']();};}function respondWithResult(_0x297099,_0x140f87){_0x140f87=_0x140f87||0xc8;return function(_0x17cebd){if(_0x17cebd){return _0x297099['status'](_0x140f87)['json'](_0x17cebd);}};}function respondWithFilteredResult(_0x4f3ed1,_0xafd1ad){return function(_0x24a146){if(_0x24a146){var _0x580a5a=_0x24a146[_0x6183('0x17')],_0x55d867=_0xafd1ad[_0x6183('0x18')],_0x19e5d3=_0xafd1ad[_0x6183('0x18')]+_0xafd1ad[_0x6183('0x19')],_0x40a69f;if(_0x19e5d3>=_0x580a5a){_0x19e5d3=_0x580a5a;_0x40a69f=0xc8;}else{_0x40a69f=0xce;}_0x4f3ed1[_0x6183('0x16')](_0x40a69f);return _0x4f3ed1['set'](_0x6183('0x1a'),_0x55d867+'-'+_0x19e5d3+'/'+_0x580a5a)[_0x6183('0x1b')](_0x24a146);}return null;};}function patchUpdates(_0x5190bb){return function(_0x28973c){try{jsonpatch['apply'](_0x28973c,_0x5190bb,!![]);}catch(_0x3b8b1b){return BPromise[_0x6183('0x1c')](_0x3b8b1b);}return _0x28973c['save']();};}function saveUpdates(_0x55ef71,_0x3ee5d2){return function(_0x227254){if(_0x227254){return _0x227254[_0x6183('0x1d')](_0x55ef71)['then'](function(_0x339ae5){return _0x339ae5;});}return null;};}function removeEntity(_0x397d65,_0x1bb37d){return function(_0x217517){if(_0x217517){return _0x217517[_0x6183('0x1e')]()[_0x6183('0x1f')](function(){_0x397d65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2286,_0x5e8b07){return function(_0x61858b){if(!_0x61858b){_0x5a2286[_0x6183('0x20')](0x194);}return _0x61858b;};}function handleError(_0x6e4edf,_0x596334){_0x596334=_0x596334||0x1f4;return function(_0x431246){logger['error'](_0x431246[_0x6183('0x21')]);if(_0x431246['name']){delete _0x431246[_0x6183('0x22')];}_0x6e4edf[_0x6183('0x16')](_0x596334)['send'](_0x431246);};}exports['show']=function(_0xa0d49e,_0x53baab){var _0xd35f17={'raw':!![],'where':{'id':_0xa0d49e['params']['id']}},_0x177511={};_0x177511[_0x6183('0x23')]=_[_0x6183('0x24')](db[_0x6183('0x25')]['rawAttributes']);_0x177511['query']=_[_0x6183('0x24')](_0xa0d49e[_0x6183('0x26')]);_0x177511[_0x6183('0x27')]=_[_0x6183('0x28')](_0x177511[_0x6183('0x23')],_0x177511[_0x6183('0x26')]);_0xd35f17[_0x6183('0x29')]=_[_0x6183('0x28')](_0x177511[_0x6183('0x23')],qs[_0x6183('0x2a')](_0xa0d49e[_0x6183('0x26')][_0x6183('0x2a')]));_0xd35f17[_0x6183('0x29')]=_0xd35f17[_0x6183('0x29')][_0x6183('0x2b')]?_0xd35f17[_0x6183('0x29')]:_0x177511['model'];if(_0xa0d49e['query'][_0x6183('0x2c')]){_0xd35f17['include']=[{'all':!![]}];}_0xd35f17=_[_0x6183('0x2d')]({},_0xd35f17,_0xa0d49e[_0x6183('0x2e')]);return db['ChatProactiveAction'][_0x6183('0x2f')](_0xd35f17)['then'](handleEntityNotFound(_0x53baab,null))[_0x6183('0x1f')](respondWithResult(_0x53baab,null))[_0x6183('0x30')](handleError(_0x53baab,null));};exports[_0x6183('0x31')]=function(_0x1de353,_0xa4260d){return db['ChatProactiveAction'][_0x6183('0x31')](_0x1de353[_0x6183('0x32')],{})[_0x6183('0x1f')](respondWithResult(_0xa4260d,0xc9))[_0x6183('0x30')](handleError(_0xa4260d,null));};exports[_0x6183('0x1d')]=function(_0x2f1b5b,_0x45711){if(_0x2f1b5b['body']['id']){delete _0x2f1b5b[_0x6183('0x32')]['id'];}return db['ChatProactiveAction'][_0x6183('0x2f')]({'where':{'id':_0x2f1b5b[_0x6183('0x33')]['id']}})['then'](handleEntityNotFound(_0x45711,null))['then'](saveUpdates(_0x2f1b5b[_0x6183('0x32')],null))[_0x6183('0x1f')](respondWithResult(_0x45711,null))[_0x6183('0x30')](handleError(_0x45711,null));};exports[_0x6183('0x1e')]=function(_0x175192,_0x45a889){return db[_0x6183('0x25')][_0x6183('0x2f')]({'where':{'id':_0x175192['params']['id']}})['then'](handleEntityNotFound(_0x45a889,null))[_0x6183('0x1f')](removeEntity(_0x45a889,null))[_0x6183('0x30')](handleError(_0x45a889,null));};
\ No newline at end of file
+var _0x1c46=['send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','set','apply','reject','save','then','destroy','error','name'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x1c46,0x141));var _0x61c4=function(_0x1070b2,_0x37176e){_0x1070b2=_0x1070b2-0x0;var _0x184baa=_0x1c46[_0x1070b2];return _0x184baa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x61c4('0x0'));var zipdir=require(_0x61c4('0x1'));var jsonpatch=require(_0x61c4('0x2'));var rp=require(_0x61c4('0x3'));var moment=require(_0x61c4('0x4'));var BPromise=require(_0x61c4('0x5'));var Mustache=require(_0x61c4('0x6'));var util=require(_0x61c4('0x7'));var path=require(_0x61c4('0x8'));var sox=require('sox');var csv=require(_0x61c4('0x9'));var ejs=require(_0x61c4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61c4('0xb'));var squel=require(_0x61c4('0xc'));var crypto=require(_0x61c4('0xd'));var jsforce=require(_0x61c4('0xe'));var deskjs=require(_0x61c4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x61c4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x61c4('0x11'));var qs=require(_0x61c4('0x12'));var as=require(_0x61c4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61c4('0x14'))(_0x61c4('0x15'));var utils=require(_0x61c4('0x16'));var config=require(_0x61c4('0x17'));var licenseUtil=require(_0x61c4('0x18'));var db=require(_0x61c4('0x19'))['db'];function respondWithStatusCode(_0x17b4ad,_0x2ec76c){_0x2ec76c=_0x2ec76c||0xcc;return function(_0x212573){if(_0x212573){return _0x17b4ad[_0x61c4('0x1a')](_0x2ec76c);}return _0x17b4ad[_0x61c4('0x1b')](_0x2ec76c)[_0x61c4('0x1c')]();};}function respondWithResult(_0x3580d7,_0x4a2440){_0x4a2440=_0x4a2440||0xc8;return function(_0x471cdc){if(_0x471cdc){return _0x3580d7[_0x61c4('0x1b')](_0x4a2440)[_0x61c4('0x1d')](_0x471cdc);}};}function respondWithFilteredResult(_0x584c5c,_0x394f87){return function(_0x3dd7e2){if(_0x3dd7e2){var _0x153076=_0x3dd7e2['count'],_0x2ff79e=_0x394f87[_0x61c4('0x1e')],_0x430338=_0x394f87[_0x61c4('0x1e')]+_0x394f87['limit'],_0x98ed95;if(_0x430338>=_0x153076){_0x430338=_0x153076;_0x98ed95=0xc8;}else{_0x98ed95=0xce;}_0x584c5c[_0x61c4('0x1b')](_0x98ed95);return _0x584c5c[_0x61c4('0x1f')]('Content-Range',_0x2ff79e+'-'+_0x430338+'/'+_0x153076)[_0x61c4('0x1d')](_0x3dd7e2);}return null;};}function patchUpdates(_0x5c3875){return function(_0x26fcd1){try{jsonpatch[_0x61c4('0x20')](_0x26fcd1,_0x5c3875,!![]);}catch(_0x269470){return BPromise[_0x61c4('0x21')](_0x269470);}return _0x26fcd1[_0x61c4('0x22')]();};}function saveUpdates(_0x33fe34,_0x17f24b){return function(_0x3a2212){if(_0x3a2212){return _0x3a2212['update'](_0x33fe34)[_0x61c4('0x23')](function(_0x5e5515){return _0x5e5515;});}return null;};}function removeEntity(_0x280409,_0x2711ba){return function(_0x1613ef){if(_0x1613ef){return _0x1613ef[_0x61c4('0x24')]()[_0x61c4('0x23')](function(){_0x280409[_0x61c4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ebd60,_0x107e55){return function(_0x1c2bd8){if(!_0x1c2bd8){_0x5ebd60[_0x61c4('0x1a')](0x194);}return _0x1c2bd8;};}function handleError(_0x93bbd7,_0x186e24){_0x186e24=_0x186e24||0x1f4;return function(_0x5b02ec){logger[_0x61c4('0x25')](_0x5b02ec['stack']);if(_0x5b02ec[_0x61c4('0x26')]){delete _0x5b02ec['name'];}_0x93bbd7[_0x61c4('0x1b')](_0x186e24)[_0x61c4('0x27')](_0x5b02ec);};}exports[_0x61c4('0x28')]=function(_0x145a93,_0x5d6fb3){var _0x44b17f={'raw':!![],'where':{'id':_0x145a93[_0x61c4('0x29')]['id']}},_0x16267c={};_0x16267c[_0x61c4('0x2a')]=_[_0x61c4('0x2b')](db[_0x61c4('0x2c')][_0x61c4('0x2d')]);_0x16267c[_0x61c4('0x2e')]=_[_0x61c4('0x2b')](_0x145a93['query']);_0x16267c[_0x61c4('0x2f')]=_[_0x61c4('0x30')](_0x16267c[_0x61c4('0x2a')],_0x16267c['query']);_0x44b17f['attributes']=_['intersection'](_0x16267c[_0x61c4('0x2a')],qs[_0x61c4('0x31')](_0x145a93[_0x61c4('0x2e')][_0x61c4('0x31')]));_0x44b17f[_0x61c4('0x32')]=_0x44b17f['attributes'][_0x61c4('0x33')]?_0x44b17f[_0x61c4('0x32')]:_0x16267c[_0x61c4('0x2a')];if(_0x145a93[_0x61c4('0x2e')][_0x61c4('0x34')]){_0x44b17f['include']=[{'all':!![]}];}_0x44b17f=_[_0x61c4('0x35')]({},_0x44b17f,_0x145a93[_0x61c4('0x36')]);return db[_0x61c4('0x2c')][_0x61c4('0x37')](_0x44b17f)['then'](handleEntityNotFound(_0x5d6fb3,null))[_0x61c4('0x23')](respondWithResult(_0x5d6fb3,null))['catch'](handleError(_0x5d6fb3,null));};exports[_0x61c4('0x38')]=function(_0x1abbce,_0x5beb94){return db[_0x61c4('0x2c')][_0x61c4('0x38')](_0x1abbce['body'],{})[_0x61c4('0x23')](respondWithResult(_0x5beb94,0xc9))[_0x61c4('0x39')](handleError(_0x5beb94,null));};exports[_0x61c4('0x3a')]=function(_0x4c4a7f,_0x31cd5f){if(_0x4c4a7f[_0x61c4('0x3b')]['id']){delete _0x4c4a7f[_0x61c4('0x3b')]['id'];}return db[_0x61c4('0x2c')][_0x61c4('0x37')]({'where':{'id':_0x4c4a7f['params']['id']}})[_0x61c4('0x23')](handleEntityNotFound(_0x31cd5f,null))['then'](saveUpdates(_0x4c4a7f[_0x61c4('0x3b')],null))[_0x61c4('0x23')](respondWithResult(_0x31cd5f,null))[_0x61c4('0x39')](handleError(_0x31cd5f,null));};exports['destroy']=function(_0x31278c,_0x1d529a){return db[_0x61c4('0x2c')][_0x61c4('0x37')]({'where':{'id':_0x31278c[_0x61c4('0x29')]['id']}})['then'](handleEntityNotFound(_0x1d529a,null))[_0x61c4('0x23')](removeEntity(_0x1d529a,null))[_0x61c4('0x39')](handleError(_0x1d529a,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index e681ae1..c63769a 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 _0x0fdc=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x5bb3a0,_0x3fd23a){var _0x1469dd=function(_0x23f9f4){while(--_0x23f9f4){_0x5bb3a0['push'](_0x5bb3a0['shift']());}};_0x1469dd(++_0x3fd23a);}(_0x0fdc,0xfc));var _0xc0fd=function(_0x519380,_0x7f196){_0x519380=_0x519380-0x0;var _0x60ba2c=_0x0fdc[_0x519380];return _0x60ba2c;};'use strict';var _=require(_0xc0fd('0x0'));var util=require(_0xc0fd('0x1'));var logger=require('../../config/logger')(_0xc0fd('0x2'));var moment=require(_0xc0fd('0x3'));var BPromise=require(_0xc0fd('0x4'));var rp=require(_0xc0fd('0x5'));var fs=require('fs');var path=require(_0xc0fd('0x6'));var rimraf=require('rimraf');var config=require(_0xc0fd('0x7'));var attributes=require(_0xc0fd('0x8'));module[_0xc0fd('0x9')]=function(_0x301ffd,_0x46e077){return _0x301ffd[_0xc0fd('0xa')](_0xc0fd('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4061=['chat_proactive_actions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x54912e,_0x3c3a9b){var _0x49d10f=function(_0x412e41){while(--_0x412e41){_0x54912e['push'](_0x54912e['shift']());}};_0x49d10f(++_0x3c3a9b);}(_0x4061,0x16c));var _0x1406=function(_0xa6d4a5,_0x19825b){_0xa6d4a5=_0xa6d4a5-0x0;var _0x3f47aa=_0x4061[_0xa6d4a5];return _0x3f47aa;};'use strict';var _=require(_0x1406('0x0'));var util=require(_0x1406('0x1'));var logger=require('../../config/logger')(_0x1406('0x2'));var moment=require(_0x1406('0x3'));var BPromise=require(_0x1406('0x4'));var rp=require(_0x1406('0x5'));var fs=require('fs');var path=require(_0x1406('0x6'));var rimraf=require(_0x1406('0x7'));var config=require(_0x1406('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x1406('0x9')]=function(_0x28bdf4,_0xb381ba){return _0x28bdf4['define']('ChatProactiveAction',attributes,{'tableName':_0x1406('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 2ae71b2..bea8368 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 _0xe3da=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','lodash'];(function(_0x150529,_0x1d08fc){var _0x21115f=function(_0x4d8002){while(--_0x4d8002){_0x150529['push'](_0x150529['shift']());}};_0x21115f(++_0x1d08fc);}(_0xe3da,0xfc));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380152,_0x33866a,_0x349b04){return new BPromise(function(_0x1f4981,_0x27ce59){return client[_0xae3d('0xe')](_0x380152,_0x349b04)['then'](function(_0x395c8b){logger[_0xae3d('0xf')](_0xae3d('0x10'),_0x33866a,_0xae3d('0x11'));logger[_0xae3d('0x12')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x33866a,_0xae3d('0x11'),JSON['stringify'](_0x395c8b));if(_0x395c8b['error']){if(_0x395c8b['error'][_0xae3d('0x13')]===0x1f4){logger[_0xae3d('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x33866a,_0x395c8b[_0xae3d('0x14')][_0xae3d('0x15')]);return _0x27ce59(_0x395c8b[_0xae3d('0x14')][_0xae3d('0x15')]);}logger[_0xae3d('0x14')](_0xae3d('0x10'),_0x33866a,_0x395c8b[_0xae3d('0x14')][_0xae3d('0x15')]);return _0x1f4981(_0x395c8b['error'][_0xae3d('0x15')]);}else{logger[_0xae3d('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x33866a,_0xae3d('0x11'));_0x1f4981(_0x395c8b[_0xae3d('0x16')][_0xae3d('0x15')]);}})['catch'](function(_0x144028){logger['error'](_0xae3d('0x10'),_0x33866a,_0x144028);_0x27ce59(_0x144028);});});}
\ No newline at end of file
+var _0xf474=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7ad554,_0x34f47d){var _0x4563f5=function(_0x5a8a75){while(--_0x5a8a75){_0x7ad554['push'](_0x7ad554['shift']());}};_0x4563f5(++_0x34f47d);}(_0xf474,0x115));var _0x4f47=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xf474[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x4f47('0x0'));var util=require(_0x4f47('0x1'));var moment=require(_0x4f47('0x2'));var BPromise=require(_0x4f47('0x3'));var rs=require(_0x4f47('0x4'));var fs=require('fs');var Redis=require(_0x4f47('0x5'));var db=require(_0x4f47('0x6'))['db'];var utils=require(_0x4f47('0x7'));var logger=require(_0x4f47('0x8'))(_0x4f47('0x9'));var config=require(_0x4f47('0xa'));var jayson=require(_0x4f47('0xb'));var client=jayson[_0x4f47('0xc')][_0x4f47('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x252264,_0x27135e,_0x1a67a9){return new BPromise(function(_0x516f14,_0x435e99){return client[_0x4f47('0xe')](_0x252264,_0x1a67a9)['then'](function(_0x7c0db8){logger[_0x4f47('0xf')](_0x4f47('0x10'),_0x27135e,_0x4f47('0x11'));logger[_0x4f47('0x12')](_0x4f47('0x13'),_0x27135e,'request\x20sent',JSON[_0x4f47('0x14')](_0x7c0db8));if(_0x7c0db8[_0x4f47('0x15')]){if(_0x7c0db8[_0x4f47('0x15')][_0x4f47('0x16')]===0x1f4){logger['error'](_0x4f47('0x10'),_0x27135e,_0x7c0db8[_0x4f47('0x15')][_0x4f47('0x17')]);return _0x435e99(_0x7c0db8[_0x4f47('0x15')][_0x4f47('0x17')]);}logger[_0x4f47('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x27135e,_0x7c0db8[_0x4f47('0x15')][_0x4f47('0x17')]);return _0x516f14(_0x7c0db8[_0x4f47('0x15')]['message']);}else{logger['info'](_0x4f47('0x10'),_0x27135e,_0x4f47('0x11'));_0x516f14(_0x7c0db8[_0x4f47('0x18')][_0x4f47('0x17')]);}})['catch'](function(_0x5a5cba){logger[_0x4f47('0x15')](_0x4f47('0x10'),_0x27135e,_0x5a5cba);_0x435e99(_0x5a5cba);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index cc64318..7753686 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 _0x3212=['./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x596172,_0x334e5c){var _0x492815=function(_0x252774){while(--_0x252774){_0x596172['push'](_0x596172['shift']());}};_0x492815(++_0x334e5c);}(_0x3212,0x1e5));var _0x2321=function(_0x10a4e8,_0x5c47aa){_0x10a4e8=_0x10a4e8-0x0;var _0x21e006=_0x3212[_0x10a4e8];return _0x21e006;};'use strict';var multer=require(_0x2321('0x0'));var util=require(_0x2321('0x1'));var path=require(_0x2321('0x2'));var timeout=require(_0x2321('0x3'));var express=require(_0x2321('0x4'));var router=express['Router']();var fs_extra=require(_0x2321('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2321('0x6'));var config=require(_0x2321('0x7'));var controller=require(_0x2321('0x8'));router[_0x2321('0x9')](_0x2321('0xa'),auth[_0x2321('0xb')](),controller[_0x2321('0xc')]);router[_0x2321('0xd')]('/',auth[_0x2321('0xb')](),controller[_0x2321('0xe')]);router[_0x2321('0xf')](_0x2321('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x2321('0xb')](),controller[_0x2321('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xcc39=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x337d86,_0x12d2d4){var _0x22fd02=function(_0x1834a9){while(--_0x1834a9){_0x337d86['push'](_0x337d86['shift']());}};_0x22fd02(++_0x12d2d4);}(_0xcc39,0x17e));var _0x9cc3=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xcc39[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x9cc3('0x0'));var util=require(_0x9cc3('0x1'));var path=require(_0x9cc3('0x2'));var timeout=require(_0x9cc3('0x3'));var express=require(_0x9cc3('0x4'));var router=express[_0x9cc3('0x5')]();var fs_extra=require(_0x9cc3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9cc3('0x7'));var config=require(_0x9cc3('0x8'));var controller=require(_0x9cc3('0x9'));router[_0x9cc3('0xa')](_0x9cc3('0xb'),auth[_0x9cc3('0xc')](),controller[_0x9cc3('0xd')]);router[_0x9cc3('0xe')]('/',auth[_0x9cc3('0xc')](),controller[_0x9cc3('0xf')]);router[_0x9cc3('0x10')](_0x9cc3('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9cc3('0x11')](_0x9cc3('0xb'),auth['isAuthenticated'](),controller[_0x9cc3('0x12')]);module[_0x9cc3('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index f6b1550..2b3cd38 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 _0xfd56=['rrmemory','sequelize','STRING','name','ENUM'];(function(_0x23add2,_0x442f0b){var _0x78e09f=function(_0x4c46f4){while(--_0x4c46f4){_0x23add2['push'](_0x23add2['shift']());}};_0x78e09f(++_0x442f0b);}(_0xfd56,0x146));var _0x6fd5=function(_0xa2a482,_0x50d26c){_0xa2a482=_0xa2a482-0x0;var _0x5b883e=_0xfd56[_0xa2a482];return _0x5b883e;};'use strict';var Sequelize=require(_0x6fd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x6fd5('0x1')],'unique':_0x6fd5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6fd5('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6fd5('0x3')](_0x6fd5('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0xb9b8=['sequelize','STRING','name','INTEGER','ENUM','beepall'];(function(_0x49ce48,_0x4469be){var _0x496f5f=function(_0xa3fc6c){while(--_0xa3fc6c){_0x49ce48['push'](_0x49ce48['shift']());}};_0x496f5f(++_0x4469be);}(_0xb9b8,0x1ce));var _0x8b9b=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0xb9b8[_0x46428c];return _0x16a677;};'use strict';var Sequelize=require(_0x8b9b('0x0'));module['exports']={'name':{'type':Sequelize[_0x8b9b('0x1')],'unique':_0x8b9b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8b9b('0x1')]},'timeout':{'type':Sequelize[_0x8b9b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b9b('0x4')]('rrmemory',_0x8b9b('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 416610f..0b05e7f 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 _0x941c=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','get','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','include','rows','show','params','keys','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','destroy','describe','getMembers','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','findOne','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','order','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra'];(function(_0x2bd2c,_0x4d02ea){var _0x332dbc=function(_0x57bdf7){while(--_0x57bdf7){_0x2bd2c['push'](_0x2bd2c['shift']());}};_0x332dbc(++_0x4d02ea);}(_0x941c,0x11d));var _0xc941=function(_0x1f9890,_0x2c4706){_0x1f9890=_0x1f9890-0x0;var _0x3e798c=_0x941c[_0x1f9890];return _0x3e798c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc941('0x0'));var jsonpatch=require(_0xc941('0x1'));var rp=require(_0xc941('0x2'));var moment=require(_0xc941('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc941('0x4'));var path=require(_0xc941('0x5'));var sox=require('sox');var csv=require(_0xc941('0x6'));var ejs=require(_0xc941('0x7'));var fs=require('fs');var fs_extra=require(_0xc941('0x8'));var _=require(_0xc941('0x9'));var squel=require(_0xc941('0xa'));var crypto=require(_0xc941('0xb'));var jsforce=require(_0xc941('0xc'));var deskjs=require(_0xc941('0xd'));var toCsv=require(_0xc941('0x6'));var querystring=require('querystring');var Papa=require(_0xc941('0xe'));var Redis=require(_0xc941('0xf'));var authService=require(_0xc941('0x10'));var qs=require(_0xc941('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc941('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc941('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc941('0x14'))['db'];config['redis']=_[_0xc941('0x15')](config[_0xc941('0x16')],{'host':_0xc941('0x17'),'port':0x18eb});var socket=require(_0xc941('0x18'))(new Redis(config[_0xc941('0x16')]));require(_0xc941('0x19'))['register'](socket);var jayson=require(_0xc941('0x1a'));var client=jayson['client'][_0xc941('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x14a4e3,_0x1db38f,_0x344a22,_0x569e54){return new BPromise(function(_0x316cdc,_0x450dd9){var _0x46a8e0=_0x569e54||client;return _0x46a8e0[_0xc941('0x1c')](_0x14a4e3,_0x344a22)[_0xc941('0x1d')](function(_0x1cbb21){logger['info'](_0xc941('0x1e'),_0x1db38f,_0xc941('0x1f'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1db38f,'request\x20sent',JSON[_0xc941('0x20')](_0x1cbb21));if(_0x1cbb21['error']){if(_0x1cbb21[_0xc941('0x21')]['code']===0x1f4){logger[_0xc941('0x21')](_0xc941('0x1e'),_0x1db38f,_0x1cbb21['error'][_0xc941('0x22')]);return _0x450dd9(_0x1cbb21[_0xc941('0x21')][_0xc941('0x22')]);}logger[_0xc941('0x21')](_0xc941('0x1e'),_0x1db38f,_0x1cbb21[_0xc941('0x21')][_0xc941('0x22')]);return _0x316cdc(_0x1cbb21[_0xc941('0x21')][_0xc941('0x22')]);}else{logger[_0xc941('0x23')](_0xc941('0x1e'),_0x1db38f,_0xc941('0x1f'));_0x316cdc(_0x1cbb21[_0xc941('0x24')][_0xc941('0x22')]);}})[_0xc941('0x25')](function(_0x372641){logger[_0xc941('0x21')](_0xc941('0x1e'),_0x1db38f,_0x372641);_0x450dd9(_0x372641);});});}function respondWithStatusCode(_0x3652a6,_0x2cddc1){_0x2cddc1=_0x2cddc1||0xcc;return function(_0x21ee61){if(_0x21ee61){return _0x3652a6[_0xc941('0x26')](_0x2cddc1);}return _0x3652a6[_0xc941('0x27')](_0x2cddc1)[_0xc941('0x28')]();};}function respondWithResult(_0x40cc2f,_0x33ccab){_0x33ccab=_0x33ccab||0xc8;return function(_0x346407){if(_0x346407){return _0x40cc2f['status'](_0x33ccab)[_0xc941('0x29')](_0x346407);}};}function respondWithFilteredResult(_0x1771f4,_0x12e6e8){return function(_0x58bec6){if(_0x58bec6){var _0x137339=_0x58bec6[_0xc941('0x2a')],_0xcee080=_0x12e6e8[_0xc941('0x2b')],_0x1f64a=_0x12e6e8[_0xc941('0x2b')]+_0x12e6e8['limit'],_0x58d97a;if(_0x1f64a>=_0x137339){_0x1f64a=_0x137339;_0x58d97a=0xc8;}else{_0x58d97a=0xce;}_0x1771f4[_0xc941('0x27')](_0x58d97a);return _0x1771f4[_0xc941('0x2c')](_0xc941('0x2d'),_0xcee080+'-'+_0x1f64a+'/'+_0x137339)['json'](_0x58bec6);}return null;};}function patchUpdates(_0x4bebdf){return function(_0x1a16f2){try{jsonpatch[_0xc941('0x2e')](_0x1a16f2,_0x4bebdf,!![]);}catch(_0x3d7b0d){return BPromise['reject'](_0x3d7b0d);}return _0x1a16f2['save']();};}function saveUpdates(_0x205d2d,_0x3cd4e8){return function(_0x4f553d){if(_0x4f553d){return _0x4f553d['update'](_0x205d2d)[_0xc941('0x1d')](function(_0x44385d){return _0x44385d;});}return null;};}function removeEntity(_0x4fa72f,_0x418eaf){return function(_0x95b278){if(_0x95b278){return _0x95b278['destroy']()[_0xc941('0x1d')](function(){var _0x148562=_0x95b278[_0xc941('0x2f')]({'plain':!![]});var _0x550afb='ChatQueues';return db[_0xc941('0x30')]['destroy']({'where':{'type':_0x550afb,'resourceId':_0x148562['id']}})[_0xc941('0x1d')](function(){return _0x95b278;});})[_0xc941('0x1d')](function(){_0x4fa72f[_0xc941('0x27')](0xcc)[_0xc941('0x28')]();});}};}function handleEntityNotFound(_0x48c331,_0x27e981){return function(_0x26f194){if(!_0x26f194){_0x48c331[_0xc941('0x26')](0x194);}return _0x26f194;};}function handleError(_0x139395,_0x29a2f3){_0x29a2f3=_0x29a2f3||0x1f4;return function(_0x38aea9){logger[_0xc941('0x21')](_0x38aea9[_0xc941('0x31')]);if(_0x38aea9['name']){delete _0x38aea9[_0xc941('0x32')];}_0x139395[_0xc941('0x27')](_0x29a2f3)['send'](_0x38aea9);};}exports[_0xc941('0x33')]=function(_0x656200,_0xac9a9b){var _0x52255d={},_0x200930={},_0x176897={'count':0x0,'rows':[]};var _0x1e0cb3=_[_0xc941('0x34')](db[_0xc941('0x35')][_0xc941('0x36')],function(_0x3ae39a){return{'name':_0x3ae39a[_0xc941('0x37')],'type':_0x3ae39a[_0xc941('0x38')][_0xc941('0x39')]};});_0x200930[_0xc941('0x3a')]=_[_0xc941('0x34')](_0x1e0cb3,'name');_0x200930[_0xc941('0x3b')]=_['keys'](_0x656200['query']);_0x200930[_0xc941('0x3c')]=_[_0xc941('0x3d')](_0x200930['model'],_0x200930[_0xc941('0x3b')]);_0x52255d[_0xc941('0x3e')]=_[_0xc941('0x3d')](_0x200930['model'],qs[_0xc941('0x3f')](_0x656200['query'][_0xc941('0x3f')]));_0x52255d[_0xc941('0x3e')]=_0x52255d[_0xc941('0x3e')][_0xc941('0x40')]?_0x52255d[_0xc941('0x3e')]:_0x200930[_0xc941('0x3a')];if(!_0x656200[_0xc941('0x3b')][_0xc941('0x41')](_0xc941('0x42'))){_0x52255d['limit']=qs[_0xc941('0x43')](_0x656200[_0xc941('0x3b')][_0xc941('0x43')]);_0x52255d['offset']=qs[_0xc941('0x2b')](_0x656200[_0xc941('0x3b')][_0xc941('0x2b')]);}_0x52255d['order']=qs[_0xc941('0x44')](_0x656200[_0xc941('0x3b')]['sort']);_0x52255d['where']=qs['filters'](_[_0xc941('0x45')](_0x656200[_0xc941('0x3b')],_0x200930['filters']),_0x1e0cb3);if(_0x656200[_0xc941('0x3b')][_0xc941('0x46')]){_0x52255d[_0xc941('0x47')]=_[_0xc941('0x48')](_0x52255d[_0xc941('0x47')],{'$or':_[_0xc941('0x34')](_0x1e0cb3,function(_0xcc0f6b){if(_0xcc0f6b[_0xc941('0x38')]!==_0xc941('0x49')){var _0x51af1e={};_0x51af1e[_0xcc0f6b[_0xc941('0x32')]]={'$like':'%'+_0x656200['query'][_0xc941('0x46')]+'%'};return _0x51af1e;}})});}_0x52255d=_[_0xc941('0x48')]({},_0x52255d,_0x656200['options']);var _0x3c0613={'where':_0x52255d[_0xc941('0x47')]};return db[_0xc941('0x35')][_0xc941('0x2a')](_0x3c0613)[_0xc941('0x1d')](function(_0x3ba506){_0x176897['count']=_0x3ba506;if(_0x656200['query']['includeAll']){_0x52255d[_0xc941('0x4a')]=[{'all':!![]}];}return db[_0xc941('0x35')]['findAll'](_0x52255d);})[_0xc941('0x1d')](function(_0x38eb97){_0x176897[_0xc941('0x4b')]=_0x38eb97;return _0x176897;})[_0xc941('0x1d')](respondWithFilteredResult(_0xac9a9b,_0x52255d))[_0xc941('0x25')](handleError(_0xac9a9b,null));};exports[_0xc941('0x4c')]=function(_0x16bb20,_0x30e32d){var _0x2448ae={'raw':!![],'where':{'id':_0x16bb20[_0xc941('0x4d')]['id']}},_0x39546b={};_0x39546b['model']=_['keys'](db[_0xc941('0x35')][_0xc941('0x36')]);_0x39546b[_0xc941('0x3b')]=_[_0xc941('0x4e')](_0x16bb20[_0xc941('0x3b')]);_0x39546b[_0xc941('0x3c')]=_[_0xc941('0x3d')](_0x39546b[_0xc941('0x3a')],_0x39546b[_0xc941('0x3b')]);_0x2448ae['attributes']=_['intersection'](_0x39546b[_0xc941('0x3a')],qs[_0xc941('0x3f')](_0x16bb20['query'][_0xc941('0x3f')]));_0x2448ae[_0xc941('0x3e')]=_0x2448ae[_0xc941('0x3e')][_0xc941('0x40')]?_0x2448ae['attributes']:_0x39546b[_0xc941('0x3a')];if(_0x16bb20[_0xc941('0x3b')]['includeAll']){_0x2448ae[_0xc941('0x4a')]=[{'all':!![]}];}_0x2448ae=_[_0xc941('0x48')]({},_0x2448ae,_0x16bb20[_0xc941('0x4f')]);return db[_0xc941('0x35')]['find'](_0x2448ae)[_0xc941('0x1d')](handleEntityNotFound(_0x30e32d,null))[_0xc941('0x1d')](respondWithResult(_0x30e32d,null))[_0xc941('0x25')](handleError(_0x30e32d,null));};exports[_0xc941('0x50')]=function(_0x386e7e,_0x2f3a3f){return db[_0xc941('0x35')][_0xc941('0x50')](_0x386e7e['body'],{})[_0xc941('0x1d')](function(_0x104265){var _0xf96759=_0x386e7e[_0xc941('0x51')][_0xc941('0x2f')]({'plain':!![]});if(!_0xf96759)throw new Error(_0xc941('0x52'));if(_0xf96759[_0xc941('0x53')]==='user'){var _0x41d412=_0x104265[_0xc941('0x2f')]({'plain':!![]});var _0x3e7dd4='ChatQueues';return db[_0xc941('0x54')]['find']({'where':{'name':_0x3e7dd4,'userProfileId':_0xf96759[_0xc941('0x55')]},'raw':!![]})[_0xc941('0x1d')](function(_0x4f7f54){if(_0x4f7f54&&_0x4f7f54[_0xc941('0x56')]===0x0){return db['UserProfileResource'][_0xc941('0x50')]({'name':_0x41d412[_0xc941('0x32')],'resourceId':_0x41d412['id'],'type':_0x4f7f54[_0xc941('0x32')],'sectionId':_0x4f7f54['id']},{})[_0xc941('0x1d')](function(){return _0x104265;});}else{return _0x104265;}})[_0xc941('0x25')](function(_0x5f1b75){logger[_0xc941('0x21')](_0xc941('0x57'),_0x5f1b75);throw _0x5f1b75;});}return _0x104265;})['then'](respondWithResult(_0x2f3a3f,0xc9))[_0xc941('0x25')](handleError(_0x2f3a3f,null));};exports[_0xc941('0x58')]=function(_0xf709a9,_0x5360e3){if(_0xf709a9[_0xc941('0x59')]['id']){delete _0xf709a9[_0xc941('0x59')]['id'];}return db[_0xc941('0x35')][_0xc941('0x5a')]({'where':{'id':_0xf709a9[_0xc941('0x4d')]['id']}})[_0xc941('0x1d')](handleEntityNotFound(_0x5360e3,null))[_0xc941('0x1d')](saveUpdates(_0xf709a9['body'],null))['then'](respondWithResult(_0x5360e3,null))[_0xc941('0x25')](handleError(_0x5360e3,null));};exports[_0xc941('0x5b')]=function(_0x1e3a7a,_0x1671e8){return db[_0xc941('0x35')][_0xc941('0x5a')]({'where':{'id':_0x1e3a7a['params']['id']}})[_0xc941('0x1d')](handleEntityNotFound(_0x1671e8,null))[_0xc941('0x1d')](removeEntity(_0x1671e8,null))[_0xc941('0x25')](handleError(_0x1671e8,null));};exports[_0xc941('0x5c')]=function(_0x50312a,_0x233fa8){return db[_0xc941('0x35')][_0xc941('0x5c')]()[_0xc941('0x1d')](respondWithResult(_0x233fa8,null))[_0xc941('0x25')](handleError(_0x233fa8,null));};exports[_0xc941('0x5d')]=function(_0x5c955f,_0x18fcc9,_0x235bad){var _0x5ce469={'raw':!![],'where':{}},_0x5116c2={},_0x564542;return db[_0xc941('0x35')]['findOne']({'where':{'id':_0x5c955f['params']['id']}})[_0xc941('0x1d')](handleEntityNotFound(_0x18fcc9,null))[_0xc941('0x1d')](function(_0x4cd8d8){if(_0x4cd8d8){_0x564542=_0x4cd8d8[_0xc941('0x2f')]({'plain':!![]});_0x5116c2[_0xc941('0x3a')]=_[_0xc941('0x4e')](db[_0xc941('0x5e')][_0xc941('0x36')]);_0x5116c2[_0xc941('0x3b')]=_['keys'](_0x5c955f['query']);_0x5116c2[_0xc941('0x3c')]=_[_0xc941('0x3d')](_0x5116c2[_0xc941('0x3a')],_0x5116c2[_0xc941('0x3b')]);_0x5ce469['attributes']=_['intersection'](_0x5116c2['model'],qs[_0xc941('0x3f')](_0x5c955f[_0xc941('0x3b')]['fields']));_0x5ce469[_0xc941('0x3e')]=_0x5ce469[_0xc941('0x3e')][_0xc941('0x40')]?_0x5ce469[_0xc941('0x3e')]:_0x5116c2[_0xc941('0x3a')];if(!_0x5c955f[_0xc941('0x3b')][_0xc941('0x41')](_0xc941('0x42'))){_0x5ce469[_0xc941('0x43')]=qs[_0xc941('0x43')](_0x5c955f[_0xc941('0x3b')][_0xc941('0x43')]);_0x5ce469[_0xc941('0x2b')]=qs['offset'](_0x5c955f[_0xc941('0x3b')][_0xc941('0x2b')]);}_0x5ce469['order']=qs[_0xc941('0x44')](_0x5c955f['query'][_0xc941('0x44')]);_0x5ce469[_0xc941('0x47')]=qs[_0xc941('0x3c')](_['pick'](_0x5c955f[_0xc941('0x3b')],_0x5116c2[_0xc941('0x3c')]));_0x5ce469[_0xc941('0x47')][_0xc941('0x5f')]=_0x4cd8d8['id'];if(_0x5c955f['query'][_0xc941('0x46')]){_0x5ce469[_0xc941('0x47')]=_[_0xc941('0x48')](_0x5ce469['where'],{'$or':_['map'](_0x5ce469[_0xc941('0x3e')],function(_0x30bd93){var _0x2d87f0={};_0x2d87f0[_0x30bd93]={'$like':'%'+_0x5c955f[_0xc941('0x3b')][_0xc941('0x46')]+'%'};return _0x2d87f0;})});}_0x5ce469=_[_0xc941('0x48')]({},_0x5ce469,_0x5c955f[_0xc941('0x4f')]);return db[_0xc941('0x5e')][_0xc941('0x60')](_0x5ce469);}})[_0xc941('0x1d')](function(_0x594f1a){if(_0x594f1a){return db[_0xc941('0x61')][_0xc941('0x62')]({'where':{'id':_[_0xc941('0x34')](_0x594f1a,_0xc941('0x63')),'role':'agent'},'attributes':['id',_0xc941('0x32'),'chatPause',_0xc941('0x64'),_0xc941('0x65')]});}})['then'](function(_0x1fe848){if(_0x1fe848){return{'count':_0x1fe848[_0xc941('0x2a')],'rows':_[_0xc941('0x34')](_0x1fe848['rows'],function(_0x1336f4){return{'membername':_0x1336f4[_0xc941('0x32')],'UserId':_0x1336f4['id'],'queue_name':_0x564542['name'],'ChatQueueId':_0x564542['id'],'interface':util[_0xc941('0x66')](_0xc941('0x67'),'SIP',_0x1336f4['name']),'penalty':0x0,'paused':_0x1336f4[_0xc941('0x68')],'createdAt':_0x1336f4[_0xc941('0x65')],'updatedAt':_0x1336f4[_0xc941('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc941('0x1d')](respondWithFilteredResult(_0x18fcc9,_0x5ce469))[_0xc941('0x25')](handleError(_0x18fcc9,null));};exports[_0xc941('0x69')]=function(_0x2ce4ac,_0x365ab5,_0x471f9b){var _0x4efa08={};var _0x5305a2={};var _0x18a653;var _0x15a69d;return db[_0xc941('0x35')][_0xc941('0x6a')]({'where':{'id':_0x2ce4ac[_0xc941('0x4d')]['id']}})['then'](handleEntityNotFound(_0x365ab5,null))['then'](function(_0x53a02a){if(_0x53a02a){_0x18a653=_0x53a02a;_0x5305a2[_0xc941('0x3a')]=_[_0xc941('0x4e')](db['Team'][_0xc941('0x36')]);_0x5305a2[_0xc941('0x3b')]=_[_0xc941('0x4e')](_0x2ce4ac[_0xc941('0x3b')]);_0x5305a2[_0xc941('0x3c')]=_[_0xc941('0x3d')](_0x5305a2['model'],_0x5305a2['query']);_0x4efa08[_0xc941('0x3e')]=_['intersection'](_0x5305a2[_0xc941('0x3a')],qs[_0xc941('0x3f')](_0x2ce4ac[_0xc941('0x3b')][_0xc941('0x3f')]));_0x4efa08[_0xc941('0x3e')]=_0x4efa08[_0xc941('0x3e')][_0xc941('0x40')]?_0x4efa08['attributes']:_0x5305a2[_0xc941('0x3a')];_0x4efa08['order']=qs[_0xc941('0x44')](_0x2ce4ac[_0xc941('0x3b')]['sort']);_0x4efa08[_0xc941('0x47')]=qs[_0xc941('0x3c')](_[_0xc941('0x45')](_0x2ce4ac['query'],_0x5305a2[_0xc941('0x3c')]));if(_0x2ce4ac['query'][_0xc941('0x46')]){_0x4efa08[_0xc941('0x47')]=_[_0xc941('0x48')](_0x4efa08['where'],{'$or':_[_0xc941('0x34')](_0x4efa08[_0xc941('0x3e')],function(_0x40e2c2){var _0x5ee394={};_0x5ee394[_0x40e2c2]={'$like':'%'+_0x2ce4ac[_0xc941('0x3b')][_0xc941('0x46')]+'%'};return _0x5ee394;})});}_0x4efa08=_[_0xc941('0x48')]({},_0x4efa08,_0x2ce4ac[_0xc941('0x4f')]);return _0x18a653['getTeams'](_0x4efa08);}})[_0xc941('0x1d')](function(_0x4f954c){if(_0x4f954c){_0x15a69d=_0x4f954c[_0xc941('0x40')];if(!_0x2ce4ac[_0xc941('0x3b')]['hasOwnProperty'](_0xc941('0x42'))){_0x4efa08[_0xc941('0x43')]=qs[_0xc941('0x43')](_0x2ce4ac[_0xc941('0x3b')]['limit']);_0x4efa08[_0xc941('0x2b')]=qs[_0xc941('0x2b')](_0x2ce4ac[_0xc941('0x3b')][_0xc941('0x2b')]);}return _0x18a653[_0xc941('0x69')](_0x4efa08);}})['then'](function(_0x4ddc5c){if(_0x4ddc5c){return _0x4ddc5c?{'count':_0x15a69d,'rows':_0x4ddc5c}:null;}})[_0xc941('0x1d')](respondWithResult(_0x365ab5,null))[_0xc941('0x25')](handleError(_0x365ab5,null));};exports[_0xc941('0x6b')]=function(_0x1cfa99,_0x2fa5ac,_0x4423a9){var _0x1ec8f0=_0x1cfa99[_0xc941('0x59')][_0xc941('0x6c')];return db[_0xc941('0x6d')]['findAll']({'where':{'id':_0x1ec8f0},'attributes':['id'],'include':[{'model':db[_0xc941('0x61')],'as':_0xc941('0x6e'),'attributes':['id',_0xc941('0x32'),_0xc941('0x6f'),_0xc941('0x70'),_0xc941('0x71')],'raw':!![]}]})[_0xc941('0x1d')](function(_0x18711a){if(_0x18711a){var _0x1ca580=_[_0xc941('0x72')](_0x18711a,function(_0x5ae9c3){var _0xacce6c=_0x5ae9c3[_0xc941('0x2f')]({'plain':!![]});return _0xacce6c[_0xc941('0x6e')];});return db[_0xc941('0x35')][_0xc941('0x5a')]({'where':{'id':_0x1cfa99['params']['id']}})[_0xc941('0x1d')](function(_0x168046){return db[_0xc941('0x73')][_0xc941('0x74')](function(_0x38b682){return _0x168046[_0xc941('0x6b')](_0x1ec8f0,{'transaction':_0x38b682})[_0xc941('0x1d')](function(){return BPromise[_0xc941('0x75')](_0x1ca580,function(_0x2a2662){return db['UserChatQueue'][_0xc941('0x76')]({'where':{'UserId':_0x2a2662['id'],'ChatQueueId':_0x1cfa99[_0xc941('0x4d')]['id']},'transaction':_0x38b682});});})['then'](function(){_0x1ca580[_0xc941('0x77')](function(_0x5d4f30){socket[_0xc941('0x78')]('userChatQueue:save',{'UserId':_0x5d4f30['id'],'ChatQueueId':_0x168046['id']});});});});});}})[_0xc941('0x1d')](respondWithStatusCode(_0x2fa5ac,null))[_0xc941('0x25')](handleError(_0x2fa5ac,null));};exports[_0xc941('0x79')]=function(_0x406a02,_0x4cb9ca,_0x462374){return db[_0xc941('0x6d')][_0xc941('0x60')]({'where':{'id':_0x406a02[_0xc941('0x3b')][_0xc941('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xc941('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc941('0x1d')](handleEntityNotFound(_0x4cb9ca,null))[_0xc941('0x1d')](function(_0x3e5edb){var _0x41f23a=_[_0xc941('0x34')](_0x3e5edb,'id');var _0x590618=[];var _0x47cb5c=[];var _0x443213=squel[_0xc941('0x7a')]();_0x443213[_0xc941('0x7b')](_0xc941('0x7c'))[_0xc941('0x7d')]('team_has_chat_queues','tq')[_0xc941('0x7e')](_0xc941('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc941('0x47')]('ChatQueueId\x20=\x20?',_0x406a02[_0xc941('0x4d')]['id']);for(var _0x1bab1c=0x0;_0x1bab1c<_0x3e5edb[_0xc941('0x40')];_0x1bab1c+=0x1){let _0x237ff7=_0x3e5edb[_0x1bab1c];for(var _0x21b709=0x0;_0x21b709<_0x237ff7[_0xc941('0x6e')][_0xc941('0x40')];_0x21b709+=0x1){let _0x48e381=_0x237ff7[_0xc941('0x6e')][_0x21b709];var _0x3d1b25=_0x443213['clone']();_0x3d1b25[_0xc941('0x47')](_0xc941('0x80'),_0x48e381['id']);_0x47cb5c[_0xc941('0x81')](db[_0xc941('0x73')][_0xc941('0x3b')](_0x3d1b25[_0xc941('0x82')](),{'type':db['sequelize'][_0xc941('0x83')]['SELECT']})[_0xc941('0x1d')](function(_0x53e615){if(_0x53e615[_0xc941('0x40')]===0x1){return _0x48e381['id'];}else{var _0x3de5de=_[_0xc941('0x84')](_[_0xc941('0x34')](_0x53e615,_0xc941('0x85')),function(_0x2c11c7){return _[_0xc941('0x86')](_0x41f23a,_0x2c11c7);});if(_0x3de5de){return _0x48e381['id'];}}}));}}return BPromise[_0xc941('0x87')](_0x47cb5c)[_0xc941('0x1d')](function(_0x204143){_0x590618=_(_0x590618)[_0xc941('0x88')](_0x204143)[_0xc941('0x89')]()['value']();return db[_0xc941('0x35')]['find']({'where':{'id':_0x406a02[_0xc941('0x4d')]['id']}})[_0xc941('0x1d')](function(_0x1a4288){return db[_0xc941('0x73')][_0xc941('0x74')](function(_0x1b7adf){return _0x1a4288[_0xc941('0x79')](_0x406a02[_0xc941('0x3b')][_0xc941('0x6c')],{'transaction':_0x1b7adf})[_0xc941('0x1d')](function(){if(!_[_0xc941('0x8a')](_0x590618)){return _0x1a4288[_0xc941('0x8b')](_0x590618,{'transaction':_0x1b7adf});}})[_0xc941('0x1d')](function(){_0x590618[_0xc941('0x77')](function(_0x26d2cf){socket[_0xc941('0x78')](_0xc941('0x8c'),{'UserId':_0x26d2cf,'ChatQueueId':_0x1a4288['id']});});});});});});})[_0xc941('0x1d')](respondWithStatusCode(_0x4cb9ca,null))[_0xc941('0x25')](handleError(_0x4cb9ca,null));};exports[_0xc941('0x8d')]=function(_0x287335,_0x214572,_0x539581){return db[_0xc941('0x35')][_0xc941('0x5a')]({'where':{'id':_0x287335[_0xc941('0x4d')]['id']}})['then'](handleEntityNotFound(_0x214572,null))[_0xc941('0x1d')](function(_0x2e35b0){if(_0x2e35b0){return _0x2e35b0[_0xc941('0x8d')](_0x287335['body'][_0xc941('0x6c')],_[_0xc941('0x8e')](_0x287335[_0xc941('0x59')],[_0xc941('0x6c'),'id'])||{})[_0xc941('0x8f')](function(_0x99fdc2){for(var _0x134078=0x0;_0x134078<_0x287335[_0xc941('0x59')][_0xc941('0x6c')][_0xc941('0x40')];_0x134078+=0x1){socket[_0xc941('0x78')](_0xc941('0x90'),{'UserId':_0x287335['body'][_0xc941('0x6c')][_0x134078],'ChatQueueId':_0x287335[_0xc941('0x4d')]['id']});}return _0x99fdc2;});}})['then'](respondWithResult(_0x214572,null))['catch'](handleError(_0x214572,null));};exports[_0xc941('0x8b')]=function(_0x24d274,_0x579d26,_0x4307c1){return db[_0xc941('0x35')][_0xc941('0x5a')]({'where':{'id':_0x24d274['params']['id']}})[_0xc941('0x1d')](handleEntityNotFound(_0x579d26,null))[_0xc941('0x1d')](function(_0x12de26){if(_0x12de26){return _0x12de26[_0xc941('0x8b')](_0x24d274[_0xc941('0x3b')][_0xc941('0x6c')])[_0xc941('0x1d')](function(){if(_['isArray'](_0x24d274[_0xc941('0x3b')]['ids'])){for(var _0x345e45=0x0;_0x345e45<_0x24d274['query'][_0xc941('0x6c')][_0xc941('0x40')];_0x345e45+=0x1){socket['emit'](_0xc941('0x8c'),{'UserId':Number(_0x24d274[_0xc941('0x3b')][_0xc941('0x6c')][_0x345e45]),'ChatQueueId':Number(_0x24d274[_0xc941('0x4d')]['id'])});}}else{socket[_0xc941('0x78')](_0xc941('0x8c'),{'UserId':Number(_0x24d274[_0xc941('0x3b')][_0xc941('0x6c')]),'ChatQueueId':Number(_0x24d274[_0xc941('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xc941('0x91')]=function(_0xd25083,_0x147c5d,_0x402c95){var _0x1f1402={};var _0x130871={};var _0xd8f451;var _0x1da491;return db[_0xc941('0x35')]['findOne']({'where':{'id':_0xd25083[_0xc941('0x4d')]['id']}})[_0xc941('0x1d')](handleEntityNotFound(_0x147c5d,null))[_0xc941('0x1d')](function(_0x2df37b){if(_0x2df37b){_0xd8f451=_0x2df37b;_0x130871[_0xc941('0x3a')]=_['keys'](db[_0xc941('0x61')]['rawAttributes']);_0x130871[_0xc941('0x3b')]=_[_0xc941('0x4e')](_0xd25083[_0xc941('0x3b')]);_0x130871['filters']=_[_0xc941('0x3d')](_0x130871[_0xc941('0x3a')],_0x130871[_0xc941('0x3b')]);_0x1f1402[_0xc941('0x3e')]=_['intersection'](_0x130871[_0xc941('0x3a')],qs[_0xc941('0x3f')](_0xd25083[_0xc941('0x3b')][_0xc941('0x3f')]));_0x1f1402[_0xc941('0x3e')]=_0x1f1402[_0xc941('0x3e')][_0xc941('0x40')]?_0x1f1402['attributes']:_0x130871['model'];_0x1f1402[_0xc941('0x92')]=qs[_0xc941('0x44')](_0xd25083[_0xc941('0x3b')][_0xc941('0x44')]);_0x1f1402[_0xc941('0x47')]=qs[_0xc941('0x3c')](_[_0xc941('0x45')](_0xd25083[_0xc941('0x3b')],_0x130871[_0xc941('0x3c')]));if(_0xd25083[_0xc941('0x3b')][_0xc941('0x46')]){_0x1f1402[_0xc941('0x47')]=_[_0xc941('0x48')](_0x1f1402[_0xc941('0x47')],{'$or':_['map'](_0x1f1402[_0xc941('0x3e')],function(_0x459c96){var _0xb829a7={};_0xb829a7[_0x459c96]={'$like':'%'+_0xd25083['query'][_0xc941('0x46')]+'%'};return _0xb829a7;})});}_0x1f1402=_[_0xc941('0x48')]({},_0x1f1402,_0xd25083[_0xc941('0x4f')]);return _0xd8f451['getAgents'](_0x1f1402);}})[_0xc941('0x1d')](function(_0x29f715){if(_0x29f715){_0x1da491=_0x29f715[_0xc941('0x40')];if(!_0xd25083[_0xc941('0x3b')][_0xc941('0x41')](_0xc941('0x42'))){_0x1f1402[_0xc941('0x43')]=qs['limit'](_0xd25083['query'][_0xc941('0x43')]);_0x1f1402[_0xc941('0x2b')]=qs['offset'](_0xd25083[_0xc941('0x3b')][_0xc941('0x2b')]);}return _0xd8f451[_0xc941('0x91')](_0x1f1402);}})['then'](function(_0x2fc551){if(_0x2fc551){return _0x2fc551?{'count':_0x1da491,'rows':_0x2fc551}:null;}})[_0xc941('0x1d')](respondWithResult(_0x147c5d,null))[_0xc941('0x25')](handleError(_0x147c5d,null));};
\ No newline at end of file
+var _0x70a5=['bluebird','mustache','util','sox','to-csv','fs-extra','lodash','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','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','destroy','get','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','keys','find','create','body','user','role','ChatQueues','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','Team','getTeams','addTeams','ids','Agents','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1581bb,_0x5d0157){var _0x2e032d=function(_0x5e3d1f){while(--_0x5e3d1f){_0x1581bb['push'](_0x1581bb['shift']());}};_0x2e032d(++_0x5d0157);}(_0x70a5,0x1c8));var _0x570a=function(_0x4a7189,_0x2f2adf){_0x4a7189=_0x4a7189-0x0;var _0x7229f=_0x70a5[_0x4a7189];return _0x7229f;};'use strict';var emlformat=require(_0x570a('0x0'));var rimraf=require(_0x570a('0x1'));var zipdir=require(_0x570a('0x2'));var jsonpatch=require(_0x570a('0x3'));var rp=require(_0x570a('0x4'));var moment=require(_0x570a('0x5'));var BPromise=require(_0x570a('0x6'));var Mustache=require(_0x570a('0x7'));var util=require(_0x570a('0x8'));var path=require('path');var sox=require(_0x570a('0x9'));var csv=require(_0x570a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x570a('0xb'));var _=require(_0x570a('0xc'));var squel=require('squel');var crypto=require(_0x570a('0xd'));var jsforce=require(_0x570a('0xe'));var deskjs=require(_0x570a('0xf'));var toCsv=require(_0x570a('0xa'));var querystring=require(_0x570a('0x10'));var Papa=require(_0x570a('0x11'));var Redis=require(_0x570a('0x12'));var authService=require(_0x570a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x570a('0x14'));var hardwareService=require(_0x570a('0x15'));var logger=require(_0x570a('0x16'))(_0x570a('0x17'));var utils=require(_0x570a('0x18'));var config=require(_0x570a('0x19'));var licenseUtil=require(_0x570a('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x570a('0x1b')],{'host':_0x570a('0x1c'),'port':0x18eb});var socket=require(_0x570a('0x1d'))(new Redis(config[_0x570a('0x1b')]));require(_0x570a('0x1e'))[_0x570a('0x1f')](socket);var jayson=require(_0x570a('0x20'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x193b41,_0x15302c,_0x5a0458,_0x1aa7b9){return new BPromise(function(_0x206922,_0x21309b){var _0xc5e1a4=_0x1aa7b9||client;return _0xc5e1a4[_0x570a('0x21')](_0x193b41,_0x5a0458)[_0x570a('0x22')](function(_0x2d86a1){logger[_0x570a('0x23')]('ChatQueue,\x20%s,\x20%s',_0x15302c,_0x570a('0x24'));logger[_0x570a('0x25')](_0x570a('0x26'),_0x15302c,'request\x20sent',JSON[_0x570a('0x27')](_0x2d86a1));if(_0x2d86a1[_0x570a('0x28')]){if(_0x2d86a1[_0x570a('0x28')][_0x570a('0x29')]===0x1f4){logger['error'](_0x570a('0x2a'),_0x15302c,_0x2d86a1[_0x570a('0x28')][_0x570a('0x2b')]);return _0x21309b(_0x2d86a1['error'][_0x570a('0x2b')]);}logger[_0x570a('0x28')](_0x570a('0x2a'),_0x15302c,_0x2d86a1[_0x570a('0x28')][_0x570a('0x2b')]);return _0x206922(_0x2d86a1['error']['message']);}else{logger[_0x570a('0x23')](_0x570a('0x2a'),_0x15302c,'request\x20sent');_0x206922(_0x2d86a1[_0x570a('0x2c')]['message']);}})[_0x570a('0x2d')](function(_0x2574a9){logger[_0x570a('0x28')](_0x570a('0x2a'),_0x15302c,_0x2574a9);_0x21309b(_0x2574a9);});});}function respondWithStatusCode(_0xbabd2,_0x5e1921){_0x5e1921=_0x5e1921||0xcc;return function(_0x1d9d46){if(_0x1d9d46){return _0xbabd2[_0x570a('0x2e')](_0x5e1921);}return _0xbabd2[_0x570a('0x2f')](_0x5e1921)['end']();};}function respondWithResult(_0x516acd,_0x588407){_0x588407=_0x588407||0xc8;return function(_0x1fef5b){if(_0x1fef5b){return _0x516acd[_0x570a('0x2f')](_0x588407)[_0x570a('0x30')](_0x1fef5b);}};}function respondWithFilteredResult(_0x4129ce,_0x515e65){return function(_0x4c8dc5){if(_0x4c8dc5){var _0x3190a9=_0x4c8dc5['count'],_0x1d0f70=_0x515e65[_0x570a('0x31')],_0x1cf971=_0x515e65[_0x570a('0x31')]+_0x515e65[_0x570a('0x32')],_0xdb93ca;if(_0x1cf971>=_0x3190a9){_0x1cf971=_0x3190a9;_0xdb93ca=0xc8;}else{_0xdb93ca=0xce;}_0x4129ce[_0x570a('0x2f')](_0xdb93ca);return _0x4129ce[_0x570a('0x33')](_0x570a('0x34'),_0x1d0f70+'-'+_0x1cf971+'/'+_0x3190a9)['json'](_0x4c8dc5);}return null;};}function patchUpdates(_0x2bf7c6){return function(_0x277265){try{jsonpatch[_0x570a('0x35')](_0x277265,_0x2bf7c6,!![]);}catch(_0x38e60e){return BPromise['reject'](_0x38e60e);}return _0x277265[_0x570a('0x36')]();};}function saveUpdates(_0x136cd7,_0x3017ed){return function(_0x5d2b89){if(_0x5d2b89){return _0x5d2b89[_0x570a('0x37')](_0x136cd7)['then'](function(_0x2e1684){return _0x2e1684;});}return null;};}function removeEntity(_0x2ea5b8,_0x557f96){return function(_0x1c1d2b){if(_0x1c1d2b){return _0x1c1d2b[_0x570a('0x38')]()[_0x570a('0x22')](function(){var _0x446aa7=_0x1c1d2b[_0x570a('0x39')]({'plain':!![]});var _0x316ea1='ChatQueues';return db['UserProfileResource'][_0x570a('0x38')]({'where':{'type':_0x316ea1,'resourceId':_0x446aa7['id']}})['then'](function(){return _0x1c1d2b;});})[_0x570a('0x22')](function(){_0x2ea5b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37915e,_0x20f1f2){return function(_0x413ca0){if(!_0x413ca0){_0x37915e[_0x570a('0x2e')](0x194);}return _0x413ca0;};}function handleError(_0x52c35f,_0x4641e1){_0x4641e1=_0x4641e1||0x1f4;return function(_0xe4f4f3){logger[_0x570a('0x28')](_0xe4f4f3[_0x570a('0x3a')]);if(_0xe4f4f3['name']){delete _0xe4f4f3[_0x570a('0x3b')];}_0x52c35f[_0x570a('0x2f')](_0x4641e1)[_0x570a('0x3c')](_0xe4f4f3);};}exports[_0x570a('0x3d')]=function(_0x10a983,_0x31e96a){var _0x11dbbe={},_0x53e226={},_0x3e5591={'count':0x0,'rows':[]};var _0xc6b02f=_[_0x570a('0x3e')](db[_0x570a('0x3f')][_0x570a('0x40')],function(_0x77224e){return{'name':_0x77224e[_0x570a('0x41')],'type':_0x77224e[_0x570a('0x42')][_0x570a('0x43')]};});_0x53e226['model']=_['map'](_0xc6b02f,'name');_0x53e226[_0x570a('0x44')]=_['keys'](_0x10a983[_0x570a('0x44')]);_0x53e226[_0x570a('0x45')]=_[_0x570a('0x46')](_0x53e226[_0x570a('0x47')],_0x53e226[_0x570a('0x44')]);_0x11dbbe[_0x570a('0x48')]=_[_0x570a('0x46')](_0x53e226['model'],qs[_0x570a('0x49')](_0x10a983[_0x570a('0x44')][_0x570a('0x49')]));_0x11dbbe[_0x570a('0x48')]=_0x11dbbe[_0x570a('0x48')][_0x570a('0x4a')]?_0x11dbbe[_0x570a('0x48')]:_0x53e226['model'];if(!_0x10a983[_0x570a('0x44')]['hasOwnProperty']('nolimit')){_0x11dbbe[_0x570a('0x32')]=qs[_0x570a('0x32')](_0x10a983[_0x570a('0x44')]['limit']);_0x11dbbe[_0x570a('0x31')]=qs['offset'](_0x10a983['query']['offset']);}_0x11dbbe['order']=qs['sort'](_0x10a983['query'][_0x570a('0x4b')]);_0x11dbbe[_0x570a('0x4c')]=qs[_0x570a('0x45')](_[_0x570a('0x4d')](_0x10a983[_0x570a('0x44')],_0x53e226[_0x570a('0x45')]),_0xc6b02f);if(_0x10a983[_0x570a('0x44')][_0x570a('0x4e')]){_0x11dbbe[_0x570a('0x4c')]=_[_0x570a('0x4f')](_0x11dbbe['where'],{'$or':_[_0x570a('0x3e')](_0xc6b02f,function(_0x489a9d){if(_0x489a9d[_0x570a('0x42')]!==_0x570a('0x50')){var _0x3bcdc6={};_0x3bcdc6[_0x489a9d[_0x570a('0x3b')]]={'$like':'%'+_0x10a983[_0x570a('0x44')]['filter']+'%'};return _0x3bcdc6;}})});}_0x11dbbe=_[_0x570a('0x4f')]({},_0x11dbbe,_0x10a983[_0x570a('0x51')]);var _0x51f53c={'where':_0x11dbbe[_0x570a('0x4c')]};return db[_0x570a('0x3f')][_0x570a('0x52')](_0x51f53c)[_0x570a('0x22')](function(_0x5403b7){_0x3e5591[_0x570a('0x52')]=_0x5403b7;if(_0x10a983[_0x570a('0x44')][_0x570a('0x53')]){_0x11dbbe[_0x570a('0x54')]=[{'all':!![]}];}return db['ChatQueue'][_0x570a('0x55')](_0x11dbbe);})[_0x570a('0x22')](function(_0x1fd67d){_0x3e5591[_0x570a('0x56')]=_0x1fd67d;return _0x3e5591;})['then'](respondWithFilteredResult(_0x31e96a,_0x11dbbe))[_0x570a('0x2d')](handleError(_0x31e96a,null));};exports[_0x570a('0x57')]=function(_0x1e7a02,_0x117159){var _0x21c90a={'raw':!![],'where':{'id':_0x1e7a02['params']['id']}},_0x3c1351={};_0x3c1351[_0x570a('0x47')]=_[_0x570a('0x58')](db[_0x570a('0x3f')]['rawAttributes']);_0x3c1351[_0x570a('0x44')]=_[_0x570a('0x58')](_0x1e7a02[_0x570a('0x44')]);_0x3c1351[_0x570a('0x45')]=_[_0x570a('0x46')](_0x3c1351[_0x570a('0x47')],_0x3c1351[_0x570a('0x44')]);_0x21c90a[_0x570a('0x48')]=_[_0x570a('0x46')](_0x3c1351[_0x570a('0x47')],qs[_0x570a('0x49')](_0x1e7a02[_0x570a('0x44')][_0x570a('0x49')]));_0x21c90a[_0x570a('0x48')]=_0x21c90a[_0x570a('0x48')][_0x570a('0x4a')]?_0x21c90a[_0x570a('0x48')]:_0x3c1351[_0x570a('0x47')];if(_0x1e7a02[_0x570a('0x44')][_0x570a('0x53')]){_0x21c90a[_0x570a('0x54')]=[{'all':!![]}];}_0x21c90a=_[_0x570a('0x4f')]({},_0x21c90a,_0x1e7a02[_0x570a('0x51')]);return db['ChatQueue'][_0x570a('0x59')](_0x21c90a)['then'](handleEntityNotFound(_0x117159,null))['then'](respondWithResult(_0x117159,null))[_0x570a('0x2d')](handleError(_0x117159,null));};exports[_0x570a('0x5a')]=function(_0x323a2c,_0x141f9f){return db[_0x570a('0x3f')][_0x570a('0x5a')](_0x323a2c[_0x570a('0x5b')],{})[_0x570a('0x22')](function(_0x1e59fd){var _0x15d08b=_0x323a2c[_0x570a('0x5c')][_0x570a('0x39')]({'plain':!![]});if(!_0x15d08b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15d08b[_0x570a('0x5d')]===_0x570a('0x5c')){var _0x11759a=_0x1e59fd[_0x570a('0x39')]({'plain':!![]});var _0x20e83a=_0x570a('0x5e');return db[_0x570a('0x5f')][_0x570a('0x59')]({'where':{'name':_0x20e83a,'userProfileId':_0x15d08b['userProfileId']},'raw':!![]})[_0x570a('0x22')](function(_0x438998){if(_0x438998&&_0x438998['autoAssociation']===0x0){return db[_0x570a('0x60')]['create']({'name':_0x11759a['name'],'resourceId':_0x11759a['id'],'type':_0x438998['name'],'sectionId':_0x438998['id']},{})[_0x570a('0x22')](function(){return _0x1e59fd;});}else{return _0x1e59fd;}})[_0x570a('0x2d')](function(_0x461079){logger[_0x570a('0x28')](_0x570a('0x61'),_0x461079);throw _0x461079;});}return _0x1e59fd;})[_0x570a('0x22')](respondWithResult(_0x141f9f,0xc9))[_0x570a('0x2d')](handleError(_0x141f9f,null));};exports[_0x570a('0x37')]=function(_0x5aa832,_0x2252f6){if(_0x5aa832[_0x570a('0x5b')]['id']){delete _0x5aa832[_0x570a('0x5b')]['id'];}return db['ChatQueue'][_0x570a('0x59')]({'where':{'id':_0x5aa832[_0x570a('0x62')]['id']}})[_0x570a('0x22')](handleEntityNotFound(_0x2252f6,null))['then'](saveUpdates(_0x5aa832['body'],null))['then'](respondWithResult(_0x2252f6,null))['catch'](handleError(_0x2252f6,null));};exports[_0x570a('0x38')]=function(_0x485786,_0xd3f486){return db[_0x570a('0x3f')]['find']({'where':{'id':_0x485786['params']['id']}})[_0x570a('0x22')](handleEntityNotFound(_0xd3f486,null))[_0x570a('0x22')](removeEntity(_0xd3f486,null))[_0x570a('0x2d')](handleError(_0xd3f486,null));};exports['describe']=function(_0x353baf,_0x28db4a){return db[_0x570a('0x3f')][_0x570a('0x63')]()[_0x570a('0x22')](respondWithResult(_0x28db4a,null))[_0x570a('0x2d')](handleError(_0x28db4a,null));};exports[_0x570a('0x64')]=function(_0x5d762e,_0x8fb996,_0x3c0053){var _0x4969d0={'raw':!![],'where':{}},_0x5390d2={},_0x28b89c;return db['ChatQueue'][_0x570a('0x65')]({'where':{'id':_0x5d762e[_0x570a('0x62')]['id']}})['then'](handleEntityNotFound(_0x8fb996,null))[_0x570a('0x22')](function(_0x2a0081){if(_0x2a0081){_0x28b89c=_0x2a0081['get']({'plain':!![]});_0x5390d2[_0x570a('0x47')]=_[_0x570a('0x58')](db[_0x570a('0x66')]['rawAttributes']);_0x5390d2[_0x570a('0x44')]=_['keys'](_0x5d762e[_0x570a('0x44')]);_0x5390d2[_0x570a('0x45')]=_[_0x570a('0x46')](_0x5390d2[_0x570a('0x47')],_0x5390d2['query']);_0x4969d0[_0x570a('0x48')]=_['intersection'](_0x5390d2['model'],qs[_0x570a('0x49')](_0x5d762e[_0x570a('0x44')][_0x570a('0x49')]));_0x4969d0[_0x570a('0x48')]=_0x4969d0[_0x570a('0x48')]['length']?_0x4969d0[_0x570a('0x48')]:_0x5390d2[_0x570a('0x47')];if(!_0x5d762e['query'][_0x570a('0x67')](_0x570a('0x68'))){_0x4969d0['limit']=qs['limit'](_0x5d762e[_0x570a('0x44')]['limit']);_0x4969d0[_0x570a('0x31')]=qs[_0x570a('0x31')](_0x5d762e[_0x570a('0x44')]['offset']);}_0x4969d0[_0x570a('0x69')]=qs[_0x570a('0x4b')](_0x5d762e['query']['sort']);_0x4969d0[_0x570a('0x4c')]=qs[_0x570a('0x45')](_[_0x570a('0x4d')](_0x5d762e[_0x570a('0x44')],_0x5390d2[_0x570a('0x45')]));_0x4969d0[_0x570a('0x4c')]['ChatQueueId']=_0x2a0081['id'];if(_0x5d762e[_0x570a('0x44')][_0x570a('0x4e')]){_0x4969d0['where']=_['merge'](_0x4969d0['where'],{'$or':_[_0x570a('0x3e')](_0x4969d0[_0x570a('0x48')],function(_0x2dd917){var _0x1209b4={};_0x1209b4[_0x2dd917]={'$like':'%'+_0x5d762e[_0x570a('0x44')][_0x570a('0x4e')]+'%'};return _0x1209b4;})});}_0x4969d0=_[_0x570a('0x4f')]({},_0x4969d0,_0x5d762e[_0x570a('0x51')]);return db['UserChatQueue']['findAll'](_0x4969d0);}})[_0x570a('0x22')](function(_0x3eb550){if(_0x3eb550){return db['User'][_0x570a('0x6a')]({'where':{'id':_[_0x570a('0x3e')](_0x3eb550,_0x570a('0x6b')),'role':_0x570a('0x6c')},'attributes':['id',_0x570a('0x3b'),_0x570a('0x6d'),_0x570a('0x6e'),'createdAt']});}})['then'](function(_0x3984bb){if(_0x3984bb){return{'count':_0x3984bb[_0x570a('0x52')],'rows':_[_0x570a('0x3e')](_0x3984bb[_0x570a('0x56')],function(_0x1f5acb){return{'membername':_0x1f5acb['name'],'UserId':_0x1f5acb['id'],'queue_name':_0x28b89c[_0x570a('0x3b')],'ChatQueueId':_0x28b89c['id'],'interface':util[_0x570a('0x6f')](_0x570a('0x70'),'SIP',_0x1f5acb[_0x570a('0x3b')]),'penalty':0x0,'paused':_0x1f5acb[_0x570a('0x6d')],'createdAt':_0x1f5acb['createdAt'],'updatedAt':_0x1f5acb[_0x570a('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x8fb996,_0x4969d0))[_0x570a('0x2d')](handleError(_0x8fb996,null));};exports['getTeams']=function(_0x22c11c,_0x2b1e80,_0x3c6cab){var _0xe64b7a={};var _0x3101a8={};var _0xfb45e7;var _0x52861e;return db['ChatQueue'][_0x570a('0x65')]({'where':{'id':_0x22c11c[_0x570a('0x62')]['id']}})[_0x570a('0x22')](handleEntityNotFound(_0x2b1e80,null))[_0x570a('0x22')](function(_0x51348a){if(_0x51348a){_0xfb45e7=_0x51348a;_0x3101a8[_0x570a('0x47')]=_[_0x570a('0x58')](db[_0x570a('0x71')]['rawAttributes']);_0x3101a8[_0x570a('0x44')]=_[_0x570a('0x58')](_0x22c11c['query']);_0x3101a8[_0x570a('0x45')]=_[_0x570a('0x46')](_0x3101a8[_0x570a('0x47')],_0x3101a8[_0x570a('0x44')]);_0xe64b7a['attributes']=_[_0x570a('0x46')](_0x3101a8[_0x570a('0x47')],qs[_0x570a('0x49')](_0x22c11c['query'][_0x570a('0x49')]));_0xe64b7a[_0x570a('0x48')]=_0xe64b7a[_0x570a('0x48')][_0x570a('0x4a')]?_0xe64b7a['attributes']:_0x3101a8['model'];_0xe64b7a[_0x570a('0x69')]=qs['sort'](_0x22c11c[_0x570a('0x44')][_0x570a('0x4b')]);_0xe64b7a['where']=qs[_0x570a('0x45')](_[_0x570a('0x4d')](_0x22c11c[_0x570a('0x44')],_0x3101a8[_0x570a('0x45')]));if(_0x22c11c[_0x570a('0x44')]['filter']){_0xe64b7a[_0x570a('0x4c')]=_[_0x570a('0x4f')](_0xe64b7a[_0x570a('0x4c')],{'$or':_[_0x570a('0x3e')](_0xe64b7a[_0x570a('0x48')],function(_0x5e7086){var _0x365dc7={};_0x365dc7[_0x5e7086]={'$like':'%'+_0x22c11c[_0x570a('0x44')][_0x570a('0x4e')]+'%'};return _0x365dc7;})});}_0xe64b7a=_[_0x570a('0x4f')]({},_0xe64b7a,_0x22c11c['options']);return _0xfb45e7[_0x570a('0x72')](_0xe64b7a);}})[_0x570a('0x22')](function(_0x48d346){if(_0x48d346){_0x52861e=_0x48d346[_0x570a('0x4a')];if(!_0x22c11c[_0x570a('0x44')]['hasOwnProperty']('nolimit')){_0xe64b7a[_0x570a('0x32')]=qs[_0x570a('0x32')](_0x22c11c[_0x570a('0x44')][_0x570a('0x32')]);_0xe64b7a[_0x570a('0x31')]=qs[_0x570a('0x31')](_0x22c11c[_0x570a('0x44')][_0x570a('0x31')]);}return _0xfb45e7[_0x570a('0x72')](_0xe64b7a);}})[_0x570a('0x22')](function(_0xb407){if(_0xb407){return _0xb407?{'count':_0x52861e,'rows':_0xb407}:null;}})['then'](respondWithResult(_0x2b1e80,null))[_0x570a('0x2d')](handleError(_0x2b1e80,null));};exports[_0x570a('0x73')]=function(_0x2e9014,_0x3cc64f,_0x5eaee9){var _0xa083f=_0x2e9014[_0x570a('0x5b')][_0x570a('0x74')];return db['Team'][_0x570a('0x55')]({'where':{'id':_0xa083f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x570a('0x75'),'attributes':['id',_0x570a('0x3b'),'online',_0x570a('0x76'),'interface'],'raw':!![]}]})[_0x570a('0x22')](function(_0xc70ca2){if(_0xc70ca2){var _0x404f96=_[_0x570a('0x77')](_0xc70ca2,function(_0x24eded){var _0x11933c=_0x24eded[_0x570a('0x39')]({'plain':!![]});return _0x11933c['Agents'];});return db[_0x570a('0x3f')][_0x570a('0x59')]({'where':{'id':_0x2e9014[_0x570a('0x62')]['id']}})[_0x570a('0x22')](function(_0x4eaed8){return db[_0x570a('0x78')]['transaction'](function(_0x57781f){return _0x4eaed8[_0x570a('0x73')](_0xa083f,{'transaction':_0x57781f})[_0x570a('0x22')](function(){return BPromise[_0x570a('0x79')](_0x404f96,function(_0x4c29a1){return db[_0x570a('0x66')][_0x570a('0x7a')]({'where':{'UserId':_0x4c29a1['id'],'ChatQueueId':_0x2e9014[_0x570a('0x62')]['id']},'transaction':_0x57781f});});})['then'](function(){_0x404f96[_0x570a('0x7b')](function(_0x1d7528){socket[_0x570a('0x7c')](_0x570a('0x7d'),{'UserId':_0x1d7528['id'],'ChatQueueId':_0x4eaed8['id']});});});});});}})[_0x570a('0x22')](respondWithStatusCode(_0x3cc64f,null))[_0x570a('0x2d')](handleError(_0x3cc64f,null));};exports[_0x570a('0x7e')]=function(_0x857812,_0x1faa72,_0xb6b9ca){return db[_0x570a('0x71')][_0x570a('0x55')]({'where':{'id':_0x857812['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x570a('0x7f')],'as':_0x570a('0x75'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1faa72,null))[_0x570a('0x22')](function(_0x9d3aa3){var _0x4d6f01=_[_0x570a('0x3e')](_0x9d3aa3,'id');var _0x801005=[];var _0x14aecd=[];var _0x568b08=squel[_0x570a('0x80')]();_0x568b08[_0x570a('0x81')](_0x570a('0x82'))[_0x570a('0x83')]('team_has_chat_queues','tq')[_0x570a('0x84')]('user_has_teams','ut',_0x570a('0x85'))['where'](_0x570a('0x86'),_0x857812[_0x570a('0x62')]['id']);for(var _0x58f96f=0x0;_0x58f96f<_0x9d3aa3[_0x570a('0x4a')];_0x58f96f+=0x1){let _0x2dff99=_0x9d3aa3[_0x58f96f];for(var _0x452db9=0x0;_0x452db9<_0x2dff99['Agents']['length'];_0x452db9+=0x1){let _0x146742=_0x2dff99[_0x570a('0x75')][_0x452db9];var _0xb02baa=_0x568b08[_0x570a('0x87')]();_0xb02baa[_0x570a('0x4c')](_0x570a('0x88'),_0x146742['id']);_0x14aecd[_0x570a('0x89')](db['sequelize'][_0x570a('0x44')](_0xb02baa[_0x570a('0x8a')](),{'type':db[_0x570a('0x78')][_0x570a('0x8b')][_0x570a('0x8c')]})[_0x570a('0x22')](function(_0x2d788d){if(_0x2d788d['length']===0x1){return _0x146742['id'];}else{var _0x4689e3=_[_0x570a('0x8d')](_[_0x570a('0x3e')](_0x2d788d,_0x570a('0x8e')),function(_0x113516){return _['includes'](_0x4d6f01,_0x113516);});if(_0x4689e3){return _0x146742['id'];}}}));}}return BPromise[_0x570a('0x8f')](_0x14aecd)[_0x570a('0x22')](function(_0x3ed6c6){_0x801005=_(_0x801005)['union'](_0x3ed6c6)[_0x570a('0x90')]()[_0x570a('0x91')]();return db[_0x570a('0x3f')]['find']({'where':{'id':_0x857812[_0x570a('0x62')]['id']}})[_0x570a('0x22')](function(_0x39ee5b){return db['sequelize'][_0x570a('0x92')](function(_0x57faf7){return _0x39ee5b['removeTeams'](_0x857812['query'][_0x570a('0x74')],{'transaction':_0x57faf7})['then'](function(){if(!_[_0x570a('0x93')](_0x801005)){return _0x39ee5b[_0x570a('0x94')](_0x801005,{'transaction':_0x57faf7});}})[_0x570a('0x22')](function(){_0x801005[_0x570a('0x7b')](function(_0x1bb985){socket[_0x570a('0x7c')](_0x570a('0x95'),{'UserId':_0x1bb985,'ChatQueueId':_0x39ee5b['id']});});});});});});})['then'](respondWithStatusCode(_0x1faa72,null))[_0x570a('0x2d')](handleError(_0x1faa72,null));};exports[_0x570a('0x96')]=function(_0x41a27a,_0x5c8096,_0x300987){return db[_0x570a('0x3f')][_0x570a('0x59')]({'where':{'id':_0x41a27a[_0x570a('0x62')]['id']}})['then'](handleEntityNotFound(_0x5c8096,null))[_0x570a('0x22')](function(_0x46907c){if(_0x46907c){return _0x46907c[_0x570a('0x96')](_0x41a27a[_0x570a('0x5b')]['ids'],_[_0x570a('0x97')](_0x41a27a[_0x570a('0x5b')],['ids','id'])||{})[_0x570a('0x98')](function(_0xaf35cf){for(var _0x5532fa=0x0;_0x5532fa<_0x41a27a[_0x570a('0x5b')][_0x570a('0x74')][_0x570a('0x4a')];_0x5532fa+=0x1){socket[_0x570a('0x7c')]('userChatQueue:save',{'UserId':_0x41a27a['body']['ids'][_0x5532fa],'ChatQueueId':_0x41a27a['params']['id']});}return _0xaf35cf;});}})[_0x570a('0x22')](respondWithResult(_0x5c8096,null))[_0x570a('0x2d')](handleError(_0x5c8096,null));};exports['removeAgents']=function(_0xd69485,_0x181c09,_0xc0ceef){return db[_0x570a('0x3f')]['find']({'where':{'id':_0xd69485[_0x570a('0x62')]['id']}})[_0x570a('0x22')](handleEntityNotFound(_0x181c09,null))['then'](function(_0x26a0f7){if(_0x26a0f7){return _0x26a0f7[_0x570a('0x94')](_0xd69485[_0x570a('0x44')][_0x570a('0x74')])['then'](function(){if(_[_0x570a('0x99')](_0xd69485['query'][_0x570a('0x74')])){for(var _0x216b42=0x0;_0x216b42<_0xd69485[_0x570a('0x44')]['ids'][_0x570a('0x4a')];_0x216b42+=0x1){socket[_0x570a('0x7c')](_0x570a('0x95'),{'UserId':Number(_0xd69485['query'][_0x570a('0x74')][_0x216b42]),'ChatQueueId':Number(_0xd69485[_0x570a('0x62')]['id'])});}}else{socket['emit'](_0x570a('0x95'),{'UserId':Number(_0xd69485[_0x570a('0x44')]['ids']),'ChatQueueId':Number(_0xd69485[_0x570a('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x181c09,null))[_0x570a('0x2d')](handleError(_0x181c09,null));};exports['getAgents']=function(_0x586426,_0x5ee794,_0x52b461){var _0x4e378e={};var _0x496053={};var _0x1e3dea;var _0x40ee7c;return db[_0x570a('0x3f')][_0x570a('0x65')]({'where':{'id':_0x586426[_0x570a('0x62')]['id']}})['then'](handleEntityNotFound(_0x5ee794,null))[_0x570a('0x22')](function(_0x8c329c){if(_0x8c329c){_0x1e3dea=_0x8c329c;_0x496053['model']=_[_0x570a('0x58')](db[_0x570a('0x7f')]['rawAttributes']);_0x496053[_0x570a('0x44')]=_['keys'](_0x586426[_0x570a('0x44')]);_0x496053['filters']=_[_0x570a('0x46')](_0x496053[_0x570a('0x47')],_0x496053['query']);_0x4e378e[_0x570a('0x48')]=_[_0x570a('0x46')](_0x496053[_0x570a('0x47')],qs[_0x570a('0x49')](_0x586426['query']['fields']));_0x4e378e['attributes']=_0x4e378e[_0x570a('0x48')][_0x570a('0x4a')]?_0x4e378e[_0x570a('0x48')]:_0x496053[_0x570a('0x47')];_0x4e378e[_0x570a('0x69')]=qs[_0x570a('0x4b')](_0x586426[_0x570a('0x44')][_0x570a('0x4b')]);_0x4e378e[_0x570a('0x4c')]=qs['filters'](_[_0x570a('0x4d')](_0x586426[_0x570a('0x44')],_0x496053[_0x570a('0x45')]));if(_0x586426[_0x570a('0x44')][_0x570a('0x4e')]){_0x4e378e[_0x570a('0x4c')]=_[_0x570a('0x4f')](_0x4e378e[_0x570a('0x4c')],{'$or':_[_0x570a('0x3e')](_0x4e378e['attributes'],function(_0x1376be){var _0x4cc9f3={};_0x4cc9f3[_0x1376be]={'$like':'%'+_0x586426[_0x570a('0x44')][_0x570a('0x4e')]+'%'};return _0x4cc9f3;})});}_0x4e378e=_[_0x570a('0x4f')]({},_0x4e378e,_0x586426['options']);return _0x1e3dea['getAgents'](_0x4e378e);}})['then'](function(_0x4799d5){if(_0x4799d5){_0x40ee7c=_0x4799d5['length'];if(!_0x586426[_0x570a('0x44')][_0x570a('0x67')](_0x570a('0x68'))){_0x4e378e[_0x570a('0x32')]=qs[_0x570a('0x32')](_0x586426[_0x570a('0x44')][_0x570a('0x32')]);_0x4e378e[_0x570a('0x31')]=qs['offset'](_0x586426[_0x570a('0x44')][_0x570a('0x31')]);}return _0x1e3dea['getAgents'](_0x4e378e);}})[_0x570a('0x22')](function(_0x138974){if(_0x138974){return _0x138974?{'count':_0x40ee7c,'rows':_0x138974}:null;}})[_0x570a('0x22')](respondWithResult(_0x5ee794,null))[_0x570a('0x2d')](handleError(_0x5ee794,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 241e0f1..7c23753 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x524499,_0x1c48e9){var _0xeecf1=function(_0x44b4c5){while(--_0x44b4c5){_0x524499['push'](_0x524499['shift']());}};_0xeecf1(++_0x1c48e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x34501b,_0x264e47){_0x34501b=_0x34501b-0x0;var _0xdcbacd=_0xb10b[_0x34501b];return _0xdcbacd;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x2f0be9,_0x5bd044){var _0x6d42d6=function(_0x4bb895){while(--_0x4bb895){_0x2f0be9['push'](_0x2f0be9['shift']());}};_0x6d42d6(++_0x5bd044);}(_0xb10b,0x12a));var _0xbb10=function(_0xf64e53,_0x4db24b){_0xf64e53=_0xf64e53-0x0;var _0x1e185e=_0xb10b[_0xf64e53];return _0x1e185e;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 50c2280..2c34fcf 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 _0xaa0c=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0xaa0c,0xff));var _0xcaa0=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xaa0c[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xcaa0('0x0'));var util=require(_0xcaa0('0x1'));var logger=require(_0xcaa0('0x2'))(_0xcaa0('0x3'));var moment=require('moment');var BPromise=require(_0xcaa0('0x4'));var rp=require(_0xcaa0('0x5'));var fs=require('fs');var path=require(_0xcaa0('0x6'));var rimraf=require(_0xcaa0('0x7'));var config=require(_0xcaa0('0x8'));var attributes=require(_0xcaa0('0x9'));module[_0xcaa0('0xa')]=function(_0x1a3010,_0x14b3c1){return _0x1a3010[_0xcaa0('0xb')](_0xcaa0('0xc'),attributes,{'tableName':_0xcaa0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84a1=['chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','define','ChatQueue'];(function(_0x215393,_0x4c406d){var _0x595198=function(_0x5d641f){while(--_0x5d641f){_0x215393['push'](_0x215393['shift']());}};_0x595198(++_0x4c406d);}(_0x84a1,0xe5));var _0x184a=function(_0x444b1a,_0x539cee){_0x444b1a=_0x444b1a-0x0;var _0x5c4412=_0x84a1[_0x444b1a];return _0x5c4412;};'use strict';var _=require(_0x184a('0x0'));var util=require('util');var logger=require(_0x184a('0x1'))(_0x184a('0x2'));var moment=require(_0x184a('0x3'));var BPromise=require(_0x184a('0x4'));var rp=require(_0x184a('0x5'));var fs=require('fs');var path=require(_0x184a('0x6'));var rimraf=require(_0x184a('0x7'));var config=require('../../config/environment');var attributes=require(_0x184a('0x8'));module['exports']=function(_0x9e256d,_0x100bb5){return _0x9e256d[_0x184a('0x9')](_0x184a('0xa'),attributes,{'tableName':_0x184a('0xb'),'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 a3e4ecd..fb20f86 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 _0x4910=['GetChatQueue','stringify','catch','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x4910,0x1d9));var _0x0491=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4910[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});config[_0x0491('0xc')]=_['defaults'](config[_0x0491('0xc')],{'host':_0x0491('0xd'),'port':0x18eb});var socket=require(_0x0491('0xe'))(new Redis(config[_0x0491('0xc')]));require(_0x0491('0xf'))['register'](socket);function respondWithRpcPromise(_0x1a4359,_0x51bd65,_0x39bafa){return new BPromise(function(_0x1b57a1,_0x3ff9c6){return client[_0x0491('0x10')](_0x1a4359,_0x39bafa)[_0x0491('0x11')](function(_0x12ab48){logger[_0x0491('0x12')](_0x0491('0x13'),_0x51bd65,_0x0491('0x14'));logger[_0x0491('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x51bd65,_0x0491('0x14'),JSON['stringify'](_0x12ab48));if(_0x12ab48[_0x0491('0x16')]){if(_0x12ab48['error']['code']===0x1f4){logger[_0x0491('0x16')](_0x0491('0x13'),_0x51bd65,_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);return _0x3ff9c6(_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);}logger[_0x0491('0x16')](_0x0491('0x13'),_0x51bd65,_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);return _0x1b57a1(_0x12ab48['error'][_0x0491('0x17')]);}else{logger[_0x0491('0x12')](_0x0491('0x13'),_0x51bd65,_0x0491('0x14'));_0x1b57a1(_0x12ab48[_0x0491('0x18')][_0x0491('0x17')]);}})['catch'](function(_0x1a924b){logger[_0x0491('0x16')]('ChatQueue,\x20%s,\x20%s',_0x51bd65,_0x1a924b);_0x3ff9c6(_0x1a924b);});});}exports['GetChatQueue']=function(_0x1ba594){var _0x52b6cc=this;return new Promise(function(_0x6f8139,_0x431782){return db['ChatQueue'][_0x0491('0x19')]({'raw':_0x1ba594[_0x0491('0x1a')]?_0x1ba594[_0x0491('0x1a')][_0x0491('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ba594['options']?_0x1ba594[_0x0491('0x1a')][_0x0491('0x1c')]||null:null,'attributes':_0x1ba594[_0x0491('0x1a')]?_0x1ba594['options'][_0x0491('0x1d')]||null:null,'limit':_0x1ba594[_0x0491('0x1a')]?_0x1ba594[_0x0491('0x1a')][_0x0491('0x1e')]||null:null,'include':_0x1ba594[_0x0491('0x1a')]?_0x1ba594[_0x0491('0x1a')][_0x0491('0x1f')]?_['map'](_0x1ba594[_0x0491('0x1a')][_0x0491('0x1f')],function(_0xc0c021){return{'model':db[_0xc0c021[_0x0491('0x20')]],'as':_0xc0c021['as'],'attributes':_0xc0c021[_0x0491('0x1d')],'include':_0xc0c021['include']?_[_0x0491('0x21')](_0xc0c021[_0x0491('0x1f')],function(_0x59beec){return{'model':db[_0x59beec[_0x0491('0x20')]],'as':_0x59beec['as'],'attributes':_0x59beec[_0x0491('0x1d')],'include':_0x59beec[_0x0491('0x1f')]?_[_0x0491('0x21')](_0x59beec[_0x0491('0x1f')],function(_0x38b4b8){return{'model':db[_0x38b4b8[_0x0491('0x20')]],'as':_0x38b4b8['as'],'attributes':_0x38b4b8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5daa56){logger['info'](_0x0491('0x22'),_0x1ba594);logger['debug'](_0x0491('0x22'),_0x1ba594,JSON[_0x0491('0x23')](_0x5daa56));_0x6f8139(_0x5daa56);})[_0x0491('0x24')](function(_0x7d4feb){logger[_0x0491('0x16')](_0x0491('0x22'),_0x7d4feb[_0x0491('0x17')],_0x1ba594);_0x431782(_0x52b6cc['error'](0x1f4,_0x7d4feb[_0x0491('0x17')]));});});};exports[_0x0491('0x25')]=function(_0x9b11c2){var _0x5cb278=this;return new Promise(function(_0x4c2a8e,_0x57103a){return db['ChatQueue'][_0x0491('0x26')]({'raw':_0x9b11c2['options']?_0x9b11c2[_0x0491('0x1a')][_0x0491('0x1b')]===undefined?!![]:![]:!![],'where':_0x9b11c2[_0x0491('0x1a')]?_0x9b11c2[_0x0491('0x1a')][_0x0491('0x1c')]||null:null,'attributes':_0x9b11c2[_0x0491('0x1a')]?_0x9b11c2[_0x0491('0x1a')][_0x0491('0x1d')]||null:null,'include':_0x9b11c2['options']?_0x9b11c2[_0x0491('0x1a')]['include']?_[_0x0491('0x21')](_0x9b11c2[_0x0491('0x1a')]['include'],function(_0x20e036){return{'model':db[_0x20e036['model']],'as':_0x20e036['as'],'attributes':_0x20e036[_0x0491('0x1d')],'include':_0x20e036[_0x0491('0x1f')]?_[_0x0491('0x21')](_0x20e036[_0x0491('0x1f')],function(_0x52a51a){return{'model':db[_0x52a51a['model']],'as':_0x52a51a['as'],'attributes':_0x52a51a[_0x0491('0x1d')],'include':_0x52a51a[_0x0491('0x1f')]?_[_0x0491('0x21')](_0x52a51a['include'],function(_0x18c2e7){return{'model':db[_0x18c2e7['model']],'as':_0x18c2e7['as'],'attributes':_0x18c2e7[_0x0491('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4145fe){logger[_0x0491('0x12')](_0x0491('0x25'),_0x9b11c2);logger['debug']('ShowChatQueue',_0x9b11c2,JSON[_0x0491('0x23')](_0x4145fe));_0x4c2a8e(_0x4145fe);})[_0x0491('0x24')](function(_0x459df1){logger['error']('ShowChatQueue',_0x459df1[_0x0491('0x17')],_0x9b11c2);_0x57103a(_0x5cb278[_0x0491('0x16')](0x1f4,_0x459df1[_0x0491('0x17')]));});});};
\ No newline at end of file
+var _0x0caf=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','then','debug','ShowChatQueue','find','where','bluebird'];(function(_0x1916ea,_0x3068d6){var _0x829e5f=function(_0x3ed76f){while(--_0x3ed76f){_0x1916ea['push'](_0x1916ea['shift']());}};_0x829e5f(++_0x3068d6);}(_0x0caf,0x9f));var _0xf0ca=function(_0x4178f0,_0x5f1a50){_0x4178f0=_0x4178f0-0x0;var _0x39a16c=_0x0caf[_0x4178f0];return _0x39a16c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf0ca('0x0'));var rs=require(_0xf0ca('0x1'));var fs=require('fs');var Redis=require(_0xf0ca('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0ca('0x3'))(_0xf0ca('0x4'));var config=require('../../config/environment');var jayson=require(_0xf0ca('0x5'));var client=jayson[_0xf0ca('0x6')][_0xf0ca('0x7')]({'port':0x232a});config['redis']=_[_0xf0ca('0x8')](config[_0xf0ca('0x9')],{'host':_0xf0ca('0xa'),'port':0x18eb});var socket=require(_0xf0ca('0xb'))(new Redis(config[_0xf0ca('0x9')]));require(_0xf0ca('0xc'))[_0xf0ca('0xd')](socket);function respondWithRpcPromise(_0x5bbec7,_0x11aa70,_0x78f205){return new BPromise(function(_0x1542b6,_0xa3f45){return client[_0xf0ca('0xe')](_0x5bbec7,_0x78f205)['then'](function(_0x49aa3d){logger[_0xf0ca('0xf')]('ChatQueue,\x20%s,\x20%s',_0x11aa70,_0xf0ca('0x10'));logger['debug'](_0xf0ca('0x11'),_0x11aa70,_0xf0ca('0x10'),JSON[_0xf0ca('0x12')](_0x49aa3d));if(_0x49aa3d[_0xf0ca('0x13')]){if(_0x49aa3d[_0xf0ca('0x13')][_0xf0ca('0x14')]===0x1f4){logger['error'](_0xf0ca('0x15'),_0x11aa70,_0x49aa3d['error']['message']);return _0xa3f45(_0x49aa3d[_0xf0ca('0x13')][_0xf0ca('0x16')]);}logger[_0xf0ca('0x13')](_0xf0ca('0x15'),_0x11aa70,_0x49aa3d[_0xf0ca('0x13')]['message']);return _0x1542b6(_0x49aa3d['error'][_0xf0ca('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x11aa70,_0xf0ca('0x10'));_0x1542b6(_0x49aa3d[_0xf0ca('0x17')][_0xf0ca('0x16')]);}})[_0xf0ca('0x18')](function(_0x3a1466){logger[_0xf0ca('0x13')]('ChatQueue,\x20%s,\x20%s',_0x11aa70,_0x3a1466);_0xa3f45(_0x3a1466);});});}exports[_0xf0ca('0x19')]=function(_0x58bed2){var _0x10bd95=this;return new Promise(function(_0x1409c4,_0x50f742){return db[_0xf0ca('0x1a')][_0xf0ca('0x1b')]({'raw':_0x58bed2[_0xf0ca('0x1c')]?_0x58bed2[_0xf0ca('0x1c')][_0xf0ca('0x1d')]===undefined?!![]:![]:!![],'where':_0x58bed2[_0xf0ca('0x1c')]?_0x58bed2[_0xf0ca('0x1c')]['where']||null:null,'attributes':_0x58bed2[_0xf0ca('0x1c')]?_0x58bed2[_0xf0ca('0x1c')][_0xf0ca('0x1e')]||null:null,'limit':_0x58bed2[_0xf0ca('0x1c')]?_0x58bed2[_0xf0ca('0x1c')][_0xf0ca('0x1f')]||null:null,'include':_0x58bed2['options']?_0x58bed2['options'][_0xf0ca('0x20')]?_[_0xf0ca('0x21')](_0x58bed2[_0xf0ca('0x1c')][_0xf0ca('0x20')],function(_0x106f8e){return{'model':db[_0x106f8e[_0xf0ca('0x22')]],'as':_0x106f8e['as'],'attributes':_0x106f8e[_0xf0ca('0x1e')],'include':_0x106f8e[_0xf0ca('0x20')]?_['map'](_0x106f8e['include'],function(_0x22c0f0){return{'model':db[_0x22c0f0[_0xf0ca('0x22')]],'as':_0x22c0f0['as'],'attributes':_0x22c0f0['attributes'],'include':_0x22c0f0[_0xf0ca('0x20')]?_[_0xf0ca('0x21')](_0x22c0f0[_0xf0ca('0x20')],function(_0x2aaae9){return{'model':db[_0x2aaae9['model']],'as':_0x2aaae9['as'],'attributes':_0x2aaae9[_0xf0ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf0ca('0x23')](function(_0x35b78c){logger[_0xf0ca('0xf')](_0xf0ca('0x19'),_0x58bed2);logger[_0xf0ca('0x24')](_0xf0ca('0x19'),_0x58bed2,JSON['stringify'](_0x35b78c));_0x1409c4(_0x35b78c);})[_0xf0ca('0x18')](function(_0x4ba8ac){logger[_0xf0ca('0x13')]('GetChatQueue',_0x4ba8ac[_0xf0ca('0x16')],_0x58bed2);_0x50f742(_0x10bd95[_0xf0ca('0x13')](0x1f4,_0x4ba8ac[_0xf0ca('0x16')]));});});};exports[_0xf0ca('0x25')]=function(_0x35bcd7){var _0x2c39f3=this;return new Promise(function(_0x108281,_0x3be90c){return db[_0xf0ca('0x1a')][_0xf0ca('0x26')]({'raw':_0x35bcd7[_0xf0ca('0x1c')]?_0x35bcd7[_0xf0ca('0x1c')][_0xf0ca('0x1d')]===undefined?!![]:![]:!![],'where':_0x35bcd7[_0xf0ca('0x1c')]?_0x35bcd7['options'][_0xf0ca('0x27')]||null:null,'attributes':_0x35bcd7[_0xf0ca('0x1c')]?_0x35bcd7[_0xf0ca('0x1c')][_0xf0ca('0x1e')]||null:null,'include':_0x35bcd7['options']?_0x35bcd7[_0xf0ca('0x1c')]['include']?_[_0xf0ca('0x21')](_0x35bcd7['options'][_0xf0ca('0x20')],function(_0x2c218b){return{'model':db[_0x2c218b['model']],'as':_0x2c218b['as'],'attributes':_0x2c218b[_0xf0ca('0x1e')],'include':_0x2c218b['include']?_['map'](_0x2c218b[_0xf0ca('0x20')],function(_0x459169){return{'model':db[_0x459169[_0xf0ca('0x22')]],'as':_0x459169['as'],'attributes':_0x459169[_0xf0ca('0x1e')],'include':_0x459169[_0xf0ca('0x20')]?_['map'](_0x459169[_0xf0ca('0x20')],function(_0x448969){return{'model':db[_0x448969[_0xf0ca('0x22')]],'as':_0x448969['as'],'attributes':_0x448969[_0xf0ca('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf0ca('0x23')](function(_0x46219a){logger['info'](_0xf0ca('0x25'),_0x35bcd7);logger[_0xf0ca('0x24')](_0xf0ca('0x25'),_0x35bcd7,JSON[_0xf0ca('0x12')](_0x46219a));_0x108281(_0x46219a);})['catch'](function(_0x206df2){logger['error'](_0xf0ca('0x25'),_0x206df2[_0xf0ca('0x16')],_0x35bcd7);_0x3be90c(_0x2c39f3[_0xf0ca('0x13')](0x1f4,_0x206df2[_0xf0ca('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 2792abc..ed6a9b2 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x46939d,_0xc1b36d){var _0x5105e8=function(_0x536281){while(--_0x536281){_0x46939d['push'](_0x46939d['shift']());}};_0x5105e8(++_0xc1b36d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x23dc5b,_0x15a5d4){_0x23dc5b=_0x23dc5b-0x0;var _0x7e075d=_0x5f2f[_0x23dc5b];return _0x7e075d;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x1633e9,_0x50a939){var _0x549ace=function(_0x15a157){while(--_0x15a157){_0x1633e9['push'](_0x1633e9['shift']());}};_0x549ace(++_0x50a939);}(_0xb10b,0x12a));var _0xbb10=function(_0x49c54c,_0x54a647){_0x49c54c=_0x49c54c-0x0;var _0x446225=_0xb10b[_0x49c54c];return _0x446225;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 94ef285..482d4bc 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 _0xc5bd=['../../components/interaction/service','../../config/environment','get','/describe','/:id','isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc5bd,0x9a));var _0xdc5b=function(_0xcbf120,_0x3c423f){_0xcbf120=_0xcbf120-0x0;var _0x573bea=_0xc5bd[_0xcbf120];return _0x573bea;};'use strict';var multer=require(_0xdc5b('0x0'));var util=require(_0xdc5b('0x1'));var path=require(_0xdc5b('0x2'));var timeout=require(_0xdc5b('0x3'));var express=require(_0xdc5b('0x4'));var router=express[_0xdc5b('0x5')]();var fs_extra=require(_0xdc5b('0x6'));var auth=require(_0xdc5b('0x7'));var interaction=require(_0xdc5b('0x8'));var config=require(_0xdc5b('0x9'));var controller=require('./chatQueue.controller');router[_0xdc5b('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdc5b('0xa')](_0xdc5b('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xdc5b('0xa')](_0xdc5b('0xc'),auth[_0xdc5b('0xd')](),controller[_0xdc5b('0xe')]);router[_0xdc5b('0xa')]('/:id/members',auth[_0xdc5b('0xd')](),controller[_0xdc5b('0xf')]);router['get'](_0xdc5b('0x10'),auth['isAuthenticated'](),controller[_0xdc5b('0x11')]);router[_0xdc5b('0xa')](_0xdc5b('0x12'),auth['isAuthenticated'](),controller[_0xdc5b('0x13')]);router[_0xdc5b('0x14')]('/',auth[_0xdc5b('0xd')](),controller[_0xdc5b('0x15')]);router['post'](_0xdc5b('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0xdc5b('0x14')](_0xdc5b('0x12'),auth['isAuthenticated'](),controller[_0xdc5b('0x16')]);router[_0xdc5b('0x17')](_0xdc5b('0xc'),auth[_0xdc5b('0xd')](),controller['update']);router[_0xdc5b('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xdc5b('0x10'),auth[_0xdc5b('0xd')](),controller['removeTeams']);router[_0xdc5b('0x18')](_0xdc5b('0x12'),auth[_0xdc5b('0xd')](),controller[_0xdc5b('0x19')]);module[_0xdc5b('0x1a')]=router;
\ No newline at end of file
+var _0x0a68=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','delete','removeTeams','exports','multer','path','connect-timeout','express','Router'];(function(_0x1afd7b,_0x45a10c){var _0x2b571e=function(_0x5307cf){while(--_0x5307cf){_0x1afd7b['push'](_0x1afd7b['shift']());}};_0x2b571e(++_0x45a10c);}(_0x0a68,0x12f));var _0x80a6=function(_0x566d78,_0x56249b){_0x566d78=_0x566d78-0x0;var _0x1f2375=_0x0a68[_0x566d78];return _0x1f2375;};'use strict';var multer=require(_0x80a6('0x0'));var util=require('util');var path=require(_0x80a6('0x1'));var timeout=require(_0x80a6('0x2'));var express=require(_0x80a6('0x3'));var router=express[_0x80a6('0x4')]();var fs_extra=require(_0x80a6('0x5'));var auth=require(_0x80a6('0x6'));var interaction=require(_0x80a6('0x7'));var config=require('../../config/environment');var controller=require(_0x80a6('0x8'));router[_0x80a6('0x9')]('/',auth[_0x80a6('0xa')](),controller['index']);router['get'](_0x80a6('0xb'),auth[_0x80a6('0xa')](),controller[_0x80a6('0xc')]);router['get'](_0x80a6('0xd'),auth[_0x80a6('0xa')](),controller[_0x80a6('0xe')]);router[_0x80a6('0x9')](_0x80a6('0xf'),auth[_0x80a6('0xa')](),controller[_0x80a6('0x10')]);router[_0x80a6('0x9')](_0x80a6('0x11'),auth[_0x80a6('0xa')](),controller[_0x80a6('0x12')]);router['get'](_0x80a6('0x13'),auth[_0x80a6('0xa')](),controller[_0x80a6('0x14')]);router[_0x80a6('0x15')]('/',auth[_0x80a6('0xa')](),controller[_0x80a6('0x16')]);router['post']('/:id/teams',auth[_0x80a6('0xa')](),controller['addTeams']);router[_0x80a6('0x15')](_0x80a6('0x13'),auth[_0x80a6('0xa')](),controller['addAgents']);router[_0x80a6('0x17')](_0x80a6('0xd'),auth['isAuthenticated'](),controller[_0x80a6('0x18')]);router[_0x80a6('0x19')](_0x80a6('0xd'),auth[_0x80a6('0xa')](),controller['destroy']);router[_0x80a6('0x19')](_0x80a6('0x11'),auth[_0x80a6('0xa')](),controller[_0x80a6('0x1a')]);router['delete'](_0x80a6('0x13'),auth[_0x80a6('0xa')](),controller['removeAgents']);module[_0x80a6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 07e0fb6..430fc5e 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 _0x93c3=['DATE','sequelize','exports','STRING'];(function(_0x3a546d,_0x1af719){var _0x3dd350=function(_0x5c3eff){while(--_0x5c3eff){_0x3a546d['push'](_0x3a546d['shift']());}};_0x3dd350(++_0x1af719);}(_0x93c3,0x199));var _0x393c=function(_0x99eded,_0x5c1e54){_0x99eded=_0x99eded-0x0;var _0x2b1dee=_0x93c3[_0x99eded];return _0x2b1dee;};'use strict';var moment=require('moment');var Sequelize=require(_0x393c('0x0'));module[_0x393c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x393c('0x2')]},'joinAt':{'type':Sequelize[_0x393c('0x3')]},'leaveAt':{'type':Sequelize[_0x393c('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x393c('0x3')]},'reason':{'type':Sequelize[_0x393c('0x2')]}};
\ No newline at end of file
+var _0xcdac=['exports','STRING','DATE','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcdac,0x9f));var _0xccda=function(_0x188daa,_0x3c2307){_0x188daa=_0x188daa-0x0;var _0x42f44d=_0xcdac[_0x188daa];return _0x42f44d;};'use strict';var moment=require(_0xccda('0x0'));var Sequelize=require('sequelize');module[_0xccda('0x1')]={'uniqueid':{'type':Sequelize[_0xccda('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xccda('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xccda('0x3')]},'acceptAt':{'type':Sequelize[_0xccda('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xccda('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 216da12..2fbbefa 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 _0x035c=['path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','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','set','reject','save','update','then','destroy','error','stack','name','index','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','eml-format','rimraf','request-promise','moment','util'];(function(_0x5bb710,_0x2f29f4){var _0x40ed91=function(_0x111bcb){while(--_0x111bcb){_0x5bb710['push'](_0x5bb710['shift']());}};_0x40ed91(++_0x2f29f4);}(_0x035c,0x87));var _0xc035=function(_0x2d583d,_0x37a6b4){_0x2d583d=_0x2d583d-0x0;var _0xadc0fa=_0x035c[_0x2d583d];return _0xadc0fa;};'use strict';var emlformat=require(_0xc035('0x0'));var rimraf=require(_0xc035('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc035('0x2'));var moment=require(_0xc035('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc035('0x4'));var path=require(_0xc035('0x5'));var sox=require(_0xc035('0x6'));var csv=require('to-csv');var ejs=require(_0xc035('0x7'));var fs=require('fs');var fs_extra=require(_0xc035('0x8'));var _=require(_0xc035('0x9'));var squel=require('squel');var crypto=require(_0xc035('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc035('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc035('0xc'));var Papa=require('papaparse');var Redis=require(_0xc035('0xd'));var authService=require(_0xc035('0xe'));var qs=require(_0xc035('0xf'));var as=require(_0xc035('0x10'));var hardwareService=require(_0xc035('0x11'));var logger=require(_0xc035('0x12'))(_0xc035('0x13'));var utils=require(_0xc035('0x14'));var config=require(_0xc035('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc035('0x16'))['db'];function respondWithStatusCode(_0x426247,_0x5cf929){_0x5cf929=_0x5cf929||0xcc;return function(_0x548e55){if(_0x548e55){return _0x426247[_0xc035('0x17')](_0x5cf929);}return _0x426247['status'](_0x5cf929)[_0xc035('0x18')]();};}function respondWithResult(_0x1163e5,_0x3c08ff){_0x3c08ff=_0x3c08ff||0xc8;return function(_0x483399){if(_0x483399){return _0x1163e5[_0xc035('0x19')](_0x3c08ff)[_0xc035('0x1a')](_0x483399);}};}function respondWithFilteredResult(_0xb55d6d,_0x5b17c9){return function(_0x135420){if(_0x135420){var _0x2254df=_0x135420['count'],_0x231c7a=_0x5b17c9[_0xc035('0x1b')],_0x3fb66a=_0x5b17c9['offset']+_0x5b17c9[_0xc035('0x1c')],_0x325284;if(_0x3fb66a>=_0x2254df){_0x3fb66a=_0x2254df;_0x325284=0xc8;}else{_0x325284=0xce;}_0xb55d6d[_0xc035('0x19')](_0x325284);return _0xb55d6d[_0xc035('0x1d')]('Content-Range',_0x231c7a+'-'+_0x3fb66a+'/'+_0x2254df)['json'](_0x135420);}return null;};}function patchUpdates(_0x203d1b){return function(_0x829aaa){try{jsonpatch['apply'](_0x829aaa,_0x203d1b,!![]);}catch(_0x2bbe65){return BPromise[_0xc035('0x1e')](_0x2bbe65);}return _0x829aaa[_0xc035('0x1f')]();};}function saveUpdates(_0x34a4a5,_0xa23408){return function(_0x546d54){if(_0x546d54){return _0x546d54[_0xc035('0x20')](_0x34a4a5)[_0xc035('0x21')](function(_0x1ebfee){return _0x1ebfee;});}return null;};}function removeEntity(_0x1992f2,_0x51da76){return function(_0x55583b){if(_0x55583b){return _0x55583b[_0xc035('0x22')]()[_0xc035('0x21')](function(){_0x1992f2[_0xc035('0x19')](0xcc)[_0xc035('0x18')]();});}};}function handleEntityNotFound(_0xb6667e,_0x1051b6){return function(_0x4c0047){if(!_0x4c0047){_0xb6667e[_0xc035('0x17')](0x194);}return _0x4c0047;};}function handleError(_0x1c4483,_0x5b702e){_0x5b702e=_0x5b702e||0x1f4;return function(_0x115a09){logger[_0xc035('0x23')](_0x115a09[_0xc035('0x24')]);if(_0x115a09[_0xc035('0x25')]){delete _0x115a09[_0xc035('0x25')];}_0x1c4483[_0xc035('0x19')](_0x5b702e)['send'](_0x115a09);};}exports[_0xc035('0x26')]=function(_0x361dfe,_0x4c4cc9){var _0x3e0bcc={},_0x2cf553={},_0x2b4e6a={'count':0x0,'rows':[]};var _0x228720=_['map'](db[_0xc035('0x27')]['rawAttributes'],function(_0x49178f){return{'name':_0x49178f[_0xc035('0x28')],'type':_0x49178f[_0xc035('0x29')][_0xc035('0x2a')]};});_0x2cf553[_0xc035('0x2b')]=_['map'](_0x228720,_0xc035('0x25'));_0x2cf553[_0xc035('0x2c')]=_[_0xc035('0x2d')](_0x361dfe[_0xc035('0x2c')]);_0x2cf553[_0xc035('0x2e')]=_['intersection'](_0x2cf553['model'],_0x2cf553['query']);_0x3e0bcc[_0xc035('0x2f')]=_[_0xc035('0x30')](_0x2cf553[_0xc035('0x2b')],qs[_0xc035('0x31')](_0x361dfe['query'][_0xc035('0x31')]));_0x3e0bcc[_0xc035('0x2f')]=_0x3e0bcc[_0xc035('0x2f')]['length']?_0x3e0bcc[_0xc035('0x2f')]:_0x2cf553[_0xc035('0x2b')];if(!_0x361dfe[_0xc035('0x2c')][_0xc035('0x32')](_0xc035('0x33'))){_0x3e0bcc['limit']=qs['limit'](_0x361dfe[_0xc035('0x2c')][_0xc035('0x1c')]);_0x3e0bcc[_0xc035('0x1b')]=qs[_0xc035('0x1b')](_0x361dfe['query']['offset']);}_0x3e0bcc['order']=qs['sort'](_0x361dfe[_0xc035('0x2c')]['sort']);_0x3e0bcc[_0xc035('0x34')]=qs['filters'](_[_0xc035('0x35')](_0x361dfe['query'],_0x2cf553[_0xc035('0x2e')]),_0x228720);if(_0x361dfe[_0xc035('0x2c')]['filter']){_0x3e0bcc['where']=_[_0xc035('0x36')](_0x3e0bcc[_0xc035('0x34')],{'$or':_['map'](_0x228720,function(_0x2efd3a){if(_0x2efd3a[_0xc035('0x29')]!==_0xc035('0x37')){var _0x46eb18={};_0x46eb18[_0x2efd3a[_0xc035('0x25')]]={'$like':'%'+_0x361dfe['query'][_0xc035('0x38')]+'%'};return _0x46eb18;}})});}_0x3e0bcc=_['merge']({},_0x3e0bcc,_0x361dfe['options']);var _0x59c4e7={'where':_0x3e0bcc[_0xc035('0x34')]};return db[_0xc035('0x27')]['count'](_0x59c4e7)[_0xc035('0x21')](function(_0x33199a){_0x2b4e6a['count']=_0x33199a;if(_0x361dfe[_0xc035('0x2c')]['includeAll']){_0x3e0bcc[_0xc035('0x39')]=[{'all':!![]}];}return db[_0xc035('0x27')][_0xc035('0x3a')](_0x3e0bcc);})[_0xc035('0x21')](function(_0x225169){_0x2b4e6a[_0xc035('0x3b')]=_0x225169;return _0x2b4e6a;})[_0xc035('0x21')](respondWithFilteredResult(_0x4c4cc9,_0x3e0bcc))[_0xc035('0x3c')](handleError(_0x4c4cc9,null));};exports[_0xc035('0x3d')]=function(_0x391e43,_0x2449f0){var _0x506130={'raw':!![],'where':{'id':_0x391e43[_0xc035('0x3e')]['id']}},_0x1eac6a={};_0x1eac6a['model']=_[_0xc035('0x2d')](db[_0xc035('0x27')][_0xc035('0x3f')]);_0x1eac6a[_0xc035('0x2c')]=_[_0xc035('0x2d')](_0x391e43[_0xc035('0x2c')]);_0x1eac6a[_0xc035('0x2e')]=_[_0xc035('0x30')](_0x1eac6a[_0xc035('0x2b')],_0x1eac6a[_0xc035('0x2c')]);_0x506130[_0xc035('0x2f')]=_[_0xc035('0x30')](_0x1eac6a[_0xc035('0x2b')],qs['fields'](_0x391e43[_0xc035('0x2c')][_0xc035('0x31')]));_0x506130['attributes']=_0x506130[_0xc035('0x2f')][_0xc035('0x40')]?_0x506130[_0xc035('0x2f')]:_0x1eac6a[_0xc035('0x2b')];if(_0x391e43[_0xc035('0x2c')][_0xc035('0x41')]){_0x506130[_0xc035('0x39')]=[{'all':!![]}];}_0x506130=_[_0xc035('0x36')]({},_0x506130,_0x391e43['options']);return db[_0xc035('0x27')][_0xc035('0x42')](_0x506130)[_0xc035('0x21')](handleEntityNotFound(_0x2449f0,null))[_0xc035('0x21')](respondWithResult(_0x2449f0,null))[_0xc035('0x3c')](handleError(_0x2449f0,null));};exports[_0xc035('0x43')]=function(_0x12b5b5,_0x1a3944){return db['ChatQueueReport'][_0xc035('0x43')](_0x12b5b5[_0xc035('0x44')],{})[_0xc035('0x21')](respondWithResult(_0x1a3944,0xc9))[_0xc035('0x3c')](handleError(_0x1a3944,null));};exports[_0xc035('0x20')]=function(_0x57b470,_0xe5eb80){if(_0x57b470[_0xc035('0x44')]['id']){delete _0x57b470[_0xc035('0x44')]['id'];}return db[_0xc035('0x27')][_0xc035('0x42')]({'where':{'id':_0x57b470[_0xc035('0x3e')]['id']}})[_0xc035('0x21')](handleEntityNotFound(_0xe5eb80,null))[_0xc035('0x21')](saveUpdates(_0x57b470[_0xc035('0x44')],null))['then'](respondWithResult(_0xe5eb80,null))[_0xc035('0x3c')](handleError(_0xe5eb80,null));};exports[_0xc035('0x22')]=function(_0x35b507,_0x4cc05e){return db[_0xc035('0x27')]['find']({'where':{'id':_0x35b507[_0xc035('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4cc05e,null))[_0xc035('0x21')](removeEntity(_0x4cc05e,null))['catch'](handleError(_0x4cc05e,null));};exports[_0xc035('0x45')]=function(_0x4886f3,_0x44ff0e){return db[_0xc035('0x27')]['describe']()[_0xc035('0x21')](respondWithResult(_0x44ff0e,null))[_0xc035('0x3c')](handleError(_0x44ff0e,null));};
\ No newline at end of file
+var _0xbf11=['then','error','stack','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','filter','merge','where','VIRTUAL','options','include','ChatQueueReport','findAll','rows','show','params','rawAttributes','length','includeAll','catch','create','body','describe','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','set','apply','reject','save','update','destroy'];(function(_0x41c66d,_0x512755){var _0x4b3302=function(_0x5e6307){while(--_0x5e6307){_0x41c66d['push'](_0x41c66d['shift']());}};_0x4b3302(++_0x512755);}(_0xbf11,0x14d));var _0x1bf1=function(_0x2e2720,_0x1ae995){_0x2e2720=_0x2e2720-0x0;var _0x3f9d2d=_0xbf11[_0x2e2720];return _0x3f9d2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bf1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bf1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1bf1('0x2'));var util=require(_0x1bf1('0x3'));var path=require(_0x1bf1('0x4'));var sox=require('sox');var csv=require(_0x1bf1('0x5'));var ejs=require(_0x1bf1('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bf1('0x7'));var squel=require('squel');var crypto=require(_0x1bf1('0x8'));var jsforce=require(_0x1bf1('0x9'));var deskjs=require(_0x1bf1('0xa'));var toCsv=require(_0x1bf1('0x5'));var querystring=require('querystring');var Papa=require(_0x1bf1('0xb'));var Redis=require(_0x1bf1('0xc'));var authService=require(_0x1bf1('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1bf1('0xe'));var hardwareService=require(_0x1bf1('0xf'));var logger=require(_0x1bf1('0x10'))(_0x1bf1('0x11'));var utils=require(_0x1bf1('0x12'));var config=require(_0x1bf1('0x13'));var licenseUtil=require(_0x1bf1('0x14'));var db=require(_0x1bf1('0x15'))['db'];function respondWithStatusCode(_0x1ec305,_0x2618a1){_0x2618a1=_0x2618a1||0xcc;return function(_0xc486c4){if(_0xc486c4){return _0x1ec305[_0x1bf1('0x16')](_0x2618a1);}return _0x1ec305[_0x1bf1('0x17')](_0x2618a1)['end']();};}function respondWithResult(_0x441a94,_0x23cc86){_0x23cc86=_0x23cc86||0xc8;return function(_0xb17274){if(_0xb17274){return _0x441a94[_0x1bf1('0x17')](_0x23cc86)[_0x1bf1('0x18')](_0xb17274);}};}function respondWithFilteredResult(_0x502b98,_0x47660f){return function(_0x5c05fc){if(_0x5c05fc){var _0x22d356=_0x5c05fc[_0x1bf1('0x19')],_0x391cbc=_0x47660f['offset'],_0x1d2183=_0x47660f['offset']+_0x47660f['limit'],_0x46d8b6;if(_0x1d2183>=_0x22d356){_0x1d2183=_0x22d356;_0x46d8b6=0xc8;}else{_0x46d8b6=0xce;}_0x502b98[_0x1bf1('0x17')](_0x46d8b6);return _0x502b98[_0x1bf1('0x1a')]('Content-Range',_0x391cbc+'-'+_0x1d2183+'/'+_0x22d356)[_0x1bf1('0x18')](_0x5c05fc);}return null;};}function patchUpdates(_0x1dfeee){return function(_0x309221){try{jsonpatch[_0x1bf1('0x1b')](_0x309221,_0x1dfeee,!![]);}catch(_0x403b9c){return BPromise[_0x1bf1('0x1c')](_0x403b9c);}return _0x309221[_0x1bf1('0x1d')]();};}function saveUpdates(_0x377f51,_0x3776bd){return function(_0x5cd95f){if(_0x5cd95f){return _0x5cd95f[_0x1bf1('0x1e')](_0x377f51)['then'](function(_0x3045bd){return _0x3045bd;});}return null;};}function removeEntity(_0x42c45a,_0x2a4603){return function(_0x19cc86){if(_0x19cc86){return _0x19cc86[_0x1bf1('0x1f')]()[_0x1bf1('0x20')](function(){_0x42c45a[_0x1bf1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x204911,_0x3cd5c6){return function(_0xf63cac){if(!_0xf63cac){_0x204911[_0x1bf1('0x16')](0x194);}return _0xf63cac;};}function handleError(_0x4b2f45,_0x8418c5){_0x8418c5=_0x8418c5||0x1f4;return function(_0x49cbce){logger[_0x1bf1('0x21')](_0x49cbce[_0x1bf1('0x22')]);if(_0x49cbce[_0x1bf1('0x23')]){delete _0x49cbce[_0x1bf1('0x23')];}_0x4b2f45[_0x1bf1('0x17')](_0x8418c5)[_0x1bf1('0x24')](_0x49cbce);};}exports[_0x1bf1('0x25')]=function(_0x4b4557,_0x4c2adf){var _0x22aca0={},_0x4fc14c={},_0x39beeb={'count':0x0,'rows':[]};var _0x9c614e=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x2bd077){return{'name':_0x2bd077[_0x1bf1('0x26')],'type':_0x2bd077[_0x1bf1('0x27')][_0x1bf1('0x28')]};});_0x4fc14c[_0x1bf1('0x29')]=_[_0x1bf1('0x2a')](_0x9c614e,_0x1bf1('0x23'));_0x4fc14c['query']=_[_0x1bf1('0x2b')](_0x4b4557[_0x1bf1('0x2c')]);_0x4fc14c[_0x1bf1('0x2d')]=_[_0x1bf1('0x2e')](_0x4fc14c[_0x1bf1('0x29')],_0x4fc14c[_0x1bf1('0x2c')]);_0x22aca0[_0x1bf1('0x2f')]=_[_0x1bf1('0x2e')](_0x4fc14c[_0x1bf1('0x29')],qs[_0x1bf1('0x30')](_0x4b4557['query'][_0x1bf1('0x30')]));_0x22aca0[_0x1bf1('0x2f')]=_0x22aca0[_0x1bf1('0x2f')]['length']?_0x22aca0[_0x1bf1('0x2f')]:_0x4fc14c[_0x1bf1('0x29')];if(!_0x4b4557[_0x1bf1('0x2c')][_0x1bf1('0x31')](_0x1bf1('0x32'))){_0x22aca0[_0x1bf1('0x33')]=qs[_0x1bf1('0x33')](_0x4b4557['query'][_0x1bf1('0x33')]);_0x22aca0[_0x1bf1('0x34')]=qs[_0x1bf1('0x34')](_0x4b4557[_0x1bf1('0x2c')][_0x1bf1('0x34')]);}_0x22aca0['order']=qs['sort'](_0x4b4557[_0x1bf1('0x2c')][_0x1bf1('0x35')]);_0x22aca0['where']=qs[_0x1bf1('0x2d')](_[_0x1bf1('0x36')](_0x4b4557['query'],_0x4fc14c[_0x1bf1('0x2d')]),_0x9c614e);if(_0x4b4557[_0x1bf1('0x2c')][_0x1bf1('0x37')]){_0x22aca0['where']=_[_0x1bf1('0x38')](_0x22aca0[_0x1bf1('0x39')],{'$or':_[_0x1bf1('0x2a')](_0x9c614e,function(_0xd1531d){if(_0xd1531d['type']!==_0x1bf1('0x3a')){var _0x460ba8={};_0x460ba8[_0xd1531d[_0x1bf1('0x23')]]={'$like':'%'+_0x4b4557[_0x1bf1('0x2c')]['filter']+'%'};return _0x460ba8;}})});}_0x22aca0=_['merge']({},_0x22aca0,_0x4b4557[_0x1bf1('0x3b')]);var _0x4c8719={'where':_0x22aca0['where']};return db['ChatQueueReport'][_0x1bf1('0x19')](_0x4c8719)[_0x1bf1('0x20')](function(_0x5b9857){_0x39beeb[_0x1bf1('0x19')]=_0x5b9857;if(_0x4b4557['query']['includeAll']){_0x22aca0[_0x1bf1('0x3c')]=[{'all':!![]}];}return db[_0x1bf1('0x3d')][_0x1bf1('0x3e')](_0x22aca0);})[_0x1bf1('0x20')](function(_0x4f1180){_0x39beeb[_0x1bf1('0x3f')]=_0x4f1180;return _0x39beeb;})[_0x1bf1('0x20')](respondWithFilteredResult(_0x4c2adf,_0x22aca0))['catch'](handleError(_0x4c2adf,null));};exports[_0x1bf1('0x40')]=function(_0x5ee29c,_0x37189b){var _0x1f2641={'raw':!![],'where':{'id':_0x5ee29c[_0x1bf1('0x41')]['id']}},_0x52de2d={};_0x52de2d[_0x1bf1('0x29')]=_[_0x1bf1('0x2b')](db[_0x1bf1('0x3d')][_0x1bf1('0x42')]);_0x52de2d[_0x1bf1('0x2c')]=_[_0x1bf1('0x2b')](_0x5ee29c[_0x1bf1('0x2c')]);_0x52de2d[_0x1bf1('0x2d')]=_[_0x1bf1('0x2e')](_0x52de2d[_0x1bf1('0x29')],_0x52de2d[_0x1bf1('0x2c')]);_0x1f2641[_0x1bf1('0x2f')]=_['intersection'](_0x52de2d[_0x1bf1('0x29')],qs[_0x1bf1('0x30')](_0x5ee29c[_0x1bf1('0x2c')][_0x1bf1('0x30')]));_0x1f2641[_0x1bf1('0x2f')]=_0x1f2641['attributes'][_0x1bf1('0x43')]?_0x1f2641['attributes']:_0x52de2d[_0x1bf1('0x29')];if(_0x5ee29c['query'][_0x1bf1('0x44')]){_0x1f2641[_0x1bf1('0x3c')]=[{'all':!![]}];}_0x1f2641=_['merge']({},_0x1f2641,_0x5ee29c['options']);return db[_0x1bf1('0x3d')]['find'](_0x1f2641)[_0x1bf1('0x20')](handleEntityNotFound(_0x37189b,null))['then'](respondWithResult(_0x37189b,null))[_0x1bf1('0x45')](handleError(_0x37189b,null));};exports[_0x1bf1('0x46')]=function(_0xa7bf4a,_0x5703b5){return db[_0x1bf1('0x3d')]['create'](_0xa7bf4a[_0x1bf1('0x47')],{})[_0x1bf1('0x20')](respondWithResult(_0x5703b5,0xc9))[_0x1bf1('0x45')](handleError(_0x5703b5,null));};exports[_0x1bf1('0x1e')]=function(_0x28e3ce,_0x522a02){if(_0x28e3ce[_0x1bf1('0x47')]['id']){delete _0x28e3ce[_0x1bf1('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x28e3ce[_0x1bf1('0x41')]['id']}})[_0x1bf1('0x20')](handleEntityNotFound(_0x522a02,null))[_0x1bf1('0x20')](saveUpdates(_0x28e3ce[_0x1bf1('0x47')],null))[_0x1bf1('0x20')](respondWithResult(_0x522a02,null))['catch'](handleError(_0x522a02,null));};exports['destroy']=function(_0x2a4032,_0x33ff4a){return db[_0x1bf1('0x3d')]['find']({'where':{'id':_0x2a4032['params']['id']}})[_0x1bf1('0x20')](handleEntityNotFound(_0x33ff4a,null))['then'](removeEntity(_0x33ff4a,null))[_0x1bf1('0x45')](handleError(_0x33ff4a,null));};exports[_0x1bf1('0x48')]=function(_0xa5e83e,_0x2b0feb){return db['ChatQueueReport'][_0x1bf1('0x48')]()[_0x1bf1('0x20')](respondWithResult(_0x2b0feb,null))[_0x1bf1('0x45')](handleError(_0x2b0feb,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index c83837c..daa35db 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 _0xffb3=['request-promise','path','rimraf','exports','define','ChatQueueReport','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffb3,0xcf));var _0x3ffb=function(_0x41e94f,_0x264b17){_0x41e94f=_0x41e94f-0x0;var _0x399443=_0xffb3[_0x41e94f];return _0x399443;};'use strict';var _=require(_0x3ffb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3ffb('0x1'));var fs=require('fs');var path=require(_0x3ffb('0x2'));var rimraf=require(_0x3ffb('0x3'));var config=require('../../config/environment');var attributes=require('./chatQueueReport.attributes');module[_0x3ffb('0x4')]=function(_0x20cd15,_0x3d357a){return _0x20cd15[_0x3ffb('0x5')](_0x3ffb('0x6'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x3ffb('0x7'),'fields':[_0x3ffb('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe852=['request-promise','path','rimraf','./chatQueueReport.attributes','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x410d65,_0x132b7f){var _0x36b2a1=function(_0x177938){while(--_0x177938){_0x410d65['push'](_0x410d65['shift']());}};_0x36b2a1(++_0x132b7f);}(_0xe852,0x1c3));var _0x2e85=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xe852[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x2e85('0x0'));var util=require(_0x2e85('0x1'));var logger=require(_0x2e85('0x2'))('api');var moment=require(_0x2e85('0x3'));var BPromise=require(_0x2e85('0x4'));var rp=require(_0x2e85('0x5'));var fs=require('fs');var path=require(_0x2e85('0x6'));var rimraf=require(_0x2e85('0x7'));var config=require('../../config/environment');var attributes=require(_0x2e85('0x8'));module['exports']=function(_0x2c69ca,_0x28fb86){return _0x2c69ca['define'](_0x2e85('0x9'),attributes,{'tableName':_0x2e85('0xa'),'paranoid':![],'indexes':[{'name':_0x2e85('0xb'),'fields':[_0x2e85('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 0ff4096..6d2fca1 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 _0x598f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateChatQueueReport','create','options','raw','catch','update','body','attributes','limit','then','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x132aed,_0x2eaf18){var _0x5ece16=function(_0x2988cf){while(--_0x2988cf){_0x132aed['push'](_0x132aed['shift']());}};_0x5ece16(++_0x2eaf18);}(_0x598f,0x164));var _0xf598=function(_0x9f4379,_0x140019){_0x9f4379=_0x9f4379-0x0;var _0x291cd8=_0x598f[_0x9f4379];return _0x291cd8;};'use strict';var _=require(_0xf598('0x0'));var util=require('util');var moment=require(_0xf598('0x1'));var BPromise=require(_0xf598('0x2'));var rs=require(_0xf598('0x3'));var fs=require('fs');var Redis=require(_0xf598('0x4'));var db=require(_0xf598('0x5'))['db'];var utils=require(_0xf598('0x6'));var logger=require(_0xf598('0x7'))(_0xf598('0x8'));var config=require(_0xf598('0x9'));var jayson=require(_0xf598('0xa'));var client=jayson[_0xf598('0xb')][_0xf598('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe4d58,_0x4a0408,_0x2f2786){return new BPromise(function(_0x10e30f,_0x5cb85a){return client[_0xf598('0xd')](_0xe4d58,_0x2f2786)['then'](function(_0x3e9e8c){logger[_0xf598('0xe')](_0xf598('0xf'),_0x4a0408,_0xf598('0x10'));logger[_0xf598('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x4a0408,'request\x20sent',JSON[_0xf598('0x12')](_0x3e9e8c));if(_0x3e9e8c[_0xf598('0x13')]){if(_0x3e9e8c[_0xf598('0x13')]['code']===0x1f4){logger[_0xf598('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x4a0408,_0x3e9e8c[_0xf598('0x13')][_0xf598('0x14')]);return _0x5cb85a(_0x3e9e8c[_0xf598('0x13')][_0xf598('0x14')]);}logger[_0xf598('0x13')](_0xf598('0xf'),_0x4a0408,_0x3e9e8c['error'][_0xf598('0x14')]);return _0x10e30f(_0x3e9e8c['error'][_0xf598('0x14')]);}else{logger[_0xf598('0xe')](_0xf598('0xf'),_0x4a0408,_0xf598('0x10'));_0x10e30f(_0x3e9e8c[_0xf598('0x15')][_0xf598('0x14')]);}})['catch'](function(_0x571e2f){logger[_0xf598('0x13')](_0xf598('0xf'),_0x4a0408,_0x571e2f);_0x5cb85a(_0x571e2f);});});}exports[_0xf598('0x16')]=function(_0x5a367e){var _0x3dc18a=this;return new Promise(function(_0x73a4f,_0x3b066f){return db['ChatQueueReport'][_0xf598('0x17')](_0x5a367e['body'],{'raw':_0x5a367e[_0xf598('0x18')]?_0x5a367e[_0xf598('0x18')][_0xf598('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x472d30){logger[_0xf598('0xe')]('CreateChatQueueReport',_0x5a367e);logger['debug'](_0xf598('0x16'),_0x5a367e,JSON[_0xf598('0x12')](_0x472d30));_0x73a4f(_0x472d30);})[_0xf598('0x1a')](function(_0x432483){logger[_0xf598('0x13')](_0xf598('0x16'),_0x432483[_0xf598('0x14')],_0x5a367e);_0x3b066f(_0x3dc18a[_0xf598('0x13')](0x1f4,_0x432483['message']));});});};exports['UpdateChatQueueReport']=function(_0x4d9549){var _0x14fd16=this;return new Promise(function(_0x5405ee,_0x409104){return db['ChatQueueReport'][_0xf598('0x1b')](_0x4d9549[_0xf598('0x1c')],{'raw':_0x4d9549[_0xf598('0x18')]?_0x4d9549[_0xf598('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d9549[_0xf598('0x18')]?_0x4d9549['options']['where']||null:null,'attributes':_0x4d9549['options']?_0x4d9549[_0xf598('0x18')][_0xf598('0x1d')]||null:null,'limit':_0x4d9549[_0xf598('0x18')]?_0x4d9549[_0xf598('0x18')][_0xf598('0x1e')]||null:null})[_0xf598('0x1f')](function(_0x4f469e){logger[_0xf598('0xe')](_0xf598('0x20'),_0x4d9549);logger[_0xf598('0x11')](_0xf598('0x20'),_0x4d9549,JSON[_0xf598('0x12')](_0x4f469e));_0x5405ee(_0x4f469e);})[_0xf598('0x1a')](function(_0x20753a){logger['error'](_0xf598('0x20'),_0x20753a['message'],_0x4d9549);_0x409104(_0x14fd16[_0xf598('0x13')](0x1f4,_0x20753a[_0xf598('0x14')]));});});};
\ No newline at end of file
+var _0x9634=['where','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','body','options','raw','ChatQueueReport','update'];(function(_0xc7ec9d,_0x21a74c){var _0xdded82=function(_0x4cf4c0){while(--_0x4cf4c0){_0xc7ec9d['push'](_0xc7ec9d['shift']());}};_0xdded82(++_0x21a74c);}(_0x9634,0x88));var _0x4963=function(_0x18fce3,_0x26b8fc){_0x18fce3=_0x18fce3-0x0;var _0x35427e=_0x9634[_0x18fce3];return _0x35427e;};'use strict';var _=require(_0x4963('0x0'));var util=require('util');var moment=require(_0x4963('0x1'));var BPromise=require(_0x4963('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4963('0x3'));var db=require(_0x4963('0x4'))['db'];var utils=require(_0x4963('0x5'));var logger=require(_0x4963('0x6'))('rpc');var config=require(_0x4963('0x7'));var jayson=require(_0x4963('0x8'));var client=jayson[_0x4963('0x9')][_0x4963('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x119b15,_0x2cd19c,_0xeac37b){return new BPromise(function(_0x368daf,_0x1dbb8d){return client['request'](_0x119b15,_0xeac37b)[_0x4963('0xb')](function(_0x561b94){logger[_0x4963('0xc')](_0x4963('0xd'),_0x2cd19c,_0x4963('0xe'));logger[_0x4963('0xf')](_0x4963('0x10'),_0x2cd19c,_0x4963('0xe'),JSON[_0x4963('0x11')](_0x561b94));if(_0x561b94[_0x4963('0x12')]){if(_0x561b94[_0x4963('0x12')][_0x4963('0x13')]===0x1f4){logger[_0x4963('0x12')](_0x4963('0xd'),_0x2cd19c,_0x561b94['error'][_0x4963('0x14')]);return _0x1dbb8d(_0x561b94[_0x4963('0x12')][_0x4963('0x14')]);}logger[_0x4963('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x2cd19c,_0x561b94[_0x4963('0x12')][_0x4963('0x14')]);return _0x368daf(_0x561b94[_0x4963('0x12')][_0x4963('0x14')]);}else{logger['info'](_0x4963('0xd'),_0x2cd19c,_0x4963('0xe'));_0x368daf(_0x561b94[_0x4963('0x15')]['message']);}})[_0x4963('0x16')](function(_0x2a7595){logger[_0x4963('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x2cd19c,_0x2a7595);_0x1dbb8d(_0x2a7595);});});}exports[_0x4963('0x17')]=function(_0x369f0e){var _0x30d0c7=this;return new Promise(function(_0x3e6fee,_0xd76b9c){return db['ChatQueueReport']['create'](_0x369f0e[_0x4963('0x18')],{'raw':_0x369f0e['options']?_0x369f0e[_0x4963('0x19')][_0x4963('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1f2dac){logger[_0x4963('0xc')](_0x4963('0x17'),_0x369f0e);logger[_0x4963('0xf')]('CreateChatQueueReport',_0x369f0e,JSON['stringify'](_0x1f2dac));_0x3e6fee(_0x1f2dac);})[_0x4963('0x16')](function(_0x4ab8e7){logger[_0x4963('0x12')](_0x4963('0x17'),_0x4ab8e7[_0x4963('0x14')],_0x369f0e);_0xd76b9c(_0x30d0c7[_0x4963('0x12')](0x1f4,_0x4ab8e7['message']));});});};exports['UpdateChatQueueReport']=function(_0xf1e29a){var _0x265a8d=this;return new Promise(function(_0x4dfe4f,_0x181d1c){return db[_0x4963('0x1b')][_0x4963('0x1c')](_0xf1e29a['body'],{'raw':_0xf1e29a[_0x4963('0x19')]?_0xf1e29a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf1e29a['options']?_0xf1e29a[_0x4963('0x19')][_0x4963('0x1d')]||null:null,'attributes':_0xf1e29a[_0x4963('0x19')]?_0xf1e29a[_0x4963('0x19')][_0x4963('0x1e')]||null:null,'limit':_0xf1e29a['options']?_0xf1e29a[_0x4963('0x19')][_0x4963('0x1f')]||null:null})[_0x4963('0xb')](function(_0xc59249){logger[_0x4963('0xc')](_0x4963('0x20'),_0xf1e29a);logger[_0x4963('0xf')](_0x4963('0x20'),_0xf1e29a,JSON[_0x4963('0x11')](_0xc59249));_0x4dfe4f(_0xc59249);})['catch'](function(_0x3fcc52){logger['error'](_0x4963('0x20'),_0x3fcc52['message'],_0xf1e29a);_0x181d1c(_0x265a8d[_0x4963('0x12')](0x1f4,_0x3fcc52[_0x4963('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index b914696..25a1aa9 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 _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x312272,_0x48dfd5){var _0x54300d=function(_0x4fea05){while(--_0x4fea05){_0x312272['push'](_0x312272['shift']());}};_0x54300d(++_0x48dfd5);}(_0x2ef3,0xba));var _0x32ef=function(_0x5e0d11,_0x252719){_0x5e0d11=_0x5e0d11-0x0;var _0x4539a6=_0x2ef3[_0x5e0d11];return _0x4539a6;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router;
\ No newline at end of file
+var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete'];(function(_0x553ff1,_0x2db566){var _0x217cb3=function(_0x4334c3){while(--_0x4334c3){_0x553ff1['push'](_0x553ff1['shift']());}};_0x217cb3(++_0x2db566);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index d830479..cd2327d 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 _0xebb3=['queue','DATE','NOW','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x316b2d,_0x460caa){var _0x34d4e5=function(_0x534e56){while(--_0x534e56){_0x316b2d['push'](_0x316b2d['shift']());}};_0x34d4e5(++_0x460caa);}(_0xebb3,0x1e9));var _0x3ebb=function(_0x39d9d7,_0xb6691){_0x39d9d7=_0x39d9d7-0x0;var _0x3b1c1d=_0xebb3[_0x39d9d7];return _0x3b1c1d;};'use strict';var moment=require('moment');var Sequelize=require(_0x3ebb('0x0'));module[_0x3ebb('0x1')]={'uniqueid':{'type':Sequelize[_0x3ebb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3ebb('0x3')](_0x3ebb('0x4'),_0x3ebb('0x5'),_0x3ebb('0x6')),'allowNull':![],'defaultValue':_0x3ebb('0x6')},'transferredAt':{'type':Sequelize[_0x3ebb('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x3ebb('0x8')]}};
\ No newline at end of file
+var _0x4939=['queue','NOW','moment','exports','ENUM','account','agent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4939,0x1ec));var _0x9493=function(_0xb67a96,_0x11dd77){_0xb67a96=_0xb67a96-0x0;var _0x598250=_0x4939[_0xb67a96];return _0x598250;};'use strict';var moment=require(_0x9493('0x0'));var Sequelize=require('sequelize');module[_0x9493('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9493('0x2')](_0x9493('0x3'),_0x9493('0x4'),_0x9493('0x5')),'allowNull':![],'defaultValue':_0x9493('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9493('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index da67a6d..d9bff1f 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 _0x5f66=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','error','stack','send','index','map','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel'];(function(_0x2f8aa5,_0x2cf56a){var _0x5800c=function(_0x54c4ca){while(--_0x54c4ca){_0x2f8aa5['push'](_0x2f8aa5['shift']());}};_0x5800c(++_0x2cf56a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=_0x19b9ff[_0x65f6('0x18')],_0x5dd324=_0x59154e[_0x65f6('0x19')],_0x1693e6=_0x59154e[_0x65f6('0x19')]+_0x59154e[_0x65f6('0x1a')],_0x5c69f8;if(_0x1693e6>=_0x49a913){_0x1693e6=_0x49a913;_0x5c69f8=0xc8;}else{_0x5c69f8=0xce;}_0x3440af[_0x65f6('0x15')](_0x5c69f8);return _0x3440af[_0x65f6('0x1b')]('Content-Range',_0x5dd324+'-'+_0x1693e6+'/'+_0x49a913)['json'](_0x19b9ff);}return null;};}function patchUpdates(_0x2d538c){return function(_0x5b4055){try{jsonpatch['apply'](_0x5b4055,_0x2d538c,!![]);}catch(_0x5c5b91){return BPromise[_0x65f6('0x1c')](_0x5c5b91);}return _0x5b4055[_0x65f6('0x1d')]();};}function saveUpdates(_0x5114a4,_0x39e19f){return function(_0x270893){if(_0x270893){return _0x270893[_0x65f6('0x1e')](_0x5114a4)[_0x65f6('0x1f')](function(_0x219ab2){return _0x219ab2;});}return null;};}function removeEntity(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['destroy']()['then'](function(){_0xc139c2[_0x65f6('0x15')](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0x524e42,_0x1eeaaa){return function(_0x471a33){if(!_0x471a33){_0x524e42[_0x65f6('0x14')](0x194);}return _0x471a33;};}function handleError(_0x2774a1,_0x4f5a69){_0x4f5a69=_0x4f5a69||0x1f4;return function(_0x9d7bb0){logger[_0x65f6('0x20')](_0x9d7bb0[_0x65f6('0x21')]);if(_0x9d7bb0['name']){delete _0x9d7bb0['name'];}_0x2774a1['status'](_0x4f5a69)[_0x65f6('0x22')](_0x9d7bb0);};}exports[_0x65f6('0x23')]=function(_0x4b2292,_0x296cd9){var _0x28f710={},_0x52277c={},_0x325cb4={'count':0x0,'rows':[]};var _0x2bff2b=_[_0x65f6('0x24')](db['ChatTransferReport']['rawAttributes'],function(_0x488d36){return{'name':_0x488d36[_0x65f6('0x25')],'type':_0x488d36[_0x65f6('0x26')][_0x65f6('0x27')]};});_0x52277c[_0x65f6('0x28')]=_[_0x65f6('0x24')](_0x2bff2b,_0x65f6('0x29'));_0x52277c[_0x65f6('0x2a')]=_['keys'](_0x4b2292['query']);_0x52277c[_0x65f6('0x2b')]=_[_0x65f6('0x2c')](_0x52277c['model'],_0x52277c['query']);_0x28f710[_0x65f6('0x2d')]=_[_0x65f6('0x2c')](_0x52277c[_0x65f6('0x28')],qs[_0x65f6('0x2e')](_0x4b2292[_0x65f6('0x2a')][_0x65f6('0x2e')]));_0x28f710['attributes']=_0x28f710[_0x65f6('0x2d')][_0x65f6('0x2f')]?_0x28f710[_0x65f6('0x2d')]:_0x52277c['model'];if(!_0x4b2292[_0x65f6('0x2a')][_0x65f6('0x30')](_0x65f6('0x31'))){_0x28f710[_0x65f6('0x1a')]=qs[_0x65f6('0x1a')](_0x4b2292[_0x65f6('0x2a')]['limit']);_0x28f710[_0x65f6('0x19')]=qs[_0x65f6('0x19')](_0x4b2292['query'][_0x65f6('0x19')]);}_0x28f710['order']=qs[_0x65f6('0x32')](_0x4b2292['query'][_0x65f6('0x32')]);_0x28f710[_0x65f6('0x33')]=qs['filters'](_[_0x65f6('0x34')](_0x4b2292[_0x65f6('0x2a')],_0x52277c[_0x65f6('0x2b')]),_0x2bff2b);if(_0x4b2292['query']['filter']){_0x28f710[_0x65f6('0x33')]=_['merge'](_0x28f710[_0x65f6('0x33')],{'$or':_['map'](_0x2bff2b,function(_0x22d760){if(_0x22d760[_0x65f6('0x26')]!=='VIRTUAL'){var _0x44b809={};_0x44b809[_0x22d760['name']]={'$like':'%'+_0x4b2292['query'][_0x65f6('0x35')]+'%'};return _0x44b809;}})});}_0x28f710=_[_0x65f6('0x36')]({},_0x28f710,_0x4b2292[_0x65f6('0x37')]);var _0x313be5={'where':_0x28f710[_0x65f6('0x33')]};return db[_0x65f6('0x38')][_0x65f6('0x18')](_0x313be5)[_0x65f6('0x1f')](function(_0x4f933b){_0x325cb4[_0x65f6('0x18')]=_0x4f933b;if(_0x4b2292['query'][_0x65f6('0x39')]){_0x28f710[_0x65f6('0x3a')]=[{'all':!![]}];}return db[_0x65f6('0x38')][_0x65f6('0x3b')](_0x28f710);})['then'](function(_0x32148f){_0x325cb4[_0x65f6('0x3c')]=_0x32148f;return _0x325cb4;})[_0x65f6('0x1f')](respondWithFilteredResult(_0x296cd9,_0x28f710))[_0x65f6('0x3d')](handleError(_0x296cd9,null));};exports[_0x65f6('0x3e')]=function(_0x3f6103,_0xed4c96){var _0x2acca5={'raw':!![],'where':{'id':_0x3f6103['params']['id']}},_0x35c195={};_0x35c195[_0x65f6('0x28')]=_[_0x65f6('0x3f')](db[_0x65f6('0x38')][_0x65f6('0x40')]);_0x35c195[_0x65f6('0x2a')]=_[_0x65f6('0x3f')](_0x3f6103[_0x65f6('0x2a')]);_0x35c195[_0x65f6('0x2b')]=_[_0x65f6('0x2c')](_0x35c195[_0x65f6('0x28')],_0x35c195[_0x65f6('0x2a')]);_0x2acca5[_0x65f6('0x2d')]=_[_0x65f6('0x2c')](_0x35c195[_0x65f6('0x28')],qs[_0x65f6('0x2e')](_0x3f6103[_0x65f6('0x2a')]['fields']));_0x2acca5[_0x65f6('0x2d')]=_0x2acca5[_0x65f6('0x2d')][_0x65f6('0x2f')]?_0x2acca5[_0x65f6('0x2d')]:_0x35c195['model'];if(_0x3f6103[_0x65f6('0x2a')][_0x65f6('0x39')]){_0x2acca5[_0x65f6('0x3a')]=[{'all':!![]}];}_0x2acca5=_['merge']({},_0x2acca5,_0x3f6103[_0x65f6('0x37')]);return db[_0x65f6('0x38')][_0x65f6('0x41')](_0x2acca5)[_0x65f6('0x1f')](handleEntityNotFound(_0xed4c96,null))['then'](respondWithResult(_0xed4c96,null))[_0x65f6('0x3d')](handleError(_0xed4c96,null));};exports['create']=function(_0x3f1baa,_0x6968b){return db['ChatTransferReport'][_0x65f6('0x42')](_0x3f1baa['body'],{})[_0x65f6('0x1f')](respondWithResult(_0x6968b,0xc9))[_0x65f6('0x3d')](handleError(_0x6968b,null));};exports[_0x65f6('0x1e')]=function(_0xc0db01,_0x3ec18f){if(_0xc0db01[_0x65f6('0x43')]['id']){delete _0xc0db01['body']['id'];}return db['ChatTransferReport'][_0x65f6('0x41')]({'where':{'id':_0xc0db01[_0x65f6('0x44')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x3ec18f,null))[_0x65f6('0x1f')](saveUpdates(_0xc0db01[_0x65f6('0x43')],null))[_0x65f6('0x1f')](respondWithResult(_0x3ec18f,null))[_0x65f6('0x3d')](handleError(_0x3ec18f,null));};exports[_0x65f6('0x45')]=function(_0x414f49,_0x517a47){return db[_0x65f6('0x38')][_0x65f6('0x41')]({'where':{'id':_0x414f49[_0x65f6('0x44')]['id']}})['then'](handleEntityNotFound(_0x517a47,null))[_0x65f6('0x1f')](removeEntity(_0x517a47,null))[_0x65f6('0x3d')](handleError(_0x517a47,null));};exports['describe']=function(_0x22d745,_0x253d52){return db['ChatTransferReport'][_0x65f6('0x46')]()['then'](respondWithResult(_0x253d52,null))[_0x65f6('0x3d')](handleError(_0x253d52,null));};
\ No newline at end of file
+var _0x5f66=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','error','stack','send','index','map','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel'];(function(_0x5f4f6e,_0x525be4){var _0x27224b=function(_0x3024af){while(--_0x3024af){_0x5f4f6e['push'](_0x5f4f6e['shift']());}};_0x27224b(++_0x525be4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=_0x19b9ff[_0x65f6('0x18')],_0x5dd324=_0x59154e[_0x65f6('0x19')],_0x1693e6=_0x59154e[_0x65f6('0x19')]+_0x59154e[_0x65f6('0x1a')],_0x5c69f8;if(_0x1693e6>=_0x49a913){_0x1693e6=_0x49a913;_0x5c69f8=0xc8;}else{_0x5c69f8=0xce;}_0x3440af[_0x65f6('0x15')](_0x5c69f8);return _0x3440af[_0x65f6('0x1b')]('Content-Range',_0x5dd324+'-'+_0x1693e6+'/'+_0x49a913)['json'](_0x19b9ff);}return null;};}function patchUpdates(_0x2d538c){return function(_0x5b4055){try{jsonpatch['apply'](_0x5b4055,_0x2d538c,!![]);}catch(_0x5c5b91){return BPromise[_0x65f6('0x1c')](_0x5c5b91);}return _0x5b4055[_0x65f6('0x1d')]();};}function saveUpdates(_0x5114a4,_0x39e19f){return function(_0x270893){if(_0x270893){return _0x270893[_0x65f6('0x1e')](_0x5114a4)[_0x65f6('0x1f')](function(_0x219ab2){return _0x219ab2;});}return null;};}function removeEntity(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['destroy']()['then'](function(){_0xc139c2[_0x65f6('0x15')](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0x524e42,_0x1eeaaa){return function(_0x471a33){if(!_0x471a33){_0x524e42[_0x65f6('0x14')](0x194);}return _0x471a33;};}function handleError(_0x2774a1,_0x4f5a69){_0x4f5a69=_0x4f5a69||0x1f4;return function(_0x9d7bb0){logger[_0x65f6('0x20')](_0x9d7bb0[_0x65f6('0x21')]);if(_0x9d7bb0['name']){delete _0x9d7bb0['name'];}_0x2774a1['status'](_0x4f5a69)[_0x65f6('0x22')](_0x9d7bb0);};}exports[_0x65f6('0x23')]=function(_0x4b2292,_0x296cd9){var _0x28f710={},_0x52277c={},_0x325cb4={'count':0x0,'rows':[]};var _0x2bff2b=_[_0x65f6('0x24')](db['ChatTransferReport']['rawAttributes'],function(_0x488d36){return{'name':_0x488d36[_0x65f6('0x25')],'type':_0x488d36[_0x65f6('0x26')][_0x65f6('0x27')]};});_0x52277c[_0x65f6('0x28')]=_[_0x65f6('0x24')](_0x2bff2b,_0x65f6('0x29'));_0x52277c[_0x65f6('0x2a')]=_['keys'](_0x4b2292['query']);_0x52277c[_0x65f6('0x2b')]=_[_0x65f6('0x2c')](_0x52277c['model'],_0x52277c['query']);_0x28f710[_0x65f6('0x2d')]=_[_0x65f6('0x2c')](_0x52277c[_0x65f6('0x28')],qs[_0x65f6('0x2e')](_0x4b2292[_0x65f6('0x2a')][_0x65f6('0x2e')]));_0x28f710['attributes']=_0x28f710[_0x65f6('0x2d')][_0x65f6('0x2f')]?_0x28f710[_0x65f6('0x2d')]:_0x52277c['model'];if(!_0x4b2292[_0x65f6('0x2a')][_0x65f6('0x30')](_0x65f6('0x31'))){_0x28f710[_0x65f6('0x1a')]=qs[_0x65f6('0x1a')](_0x4b2292[_0x65f6('0x2a')]['limit']);_0x28f710[_0x65f6('0x19')]=qs[_0x65f6('0x19')](_0x4b2292['query'][_0x65f6('0x19')]);}_0x28f710['order']=qs[_0x65f6('0x32')](_0x4b2292['query'][_0x65f6('0x32')]);_0x28f710[_0x65f6('0x33')]=qs['filters'](_[_0x65f6('0x34')](_0x4b2292[_0x65f6('0x2a')],_0x52277c[_0x65f6('0x2b')]),_0x2bff2b);if(_0x4b2292['query']['filter']){_0x28f710[_0x65f6('0x33')]=_['merge'](_0x28f710[_0x65f6('0x33')],{'$or':_['map'](_0x2bff2b,function(_0x22d760){if(_0x22d760[_0x65f6('0x26')]!=='VIRTUAL'){var _0x44b809={};_0x44b809[_0x22d760['name']]={'$like':'%'+_0x4b2292['query'][_0x65f6('0x35')]+'%'};return _0x44b809;}})});}_0x28f710=_[_0x65f6('0x36')]({},_0x28f710,_0x4b2292[_0x65f6('0x37')]);var _0x313be5={'where':_0x28f710[_0x65f6('0x33')]};return db[_0x65f6('0x38')][_0x65f6('0x18')](_0x313be5)[_0x65f6('0x1f')](function(_0x4f933b){_0x325cb4[_0x65f6('0x18')]=_0x4f933b;if(_0x4b2292['query'][_0x65f6('0x39')]){_0x28f710[_0x65f6('0x3a')]=[{'all':!![]}];}return db[_0x65f6('0x38')][_0x65f6('0x3b')](_0x28f710);})['then'](function(_0x32148f){_0x325cb4[_0x65f6('0x3c')]=_0x32148f;return _0x325cb4;})[_0x65f6('0x1f')](respondWithFilteredResult(_0x296cd9,_0x28f710))[_0x65f6('0x3d')](handleError(_0x296cd9,null));};exports[_0x65f6('0x3e')]=function(_0x3f6103,_0xed4c96){var _0x2acca5={'raw':!![],'where':{'id':_0x3f6103['params']['id']}},_0x35c195={};_0x35c195[_0x65f6('0x28')]=_[_0x65f6('0x3f')](db[_0x65f6('0x38')][_0x65f6('0x40')]);_0x35c195[_0x65f6('0x2a')]=_[_0x65f6('0x3f')](_0x3f6103[_0x65f6('0x2a')]);_0x35c195[_0x65f6('0x2b')]=_[_0x65f6('0x2c')](_0x35c195[_0x65f6('0x28')],_0x35c195[_0x65f6('0x2a')]);_0x2acca5[_0x65f6('0x2d')]=_[_0x65f6('0x2c')](_0x35c195[_0x65f6('0x28')],qs[_0x65f6('0x2e')](_0x3f6103[_0x65f6('0x2a')]['fields']));_0x2acca5[_0x65f6('0x2d')]=_0x2acca5[_0x65f6('0x2d')][_0x65f6('0x2f')]?_0x2acca5[_0x65f6('0x2d')]:_0x35c195['model'];if(_0x3f6103[_0x65f6('0x2a')][_0x65f6('0x39')]){_0x2acca5[_0x65f6('0x3a')]=[{'all':!![]}];}_0x2acca5=_['merge']({},_0x2acca5,_0x3f6103[_0x65f6('0x37')]);return db[_0x65f6('0x38')][_0x65f6('0x41')](_0x2acca5)[_0x65f6('0x1f')](handleEntityNotFound(_0xed4c96,null))['then'](respondWithResult(_0xed4c96,null))[_0x65f6('0x3d')](handleError(_0xed4c96,null));};exports['create']=function(_0x3f1baa,_0x6968b){return db['ChatTransferReport'][_0x65f6('0x42')](_0x3f1baa['body'],{})[_0x65f6('0x1f')](respondWithResult(_0x6968b,0xc9))[_0x65f6('0x3d')](handleError(_0x6968b,null));};exports[_0x65f6('0x1e')]=function(_0xc0db01,_0x3ec18f){if(_0xc0db01[_0x65f6('0x43')]['id']){delete _0xc0db01['body']['id'];}return db['ChatTransferReport'][_0x65f6('0x41')]({'where':{'id':_0xc0db01[_0x65f6('0x44')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x3ec18f,null))[_0x65f6('0x1f')](saveUpdates(_0xc0db01[_0x65f6('0x43')],null))[_0x65f6('0x1f')](respondWithResult(_0x3ec18f,null))[_0x65f6('0x3d')](handleError(_0x3ec18f,null));};exports[_0x65f6('0x45')]=function(_0x414f49,_0x517a47){return db[_0x65f6('0x38')][_0x65f6('0x41')]({'where':{'id':_0x414f49[_0x65f6('0x44')]['id']}})['then'](handleEntityNotFound(_0x517a47,null))[_0x65f6('0x1f')](removeEntity(_0x517a47,null))[_0x65f6('0x3d')](handleError(_0x517a47,null));};exports['describe']=function(_0x22d745,_0x253d52){return db['ChatTransferReport'][_0x65f6('0x46')]()['then'](respondWithResult(_0x253d52,null))[_0x65f6('0x3d')](handleError(_0x253d52,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 16515bb..d7aad18 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 _0xcbdb=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0xfc67b8,_0x32eab0){var _0x4d113d=function(_0xbab5d3){while(--_0xbab5d3){_0xfc67b8['push'](_0xfc67b8['shift']());}};_0x4d113d(++_0x32eab0);}(_0xcbdb,0x6b));var _0xbcbd=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xcbdb[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xbcbd('0x0'));var util=require(_0xbcbd('0x1'));var logger=require(_0xbcbd('0x2'))(_0xbcbd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbcbd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbcbd('0x5'));var config=require(_0xbcbd('0x6'));var attributes=require(_0xbcbd('0x7'));module[_0xbcbd('0x8')]=function(_0x18b045,_0x771491){return _0x18b045[_0xbcbd('0x9')](_0xbcbd('0xa'),attributes,{'tableName':_0xbcbd('0xb'),'paranoid':![],'indexes':[{'name':_0xbcbd('0xc'),'fields':[_0xbcbd('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f61=['uniqueid','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x3b827f,_0x5d7cd6){var _0x5f05d3=function(_0x51cb83){while(--_0x51cb83){_0x3b827f['push'](_0x3b827f['shift']());}};_0x5f05d3(++_0x5d7cd6);}(_0x1f61,0x83));var _0x11f6=function(_0x26ce99,_0x51c44a){_0x26ce99=_0x26ce99-0x0;var _0x69dd3d=_0x1f61[_0x26ce99];return _0x69dd3d;};'use strict';var _=require(_0x11f6('0x0'));var util=require(_0x11f6('0x1'));var logger=require('../../config/logger')(_0x11f6('0x2'));var moment=require(_0x11f6('0x3'));var BPromise=require(_0x11f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x11f6('0x5'));var config=require(_0x11f6('0x6'));var attributes=require(_0x11f6('0x7'));module[_0x11f6('0x8')]=function(_0x51900d,_0x1550ce){return _0x51900d[_0x11f6('0x9')](_0x11f6('0xa'),attributes,{'tableName':_0x11f6('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x11f6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index cbdc4da..0c9cb2c 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 _0x6ec7=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x107fd,_0x638b31){var _0x29df88=function(_0x5995d8){while(--_0x5995d8){_0x107fd['push'](_0x107fd['shift']());}};_0x29df88(++_0x638b31);}(_0x6ec7,0x8d));var _0x76ec=function(_0xa98fb3,_0x503b17){_0xa98fb3=_0xa98fb3-0x0;var _0x22751a=_0x6ec7[_0xa98fb3];return _0x22751a;};'use strict';var _=require(_0x76ec('0x0'));var util=require('util');var moment=require(_0x76ec('0x1'));var BPromise=require(_0x76ec('0x2'));var rs=require(_0x76ec('0x3'));var fs=require('fs');var Redis=require(_0x76ec('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76ec('0x5'));var logger=require('../../config/logger')(_0x76ec('0x6'));var config=require(_0x76ec('0x7'));var jayson=require(_0x76ec('0x8'));var client=jayson[_0x76ec('0x9')][_0x76ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15c407,_0x55de0f,_0x5c8c75){return new BPromise(function(_0x4c82dc,_0x271c0a){return client['request'](_0x15c407,_0x5c8c75)[_0x76ec('0xb')](function(_0x185546){logger[_0x76ec('0xc')](_0x76ec('0xd'),_0x55de0f,_0x76ec('0xe'));logger['debug'](_0x76ec('0xf'),_0x55de0f,_0x76ec('0xe'),JSON['stringify'](_0x185546));if(_0x185546['error']){if(_0x185546[_0x76ec('0x10')]['code']===0x1f4){logger[_0x76ec('0x10')](_0x76ec('0xd'),_0x55de0f,_0x185546['error'][_0x76ec('0x11')]);return _0x271c0a(_0x185546[_0x76ec('0x10')][_0x76ec('0x11')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x55de0f,_0x185546[_0x76ec('0x10')][_0x76ec('0x11')]);return _0x4c82dc(_0x185546[_0x76ec('0x10')][_0x76ec('0x11')]);}else{logger[_0x76ec('0xc')](_0x76ec('0xd'),_0x55de0f,_0x76ec('0xe'));_0x4c82dc(_0x185546[_0x76ec('0x12')][_0x76ec('0x11')]);}})[_0x76ec('0x13')](function(_0xe3abeb){logger[_0x76ec('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x55de0f,_0xe3abeb);_0x271c0a(_0xe3abeb);});});}
\ No newline at end of file
+var _0xc5c6=['rpc','../../config/environment','jayson/promise','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2e3766,_0x249b8d){var _0x428561=function(_0x2f401a){while(--_0x2f401a){_0x2e3766['push'](_0x2e3766['shift']());}};_0x428561(++_0x249b8d);}(_0xc5c6,0x8d));var _0x6c5c=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xc5c6[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x6c5c('0x0'));var util=require(_0x6c5c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6c5c('0x2'));var fs=require('fs');var Redis=require(_0x6c5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c5c('0x4'));var logger=require(_0x6c5c('0x5'))(_0x6c5c('0x6'));var config=require(_0x6c5c('0x7'));var jayson=require(_0x6c5c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55008c,_0x3f039a,_0x10b6ee){return new BPromise(function(_0x53ed8e,_0x248cef){return client[_0x6c5c('0x9')](_0x55008c,_0x10b6ee)[_0x6c5c('0xa')](function(_0x30f7ea){logger[_0x6c5c('0xb')](_0x6c5c('0xc'),_0x3f039a,'request\x20sent');logger[_0x6c5c('0xd')](_0x6c5c('0xe'),_0x3f039a,_0x6c5c('0xf'),JSON[_0x6c5c('0x10')](_0x30f7ea));if(_0x30f7ea[_0x6c5c('0x11')]){if(_0x30f7ea['error'][_0x6c5c('0x12')]===0x1f4){logger[_0x6c5c('0x11')](_0x6c5c('0xc'),_0x3f039a,_0x30f7ea[_0x6c5c('0x11')][_0x6c5c('0x13')]);return _0x248cef(_0x30f7ea[_0x6c5c('0x11')][_0x6c5c('0x13')]);}logger[_0x6c5c('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3f039a,_0x30f7ea[_0x6c5c('0x11')][_0x6c5c('0x13')]);return _0x53ed8e(_0x30f7ea[_0x6c5c('0x11')]['message']);}else{logger[_0x6c5c('0xb')](_0x6c5c('0xc'),_0x3f039a,'request\x20sent');_0x53ed8e(_0x30f7ea['result']['message']);}})[_0x6c5c('0x14')](function(_0x3c3e94){logger[_0x6c5c('0x11')](_0x6c5c('0xc'),_0x3f039a,_0x3c3e94);_0x248cef(_0x3c3e94);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 49aa4fd..3ff16e1 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 _0x2c4c=['delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put'];(function(_0x49892d,_0x497f14){var _0x4e3e3f=function(_0x2ad008){while(--_0x2ad008){_0x49892d['push'](_0x49892d['shift']());}};_0x4e3e3f(++_0x497f14);}(_0x2c4c,0x1d7));var _0xc2c4=function(_0x4a397d,_0x5bab1f){_0x4a397d=_0x4a397d-0x0;var _0x316571=_0x2c4c[_0x4a397d];return _0x316571;};'use strict';var multer=require(_0xc2c4('0x0'));var util=require('util');var path=require(_0xc2c4('0x1'));var timeout=require('connect-timeout');var express=require(_0xc2c4('0x2'));var router=express['Router']();var fs_extra=require(_0xc2c4('0x3'));var auth=require(_0xc2c4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc2c4('0x5'));var controller=require(_0xc2c4('0x6'));router[_0xc2c4('0x7')]('/',auth[_0xc2c4('0x8')](),controller['index']);router[_0xc2c4('0x7')](_0xc2c4('0x9'),auth['isAuthenticated'](),controller[_0xc2c4('0xa')]);router[_0xc2c4('0x7')](_0xc2c4('0xb'),auth['isAuthenticated'](),controller[_0xc2c4('0xc')]);router[_0xc2c4('0xd')]('/',auth[_0xc2c4('0x8')](),controller['create']);router[_0xc2c4('0xe')]('/:id',auth[_0xc2c4('0x8')](),controller['update']);router[_0xc2c4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc2c4('0x10')]);module[_0xc2c4('0x11')]=router;
\ No newline at end of file
+var _0xf364=['/:id','show','post','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x11f893,_0x259935){var _0x400fa8=function(_0x25933b){while(--_0x25933b){_0x11f893['push'](_0x11f893['shift']());}};_0x400fa8(++_0x259935);}(_0xf364,0x194));var _0x4f36=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xf364[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x4f36('0x0'));var util=require('util');var path=require(_0x4f36('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f36('0x2'));var router=express[_0x4f36('0x3')]();var fs_extra=require(_0x4f36('0x4'));var auth=require(_0x4f36('0x5'));var interaction=require(_0x4f36('0x6'));var config=require(_0x4f36('0x7'));var controller=require(_0x4f36('0x8'));router[_0x4f36('0x9')]('/',auth[_0x4f36('0xa')](),controller[_0x4f36('0xb')]);router['get'](_0x4f36('0xc'),auth[_0x4f36('0xa')](),controller[_0x4f36('0xd')]);router['get'](_0x4f36('0xe'),auth[_0x4f36('0xa')](),controller[_0x4f36('0xf')]);router[_0x4f36('0x10')]('/',auth[_0x4f36('0xa')](),controller[_0x4f36('0x11')]);router[_0x4f36('0x12')](_0x4f36('0xe'),auth[_0x4f36('0xa')](),controller[_0x4f36('0x13')]);router[_0x4f36('0x14')](_0x4f36('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f36('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index d7aa7b5..cc446b8 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 _0x008c=['email','Agent','#011F6A','INTEGER','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Skip','ENUM','stringify','input','name','text','onlineForm','parse','getDataValue','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x343003,_0x404558){var _0x407574=function(_0x4fd0ff){while(--_0x4fd0ff){_0x343003['push'](_0x343003['shift']());}};_0x407574(++_0x404558);}(_0x008c,0x188));var _0xc008=function(_0x4326eb,_0x1801c5){_0x4326eb=_0x4326eb-0x0;var _0x2735a3=_0x008c[_0x4326eb];return _0x2735a3;};'use strict';var Sequelize=require(_0xc008('0x0'));var rs=require(_0xc008('0x1'));module[_0xc008('0x2')]={'name':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xc008('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xc008('0x3')]},'mapKey':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x4')},'mapKeyOffline':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x4')},'key':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x5')},'customerAlias':{'type':Sequelize[_0xc008('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc008('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc008('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc008('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc008('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xc008('0x8')),'defaultValue':_0xc008('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xc008('0xa')},'start_chat_button':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0xb')},'offline_chat_button':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0xc')},'header_offline':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc008('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xc008('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xc008('0xf')]},'closingQuestion':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc008('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x11')},'placeholderMessage':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xc008('0x14')]('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xc008('0x15')]({'items':[{'type':_0xc008('0x16'),'variable':null,'config':{'placeholder':_0xc008('0x17'),'type':_0xc008('0x18'),'required':!![]},'props':{'title':_0xc008('0x17'),'helpText':''}},{'type':_0xc008('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xc008('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xc008('0x19'))?JSON[_0xc008('0x1a')](this[_0xc008('0x1b')](_0xc008('0x19'))):{};},'set':function(_0x5410f5){return this['setDataValue']('onlineForm',JSON[_0xc008('0x15')](_0x5410f5));}},'offlineForm':{'type':Sequelize[_0xc008('0xf')],'defaultValue':function(){return JSON[_0xc008('0x15')]({'items':[{'type':_0xc008('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xc008('0x1c'),'helpText':_0xc008('0x1d')}}],'fromKey':0x0});},'get':function(){return this[_0xc008('0x1b')]('offlineForm')?JSON[_0xc008('0x1a')](this[_0xc008('0x1b')](_0xc008('0x1e'))):{};},'set':function(_0x2a7d4f){return this['setDataValue'](_0xc008('0x1e'),JSON[_0xc008('0x15')](_0x2a7d4f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc008('0x3')]},'forwardOffline':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc008('0x3')]},'waitingTitle':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x1f')},'waitingMessage':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x21')},'offlineMessageBody':{'type':Sequelize[_0xc008('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xc008('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc008('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x13')},'sendUnmanaged':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xc008('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc008('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc008('0x22');}},'notificationSound':{'type':Sequelize[_0xc008('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x23')},'waitForTheAssignedAgent':{'type':Sequelize[_0xc008('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xc008('0x24')},'verticalAlignment':{'type':Sequelize[_0xc008('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xc008('0x25')},'defaultTitle':{'type':Sequelize[_0xc008('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc008('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xc008('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc008('0x3')],'defaultValue':_0xc008('0x26')},'systemAvatar':{'type':Sequelize[_0xc008('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc008('0x7')],'comment':_0xc008('0x27')},'mandatoryDisposition':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![],'comment':_0xc008('0x28'),'set':function(_0x35b496){if(!_0x35b496)this[_0xc008('0x29')](_0xc008('0x2a'),null);this[_0xc008('0x29')](_0xc008('0x2b'),_0x35b496);}},'vidaooEscalation':{'type':Sequelize[_0xc008('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc008('0x3')],'defaultValue':![]},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc008('0xf')]}};
\ No newline at end of file
+var _0x44e8=['name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Feedback','ENUM','star','stringify','input'];(function(_0x179733,_0x457dfc){var _0x370b8b=function(_0x40b3b4){while(--_0x40b3b4){_0x179733['push'](_0x179733['shift']());}};_0x370b8b(++_0x457dfc);}(_0x44e8,0xd7));var _0x844e=function(_0x112ea7,_0x33698b){_0x112ea7=_0x112ea7-0x0;var _0x194fb8=_0x44e8[_0x112ea7];return _0x194fb8;};'use strict';var Sequelize=require(_0x844e('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x844e('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x844e('0x1')],'allowNull':![],'unique':_0x844e('0x2')},'description':{'type':Sequelize[_0x844e('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x844e('0x3')},'mapKeyOffline':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x3')},'key':{'type':Sequelize[_0x844e('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x844e('0x4')},'customerAlias':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x844e('0x1')],'allowNull':![],'defaultValue':_0x844e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x844e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x844e('0x1')],'allowNull':![],'defaultValue':_0x844e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x844e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x844e('0x1')]},'animation':{'type':Sequelize[_0x844e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x844e('0x9'),_0x844e('0xa')),'defaultValue':_0x844e('0x9')},'header_online':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0xb')},'start_chat_button':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x844e('0xd')},'header_offline':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x844e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x844e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x844e('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x844e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x844e('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x844e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x12')},'noteTitle':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x13')},'placeholderMessage':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x14')},'ratingType':{'type':Sequelize[_0x844e('0x15')](_0x844e('0x16'),'thumb'),'defaultValue':_0x844e('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x844e('0x17')]({'items':[{'type':_0x844e('0x18'),'variable':null,'config':{'placeholder':_0x844e('0x19'),'type':_0x844e('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x844e('0x18'),'props':{'title':_0x844e('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x844e('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x844e('0x1b')](_0x844e('0x1c'))?JSON[_0x844e('0x1d')](this[_0x844e('0x1b')](_0x844e('0x1c'))):{};},'set':function(_0x498ae0){return this[_0x844e('0x1e')](_0x844e('0x1c'),JSON[_0x844e('0x17')](_0x498ae0));}},'offlineForm':{'type':Sequelize[_0x844e('0xf')],'defaultValue':function(){return JSON[_0x844e('0x17')]({'items':[{'type':'input','props':{'title':_0x844e('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x844e('0x1f'),'config':{'placeholder':_0x844e('0x20')},'props':{'title':_0x844e('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x844e('0x1b')](_0x844e('0x21'))?JSON[_0x844e('0x1d')](this['getDataValue'](_0x844e('0x21'))):{};},'set':function(_0x81d4de){return this[_0x844e('0x1e')](_0x844e('0x21'),JSON[_0x844e('0x17')](_0x81d4de));}},'token':{'type':Sequelize[_0x844e('0x1')],'defaultValue':function(){return rs[_0x844e('0x22')]();}},'autoclose':{'type':Sequelize[_0x844e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x844e('0x1')]},'waitingTitle':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x23')},'waitingMessage':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x844e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x844e('0x26')},'skipUnmanaged':{'type':Sequelize[_0x844e('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x844e('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x844e('0x1')]},'notificationTemplate':{'type':Sequelize[_0x844e('0xf')],'defaultValue':function(){return _0x844e('0x27');}},'notificationSound':{'type':Sequelize[_0x844e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x844e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x29')},'verticalAlignment':{'type':Sequelize[_0x844e('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x2a')},'defaultTitle':{'type':Sequelize[_0x844e('0x1')]},'customerAvatar':{'type':Sequelize[_0x844e('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x844e('0x1')],'allowNull':![],'defaultValue':_0x844e('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x844e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x844e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x844e('0x1')],'defaultValue':_0x844e('0x2c')},'systemAvatar':{'type':Sequelize[_0x844e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x844e('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x844e('0x2e'),'set':function(_0x535e21){if(!_0x535e21)this[_0x844e('0x1e')]('mandatoryDispositionPauseId',null);this[_0x844e('0x1e')](_0x844e('0x2f'),_0x535e21);}},'vidaooEscalation':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x844e('0x1')],'defaultValue':![]},'openNewInteraction':{'type':Sequelize[_0x844e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x844e('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 77d30be..8916f44 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 _0x5301=['iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getLicense','virtual','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','alignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','false','offlineForm','items','fromKey','getOfflineMessages','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','end','json','offset','limit','set','apply','save','then','destroy','ChatWebsites','stack','name','mandatoryDispositionPause','ChatWebsite','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','Pause','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','order','sort','ChatWebsiteId','rows','removeDispositions','ids','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','ChatApplication','Applications','account','applications','List','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','no\x20available\x20attributes','CompanyId','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','files','attachments','basename','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','subjectOffline','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone'];(function(_0x5826c4,_0x5061e6){var _0x4a8f6e=function(_0x54577f){while(--_0x54577f){_0x5826c4['push'](_0x5826c4['shift']());}};_0x4a8f6e(++_0x5061e6);}(_0x5301,0x157));var _0x1530=function(_0x216d62,_0xd392){_0x216d62=_0x216d62-0x0;var _0x8b2feb=_0x5301[_0x216d62];return _0x8b2feb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1530('0x0'));var zipdir=require(_0x1530('0x1'));var jsonpatch=require(_0x1530('0x2'));var rp=require(_0x1530('0x3'));var moment=require(_0x1530('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1530('0x5'));var util=require(_0x1530('0x6'));var path=require(_0x1530('0x7'));var sox=require(_0x1530('0x8'));var csv=require('to-csv');var ejs=require(_0x1530('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1530('0xa'));var squel=require('squel');var crypto=require(_0x1530('0xb'));var jsforce=require(_0x1530('0xc'));var deskjs=require(_0x1530('0xd'));var toCsv=require(_0x1530('0xe'));var querystring=require(_0x1530('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1530('0x10'));var qs=require(_0x1530('0x11'));var as=require(_0x1530('0x12'));var hardwareService=require(_0x1530('0x13'));var logger=require('../../config/logger')(_0x1530('0x14'));var utils=require(_0x1530('0x15'));var config=require(_0x1530('0x16'));var licenseUtil=require(_0x1530('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1530('0x18')](config[_0x1530('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x1530('0x1a'))(new Redis(config[_0x1530('0x19')]));require('./chatWebsite.socket')[_0x1530('0x1b')](socket);var jayson=require(_0x1530('0x1c'));var client=jayson[_0x1530('0x1d')][_0x1530('0x1e')]({'port':0x232c});var client9002=jayson[_0x1530('0x1d')][_0x1530('0x1e')]({'port':0x232a});var client9003=jayson[_0x1530('0x1d')][_0x1530('0x1e')]({'port':0x232b});var client9001=jayson[_0x1530('0x1d')][_0x1530('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x3c5eb3,_0xe0f8a0,_0x4da2b1,_0x1b8e27){return new BPromise(function(_0x164f5f,_0x4b2d5f){var _0x4b9006=_0x1b8e27||client;return _0x4b9006['request'](_0x3c5eb3,_0x4da2b1)['then'](function(_0x44027d){logger[_0x1530('0x1f')](_0x1530('0x20'),_0xe0f8a0,'request\x20sent');logger[_0x1530('0x21')](_0x1530('0x22'),_0xe0f8a0,'request\x20sent',JSON[_0x1530('0x23')](_0x44027d));if(_0x44027d[_0x1530('0x24')]){if(_0x44027d[_0x1530('0x24')][_0x1530('0x25')]===0x1f4){logger[_0x1530('0x24')]('ChatWebsite,\x20%s,\x20%s',_0xe0f8a0,_0x44027d[_0x1530('0x24')][_0x1530('0x26')]);return _0x4b2d5f(_0x44027d['error'][_0x1530('0x26')]);}logger[_0x1530('0x24')](_0x1530('0x20'),_0xe0f8a0,_0x44027d[_0x1530('0x24')][_0x1530('0x26')]);return _0x164f5f(_0x44027d[_0x1530('0x24')][_0x1530('0x26')]);}else{logger[_0x1530('0x1f')](_0x1530('0x20'),_0xe0f8a0,_0x1530('0x27'));_0x164f5f(_0x44027d['result'][_0x1530('0x26')]);}})[_0x1530('0x28')](function(_0xebb344){logger[_0x1530('0x24')]('ChatWebsite,\x20%s,\x20%s',_0xe0f8a0,_0xebb344);_0x4b2d5f(_0xebb344);});});}function respondWithStatusCode(_0x3d4844,_0x33f342){_0x33f342=_0x33f342||0xcc;return function(_0x3e1cd6){if(_0x3e1cd6){return _0x3d4844[_0x1530('0x29')](_0x33f342);}return _0x3d4844[_0x1530('0x2a')](_0x33f342)[_0x1530('0x2b')]();};}function respondWithResult(_0x265892,_0x4fe3ad){_0x4fe3ad=_0x4fe3ad||0xc8;return function(_0x703f85){if(_0x703f85){return _0x265892['status'](_0x4fe3ad)[_0x1530('0x2c')](_0x703f85);}};}function respondWithFilteredResult(_0xf96c11,_0x56f441){return function(_0x40346d){if(_0x40346d){var _0x33e4da=_0x40346d['count'],_0x34dea8=_0x56f441[_0x1530('0x2d')],_0x5815f6=_0x56f441[_0x1530('0x2d')]+_0x56f441[_0x1530('0x2e')],_0x2e75bc;if(_0x5815f6>=_0x33e4da){_0x5815f6=_0x33e4da;_0x2e75bc=0xc8;}else{_0x2e75bc=0xce;}_0xf96c11[_0x1530('0x2a')](_0x2e75bc);return _0xf96c11[_0x1530('0x2f')]('Content-Range',_0x34dea8+'-'+_0x5815f6+'/'+_0x33e4da)['json'](_0x40346d);}return null;};}function patchUpdates(_0x5b9137){return function(_0x5222b5){try{jsonpatch[_0x1530('0x30')](_0x5222b5,_0x5b9137,!![]);}catch(_0x501713){return BPromise['reject'](_0x501713);}return _0x5222b5[_0x1530('0x31')]();};}function saveUpdates(_0x2143d1,_0x4dc21a){return function(_0x464220){if(_0x464220){return _0x464220['update'](_0x2143d1)[_0x1530('0x32')](function(_0x453fbe){return _0x453fbe;});}return null;};}function removeEntity(_0x3295a7,_0x58c9f9){return function(_0x23209c){if(_0x23209c){return _0x23209c[_0x1530('0x33')]()['then'](function(){var _0x37713d=_0x23209c['get']({'plain':!![]});var _0x3d3454=_0x1530('0x34');return db['UserProfileResource'][_0x1530('0x33')]({'where':{'type':_0x3d3454,'resourceId':_0x37713d['id']}})[_0x1530('0x32')](function(){return _0x23209c;});})[_0x1530('0x32')](function(){_0x3295a7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa352be,_0x587bff){return function(_0x3525b2){if(!_0x3525b2){_0xa352be[_0x1530('0x29')](0x194);}return _0x3525b2;};}function handleError(_0x42dff9,_0x39f7fc){_0x39f7fc=_0x39f7fc||0x1f4;return function(_0x162e04){logger[_0x1530('0x24')](_0x162e04[_0x1530('0x35')]);if(_0x162e04[_0x1530('0x36')]){delete _0x162e04['name'];}_0x42dff9[_0x1530('0x2a')](_0x39f7fc)['send'](_0x162e04);};}exports['index']=function(_0x431e40,_0x52a019){var _0x192dd7={'include':[{'model':db['Pause'],'as':_0x1530('0x37')}]},_0x504fc2={},_0x42dc75={'count':0x0,'rows':[]};var _0x4d78b6=_['map'](db[_0x1530('0x38')]['rawAttributes'],function(_0x55171b){return{'name':_0x55171b[_0x1530('0x39')],'type':_0x55171b[_0x1530('0x3a')][_0x1530('0x3b')]};});_0x504fc2['model']=_[_0x1530('0x3c')](_0x4d78b6,'name');_0x504fc2[_0x1530('0x3d')]=_[_0x1530('0x3e')](_0x431e40['query']);_0x504fc2['filters']=_[_0x1530('0x3f')](_0x504fc2[_0x1530('0x40')],_0x504fc2[_0x1530('0x3d')]);_0x192dd7[_0x1530('0x41')]=_[_0x1530('0x3f')](_0x504fc2[_0x1530('0x40')],qs[_0x1530('0x42')](_0x431e40['query']['fields']));_0x192dd7['attributes']=_0x192dd7['attributes'][_0x1530('0x43')]?_0x192dd7[_0x1530('0x41')]:_0x504fc2[_0x1530('0x40')];if(!_0x431e40[_0x1530('0x3d')][_0x1530('0x44')](_0x1530('0x45'))){_0x192dd7[_0x1530('0x2e')]=qs[_0x1530('0x2e')](_0x431e40[_0x1530('0x3d')][_0x1530('0x2e')]);_0x192dd7[_0x1530('0x2d')]=qs[_0x1530('0x2d')](_0x431e40[_0x1530('0x3d')][_0x1530('0x2d')]);}_0x192dd7['order']=qs['sort'](_0x431e40[_0x1530('0x3d')]['sort']);_0x192dd7['where']=qs[_0x1530('0x46')](_[_0x1530('0x47')](_0x431e40[_0x1530('0x3d')],_0x504fc2[_0x1530('0x46')]),_0x4d78b6);if(_0x431e40['query'][_0x1530('0x48')]){_0x192dd7[_0x1530('0x49')]=_[_0x1530('0x4a')](_0x192dd7[_0x1530('0x49')],{'$or':_[_0x1530('0x3c')](_0x4d78b6,function(_0x32ae26){if(_0x32ae26[_0x1530('0x3a')]!==_0x1530('0x4b')){var _0x1e06d2={};_0x1e06d2[_0x32ae26[_0x1530('0x36')]]={'$like':'%'+_0x431e40[_0x1530('0x3d')][_0x1530('0x48')]+'%'};return _0x1e06d2;}})});}_0x192dd7=_[_0x1530('0x4a')]({},_0x192dd7,_0x431e40[_0x1530('0x4c')]);var _0x45896d={'where':_0x192dd7[_0x1530('0x49')]};return db['ChatWebsite']['count'](_0x45896d)[_0x1530('0x32')](function(_0x32840e){_0x42dc75[_0x1530('0x4d')]=_0x32840e;if(_0x431e40[_0x1530('0x3d')][_0x1530('0x4e')]){_0x192dd7[_0x1530('0x4f')]=[{'all':!![]}];}return db[_0x1530('0x38')][_0x1530('0x50')](_0x192dd7);})[_0x1530('0x32')](function(_0x4416fc){_0x42dc75['rows']=_0x4416fc;return _0x42dc75;})['then'](respondWithFilteredResult(_0x52a019,_0x192dd7))['catch'](handleError(_0x52a019,null));};exports[_0x1530('0x51')]=function(_0x58ba60,_0x191104){var _0x3472b3={'raw':![],'where':{'id':_0x58ba60[_0x1530('0x52')]['id']},'include':[{'model':db[_0x1530('0x53')],'as':_0x1530('0x37')}]},_0x4c31bb={};_0x4c31bb[_0x1530('0x40')]=_[_0x1530('0x3e')](db['ChatWebsite'][_0x1530('0x54')]);_0x4c31bb[_0x1530('0x3d')]=_[_0x1530('0x3e')](_0x58ba60['query']);_0x4c31bb['filters']=_[_0x1530('0x3f')](_0x4c31bb[_0x1530('0x40')],_0x4c31bb[_0x1530('0x3d')]);_0x3472b3[_0x1530('0x41')]=_[_0x1530('0x3f')](_0x4c31bb[_0x1530('0x40')],qs[_0x1530('0x42')](_0x58ba60['query'][_0x1530('0x42')]));_0x3472b3[_0x1530('0x41')]=_0x3472b3[_0x1530('0x41')][_0x1530('0x43')]?_0x3472b3[_0x1530('0x41')]:_0x4c31bb[_0x1530('0x40')];if(_0x58ba60['query'][_0x1530('0x4e')]){_0x3472b3[_0x1530('0x4f')]=[{'all':!![]}];}_0x3472b3=_[_0x1530('0x4a')]({},_0x3472b3,_0x58ba60[_0x1530('0x4c')]);return db['ChatWebsite']['find'](_0x3472b3)[_0x1530('0x32')](handleEntityNotFound(_0x191104,null))[_0x1530('0x32')](respondWithResult(_0x191104,null))[_0x1530('0x28')](handleError(_0x191104,null));};exports['create']=function(_0xe631f1,_0x2f6b9f){return db['ChatWebsite'][_0x1530('0x55')](_0xe631f1[_0x1530('0x56')],{})['then'](function(_0x25fa7b){var _0x49dc03=_0xe631f1[_0x1530('0x57')][_0x1530('0x58')]({'plain':!![]});if(!_0x49dc03)throw new Error(_0x1530('0x59'));if(_0x49dc03[_0x1530('0x5a')]==='user'){var _0x34ddf5=_0x25fa7b['get']({'plain':!![]});var _0x211fe7=_0x1530('0x34');return db[_0x1530('0x5b')][_0x1530('0x5c')]({'where':{'name':_0x211fe7,'userProfileId':_0x49dc03[_0x1530('0x5d')]},'raw':!![]})[_0x1530('0x32')](function(_0x5240fd){if(_0x5240fd&&_0x5240fd['autoAssociation']===0x0){return db[_0x1530('0x5e')]['create']({'name':_0x34ddf5[_0x1530('0x36')],'resourceId':_0x34ddf5['id'],'type':_0x5240fd[_0x1530('0x36')],'sectionId':_0x5240fd['id']},{})[_0x1530('0x32')](function(){return _0x25fa7b;});}else{return _0x25fa7b;}})['catch'](function(_0x4c2d1d){logger['error'](_0x1530('0x5f'),_0x4c2d1d);throw _0x4c2d1d;});}return _0x25fa7b;})[_0x1530('0x32')](respondWithResult(_0x2f6b9f,0xc9))[_0x1530('0x28')](handleError(_0x2f6b9f,null));};exports[_0x1530('0x60')]=function(_0x35aed7,_0x494982){if(_0x35aed7[_0x1530('0x56')]['id']){delete _0x35aed7[_0x1530('0x56')]['id'];}return db[_0x1530('0x38')]['find']({'where':{'id':_0x35aed7[_0x1530('0x52')]['id']},'include':[{'model':db[_0x1530('0x53')],'as':_0x1530('0x37')}]})[_0x1530('0x32')](handleEntityNotFound(_0x494982,null))['then'](saveUpdates(_0x35aed7[_0x1530('0x56')],null))[_0x1530('0x32')](respondWithResult(_0x494982,null))[_0x1530('0x28')](handleError(_0x494982,null));};exports[_0x1530('0x33')]=function(_0x2c442f,_0x55bbd9){return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x2c442f[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x55bbd9,null))[_0x1530('0x32')](removeEntity(_0x55bbd9,null))['catch'](handleError(_0x55bbd9,null));};exports[_0x1530('0x61')]=function(_0x2c70ce,_0x396ea3){return db[_0x1530('0x38')][_0x1530('0x61')]()['then'](respondWithResult(_0x396ea3,null))[_0x1530('0x28')](handleError(_0x396ea3,null));};exports[_0x1530('0x62')]=function(_0x13c3f4,_0x5e41b5,_0x21efe7){if(_0x13c3f4[_0x1530('0x56')]['id']){delete _0x13c3f4[_0x1530('0x56')]['id'];}return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x13c3f4[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x5e41b5,null))[_0x1530('0x32')](function(_0x52ab6f){if(_0x52ab6f){_0x13c3f4['body']['ChatWebsiteId']=_0x52ab6f['id'];return db[_0x1530('0x63')][_0x1530('0x55')](_0x13c3f4['body']);}})[_0x1530('0x32')](respondWithResult(_0x5e41b5,null))[_0x1530('0x28')](handleError(_0x5e41b5,null));};exports[_0x1530('0x64')]=function(_0x2824ff,_0x1bcc24,_0xb37b9f){var _0x2a0dc4={'raw':![],'where':{}};var _0x4fa799={};var _0x1e7daf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1530('0x65')]({'where':{'id':_0x2824ff[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x1bcc24,null))[_0x1530('0x32')](function(_0x4b8ff4){if(_0x4b8ff4){_0x4fa799['model']=_[_0x1530('0x3e')](db['Disposition']['rawAttributes']);_0x4fa799[_0x1530('0x3d')]=_[_0x1530('0x3e')](_0x2824ff[_0x1530('0x3d')]);_0x4fa799[_0x1530('0x46')]=_[_0x1530('0x3f')](_0x4fa799[_0x1530('0x40')],_0x4fa799[_0x1530('0x3d')]);_0x2a0dc4[_0x1530('0x41')]=_[_0x1530('0x3f')](_0x4fa799[_0x1530('0x40')],qs['fields'](_0x2824ff['query'][_0x1530('0x42')]));_0x2a0dc4['attributes']=_0x2a0dc4[_0x1530('0x41')][_0x1530('0x43')]?_0x2a0dc4[_0x1530('0x41')]:_0x4fa799[_0x1530('0x40')];if(!_0x2824ff[_0x1530('0x3d')][_0x1530('0x44')]('nolimit')){_0x2a0dc4[_0x1530('0x2e')]=qs[_0x1530('0x2e')](_0x2824ff[_0x1530('0x3d')][_0x1530('0x2e')]);_0x2a0dc4[_0x1530('0x2d')]=qs[_0x1530('0x2d')](_0x2824ff[_0x1530('0x3d')]['offset']);}_0x2a0dc4[_0x1530('0x66')]=qs['sort'](_0x2824ff[_0x1530('0x3d')][_0x1530('0x67')]);_0x2a0dc4[_0x1530('0x49')]=qs[_0x1530('0x46')](_[_0x1530('0x47')](_0x2824ff[_0x1530('0x3d')],_0x4fa799['filters']));_0x2a0dc4[_0x1530('0x49')][_0x1530('0x68')]=_0x4b8ff4['id'];if(_0x2824ff[_0x1530('0x3d')][_0x1530('0x48')]){_0x2a0dc4[_0x1530('0x49')]=_[_0x1530('0x4a')](_0x2a0dc4[_0x1530('0x49')],{'$or':_[_0x1530('0x3c')](_0x2a0dc4['attributes'],function(_0x212053){var _0x530118={};_0x530118[_0x212053]={'$like':'%'+_0x2824ff['query'][_0x1530('0x48')]+'%'};return _0x530118;})});}_0x2a0dc4=_['merge']({},_0x2a0dc4,_0x2824ff['options']);return db[_0x1530('0x63')][_0x1530('0x4d')]({'where':_0x2a0dc4[_0x1530('0x49')]})[_0x1530('0x32')](function(_0x38f64b){_0x1e7daf[_0x1530('0x4d')]=_0x38f64b;if(_0x2824ff[_0x1530('0x3d')][_0x1530('0x4e')]){_0x2a0dc4[_0x1530('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0x1530('0x50')](_0x2a0dc4);})[_0x1530('0x32')](function(_0x1edb36){_0x1e7daf[_0x1530('0x69')]=_0x1edb36;return _0x1e7daf;});}})['then'](respondWithFilteredResult(_0x1bcc24,_0x2a0dc4))[_0x1530('0x28')](handleError(_0x1bcc24,null));};exports['removeDispositions']=function(_0x4865ae,_0x50afb3,_0x1fc684){return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x4865ae[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x50afb3,null))[_0x1530('0x32')](function(_0x581b93){if(_0x581b93){return _0x581b93[_0x1530('0x6a')](_0x4865ae[_0x1530('0x3d')][_0x1530('0x6b')]);}})[_0x1530('0x32')](respondWithStatusCode(_0x50afb3,null))[_0x1530('0x28')](handleError(_0x50afb3,null));};exports['addAnswer']=function(_0x273a48,_0x26c936,_0x5252d9){if(_0x273a48[_0x1530('0x56')]['id']){delete _0x273a48[_0x1530('0x56')]['id'];}return db['ChatWebsite'][_0x1530('0x5c')]({'where':{'id':_0x273a48[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x26c936,null))['then'](function(_0x29e7f0){if(_0x29e7f0){_0x273a48[_0x1530('0x56')][_0x1530('0x68')]=_0x29e7f0['id'];return db[_0x1530('0x6c')][_0x1530('0x55')](_0x273a48['body']);}})['then'](respondWithResult(_0x26c936,null))['catch'](handleError(_0x26c936,null));};exports['getAnswers']=function(_0x52ed90,_0x5ae5c6,_0x3a7c81){var _0x3dc170={'raw':![],'where':{}};var _0x25eda1={};var _0x2b8115={'count':0x0,'rows':[]};return db[_0x1530('0x38')][_0x1530('0x65')]({'where':{'id':_0x52ed90[_0x1530('0x52')]['id']}})['then'](handleEntityNotFound(_0x5ae5c6,null))[_0x1530('0x32')](function(_0x446d0f){if(_0x446d0f){_0x25eda1[_0x1530('0x40')]=_[_0x1530('0x3e')](db['CannedAnswer']['rawAttributes']);_0x25eda1[_0x1530('0x3d')]=_[_0x1530('0x3e')](_0x52ed90[_0x1530('0x3d')]);_0x25eda1[_0x1530('0x46')]=_[_0x1530('0x3f')](_0x25eda1[_0x1530('0x40')],_0x25eda1[_0x1530('0x3d')]);_0x3dc170['attributes']=_[_0x1530('0x3f')](_0x25eda1[_0x1530('0x40')],qs[_0x1530('0x42')](_0x52ed90['query'][_0x1530('0x42')]));_0x3dc170[_0x1530('0x41')]=_0x3dc170[_0x1530('0x41')][_0x1530('0x43')]?_0x3dc170['attributes']:_0x25eda1[_0x1530('0x40')];if(!_0x52ed90[_0x1530('0x3d')][_0x1530('0x44')](_0x1530('0x45'))){_0x3dc170['limit']=qs['limit'](_0x52ed90[_0x1530('0x3d')]['limit']);_0x3dc170[_0x1530('0x2d')]=qs['offset'](_0x52ed90[_0x1530('0x3d')]['offset']);}_0x3dc170[_0x1530('0x66')]=qs[_0x1530('0x67')](_0x52ed90[_0x1530('0x3d')][_0x1530('0x67')]);_0x3dc170[_0x1530('0x49')]=qs[_0x1530('0x46')](_[_0x1530('0x47')](_0x52ed90['query'],_0x25eda1[_0x1530('0x46')]));_0x3dc170[_0x1530('0x49')][_0x1530('0x68')]=_0x446d0f['id'];if(_0x52ed90[_0x1530('0x3d')][_0x1530('0x48')]){_0x3dc170['where']=_[_0x1530('0x4a')](_0x3dc170['where'],{'$or':_[_0x1530('0x3c')](_0x3dc170[_0x1530('0x41')],function(_0x1e67ac){var _0x7b5440={};_0x7b5440[_0x1e67ac]={'$like':'%'+_0x52ed90[_0x1530('0x3d')]['filter']+'%'};return _0x7b5440;})});}_0x3dc170=_[_0x1530('0x4a')]({},_0x3dc170,_0x52ed90[_0x1530('0x4c')]);return db['CannedAnswer'][_0x1530('0x4d')]({'where':_0x3dc170[_0x1530('0x49')]})[_0x1530('0x32')](function(_0x28715b){_0x2b8115[_0x1530('0x4d')]=_0x28715b;if(_0x52ed90['query'][_0x1530('0x4e')]){_0x3dc170[_0x1530('0x4f')]=[{'all':!![]}];}return db[_0x1530('0x6c')][_0x1530('0x50')](_0x3dc170);})['then'](function(_0x146696){_0x2b8115[_0x1530('0x69')]=_0x146696;return _0x2b8115;});}})[_0x1530('0x32')](respondWithFilteredResult(_0x5ae5c6,_0x3dc170))[_0x1530('0x28')](handleError(_0x5ae5c6,null));};exports[_0x1530('0x6d')]=function(_0x4f3aa4,_0x322216,_0x50dcdc){return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x4f3aa4[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x322216,null))[_0x1530('0x32')](function(_0x25dfa0){if(_0x25dfa0){return _0x25dfa0[_0x1530('0x6d')](_0x4f3aa4[_0x1530('0x3d')][_0x1530('0x6b')]);}})['then'](respondWithStatusCode(_0x322216,null))['catch'](handleError(_0x322216,null));};exports['addLogo']=function(_0x4184c8,_0x34c6ca,_0x5aabc2){_0x4184c8[_0x1530('0x56')][_0x1530('0x6e')]=_0x4184c8[_0x1530('0x6f')][_0x1530('0x70')];return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x4184c8['params']['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x34c6ca,null))[_0x1530('0x32')](saveUpdates(_0x4184c8['body'],null))['then'](respondWithResult(_0x34c6ca,null))[_0x1530('0x28')](handleError(_0x34c6ca,null));};exports[_0x1530('0x71')]=function(_0x3ba6fe,_0x451148,_0x3e3bb8){_0x3ba6fe[_0x1530('0x56')]['agentAvatar']=_0x3ba6fe[_0x1530('0x6f')][_0x1530('0x70')];return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x3ba6fe[_0x1530('0x52')]['id']}})['then'](handleEntityNotFound(_0x451148,null))[_0x1530('0x32')](saveUpdates(_0x3ba6fe[_0x1530('0x56')],null))[_0x1530('0x32')](respondWithResult(_0x451148,null))[_0x1530('0x28')](handleError(_0x451148,null));};exports[_0x1530('0x72')]=function(_0x135054,_0x54240f,_0x30b290){_0x135054[_0x1530('0x56')][_0x1530('0x73')]=_0x135054[_0x1530('0x6f')]['filename'];return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x135054['params']['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x54240f,null))[_0x1530('0x32')](saveUpdates(_0x135054[_0x1530('0x56')],null))[_0x1530('0x32')](respondWithResult(_0x54240f,null))['catch'](handleError(_0x54240f,null));};exports[_0x1530('0x74')]=function(_0x5f4ab7,_0x5931f9,_0x1616ee){_0x5f4ab7[_0x1530('0x56')][_0x1530('0x75')]=_0x5f4ab7[_0x1530('0x6f')]['filename'];return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x5f4ab7[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x5931f9,null))['then'](saveUpdates(_0x5f4ab7[_0x1530('0x56')],null))['then'](respondWithResult(_0x5931f9,null))[_0x1530('0x28')](handleError(_0x5931f9,null));};exports['getLogo']=function(_0x92f10a,_0x2ed85d,_0x2fbf16){var _0x3a4c75=path[_0x1530('0x76')](config['root'],_0x1530('0x77'));var _0x175333={'where':{'id':_0x92f10a['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5815cb=![];return require(_0x1530('0x17'))['getLicense']()[_0x1530('0x32')](function(_0x1b39d5){if(_0x1b39d5){_0x5815cb=_0x1b39d5['custom'];}})[_0x1530('0x32')](function(){return db[_0x1530('0x38')][_0x1530('0x5c')](_0x175333);})[_0x1530('0x32')](handleEntityNotFound(_0x2ed85d,null))['then'](function(_0x5eefb9){if(_0x5eefb9){if(!_['isNil'](_0x5eefb9[_0x1530('0x6e')])){if(fs[_0x1530('0x78')](path[_0x1530('0x76')](config[_0x1530('0x79')],_0x1530('0x7a'),_0x5eefb9[_0x1530('0x6e')]))&&_0x5815cb){_0x3a4c75=path[_0x1530('0x76')](config[_0x1530('0x79')],_0x1530('0x7a'),_0x5eefb9[_0x1530('0x6e')]);}}return _0x2ed85d['download'](_0x3a4c75);}})[_0x1530('0x28')](handleError(_0x2ed85d,null));};exports[_0x1530('0x7b')]=function(_0x89ee73,_0x32fedf,_0x1e5891){var _0x949ea=path[_0x1530('0x76')](config[_0x1530('0x79')],_0x1530('0x7c'));var _0x33c561={'where':{'id':_0x89ee73[_0x1530('0x52')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x1530('0x38')][_0x1530('0x5c')](_0x33c561)[_0x1530('0x32')](handleEntityNotFound(_0x32fedf,null))['then'](function(_0x1ade31){if(_0x1ade31){if(!_[_0x1530('0x7d')](_0x1ade31[_0x1530('0x7e')])){if(fs[_0x1530('0x78')](path[_0x1530('0x76')](config[_0x1530('0x79')],'server/files/images/avatars/',_0x1ade31[_0x1530('0x7e')]))){_0x949ea=path['join'](config[_0x1530('0x79')],_0x1530('0x7f'),_0x1ade31[_0x1530('0x7e')]);}}return _0x32fedf[_0x1530('0x80')](_0x949ea);}})[_0x1530('0x28')](handleError(_0x32fedf,null));};exports[_0x1530('0x81')]=function(_0x4f461d,_0x889d9c,_0x30d15e){var _0x2f92db=path[_0x1530('0x76')](config['root'],_0x1530('0x82'));var _0x4cd309={'where':{'id':_0x4f461d['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x1530('0x38')][_0x1530('0x5c')](_0x4cd309)[_0x1530('0x32')](handleEntityNotFound(_0x889d9c,null))[_0x1530('0x32')](function(_0x20c25b){if(_0x20c25b){if(!_[_0x1530('0x7d')](_0x20c25b['customerAvatar'])){if(fs[_0x1530('0x78')](path['join'](config[_0x1530('0x79')],'server/files/images/avatars/',_0x20c25b[_0x1530('0x73')]))&&_0x20c25b[_0x1530('0x83')]){_0x2f92db=path[_0x1530('0x76')](config[_0x1530('0x79')],_0x1530('0x7f'),_0x20c25b[_0x1530('0x73')]);}}return _0x889d9c[_0x1530('0x80')](_0x2f92db);}})[_0x1530('0x28')](handleError(_0x889d9c,null));};exports['getSystemAvatar']=function(_0x2cda74,_0x4ba4d2,_0x15df56){var _0x14080b=path[_0x1530('0x76')](config[_0x1530('0x79')],_0x1530('0x84'));var _0x56bf39={'where':{'id':_0x2cda74[_0x1530('0x52')]['id']},'attributes':['id',_0x1530('0x75')],'raw':!![]};return db[_0x1530('0x38')]['find'](_0x56bf39)[_0x1530('0x32')](handleEntityNotFound(_0x4ba4d2,null))[_0x1530('0x32')](function(_0x41a7a8){if(_0x41a7a8){if(!_[_0x1530('0x7d')](_0x41a7a8[_0x1530('0x75')])){if(fs[_0x1530('0x78')](path[_0x1530('0x76')](config[_0x1530('0x79')],'server/files/images/avatars/',_0x41a7a8[_0x1530('0x75')]))){_0x14080b=path[_0x1530('0x76')](config[_0x1530('0x79')],_0x1530('0x7f'),_0x41a7a8['systemAvatar']);}}return _0x4ba4d2['download'](_0x14080b);}})[_0x1530('0x28')](handleError(_0x4ba4d2,null));};exports[_0x1530('0x85')]=function(_0x4ae342,_0x5c8342,_0x446154){var _0x4ca40c=require('user-agent-parser');var _0x250112=new _0x4ca40c();var _0x5b730b=_0x250112[_0x1530('0x86')](_0x4ae342[_0x1530('0x87')][_0x1530('0x88')])[_0x1530('0x89')]();var _0x39abba={'body':_0x4ae342[_0x1530('0x56')],'channel':_0x1530('0x8a')};var _0x3a7805=[];var _0x2c187b=[];var _0x4217d5={};var _0x6b4871=![];return db[_0x1530('0x8b')]['describe']()[_0x1530('0x32')](function(_0x41d182){if(!_0x41d182){throw new db[(_0x1530('0x8c'))][(_0x1530('0x8d'))]('no\x20available\x20attributes');}_0x3a7805=_[_0x1530('0x8e')](_[_0x1530('0x3e')](_0x41d182),[_0x1530('0x8f'),_0x1530('0x90')]);_0x2c187b=_[_0x1530('0x8e')](_[_0x1530('0x3e')](_0x41d182),[_0x1530('0x8f'),_0x1530('0x90'),'CompanyId',_0x1530('0x91')]);if(_0x4ae342[_0x1530('0x56')]['id']){delete _0x4ae342[_0x1530('0x56')]['id'];}if(_[_0x1530('0x7d')](_0x4ae342[_0x1530('0x56')][_0x1530('0x92')])){throw new db[(_0x1530('0x8c'))][(_0x1530('0x8d'))]('from\x20is\x20mandatory');}if(_[_0x1530('0x7d')](_0x4ae342[_0x1530('0x56')][_0x1530('0x56')])||_0x4ae342[_0x1530('0x56')][_0x1530('0x56')]===''){throw new db[(_0x1530('0x8c'))][(_0x1530('0x8d'))](_0x1530('0x93'));}if(_[_0x1530('0x7d')](_0x4ae342['body']['mapKey'])){throw new db[(_0x1530('0x8c'))][(_0x1530('0x8d'))](_0x1530('0x94')+_0x2c187b);}if(!_[_0x1530('0x95')](_0x2c187b,_0x4ae342[_0x1530('0x56')][_0x1530('0x96')])){throw new db[(_0x1530('0x8c'))][(_0x1530('0x8d'))](_0x1530('0x97')+_0x2c187b);}_0x4217d5[_0x4ae342[_0x1530('0x56')][_0x1530('0x96')]]=_0x4ae342[_0x1530('0x56')][_0x1530('0x92')];})[_0x1530('0x32')](function(){return db['ChatWebsite'][_0x1530('0x5c')]({'where':{'id':_0x4ae342['params']['id']},'include':[{'model':db[_0x1530('0x98')],'as':'List','include':[{'model':db['CmContact'],'as':_0x1530('0x99'),'where':_0x4217d5,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1530('0x9a')],'as':_0x1530('0x9b')}]});})[_0x1530('0x32')](handleEntityNotFound(_0x5c8342,null))['then'](function(_0x34c2e4){if(_0x34c2e4&&_0x34c2e4['List']){_0x39abba[_0x1530('0x9c')]=_0x34c2e4;_0x39abba[_0x1530('0x9d')]=_0x34c2e4[_0x1530('0x9b')];_0x39abba['list']=_0x34c2e4[_0x1530('0x9e')];_0x39abba[_0x1530('0x9d')]=_['orderBy'](_0x39abba[_0x1530('0x9d')],[_0x1530('0x9f')],[_0x1530('0xa0')]);if(_0x39abba[_0x1530('0x9c')][_0x1530('0x9b')]){delete _0x39abba['account'][_0x1530('0x9b')];}if(_0x39abba[_0x1530('0x9c')][_0x1530('0x9e')]&&_0x39abba[_0x1530('0x9c')][_0x1530('0x9e')]['Contacts'][_0x1530('0x43')]){return _0x39abba[_0x1530('0x9c')]['List'][_0x1530('0x99')][0x0];}var _0x3f70f0=_['defaults'](_0x4ae342['body'],{'firstName':_0x4ae342[_0x1530('0x56')][_0x1530('0x92')],'ListId':_0x34c2e4['ListId']});_0x3f70f0[_0x4ae342[_0x1530('0x56')][_0x1530('0x96')]]=_0x4ae342[_0x1530('0x56')][_0x1530('0x92')];return db['CmContact'][_0x1530('0x55')](_0x3f70f0,{'fields':_0x3a7805,'raw':!![]});}})['then'](handleEntityNotFound(_0x5c8342,null))[_0x1530('0x32')](function(_0x3c9049){_0x39abba[_0x1530('0xa1')]=_0x3c9049;var _0x90b048=_0x4ae342[_0x1530('0x56')][_0x1530('0xa2')];if(_0x4ae342[_0x1530('0x87')][_0x1530('0xa3')]){_0x90b048=_0x4ae342[_0x1530('0x87')][_0x1530('0xa3')];}else if(_0x4ae342[_0x1530('0x87')]['x-forwarded-for']){_0x90b048=_[_0x1530('0xa4')](_0x4ae342[_0x1530('0x87')][_0x1530('0xa5')][_0x1530('0xa6')](','));}if(_0x3c9049){var _0x2c83ee={'ContactId':_0x3c9049['id'],'ChatWebsiteId':_0x4ae342[_0x1530('0x52')]['id'],'from':(_0x3c9049[_0x1530('0xa7')]||'')+'\x20'+(_0x3c9049[_0x1530('0xa8')]||''),'customerIp':_0x90b048,'customerPort':_0x4ae342[_0x1530('0x87')][_0x1530('0xa9')]?_0x4ae342[_0x1530('0x87')]['x-real-port']:null,'referer':_0x4ae342['body'][_0x1530('0xaa')],'browserName':_0x5b730b[_0x1530('0xab')][_0x1530('0x36')]&&_0x5b730b['browser'][_0x1530('0xac')]?util[_0x1530('0xad')](_0x1530('0xae'),_0x5b730b[_0x1530('0xab')][_0x1530('0x36')],_0x5b730b[_0x1530('0xab')][_0x1530('0xac')]):_0x1530('0xaf'),'browserVersion':_0x5b730b[_0x1530('0xab')][_0x1530('0xac')]||_0x1530('0xaf'),'osName':util[_0x1530('0xad')](_0x1530('0xae'),_0x5b730b['os'][_0x1530('0x36')],_0x5b730b['os'][_0x1530('0xac')]),'osVersion':_0x5b730b['os'][_0x1530('0xac')],'deviceModel':_0x5b730b[_0x1530('0xb0')][_0x1530('0x40')]&&_0x5b730b[_0x1530('0xb0')]['vendor']?util[_0x1530('0xad')](_0x1530('0xb1'),_0x5b730b['device'][_0x1530('0x40')],_0x5b730b['device'][_0x1530('0xb2')],_0x5b730b[_0x1530('0xb0')][_0x1530('0x3a')]):null,'deviceVendor':_0x5b730b['device'][_0x1530('0xb2')],'deviceType':_0x5b730b[_0x1530('0xb0')][_0x1530('0x3a')],'formData':JSON['stringify'](_0x4ae342[_0x1530('0x56')])};var _0x445491={'ChatWebsiteId':_0x4ae342['params']['id'],'closed':![]};if(_0x4ae342['body']['threadId']){_0x445491[_0x1530('0xb3')]=_0x4ae342[_0x1530('0x56')][_0x1530('0xb3')];return db[_0x1530('0xb4')]['find']({'where':_0x445491})[_0x1530('0x32')](function(_0x4ab771){if(_0x4ab771){return[_0x4ab771,![]];}_0x2c83ee['threadId']=_0x4ae342[_0x1530('0x56')][_0x1530('0xb3')];_0x2c83ee['externalUrl']=_0x4ae342[_0x1530('0x56')][_0x1530('0xb5')];return db['ChatInteraction'][_0x1530('0x55')](_0x2c83ee)[_0x1530('0x32')](function(_0x35d37b){return[_0x35d37b,!![]];});});}_0x445491[_0x1530('0xb6')]=_0x3c9049['id'];if(_0x4ae342['body'][_0x1530('0xb7')]&&_0x4ae342[_0x1530('0x56')][_0x1530('0xb7')]['id']){_0x445491['id']=_0x4ae342[_0x1530('0x56')][_0x1530('0xb7')]['id'];return db[_0x1530('0xb4')][_0x1530('0x5c')]({'where':_0x445491})[_0x1530('0x32')](function(_0xfaa7ae){if(_0xfaa7ae){return[_0xfaa7ae,![]];}return db[_0x1530('0xb4')]['create'](_0x2c83ee)['then'](function(_0x3434d2){return[_0x3434d2,!![]];});});}return db['ChatInteraction'][_0x1530('0x55')](_0x2c83ee)[_0x1530('0x32')](function(_0x3ed04f){return[_0x3ed04f,!![]];});}})[_0x1530('0xb8')](function(_0x278f93,_0x37cbc8){if(_0x278f93){_0x6b4871=_0x37cbc8;if(!_0x37cbc8){var _0x15e6b5={'from':(_0x39abba['contact']['firstName']||'')+'\x20'+(_0x39abba['contact'][_0x1530('0xa8')]||'')};if(_0x4ae342[_0x1530('0x56')][_0x1530('0xb3')]&&_0x4ae342['body']['messageId']&&_0x4ae342[_0x1530('0x56')][_0x1530('0xb3')]!=_0x4ae342[_0x1530('0x56')][_0x1530('0xb9')]){_0x15e6b5['threadId']=_0x4ae342['body'][_0x1530('0xb9')];}return _0x278f93[_0x1530('0x60')](_0x15e6b5);}else{return _0x278f93;}}})[_0x1530('0x32')](function(_0x38a12c){_0x39abba[_0x1530('0xb7')]=_0x38a12c[_0x1530('0x58')]({'plain':!![]});_0x39abba[_0x1530('0xb7')]['created']=_0x6b4871;if(_0x39abba[_0x1530('0xb7')][_0x1530('0xba')]){if(_0x39abba[_0x1530('0x9c')]['autoclose']){_0x39abba[_0x1530('0x9d')][_0x1530('0xbb')]({'id':0x0,'priority':_0x39abba['applications']['length']+0x1,'app':_0x1530('0xbc'),'appdata':_0x1530('0xbd'),'interval':_0x1530('0xbe')});}}return db['ChatMessage'][_0x1530('0x55')]({'body':_0x4ae342[_0x1530('0x56')]['body'],'ChatWebsiteId':_0x4ae342['params']['id'],'ChatInteractionId':_0x38a12c['id'],'direction':'in','ContactId':_0x39abba[_0x1530('0xa1')]['id'],'AttachmentId':_0x4ae342[_0x1530('0x56')][_0x1530('0xbf')]});})[_0x1530('0x32')](function(_0x359bb3){_0x39abba[_0x1530('0x26')]=_0x359bb3;if(_0x39abba[_0x1530('0xb7')]['UserId']){return db['User'][_0x1530('0x5c')]({'attributes':['id',_0x1530('0x36')],'where':{'id':_0x39abba['interaction'][_0x1530('0xc0')]}})['then'](function(_0xcae1d0){if(_0xcae1d0){_0x39abba[_0x1530('0x9d')][_0x1530('0xc1')]({'id':0x0,'priority':0x0,'app':_0x1530('0xc2'),'appdata':_0xcae1d0[_0x1530('0x36')]+','+(_0x39abba[_0x1530('0x9c')]['waitForTheAssignedAgent']||0xa),'interval':_0x1530('0xbe')});_0x39abba[_0x1530('0xc3')]=!![];}return respondWithRpcPromise(_0x1530('0xc4'),_0x1530('0xc5'),_0x39abba);});}return respondWithRpcPromise('Start',_0x1530('0xc5'),_0x39abba);})[_0x1530('0x32')](function(_0x4c7e76){respondWithRpcPromise(_0x1530('0xc6'),_0x1530('0xc6'),{'event':_0x1530('0x85'),'message':_0x4c7e76},client9002);return _0x4c7e76;})[_0x1530('0x32')](respondWithResult(_0x5c8342,null))['catch'](handleError(_0x5c8342,null));};exports['offline']=function(_0x4d2af1,_0x4c44df,_0x414999){var _0x478258,_0x506707,_0xda7c56;var _0x5696ec=[];var _0x449edb=[];var _0x7cc728={};var _0x104752=_0x4d2af1['files']||[];var _0x51979e=[];var _0x2eb630;return db[_0x1530('0x8b')][_0x1530('0x61')]()['then'](function(_0x16a9b9){if(!_0x16a9b9){throw new db[(_0x1530('0x8c'))][(_0x1530('0x8d'))](_0x1530('0xc7'));}_0x449edb=_[_0x1530('0x8e')](_[_0x1530('0x3e')](_0x16a9b9),[_0x1530('0x8f'),_0x1530('0x90')]);_0x5696ec=_[_0x1530('0x8e')](_[_0x1530('0x3e')](_0x16a9b9),[_0x1530('0x8f'),_0x1530('0x90'),_0x1530('0xc8'),_0x1530('0x91')]);if(_0x4d2af1['body']['id']){delete _0x4d2af1[_0x1530('0x56')]['id'];}if(_[_0x1530('0x7d')](_0x4d2af1[_0x1530('0x56')][_0x1530('0x92')])){throw _0x4c44df[_0x1530('0x2a')](0x1f4)[_0x1530('0xc9')](new db[(_0x1530('0x8c'))][(_0x1530('0x8d'))](_0x1530('0xca')));}if(_[_0x1530('0x7d')](_0x4d2af1[_0x1530('0x56')][_0x1530('0x56')])||_0x4d2af1[_0x1530('0x56')][_0x1530('0x56')]===''){throw _0x4c44df[_0x1530('0x2a')](0x1f4)[_0x1530('0xc9')](new db[(_0x1530('0x8c'))][(_0x1530('0x8d'))](_0x1530('0x93')));}if(_[_0x1530('0x7d')](_0x4d2af1[_0x1530('0x56')][_0x1530('0xcb')])){throw _0x4c44df[_0x1530('0x2a')](0x1f4)[_0x1530('0xc9')](new db['Sequelize'][(_0x1530('0x8d'))](_0x1530('0xcc')+_0x5696ec));}if(!_[_0x1530('0x95')](_0x5696ec,_0x4d2af1[_0x1530('0x56')][_0x1530('0xcb')])){throw _0x4c44df['status'](0x1f4)['send'](new db[(_0x1530('0x8c'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5696ec));}_0x7cc728[_0x4d2af1[_0x1530('0x56')][_0x1530('0xcb')]]=_0x4d2af1['body']['from'];})[_0x1530('0x32')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4d2af1['params']['id']},'include':[{'model':db[_0x1530('0x98')],'as':'List'},{'model':db['MailAccount'],'as':_0x1530('0xcd')}]});})[_0x1530('0x32')](handleEntityNotFound(_0x4c44df,null))[_0x1530('0x32')](function(_0xfc791f){if(_0xfc791f&&_0xfc791f[_0x1530('0x9e')]){_0x506707=_0xfc791f;var _0x41a7bf=_[_0x1530('0x18')](_0x4d2af1[_0x1530('0x56')],{'firstName':_0x4d2af1['body'][_0x1530('0x92')],'phone':_0x4d2af1['body'][_0x1530('0x92')],'ListId':_0xfc791f[_0x1530('0x91')]});_0x41a7bf[_0x4d2af1[_0x1530('0x56')]['mapKeyOffline']]=_0x4d2af1[_0x1530('0x56')][_0x1530('0x92')];return db[_0x1530('0x8b')]['findOrCreate']({'where':_0x7cc728,'defaults':_0x41a7bf});}})[_0x1530('0xb8')](function(_0x4dc4f6){if(_0x4dc4f6){_0xda7c56=_0x4dc4f6;var _0x298e46=fs[_0x1530('0xce')](path['join'](config[_0x1530('0x79')],_0x1530('0xcf')),_0x1530('0xd0'));var _0xc00f54=ejs[_0x1530('0xd1')](_0x298e46,{'body':_[_0x1530('0xd2')](_0x4d2af1[_0x1530('0x56')][_0x1530('0x56')]),'bodyTitle':_0x506707[_0x1530('0xd3')]});return db[_0x1530('0xd4')][_0x1530('0x55')]({'body':_0xc00f54,'ContactId':_0x4dc4f6['id'],'ChatWebsiteId':_0x506707['id']});}})[_0x1530('0x32')](function(_0x569e97){_0x2eb630=_0x569e97;if(_0x104752[_0x1530('0x43')]){var _0x1e08d2=_0x104752[_0x1530('0x3c')](function(_0x3dfe67){return{'name':_0x3dfe67[_0x1530('0xd5')],'basename':_0x3dfe67['filename'],'type':_0x3dfe67[_0x1530('0xd6')],'ChatOfflineMessageId':_0x569e97['id']};});_0x51979e=_0x1e08d2['map'](_0x433212=>{var _0xc5fd0a={'filename':_0x433212[_0x1530('0x36')],'path':path[_0x1530('0x76')](config[_0x1530('0x79')],_0x1530('0xd7'),_0x1530('0xd8'),_0x1530('0xd9'),'offline-chat',_0x433212[_0x1530('0xda')])};return _0xc5fd0a;});if(!_0x506707['openNewInteraction']){return db[_0x1530('0xdb')][_0x1530('0xdc')](function(_0x1322d2){return db[_0x1530('0xdd')]['bulkCreate'](_0x1e08d2,{'transaction':_0x1322d2});});}}})[_0x1530('0x32')](function(){if(_0x2eb630){_0x478258=_0x2eb630;return db[_0x1530('0xcd')][_0x1530('0x65')]({'where':{'active':!![]},'include':[{'model':db[_0x1530('0xde')],'as':_0x1530('0xdf'),'raw':!![]}]});}})[_0x1530('0x32')](function(_0x2a0160){if(_0x2a0160&&_0x2a0160[_0x1530('0xdf')]&&_0x506707[_0x1530('0xe0')]&&_0x506707[_0x1530('0xe1')]){var _0x24b181={'tls':{'rejectUnauthorized':![]}};if(_0x2a0160[_0x1530('0xdf')][_0x1530('0xe2')]){_0x24b181[_0x1530('0xe2')]=_0x2a0160[_0x1530('0xdf')]['service'];}else{_0x24b181[_0x1530('0xe3')]=_0x2a0160[_0x1530('0xdf')][_0x1530('0xe3')];_0x24b181[_0x1530('0xe4')]=_0x2a0160[_0x1530('0xdf')][_0x1530('0xe4')];_0x24b181[_0x1530('0xe5')]=_0x2a0160[_0x1530('0xdf')][_0x1530('0xe5')];}if(_0x2a0160[_0x1530('0xdf')][_0x1530('0xe6')]){_0x24b181[_0x1530('0xe7')]={'user':_0x2a0160['Smtp'][_0x1530('0x57')],'pass':_0x2a0160[_0x1530('0xdf')][_0x1530('0xe8')]};}return respondWithRpcPromise(_0x1530('0xe9'),_0x1530('0xea'),{'account':_0x24b181,'message':{'from':util['format'](_0x1530('0xeb'),_0x2a0160[_0x1530('0x36')],_0x2a0160[_0x1530('0xec')]||_0x2a0160[_0x1530('0xdf')][_0x1530('0x57')]),'to':_0x506707[_0x1530('0xe1')],'subject':_0x506707[_0x1530('0xed')],'text':_0x478258['body'],'attachments':_0x51979e}},client9003)['then'](function(){return _0x478258;})[_0x1530('0x28')](function(_0x469943){console['error'](_0x469943);});}})[_0x1530('0x32')](function(){if(_0x506707&&_0x506707[_0x1530('0xee')]&&_0x506707[_0x1530('0xef')]){var _0x19381f=[];if(_0x104752[_0x1530('0x43')]){_0x19381f=_0x104752[_0x1530('0x3c')](function(_0x48bcfa){return{'name':_0x48bcfa[_0x1530('0xd5')],'basename':_0x48bcfa[_0x1530('0x70')],'type':_0x48bcfa[_0x1530('0xd6')],'ChatOfflineMessageId':_0x2eb630['id']};});}var _0x5e3486;if(!_[_0x1530('0x7d')](_0x506707['subjectOffline'])){var _0xa9fbf9=_['map'](_0x4d2af1['body'],function(_0x3bdc03){return _0x3bdc03;});var _0xefea53=_[_0x1530('0xf0')](_0xa9fbf9)[0x0];var _0x5c819a=_['mapValues'](_0xefea53,function(_0x3dbc9a){return _0x3dbc9a;});_0x5e3486=_0x5c819a[0x1][_0x506707[_0x1530('0xf1')]];}var _0x9ca03a={'from':_0xda7c56[_0x1530('0xec')],'firstName':_0xda7c56[_0x1530('0xa7')],'lastName':_0xda7c56[_0x1530('0xa8')],'mapKey':_0x1530('0xec'),'message':{'from':_0xda7c56[_0x1530('0xec')],'to':_0x506707['MailAccount']['email'],'cc':'','subject':_[_0x1530('0x7d')](_0x5e3486)?_0x506707[_0x1530('0xed')]:_0x5e3486,'messageId':'','sentAt':new Date(),'attach':_0x19381f[_0x1530('0x43')],'attachments':_0x19381f,'originChannel':'Chat','ChatWebsiteId':_0x506707['id'],'ChatOfflineMessageId':_0x478258['id'],'originTo':_0x506707[_0x1530('0xcd')][_0x1530('0xec')]},'body':_0x478258[_0x1530('0x56')]};var _0x3ea4f6={'account':{'id':_0x506707['MailAccountId']},'body':_0x9ca03a,'log':_0x1530('0xf2')};return respondWithRpcPromise(_0x1530('0xf2'),_0x1530('0xf3'),_0x3ea4f6,client9001)['then'](function(){return _0x478258;})['catch'](function(_0x54e775){console[_0x1530('0x24')](_0x54e775);});}return;})[_0x1530('0x32')](function(){if(_0x478258){return _0x478258;}})[_0x1530('0x32')](respondWithResult(_0x4c44df,null))['catch'](function(_0x28d185){console[_0x1530('0x24')](_0x1530('0x28'),_0x28d185);for(var _0xf540e2 of _0x104752){var _0xc943c=path[_0x1530('0x76')](config[_0x1530('0x79')],'server','files',_0x1530('0xd9'),_0x1530('0xf4'),_0xf540e2[_0x1530('0x70')]);fs_extra[_0x1530('0xf5')](_0xc943c)[_0x1530('0x28')](function(_0x3eed23){console['error'](_0x1530('0xf6'),_0xc943c,_0x3eed23);});}});};exports[_0x1530('0xf7')]=function(_0x4217a2,_0x1756a6,_0x305581){return db[_0x1530('0xb4')][_0x1530('0x5c')]({'where':{'id':_0x4217a2[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x1756a6,null))[_0x1530('0x32')](function(_0x2418f2){if(_0x2418f2){return _0x2418f2[_0x1530('0xf7')](_0x4217a2['body']['ids'],_[_0x1530('0xf8')](_0x4217a2[_0x1530('0x56')],[_0x1530('0x6b'),'id'])||{});}})[_0x1530('0x32')](respondWithResult(_0x1756a6,null))[_0x1530('0x28')](handleError(_0x1756a6,null));};exports['getInteractions']=function(_0x573f68,_0x1d34eb,_0xf24d5e){var _0xd76ab5={'raw':![],'where':{}};var _0x3d5e9={};var _0x4b218d={'count':0x0,'rows':[]};return db[_0x1530('0x38')]['findOne']({'where':{'id':_0x573f68[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x1d34eb,null))[_0x1530('0x32')](function(_0x193589){if(_0x193589){_0x3d5e9[_0x1530('0x40')]=_[_0x1530('0x3e')](db[_0x1530('0xb4')][_0x1530('0x54')]);_0x3d5e9[_0x1530('0x3d')]=_[_0x1530('0x3e')](_0x573f68['query']);_0x3d5e9[_0x1530('0x46')]=_[_0x1530('0x3f')](_0x3d5e9[_0x1530('0x40')],_0x3d5e9[_0x1530('0x3d')]);_0xd76ab5[_0x1530('0x41')]=_[_0x1530('0x3f')](_0x3d5e9[_0x1530('0x40')],qs['fields'](_0x573f68['query']['fields']));_0xd76ab5['attributes']=_0xd76ab5[_0x1530('0x41')][_0x1530('0x43')]?_0xd76ab5[_0x1530('0x41')]:_0x3d5e9[_0x1530('0x40')];if(!_0x573f68['query'][_0x1530('0x44')]('nolimit')){_0xd76ab5[_0x1530('0x2e')]=qs['limit'](_0x573f68[_0x1530('0x3d')][_0x1530('0x2e')]);_0xd76ab5[_0x1530('0x2d')]=qs['offset'](_0x573f68[_0x1530('0x3d')][_0x1530('0x2d')]);}_0xd76ab5[_0x1530('0x66')]=qs[_0x1530('0x67')](_0x573f68[_0x1530('0x3d')]['sort']);_0xd76ab5['where']=qs[_0x1530('0x46')](_[_0x1530('0x47')](_0x573f68[_0x1530('0x3d')],_0x3d5e9[_0x1530('0x46')]));_0xd76ab5['where'][_0x1530('0x68')]=_0x193589['id'];if(_0x573f68[_0x1530('0x3d')][_0x1530('0x48')]){_0xd76ab5[_0x1530('0x49')]=_[_0x1530('0x4a')](_0xd76ab5['where'],{'$or':_['map'](_0xd76ab5[_0x1530('0x41')],function(_0x28dd22){var _0x1f09f2={};_0x1f09f2[_0x28dd22]={'$like':'%'+_0x573f68[_0x1530('0x3d')][_0x1530('0x48')]+'%'};return _0x1f09f2;})});}_0xd76ab5=_[_0x1530('0x4a')]({},_0xd76ab5,_0x573f68[_0x1530('0x4c')]);return db[_0x1530('0xb4')]['count']({'where':_0xd76ab5[_0x1530('0x49')]})['then'](function(_0x702a85){_0x4b218d[_0x1530('0x4d')]=_0x702a85;if(_0x573f68[_0x1530('0x3d')]['includeAll']){_0xd76ab5[_0x1530('0x4f')]=[{'model':db[_0x1530('0x8b')],'as':_0x1530('0xf9'),'required':![]},{'model':db[_0x1530('0xfa')],'as':_0x1530('0xfb'),'attributes':[_0x1530('0x36'),_0x1530('0xfc'),_0x1530('0xfd')],'required':![]},{'model':db[_0x1530('0xfe')],'as':_0x1530('0xff'),'attributes':['id',_0x1530('0x36'),_0x1530('0x100')],'where':_0x573f68[_0x1530('0x3d')]['tag']?{'id':_0x573f68['query'][_0x1530('0x101')]}:undefined,'required':_0x573f68['query'][_0x1530('0x101')]?!![]:![]}];}return db['ChatInteraction'][_0x1530('0x50')](_0xd76ab5);})[_0x1530('0x32')](function(_0x2f00e4){_0x4b218d['rows']=_0x2f00e4;return _0x4b218d;});}})[_0x1530('0x32')](respondWithFilteredResult(_0x1d34eb,_0xd76ab5))[_0x1530('0x28')](handleError(_0x1d34eb,null));};function iftimePromise(_0x3283e6,_0x161136){return respondWithRpcPromise(_0x1530('0x102'),_0x1530('0x103'),{'command':_0x161136[_0x1530('0x104')]?util[_0x1530('0xad')](_0x1530('0x105'),_0x3283e6[_0x1530('0x106')],_0x161136[_0x1530('0x104')]):util[_0x1530('0xad')]('iftime\x20%s',_0x3283e6['interval'])},client9002)[_0x1530('0x32')](function(_0x1f498f){var _0x570262=_0x1f498f&&_0x1f498f[_0x1530('0x107')](_0x1530('0x108'))>=0x0?!![]:![];logger[_0x1530('0x1f')](_0x1530('0x109'),_0x161136['id'],_0x3283e6['id'],_0x3283e6[_0x1530('0x106')],_0x570262?_0x1530('0x10a'):'OFFLINE',_0x161136[_0x1530('0x104')]?_0x161136['timezone']:_0x1530('0x10b'));return _0x570262;})[_0x1530('0x28')](function(_0x1e9076){logger[_0x1530('0x24')](_0x1530('0x109'),_0x161136['id'],_0x3283e6['id'],_0x3283e6[_0x1530('0x106')],util[_0x1530('0x10c')](_0x1e9076,{'showHidden':![],'depth':null}),_0x161136[_0x1530('0x104')]?_0x161136[_0x1530('0x104')]:'No\x20timezone');return![];});}exports[_0x1530('0x103')]=function(_0x18926f,_0xa0013d,_0x16c00d){var _0x40d682=0x0;var _0x49fcb2=0x0;var _0x5e49da=![];var _0x1cc7c6;var _0x21b00a;return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x18926f[_0x1530('0x52')]['id']},'include':[{'model':db[_0x1530('0x10d')],'as':_0x1530('0x10d'),'include':[{'model':db[_0x1530('0x10d')],'as':_0x1530('0x10e'),'attributes':['id',_0x1530('0x106')],'raw':!![]}]}]})[_0x1530('0x32')](handleEntityNotFound(_0xa0013d,null))['then'](function(_0x48f38e){if(_0x48f38e){_0x1cc7c6=_0x48f38e;return _0x48f38e['getProactiveActions']({'raw':!![]});}})['then'](function(_0x3a4554){if(_0x1cc7c6){if(_0x3a4554){_0x21b00a=_0x3a4554;}}return require(_0x1530('0x17'))[_0x1530('0x10f')]();})[_0x1530('0x32')](function(_0x4dfa90){if(_0x4dfa90){_0x49fcb2=_0x4dfa90[_0x1530('0x110')];_0x5e49da=_0x4dfa90['custom'];}})[_0x1530('0x32')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x1530('0x32')](function(_0x2fd3ee){_0x40d682=_0x2fd3ee;if(_0x49fcb2&&_0x2fd3ee>_0x49fcb2){return db['License'][_0x1530('0x65')]({'where':{'id':0x1}})[_0x1530('0x32')](function(_0xd819f2){if(_0xd819f2){_0xd819f2['increment'](_0x1530('0x111'));}});}})[_0x1530('0x32')](function(){if(_0x1cc7c6[_0x1530('0x10d')]&&_0x1cc7c6[_0x1530('0x10d')][_0x1530('0x10e')]){var _0x299a8b=[];for(var _0x48b738=0x0;_0x48b738<_0x1cc7c6['Interval']['Intervals'][_0x1530('0x43')];_0x48b738++){var _0x4c828a=_0x1cc7c6[_0x1530('0x10d')][_0x1530('0x10e')][_0x48b738][_0x1530('0x58')]({'plain':!![]});_0x299a8b[_0x1530('0xbb')](iftimePromise(_0x4c828a,_0x1cc7c6));}return BPromise[_0x1530('0x112')](_0x299a8b)[_0x1530('0x32')](function(_0x4cd746){return _[_0x1530('0x113')](_0x4cd746);});}else{return!![];}})[_0x1530('0x32')](function(_0x4e2f6c){var _0x524af8=fs[_0x1530('0xce')](path[_0x1530('0x76')](config['root'],_0x1530('0x114')),_0x1530('0xd0'));var _0x54116d={'remote':_0x1cc7c6[_0x1530('0x115')],'query':querystring[_0x1530('0x23')](_[_0x1530('0x4a')](_0x1cc7c6[_0x1530('0x58')]({'plain':!![]}),{'customerIp':_0x18926f[_0x1530('0x87')][_0x1530('0xa5')]||_0x18926f['headers'][_0x1530('0x116')]||_0x18926f[_0x1530('0x117')]['remoteAddress']||_0x18926f['ip'],'referer':_0x18926f[_0x1530('0x87')][_0x1530('0xaa')],'openedInteractions':_0x40d682,'maxInteractions':_0x49fcb2,'virtual':_0x5e49da[_0x1530('0x110')],'online':_0x4e2f6c,'custom':_0x5e49da}))['replace'](/'/g,'\x5c\x27')};_0xa0013d[_0x1530('0xc9')](ejs['render'](Mustache[_0x1530('0xd1')](_0x524af8,_0x54116d),{'proactiveActions':_0x21b00a,'alignment':_0x1cc7c6[_0x1530('0x118')],'verticalAlignment':_0x1cc7c6['verticalAlignment'],'div_color':_0x1cc7c6[_0x1530('0x100')],'text_color':_0x1cc7c6[_0x1530('0x119')],'button_color':_0x1cc7c6[_0x1530('0x11a')],'background_color':_0x1cc7c6[_0x1530('0x11b')]}));})[_0x1530('0x28')](handleError(_0xa0013d,null));};exports[_0x1530('0x11c')]=function(_0x368f5b,_0x1f42bc,_0x4c9032){return db[_0x1530('0x38')][_0x1530('0x65')]({'where':{'id':_0x368f5b[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x1f42bc,null))['then'](function(_0x75e7b9){if(_0x75e7b9){return db[_0x1530('0xdb')]['transaction'](function(_0x2a1a69){return db[_0x1530('0x9a')][_0x1530('0x33')]({'where':{'ChatWebsiteId':_0x368f5b[_0x1530('0x52')]['id']},'transaction':_0x2a1a69})['then'](function(_0x465186){var _0x3470f9=_[_0x1530('0x3c')](_0x368f5b[_0x1530('0x56')],function(_0x259010){_0x259010[_0x1530('0x68')]=_0x368f5b[_0x1530('0x52')]['id'];return _0x259010;});return db['ChatApplication']['bulkCreate'](_0x3470f9,{'transaction':_0x2a1a69});});})['then'](function(){return db[_0x1530('0x9a')][_0x1530('0x11d')]({'where':{'ChatWebsiteId':_0x368f5b[_0x1530('0x52')]['id']},'order':'priority'});});}})[_0x1530('0x32')](respondWithResult(_0x1f42bc,null))[_0x1530('0x28')](handleError(_0x1f42bc,null));};exports[_0x1530('0x11e')]=function(_0x2e108f,_0x38a787,_0x30e0b7){var _0x202c1d={};var _0x50458b={};var _0x3e7e77;var _0x32e3ef;return db['ChatWebsite']['findOne']({'where':{'id':_0x2e108f[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x38a787,null))[_0x1530('0x32')](function(_0x33363c){if(_0x33363c){_0x3e7e77=_0x33363c;_0x50458b['model']=_[_0x1530('0x3e')](db[_0x1530('0x9a')][_0x1530('0x54')]);_0x50458b[_0x1530('0x3d')]=_[_0x1530('0x3e')](_0x2e108f[_0x1530('0x3d')]);_0x50458b[_0x1530('0x46')]=_[_0x1530('0x3f')](_0x50458b[_0x1530('0x40')],_0x50458b['query']);_0x202c1d['attributes']=_['intersection'](_0x50458b[_0x1530('0x40')],qs[_0x1530('0x42')](_0x2e108f['query'][_0x1530('0x42')]));_0x202c1d['attributes']=_0x202c1d[_0x1530('0x41')][_0x1530('0x43')]?_0x202c1d[_0x1530('0x41')]:_0x50458b['model'];_0x202c1d[_0x1530('0x66')]=qs['sort'](_0x2e108f[_0x1530('0x3d')][_0x1530('0x67')]);_0x202c1d['where']=qs['filters'](_[_0x1530('0x47')](_0x2e108f[_0x1530('0x3d')],_0x50458b['filters']));if(_0x2e108f[_0x1530('0x3d')][_0x1530('0x48')]){_0x202c1d[_0x1530('0x49')]=_['merge'](_0x202c1d[_0x1530('0x49')],{'$or':_[_0x1530('0x3c')](_0x202c1d['attributes'],function(_0x516ce0){var _0x14f4db={};_0x14f4db[_0x516ce0]={'$like':'%'+_0x2e108f['query']['filter']+'%'};return _0x14f4db;})});}_0x202c1d=_[_0x1530('0x4a')]({},_0x202c1d,_0x2e108f[_0x1530('0x4c')]);return _0x3e7e77[_0x1530('0x11e')](_0x202c1d);}})['then'](function(_0xfd6952){if(_0xfd6952){_0x32e3ef=_0xfd6952[_0x1530('0x43')];if(!_0x2e108f[_0x1530('0x3d')][_0x1530('0x44')](_0x1530('0x45'))){_0x202c1d[_0x1530('0x2e')]=qs[_0x1530('0x2e')](_0x2e108f[_0x1530('0x3d')][_0x1530('0x2e')]);_0x202c1d[_0x1530('0x2d')]=qs[_0x1530('0x2d')](_0x2e108f[_0x1530('0x3d')]['offset']);}return _0x3e7e77['getApplications'](_0x202c1d);}})['then'](function(_0x7b128c){if(_0x7b128c){return _0x7b128c?{'count':_0x32e3ef,'rows':_0x7b128c}:null;}})['then'](respondWithResult(_0x38a787,null))[_0x1530('0x28')](handleError(_0x38a787,null));};exports[_0x1530('0x11f')]=function(_0x4cc55a,_0x1e8bc0,_0x13cadf){return db[_0x1530('0x120')][_0x1530('0x5c')]({'where':{'id':_0x4cc55a[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x1e8bc0,null))[_0x1530('0x32')](function(_0x15c037){if(_0x15c037){return _0x15c037[_0x1530('0x11f')](_0x4cc55a[_0x1530('0x56')][_0x1530('0x6b')],_['omit'](_0x4cc55a[_0x1530('0x56')],[_0x1530('0x6b'),'id'])||{});}})[_0x1530('0x32')](respondWithResult(_0x1e8bc0,null))[_0x1530('0x28')](handleError(_0x1e8bc0,null));};exports[_0x1530('0x121')]=function(_0x3d0ced,_0x898092,_0x58c112){var _0x2859fd={};var _0x22ef5d={};var _0x28d607;var _0x580d76;return db[_0x1530('0x38')]['findOne']({'where':{'id':_0x3d0ced['params']['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x898092,null))[_0x1530('0x32')](function(_0x50deda){if(_0x50deda){_0x28d607=_0x50deda;_0x22ef5d[_0x1530('0x40')]=_[_0x1530('0x3e')](db['ChatProactiveAction'][_0x1530('0x54')]);_0x22ef5d[_0x1530('0x3d')]=_[_0x1530('0x3e')](_0x3d0ced['query']);_0x22ef5d['filters']=_[_0x1530('0x3f')](_0x22ef5d['model'],_0x22ef5d[_0x1530('0x3d')]);_0x2859fd[_0x1530('0x41')]=_[_0x1530('0x3f')](_0x22ef5d[_0x1530('0x40')],qs[_0x1530('0x42')](_0x3d0ced[_0x1530('0x3d')][_0x1530('0x42')]));_0x2859fd['attributes']=_0x2859fd['attributes'][_0x1530('0x43')]?_0x2859fd[_0x1530('0x41')]:_0x22ef5d[_0x1530('0x40')];_0x2859fd[_0x1530('0x66')]=qs['sort'](_0x3d0ced[_0x1530('0x3d')][_0x1530('0x67')]);_0x2859fd[_0x1530('0x49')]=qs[_0x1530('0x46')](_['pick'](_0x3d0ced[_0x1530('0x3d')],_0x22ef5d[_0x1530('0x46')]));if(_0x3d0ced[_0x1530('0x3d')][_0x1530('0x48')]){_0x2859fd['where']=_[_0x1530('0x4a')](_0x2859fd[_0x1530('0x49')],{'$or':_[_0x1530('0x3c')](_0x2859fd[_0x1530('0x41')],function(_0x48de70){var _0x391952={};_0x391952[_0x48de70]={'$like':'%'+_0x3d0ced[_0x1530('0x3d')][_0x1530('0x48')]+'%'};return _0x391952;})});}_0x2859fd=_[_0x1530('0x4a')]({},_0x2859fd,_0x3d0ced[_0x1530('0x4c')]);return _0x28d607[_0x1530('0x121')](_0x2859fd);}})[_0x1530('0x32')](function(_0x35fd80){if(_0x35fd80){_0x580d76=_0x35fd80[_0x1530('0x43')];if(!_0x3d0ced[_0x1530('0x3d')][_0x1530('0x44')](_0x1530('0x45'))){_0x2859fd[_0x1530('0x2e')]=qs[_0x1530('0x2e')](_0x3d0ced['query'][_0x1530('0x2e')]);_0x2859fd[_0x1530('0x2d')]=qs[_0x1530('0x2d')](_0x3d0ced['query'][_0x1530('0x2d')]);}return _0x28d607[_0x1530('0x121')](_0x2859fd);}})[_0x1530('0x32')](function(_0x130d5f){if(_0x130d5f){return _0x130d5f?{'count':_0x580d76,'rows':_0x130d5f}:null;}})[_0x1530('0x32')](respondWithResult(_0x898092,null))[_0x1530('0x28')](handleError(_0x898092,null));};exports[_0x1530('0x122')]=function(_0x2159ff,_0x1dea55,_0x5b166f){var _0x5ea2ba=_0x2159ff[_0x1530('0x3d')]['online']===_0x1530('0x123')?_0x1530('0x124'):'onlineForm';return db[_0x1530('0x38')]['find']({'attributes':['id',_0x5ea2ba],'where':{'id':_0x2159ff[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x1dea55,null))[_0x1530('0x32')](function(_0x3cc2cb){if(_0x3cc2cb){var _0x397be6=_0x3cc2cb[_0x5ea2ba];var _0x1a51cc=_0x397be6&&_0x397be6[_0x1530('0x125')]?_0x397be6[_0x1530('0x125')]:[];_0x1dea55[_0x1530('0xc9')]({'fromKey':_['isNil'](_0x397be6[_0x1530('0x126')])?undefined:_0x397be6[_0x1530('0x126')],'count':_0x1a51cc['length'],'rows':_0x1a51cc});}})[_0x1530('0x28')](handleError(_0x1dea55,null));};exports[_0x1530('0x127')]=function(_0x334220,_0x567a1e,_0x40dba6){var _0x37432b={'raw':![],'where':{}};var _0x4a554e={};var _0x3e3557={'count':0x0,'rows':[]};return db[_0x1530('0x38')][_0x1530('0x65')]({'where':{'id':_0x334220[_0x1530('0x52')]['id']}})['then'](handleEntityNotFound(_0x567a1e,null))[_0x1530('0x32')](function(_0x121da7){if(_0x121da7){_0x4a554e[_0x1530('0x40')]=_[_0x1530('0x3e')](db[_0x1530('0xd4')]['rawAttributes']);_0x4a554e[_0x1530('0x3d')]=_[_0x1530('0x3e')](_0x334220[_0x1530('0x3d')]);_0x4a554e[_0x1530('0x46')]=_[_0x1530('0x3f')](_0x4a554e[_0x1530('0x40')],_0x4a554e[_0x1530('0x3d')]);_0x37432b[_0x1530('0x41')]=_['intersection'](_0x4a554e[_0x1530('0x40')],qs['fields'](_0x334220[_0x1530('0x3d')][_0x1530('0x42')]));_0x37432b[_0x1530('0x41')]=_0x37432b[_0x1530('0x41')][_0x1530('0x43')]?_0x37432b[_0x1530('0x41')]:_0x4a554e['model'];if(!_0x334220['query'][_0x1530('0x44')](_0x1530('0x45'))){_0x37432b[_0x1530('0x2e')]=qs['limit'](_0x334220['query'][_0x1530('0x2e')]);_0x37432b[_0x1530('0x2d')]=qs['offset'](_0x334220[_0x1530('0x3d')][_0x1530('0x2d')]);}_0x37432b[_0x1530('0x66')]=qs['sort'](_0x334220['query']['sort']);_0x37432b[_0x1530('0x49')]=qs[_0x1530('0x46')](_[_0x1530('0x47')](_0x334220[_0x1530('0x3d')],_0x4a554e['filters']));_0x37432b[_0x1530('0x49')][_0x1530('0x68')]=_0x121da7['id'];if(_0x334220['query'][_0x1530('0x48')]){_0x37432b[_0x1530('0x49')]=_[_0x1530('0x4a')](_0x37432b[_0x1530('0x49')],{'$or':_[_0x1530('0x3c')](_0x37432b['attributes'],function(_0x5d42e5){var _0x2b4c54={};_0x2b4c54[_0x5d42e5]={'$like':'%'+_0x334220[_0x1530('0x3d')][_0x1530('0x48')]+'%'};return _0x2b4c54;})});}_0x37432b=_[_0x1530('0x4a')]({},_0x37432b,_0x334220['options']);return db[_0x1530('0xd4')][_0x1530('0x4d')]({'where':_0x37432b[_0x1530('0x49')]})[_0x1530('0x32')](function(_0x5429db){_0x3e3557['count']=_0x5429db;if(_0x334220[_0x1530('0x3d')][_0x1530('0x4e')]){_0x37432b['include']=[{'all':!![]}];}else{_0x37432b[_0x1530('0x4f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x1530('0xd4')]['findAll'](_0x37432b);})[_0x1530('0x32')](function(_0x227f0a){_0x3e3557[_0x1530('0x69')]=_0x227f0a;return _0x3e3557;});}})['then'](respondWithFilteredResult(_0x567a1e,_0x37432b))['catch'](handleError(_0x567a1e,null));};exports['addAgents']=function(_0x5e9359,_0x3f76fe,_0x979b65){return db[_0x1530('0x38')][_0x1530('0x5c')]({'where':{'id':_0x5e9359[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x3f76fe,null))[_0x1530('0x32')](function(_0x2d9ff4){if(_0x2d9ff4){return _0x2d9ff4['addAgents'](_0x5e9359[_0x1530('0x56')][_0x1530('0x6b')],_['omit'](_0x5e9359[_0x1530('0x56')],[_0x1530('0x6b'),'id'])||{})[_0x1530('0xb8')](function(_0x3c3c6d){for(var _0xc7d98d=0x0;_0xc7d98d<_0x5e9359['body'][_0x1530('0x6b')][_0x1530('0x43')];_0xc7d98d+=0x1){socket[_0x1530('0x128')](_0x1530('0x129'),{'UserId':_0x5e9359[_0x1530('0x56')][_0x1530('0x6b')][_0xc7d98d],'ChatWebsiteId':_0x5e9359[_0x1530('0x52')]['id']});}return _0x3c3c6d;});}})[_0x1530('0x32')](respondWithResult(_0x3f76fe,null))[_0x1530('0x28')](handleError(_0x3f76fe,null));};exports[_0x1530('0x12a')]=function(_0x12a662,_0x1cd05b,_0x38a6ee){return db['ChatWebsite']['find']({'where':{'id':_0x12a662[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x1cd05b,null))[_0x1530('0x32')](function(_0x27b362){if(_0x27b362){return _0x27b362['removeAgents'](_0x12a662['query'][_0x1530('0x6b')])[_0x1530('0x32')](function(){if(_[_0x1530('0x12b')](_0x12a662['query'][_0x1530('0x6b')])){for(var _0x5cb12f=0x0;_0x5cb12f<_0x12a662[_0x1530('0x3d')][_0x1530('0x6b')]['length'];_0x5cb12f+=0x1){socket[_0x1530('0x128')](_0x1530('0x12c'),{'UserId':Number(_0x12a662[_0x1530('0x3d')][_0x1530('0x6b')][_0x5cb12f]),'ChatWebsiteId':Number(_0x12a662[_0x1530('0x52')]['id'])});}}else{socket[_0x1530('0x128')](_0x1530('0x12c'),{'UserId':Number(_0x12a662[_0x1530('0x3d')][_0x1530('0x6b')]),'ChatWebsiteId':Number(_0x12a662[_0x1530('0x52')]['id'])});}});}})[_0x1530('0x32')](respondWithStatusCode(_0x1cd05b,null))[_0x1530('0x28')](handleError(_0x1cd05b,null));};exports[_0x1530('0x12d')]=function(_0x5782d6,_0x31beea,_0xddd988){var _0x56e905={};var _0x2519ed={};var _0xdc2346;var _0x884e57;return db[_0x1530('0x38')][_0x1530('0x65')]({'where':{'id':_0x5782d6[_0x1530('0x52')]['id']}})[_0x1530('0x32')](handleEntityNotFound(_0x31beea,null))[_0x1530('0x32')](function(_0x2c8e4f){if(_0x2c8e4f){_0xdc2346=_0x2c8e4f;_0x2519ed[_0x1530('0x40')]=_[_0x1530('0x3e')](db[_0x1530('0xfa')][_0x1530('0x54')]);_0x2519ed[_0x1530('0x3d')]=_['keys'](_0x5782d6[_0x1530('0x3d')]);_0x2519ed[_0x1530('0x46')]=_[_0x1530('0x3f')](_0x2519ed[_0x1530('0x40')],_0x2519ed['query']);_0x56e905[_0x1530('0x41')]=_[_0x1530('0x3f')](_0x2519ed[_0x1530('0x40')],qs[_0x1530('0x42')](_0x5782d6[_0x1530('0x3d')][_0x1530('0x42')]));_0x56e905[_0x1530('0x41')]=_0x56e905[_0x1530('0x41')][_0x1530('0x43')]?_0x56e905[_0x1530('0x41')]:_0x2519ed['model'];_0x56e905[_0x1530('0x66')]=qs[_0x1530('0x67')](_0x5782d6[_0x1530('0x3d')][_0x1530('0x67')]);_0x56e905[_0x1530('0x49')]=qs[_0x1530('0x46')](_[_0x1530('0x47')](_0x5782d6[_0x1530('0x3d')],_0x2519ed['filters']));if(_0x5782d6['query'][_0x1530('0x48')]){_0x56e905['where']=_[_0x1530('0x4a')](_0x56e905[_0x1530('0x49')],{'$or':_['map'](_0x56e905[_0x1530('0x41')],function(_0x647be7){var _0x28c143={};_0x28c143[_0x647be7]={'$like':'%'+_0x5782d6['query']['filter']+'%'};return _0x28c143;})});}_0x56e905=_['merge']({},_0x56e905,_0x5782d6[_0x1530('0x4c')]);return _0xdc2346[_0x1530('0x12d')](_0x56e905);}})[_0x1530('0x32')](function(_0x2929ee){if(_0x2929ee){_0x884e57=_0x2929ee[_0x1530('0x43')];if(!_0x5782d6[_0x1530('0x3d')][_0x1530('0x44')]('nolimit')){_0x56e905[_0x1530('0x2e')]=qs[_0x1530('0x2e')](_0x5782d6[_0x1530('0x3d')]['limit']);_0x56e905[_0x1530('0x2d')]=qs[_0x1530('0x2d')](_0x5782d6[_0x1530('0x3d')][_0x1530('0x2d')]);}return _0xdc2346[_0x1530('0x12d')](_0x56e905);}})['then'](function(_0x5e5f09){if(_0x5e5f09){return _0x5e5f09?{'count':_0x884e57,'rows':_0x5e5f09}:null;}})['then'](respondWithResult(_0x31beea,null))['catch'](handleError(_0x31beea,null));};
\ No newline at end of file
+var _0xa8a8=['send','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','model','keys','query','filters','intersection','fields','length','attributes','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','rawAttributes','removeDispositions','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','join','getAvatar','agentAvatar','isNil','existsSync','server/files/images/avatars/','download','getCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','contact','headers','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','pass','SendMail','sendMail','email','MailAccountId','subjectOffline','mapValues','firstName','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','push','all','some','readFileSync','server/files/chat/iframe.js','x-real-ip','connection','replace','alignment','color','color_button','addApplications','ChatApplication','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','items','Contact','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name'];(function(_0x4db62f,_0x15a206){var _0xbedd45=function(_0x368276){while(--_0x368276){_0x4db62f['push'](_0x4db62f['shift']());}};_0xbedd45(++_0x15a206);}(_0xa8a8,0xec));var _0x8a8a=function(_0x24351b,_0x217d26){_0x24351b=_0x24351b-0x0;var _0xfe4d80=_0xa8a8[_0x24351b];return _0xfe4d80;};'use strict';var emlformat=require(_0x8a8a('0x0'));var rimraf=require(_0x8a8a('0x1'));var zipdir=require(_0x8a8a('0x2'));var jsonpatch=require(_0x8a8a('0x3'));var rp=require('request-promise');var moment=require(_0x8a8a('0x4'));var BPromise=require(_0x8a8a('0x5'));var Mustache=require(_0x8a8a('0x6'));var util=require(_0x8a8a('0x7'));var path=require(_0x8a8a('0x8'));var sox=require(_0x8a8a('0x9'));var csv=require(_0x8a8a('0xa'));var ejs=require(_0x8a8a('0xb'));var fs=require('fs');var fs_extra=require(_0x8a8a('0xc'));var _=require(_0x8a8a('0xd'));var squel=require(_0x8a8a('0xe'));var crypto=require(_0x8a8a('0xf'));var jsforce=require(_0x8a8a('0x10'));var deskjs=require(_0x8a8a('0x11'));var toCsv=require(_0x8a8a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a8a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8a8a('0x13'));var as=require(_0x8a8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a8a('0x15'))(_0x8a8a('0x16'));var utils=require(_0x8a8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8a8a('0x18'));var db=require(_0x8a8a('0x19'))['db'];config[_0x8a8a('0x1a')]=_[_0x8a8a('0x1b')](config['redis'],{'host':_0x8a8a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a8a('0x1a')]));require(_0x8a8a('0x1d'))[_0x8a8a('0x1e')](socket);var jayson=require(_0x8a8a('0x1f'));var client=jayson[_0x8a8a('0x20')][_0x8a8a('0x21')]({'port':0x232c});var client9002=jayson[_0x8a8a('0x20')]['http']({'port':0x232a});var client9003=jayson[_0x8a8a('0x20')]['http']({'port':0x232b});var client9001=jayson[_0x8a8a('0x20')][_0x8a8a('0x21')]({'port':0x2329});function respondWithRpcPromise(_0x46a4f4,_0x4291e9,_0x42e8b6,_0x5dd616){return new BPromise(function(_0x9d55f9,_0x3d165c){var _0x262ca9=_0x5dd616||client;return _0x262ca9[_0x8a8a('0x22')](_0x46a4f4,_0x42e8b6)[_0x8a8a('0x23')](function(_0x22e611){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4291e9,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4291e9,_0x8a8a('0x24'),JSON[_0x8a8a('0x25')](_0x22e611));if(_0x22e611[_0x8a8a('0x26')]){if(_0x22e611[_0x8a8a('0x26')][_0x8a8a('0x27')]===0x1f4){logger[_0x8a8a('0x26')](_0x8a8a('0x28'),_0x4291e9,_0x22e611[_0x8a8a('0x26')][_0x8a8a('0x29')]);return _0x3d165c(_0x22e611[_0x8a8a('0x26')][_0x8a8a('0x29')]);}logger[_0x8a8a('0x26')](_0x8a8a('0x28'),_0x4291e9,_0x22e611[_0x8a8a('0x26')][_0x8a8a('0x29')]);return _0x9d55f9(_0x22e611['error'][_0x8a8a('0x29')]);}else{logger[_0x8a8a('0x2a')](_0x8a8a('0x28'),_0x4291e9,_0x8a8a('0x24'));_0x9d55f9(_0x22e611[_0x8a8a('0x2b')][_0x8a8a('0x29')]);}})[_0x8a8a('0x2c')](function(_0x5f4dcc){logger[_0x8a8a('0x26')](_0x8a8a('0x28'),_0x4291e9,_0x5f4dcc);_0x3d165c(_0x5f4dcc);});});}function respondWithStatusCode(_0x2e217a,_0x54ff7e){_0x54ff7e=_0x54ff7e||0xcc;return function(_0x58f42b){if(_0x58f42b){return _0x2e217a[_0x8a8a('0x2d')](_0x54ff7e);}return _0x2e217a[_0x8a8a('0x2e')](_0x54ff7e)['end']();};}function respondWithResult(_0x4d8760,_0x4b3bc5){_0x4b3bc5=_0x4b3bc5||0xc8;return function(_0x78fd48){if(_0x78fd48){return _0x4d8760['status'](_0x4b3bc5)[_0x8a8a('0x2f')](_0x78fd48);}};}function respondWithFilteredResult(_0xdd6221,_0x49ea81){return function(_0x36c7f8){if(_0x36c7f8){var _0x2c8f27=_0x36c7f8[_0x8a8a('0x30')],_0x250852=_0x49ea81[_0x8a8a('0x31')],_0x8df0cb=_0x49ea81[_0x8a8a('0x31')]+_0x49ea81['limit'],_0x41802e;if(_0x8df0cb>=_0x2c8f27){_0x8df0cb=_0x2c8f27;_0x41802e=0xc8;}else{_0x41802e=0xce;}_0xdd6221['status'](_0x41802e);return _0xdd6221['set'](_0x8a8a('0x32'),_0x250852+'-'+_0x8df0cb+'/'+_0x2c8f27)[_0x8a8a('0x2f')](_0x36c7f8);}return null;};}function patchUpdates(_0x5f301e){return function(_0x2b5dc9){try{jsonpatch[_0x8a8a('0x33')](_0x2b5dc9,_0x5f301e,!![]);}catch(_0x481e92){return BPromise[_0x8a8a('0x34')](_0x481e92);}return _0x2b5dc9[_0x8a8a('0x35')]();};}function saveUpdates(_0x63b9be,_0x49e287){return function(_0x5bee53){if(_0x5bee53){return _0x5bee53[_0x8a8a('0x36')](_0x63b9be)['then'](function(_0x2a3198){return _0x2a3198;});}return null;};}function removeEntity(_0x3a4aa6,_0x3ecbca){return function(_0x196698){if(_0x196698){return _0x196698[_0x8a8a('0x37')]()[_0x8a8a('0x23')](function(){var _0x37ce45=_0x196698[_0x8a8a('0x38')]({'plain':!![]});var _0x320398=_0x8a8a('0x39');return db[_0x8a8a('0x3a')][_0x8a8a('0x37')]({'where':{'type':_0x320398,'resourceId':_0x37ce45['id']}})[_0x8a8a('0x23')](function(){return _0x196698;});})[_0x8a8a('0x23')](function(){_0x3a4aa6[_0x8a8a('0x2e')](0xcc)[_0x8a8a('0x3b')]();});}};}function handleEntityNotFound(_0x8e3017,_0x29d187){return function(_0x4c8003){if(!_0x4c8003){_0x8e3017['sendStatus'](0x194);}return _0x4c8003;};}function handleError(_0x53da01,_0x34db33){_0x34db33=_0x34db33||0x1f4;return function(_0x9e0128){logger[_0x8a8a('0x26')](_0x9e0128[_0x8a8a('0x3c')]);if(_0x9e0128[_0x8a8a('0x3d')]){delete _0x9e0128['name'];}_0x53da01['status'](_0x34db33)[_0x8a8a('0x3e')](_0x9e0128);};}exports['index']=function(_0x41a4c4,_0x5c210e){var _0x52811b={'include':[{'model':db[_0x8a8a('0x3f')],'as':_0x8a8a('0x40')}]},_0x1b33eb={},_0x1ac761={'count':0x0,'rows':[]};var _0x31307c=_[_0x8a8a('0x41')](db[_0x8a8a('0x42')]['rawAttributes'],function(_0x40d509){return{'name':_0x40d509[_0x8a8a('0x43')],'type':_0x40d509[_0x8a8a('0x44')]['key']};});_0x1b33eb[_0x8a8a('0x45')]=_[_0x8a8a('0x41')](_0x31307c,_0x8a8a('0x3d'));_0x1b33eb['query']=_[_0x8a8a('0x46')](_0x41a4c4[_0x8a8a('0x47')]);_0x1b33eb[_0x8a8a('0x48')]=_[_0x8a8a('0x49')](_0x1b33eb[_0x8a8a('0x45')],_0x1b33eb[_0x8a8a('0x47')]);_0x52811b['attributes']=_['intersection'](_0x1b33eb[_0x8a8a('0x45')],qs['fields'](_0x41a4c4[_0x8a8a('0x47')][_0x8a8a('0x4a')]));_0x52811b['attributes']=_0x52811b['attributes'][_0x8a8a('0x4b')]?_0x52811b[_0x8a8a('0x4c')]:_0x1b33eb[_0x8a8a('0x45')];if(!_0x41a4c4[_0x8a8a('0x47')]['hasOwnProperty'](_0x8a8a('0x4d'))){_0x52811b['limit']=qs[_0x8a8a('0x4e')](_0x41a4c4[_0x8a8a('0x47')]['limit']);_0x52811b[_0x8a8a('0x31')]=qs[_0x8a8a('0x31')](_0x41a4c4[_0x8a8a('0x47')]['offset']);}_0x52811b[_0x8a8a('0x4f')]=qs[_0x8a8a('0x50')](_0x41a4c4[_0x8a8a('0x47')]['sort']);_0x52811b['where']=qs[_0x8a8a('0x48')](_[_0x8a8a('0x51')](_0x41a4c4[_0x8a8a('0x47')],_0x1b33eb['filters']),_0x31307c);if(_0x41a4c4[_0x8a8a('0x47')][_0x8a8a('0x52')]){_0x52811b[_0x8a8a('0x53')]=_[_0x8a8a('0x54')](_0x52811b[_0x8a8a('0x53')],{'$or':_[_0x8a8a('0x41')](_0x31307c,function(_0x13c233){if(_0x13c233[_0x8a8a('0x44')]!==_0x8a8a('0x55')){var _0x229751={};_0x229751[_0x13c233[_0x8a8a('0x3d')]]={'$like':'%'+_0x41a4c4['query'][_0x8a8a('0x52')]+'%'};return _0x229751;}})});}_0x52811b=_[_0x8a8a('0x54')]({},_0x52811b,_0x41a4c4[_0x8a8a('0x56')]);var _0x386e1c={'where':_0x52811b[_0x8a8a('0x53')]};return db[_0x8a8a('0x42')]['count'](_0x386e1c)[_0x8a8a('0x23')](function(_0x396ffd){_0x1ac761[_0x8a8a('0x30')]=_0x396ffd;if(_0x41a4c4[_0x8a8a('0x47')]['includeAll']){_0x52811b[_0x8a8a('0x57')]=[{'all':!![]}];}return db[_0x8a8a('0x42')][_0x8a8a('0x58')](_0x52811b);})['then'](function(_0x4fa5a9){_0x1ac761[_0x8a8a('0x59')]=_0x4fa5a9;return _0x1ac761;})[_0x8a8a('0x23')](respondWithFilteredResult(_0x5c210e,_0x52811b))[_0x8a8a('0x2c')](handleError(_0x5c210e,null));};exports[_0x8a8a('0x5a')]=function(_0x393a4a,_0x20efe1){var _0x1d1b5c={'raw':![],'where':{'id':_0x393a4a[_0x8a8a('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x35464a={};_0x35464a[_0x8a8a('0x45')]=_[_0x8a8a('0x46')](db['ChatWebsite']['rawAttributes']);_0x35464a[_0x8a8a('0x47')]=_['keys'](_0x393a4a[_0x8a8a('0x47')]);_0x35464a['filters']=_[_0x8a8a('0x49')](_0x35464a[_0x8a8a('0x45')],_0x35464a[_0x8a8a('0x47')]);_0x1d1b5c[_0x8a8a('0x4c')]=_[_0x8a8a('0x49')](_0x35464a[_0x8a8a('0x45')],qs[_0x8a8a('0x4a')](_0x393a4a[_0x8a8a('0x47')][_0x8a8a('0x4a')]));_0x1d1b5c[_0x8a8a('0x4c')]=_0x1d1b5c['attributes'][_0x8a8a('0x4b')]?_0x1d1b5c[_0x8a8a('0x4c')]:_0x35464a[_0x8a8a('0x45')];if(_0x393a4a[_0x8a8a('0x47')][_0x8a8a('0x5c')]){_0x1d1b5c['include']=[{'all':!![]}];}_0x1d1b5c=_[_0x8a8a('0x54')]({},_0x1d1b5c,_0x393a4a[_0x8a8a('0x56')]);return db['ChatWebsite']['find'](_0x1d1b5c)[_0x8a8a('0x23')](handleEntityNotFound(_0x20efe1,null))[_0x8a8a('0x23')](respondWithResult(_0x20efe1,null))[_0x8a8a('0x2c')](handleError(_0x20efe1,null));};exports[_0x8a8a('0x5d')]=function(_0x265e98,_0x2dc4e8){return db['ChatWebsite']['create'](_0x265e98['body'],{})[_0x8a8a('0x23')](function(_0x54d848){var _0x3984dd=_0x265e98[_0x8a8a('0x5e')]['get']({'plain':!![]});if(!_0x3984dd)throw new Error(_0x8a8a('0x5f'));if(_0x3984dd[_0x8a8a('0x60')]===_0x8a8a('0x5e')){var _0x119fb5=_0x54d848['get']({'plain':!![]});var _0x12e040='ChatWebsites';return db[_0x8a8a('0x61')][_0x8a8a('0x62')]({'where':{'name':_0x12e040,'userProfileId':_0x3984dd['userProfileId']},'raw':!![]})[_0x8a8a('0x23')](function(_0x101543){if(_0x101543&&_0x101543[_0x8a8a('0x63')]===0x0){return db[_0x8a8a('0x3a')]['create']({'name':_0x119fb5[_0x8a8a('0x3d')],'resourceId':_0x119fb5['id'],'type':_0x101543[_0x8a8a('0x3d')],'sectionId':_0x101543['id']},{})[_0x8a8a('0x23')](function(){return _0x54d848;});}else{return _0x54d848;}})['catch'](function(_0x4fe07d){logger[_0x8a8a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fe07d);throw _0x4fe07d;});}return _0x54d848;})['then'](respondWithResult(_0x2dc4e8,0xc9))['catch'](handleError(_0x2dc4e8,null));};exports[_0x8a8a('0x36')]=function(_0x7d79a4,_0x5bdbd3){if(_0x7d79a4[_0x8a8a('0x64')]['id']){delete _0x7d79a4['body']['id'];}return db['ChatWebsite'][_0x8a8a('0x62')]({'where':{'id':_0x7d79a4[_0x8a8a('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x8a8a('0x40')}]})[_0x8a8a('0x23')](handleEntityNotFound(_0x5bdbd3,null))[_0x8a8a('0x23')](saveUpdates(_0x7d79a4[_0x8a8a('0x64')],null))[_0x8a8a('0x23')](respondWithResult(_0x5bdbd3,null))[_0x8a8a('0x2c')](handleError(_0x5bdbd3,null));};exports['destroy']=function(_0x3ca3d6,_0x402b5f){return db['ChatWebsite'][_0x8a8a('0x62')]({'where':{'id':_0x3ca3d6[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x402b5f,null))[_0x8a8a('0x23')](removeEntity(_0x402b5f,null))[_0x8a8a('0x2c')](handleError(_0x402b5f,null));};exports[_0x8a8a('0x65')]=function(_0x81c1dd,_0x34a079){return db[_0x8a8a('0x42')][_0x8a8a('0x65')]()['then'](respondWithResult(_0x34a079,null))[_0x8a8a('0x2c')](handleError(_0x34a079,null));};exports[_0x8a8a('0x66')]=function(_0x521883,_0x334eb3,_0x1f90af){if(_0x521883[_0x8a8a('0x64')]['id']){delete _0x521883[_0x8a8a('0x64')]['id'];}return db[_0x8a8a('0x42')]['find']({'where':{'id':_0x521883[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x334eb3,null))[_0x8a8a('0x23')](function(_0x2984eb){if(_0x2984eb){_0x521883[_0x8a8a('0x64')][_0x8a8a('0x67')]=_0x2984eb['id'];return db[_0x8a8a('0x68')]['create'](_0x521883[_0x8a8a('0x64')]);}})[_0x8a8a('0x23')](respondWithResult(_0x334eb3,null))[_0x8a8a('0x2c')](handleError(_0x334eb3,null));};exports['getDispositions']=function(_0x2f5ef0,_0x54c7c1,_0x15b2e7){var _0x27a8bc={'raw':![],'where':{}};var _0x571d8b={};var _0x82b378={'count':0x0,'rows':[]};return db[_0x8a8a('0x42')][_0x8a8a('0x69')]({'where':{'id':_0x2f5ef0[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x54c7c1,null))[_0x8a8a('0x23')](function(_0xaac98f){if(_0xaac98f){_0x571d8b[_0x8a8a('0x45')]=_[_0x8a8a('0x46')](db[_0x8a8a('0x68')][_0x8a8a('0x6a')]);_0x571d8b[_0x8a8a('0x47')]=_[_0x8a8a('0x46')](_0x2f5ef0[_0x8a8a('0x47')]);_0x571d8b[_0x8a8a('0x48')]=_[_0x8a8a('0x49')](_0x571d8b[_0x8a8a('0x45')],_0x571d8b[_0x8a8a('0x47')]);_0x27a8bc['attributes']=_[_0x8a8a('0x49')](_0x571d8b['model'],qs[_0x8a8a('0x4a')](_0x2f5ef0[_0x8a8a('0x47')][_0x8a8a('0x4a')]));_0x27a8bc['attributes']=_0x27a8bc['attributes'][_0x8a8a('0x4b')]?_0x27a8bc[_0x8a8a('0x4c')]:_0x571d8b[_0x8a8a('0x45')];if(!_0x2f5ef0['query']['hasOwnProperty'](_0x8a8a('0x4d'))){_0x27a8bc[_0x8a8a('0x4e')]=qs[_0x8a8a('0x4e')](_0x2f5ef0[_0x8a8a('0x47')][_0x8a8a('0x4e')]);_0x27a8bc[_0x8a8a('0x31')]=qs[_0x8a8a('0x31')](_0x2f5ef0[_0x8a8a('0x47')]['offset']);}_0x27a8bc[_0x8a8a('0x4f')]=qs[_0x8a8a('0x50')](_0x2f5ef0['query'][_0x8a8a('0x50')]);_0x27a8bc[_0x8a8a('0x53')]=qs[_0x8a8a('0x48')](_[_0x8a8a('0x51')](_0x2f5ef0[_0x8a8a('0x47')],_0x571d8b[_0x8a8a('0x48')]));_0x27a8bc['where'][_0x8a8a('0x67')]=_0xaac98f['id'];if(_0x2f5ef0[_0x8a8a('0x47')][_0x8a8a('0x52')]){_0x27a8bc[_0x8a8a('0x53')]=_[_0x8a8a('0x54')](_0x27a8bc['where'],{'$or':_[_0x8a8a('0x41')](_0x27a8bc[_0x8a8a('0x4c')],function(_0x34d140){var _0x3d9511={};_0x3d9511[_0x34d140]={'$like':'%'+_0x2f5ef0[_0x8a8a('0x47')][_0x8a8a('0x52')]+'%'};return _0x3d9511;})});}_0x27a8bc=_[_0x8a8a('0x54')]({},_0x27a8bc,_0x2f5ef0[_0x8a8a('0x56')]);return db[_0x8a8a('0x68')][_0x8a8a('0x30')]({'where':_0x27a8bc['where']})[_0x8a8a('0x23')](function(_0x20b40e){_0x82b378[_0x8a8a('0x30')]=_0x20b40e;if(_0x2f5ef0[_0x8a8a('0x47')][_0x8a8a('0x5c')]){_0x27a8bc['include']=[{'all':!![]}];}return db['Disposition'][_0x8a8a('0x58')](_0x27a8bc);})[_0x8a8a('0x23')](function(_0x3d63be){_0x82b378['rows']=_0x3d63be;return _0x82b378;});}})[_0x8a8a('0x23')](respondWithFilteredResult(_0x54c7c1,_0x27a8bc))[_0x8a8a('0x2c')](handleError(_0x54c7c1,null));};exports[_0x8a8a('0x6b')]=function(_0x7e73d1,_0x5675ec,_0x13504b){return db[_0x8a8a('0x42')][_0x8a8a('0x62')]({'where':{'id':_0x7e73d1['params']['id']}})['then'](handleEntityNotFound(_0x5675ec,null))['then'](function(_0x350183){if(_0x350183){return _0x350183['removeDispositions'](_0x7e73d1[_0x8a8a('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x5675ec,null))[_0x8a8a('0x2c')](handleError(_0x5675ec,null));};exports['addAnswer']=function(_0x554bd8,_0x47cc51,_0x4463c2){if(_0x554bd8['body']['id']){delete _0x554bd8['body']['id'];}return db[_0x8a8a('0x42')]['find']({'where':{'id':_0x554bd8[_0x8a8a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x47cc51,null))[_0x8a8a('0x23')](function(_0x27c4ba){if(_0x27c4ba){_0x554bd8[_0x8a8a('0x64')][_0x8a8a('0x67')]=_0x27c4ba['id'];return db['CannedAnswer'][_0x8a8a('0x5d')](_0x554bd8[_0x8a8a('0x64')]);}})['then'](respondWithResult(_0x47cc51,null))[_0x8a8a('0x2c')](handleError(_0x47cc51,null));};exports[_0x8a8a('0x6c')]=function(_0x913e4c,_0x468669,_0x50a275){var _0x4ef4b8={'raw':![],'where':{}};var _0x1fd850={};var _0x1ee082={'count':0x0,'rows':[]};return db[_0x8a8a('0x42')]['findOne']({'where':{'id':_0x913e4c[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x468669,null))[_0x8a8a('0x23')](function(_0x4acabe){if(_0x4acabe){_0x1fd850[_0x8a8a('0x45')]=_[_0x8a8a('0x46')](db[_0x8a8a('0x6d')][_0x8a8a('0x6a')]);_0x1fd850[_0x8a8a('0x47')]=_['keys'](_0x913e4c[_0x8a8a('0x47')]);_0x1fd850[_0x8a8a('0x48')]=_[_0x8a8a('0x49')](_0x1fd850[_0x8a8a('0x45')],_0x1fd850[_0x8a8a('0x47')]);_0x4ef4b8[_0x8a8a('0x4c')]=_[_0x8a8a('0x49')](_0x1fd850['model'],qs['fields'](_0x913e4c[_0x8a8a('0x47')][_0x8a8a('0x4a')]));_0x4ef4b8[_0x8a8a('0x4c')]=_0x4ef4b8['attributes'][_0x8a8a('0x4b')]?_0x4ef4b8[_0x8a8a('0x4c')]:_0x1fd850[_0x8a8a('0x45')];if(!_0x913e4c[_0x8a8a('0x47')][_0x8a8a('0x6e')](_0x8a8a('0x4d'))){_0x4ef4b8[_0x8a8a('0x4e')]=qs[_0x8a8a('0x4e')](_0x913e4c[_0x8a8a('0x47')][_0x8a8a('0x4e')]);_0x4ef4b8['offset']=qs[_0x8a8a('0x31')](_0x913e4c[_0x8a8a('0x47')][_0x8a8a('0x31')]);}_0x4ef4b8['order']=qs[_0x8a8a('0x50')](_0x913e4c[_0x8a8a('0x47')][_0x8a8a('0x50')]);_0x4ef4b8['where']=qs['filters'](_[_0x8a8a('0x51')](_0x913e4c[_0x8a8a('0x47')],_0x1fd850[_0x8a8a('0x48')]));_0x4ef4b8[_0x8a8a('0x53')]['ChatWebsiteId']=_0x4acabe['id'];if(_0x913e4c[_0x8a8a('0x47')][_0x8a8a('0x52')]){_0x4ef4b8[_0x8a8a('0x53')]=_[_0x8a8a('0x54')](_0x4ef4b8['where'],{'$or':_['map'](_0x4ef4b8[_0x8a8a('0x4c')],function(_0x300948){var _0x87ebeb={};_0x87ebeb[_0x300948]={'$like':'%'+_0x913e4c['query'][_0x8a8a('0x52')]+'%'};return _0x87ebeb;})});}_0x4ef4b8=_[_0x8a8a('0x54')]({},_0x4ef4b8,_0x913e4c[_0x8a8a('0x56')]);return db[_0x8a8a('0x6d')][_0x8a8a('0x30')]({'where':_0x4ef4b8['where']})[_0x8a8a('0x23')](function(_0x5d727e){_0x1ee082[_0x8a8a('0x30')]=_0x5d727e;if(_0x913e4c[_0x8a8a('0x47')][_0x8a8a('0x5c')]){_0x4ef4b8[_0x8a8a('0x57')]=[{'all':!![]}];}return db[_0x8a8a('0x6d')][_0x8a8a('0x58')](_0x4ef4b8);})['then'](function(_0x1ec034){_0x1ee082[_0x8a8a('0x59')]=_0x1ec034;return _0x1ee082;});}})['then'](respondWithFilteredResult(_0x468669,_0x4ef4b8))['catch'](handleError(_0x468669,null));};exports[_0x8a8a('0x6f')]=function(_0x15eb58,_0x526ccd,_0x41748f){return db['ChatWebsite']['find']({'where':{'id':_0x15eb58[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x526ccd,null))[_0x8a8a('0x23')](function(_0x4a8702){if(_0x4a8702){return _0x4a8702[_0x8a8a('0x6f')](_0x15eb58[_0x8a8a('0x47')][_0x8a8a('0x70')]);}})[_0x8a8a('0x23')](respondWithStatusCode(_0x526ccd,null))[_0x8a8a('0x2c')](handleError(_0x526ccd,null));};exports[_0x8a8a('0x71')]=function(_0x5e0c7e,_0x595809,_0x482cce){_0x5e0c7e[_0x8a8a('0x64')][_0x8a8a('0x72')]=_0x5e0c7e[_0x8a8a('0x73')][_0x8a8a('0x74')];return db[_0x8a8a('0x42')][_0x8a8a('0x62')]({'where':{'id':_0x5e0c7e[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x595809,null))[_0x8a8a('0x23')](saveUpdates(_0x5e0c7e['body'],null))[_0x8a8a('0x23')](respondWithResult(_0x595809,null))[_0x8a8a('0x2c')](handleError(_0x595809,null));};exports[_0x8a8a('0x75')]=function(_0x6c6aae,_0x40b73c,_0xce1136){_0x6c6aae['body']['agentAvatar']=_0x6c6aae['file'][_0x8a8a('0x74')];return db['ChatWebsite'][_0x8a8a('0x62')]({'where':{'id':_0x6c6aae['params']['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x40b73c,null))['then'](saveUpdates(_0x6c6aae[_0x8a8a('0x64')],null))[_0x8a8a('0x23')](respondWithResult(_0x40b73c,null))['catch'](handleError(_0x40b73c,null));};exports[_0x8a8a('0x76')]=function(_0x4a53d4,_0x48c4a8,_0xf071aa){_0x4a53d4['body'][_0x8a8a('0x77')]=_0x4a53d4['file'][_0x8a8a('0x74')];return db['ChatWebsite'][_0x8a8a('0x62')]({'where':{'id':_0x4a53d4[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x48c4a8,null))[_0x8a8a('0x23')](saveUpdates(_0x4a53d4['body'],null))[_0x8a8a('0x23')](respondWithResult(_0x48c4a8,null))[_0x8a8a('0x2c')](handleError(_0x48c4a8,null));};exports[_0x8a8a('0x78')]=function(_0x33ac80,_0x515328,_0x19804c){_0x33ac80[_0x8a8a('0x64')][_0x8a8a('0x79')]=_0x33ac80['file'][_0x8a8a('0x74')];return db[_0x8a8a('0x42')][_0x8a8a('0x62')]({'where':{'id':_0x33ac80[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x515328,null))['then'](saveUpdates(_0x33ac80['body'],null))[_0x8a8a('0x23')](respondWithResult(_0x515328,null))[_0x8a8a('0x2c')](handleError(_0x515328,null));};exports[_0x8a8a('0x7a')]=function(_0x4a3a13,_0x5a0a1,_0x122f4f){var _0x559f13=path['join'](config[_0x8a8a('0x7b')],_0x8a8a('0x7c'));var _0x144e48={'where':{'id':_0x4a3a13['params']['id']},'attributes':['id',_0x8a8a('0x72')],'raw':!![]};var _0x2f3aa6=![];return require('../../config/license/util')[_0x8a8a('0x7d')]()[_0x8a8a('0x23')](function(_0x5ab942){if(_0x5ab942){_0x2f3aa6=_0x5ab942[_0x8a8a('0x7e')];}})['then'](function(){return db[_0x8a8a('0x42')][_0x8a8a('0x62')](_0x144e48);})['then'](handleEntityNotFound(_0x5a0a1,null))[_0x8a8a('0x23')](function(_0x35cf74){if(_0x35cf74){if(!_['isNil'](_0x35cf74[_0x8a8a('0x72')])){if(fs['existsSync'](path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],'server/files/images/logos/',_0x35cf74[_0x8a8a('0x72')]))&&_0x2f3aa6){_0x559f13=path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],'server/files/images/logos/',_0x35cf74[_0x8a8a('0x72')]);}}return _0x5a0a1['download'](_0x559f13);}})[_0x8a8a('0x2c')](handleError(_0x5a0a1,null));};exports[_0x8a8a('0x80')]=function(_0x3197a7,_0x409210,_0x122b8d){var _0x54ad37=path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],'server/files/images/avatars/default_avatar.png');var _0x31f30a={'where':{'id':_0x3197a7[_0x8a8a('0x5b')]['id']},'attributes':['id',_0x8a8a('0x81')],'raw':!![]};return db['ChatWebsite']['find'](_0x31f30a)[_0x8a8a('0x23')](handleEntityNotFound(_0x409210,null))[_0x8a8a('0x23')](function(_0x279002){if(_0x279002){if(!_[_0x8a8a('0x82')](_0x279002[_0x8a8a('0x81')])){if(fs[_0x8a8a('0x83')](path[_0x8a8a('0x7f')](config['root'],'server/files/images/avatars/',_0x279002['agentAvatar']))){_0x54ad37=path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],_0x8a8a('0x84'),_0x279002['agentAvatar']);}}return _0x409210[_0x8a8a('0x85')](_0x54ad37);}})[_0x8a8a('0x2c')](handleError(_0x409210,null));};exports[_0x8a8a('0x86')]=function(_0x19c264,_0x3154ee,_0x545699){var _0x14bcab=path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],'server/files/images/avatars/customer_avatar.png');var _0x913a2f={'where':{'id':_0x19c264[_0x8a8a('0x5b')]['id']},'attributes':['id',_0x8a8a('0x77'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x8a8a('0x62')](_0x913a2f)[_0x8a8a('0x23')](handleEntityNotFound(_0x3154ee,null))[_0x8a8a('0x23')](function(_0x59a37a){if(_0x59a37a){if(!_[_0x8a8a('0x82')](_0x59a37a[_0x8a8a('0x77')])){if(fs['existsSync'](path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],'server/files/images/avatars/',_0x59a37a[_0x8a8a('0x77')]))&&_0x59a37a['showCustomerAvatar']){_0x14bcab=path['join'](config[_0x8a8a('0x7b')],_0x8a8a('0x84'),_0x59a37a['customerAvatar']);}}return _0x3154ee['download'](_0x14bcab);}})['catch'](handleError(_0x3154ee,null));};exports[_0x8a8a('0x87')]=function(_0x55bec7,_0x57a937,_0xc0fb22){var _0x69e16=path['join'](config[_0x8a8a('0x7b')],_0x8a8a('0x88'));var _0x1c2ff0={'where':{'id':_0x55bec7[_0x8a8a('0x5b')]['id']},'attributes':['id',_0x8a8a('0x79')],'raw':!![]};return db['ChatWebsite'][_0x8a8a('0x62')](_0x1c2ff0)['then'](handleEntityNotFound(_0x57a937,null))[_0x8a8a('0x23')](function(_0x9fa66d){if(_0x9fa66d){if(!_[_0x8a8a('0x82')](_0x9fa66d[_0x8a8a('0x79')])){if(fs['existsSync'](path['join'](config[_0x8a8a('0x7b')],_0x8a8a('0x84'),_0x9fa66d['systemAvatar']))){_0x69e16=path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],'server/files/images/avatars/',_0x9fa66d[_0x8a8a('0x79')]);}}return _0x57a937[_0x8a8a('0x85')](_0x69e16);}})[_0x8a8a('0x2c')](handleError(_0x57a937,null));};exports['notify']=function(_0x5544fa,_0x83f17d,_0x4d9d70){var _0x46aff7=require('user-agent-parser');var _0xca927d=new _0x46aff7();var _0x545e06=_0xca927d['setUA'](_0x5544fa['headers']['user-agent'])[_0x8a8a('0x89')]();var _0xe65a6d={'body':_0x5544fa[_0x8a8a('0x64')],'channel':'chat'};var _0x32eb6b=[];var _0x16b941=[];var _0x128bb3={};var _0x2a8177=![];return db[_0x8a8a('0x8a')][_0x8a8a('0x65')]()[_0x8a8a('0x23')](function(_0x586686){if(!_0x586686){throw new db['Sequelize'][(_0x8a8a('0x8b'))](_0x8a8a('0x8c'));}_0x32eb6b=_[_0x8a8a('0x8d')](_['keys'](_0x586686),[_0x8a8a('0x8e'),_0x8a8a('0x8f')]);_0x16b941=_[_0x8a8a('0x8d')](_[_0x8a8a('0x46')](_0x586686),['createdAt','updatedAt',_0x8a8a('0x90'),_0x8a8a('0x91')]);if(_0x5544fa[_0x8a8a('0x64')]['id']){delete _0x5544fa[_0x8a8a('0x64')]['id'];}if(_[_0x8a8a('0x82')](_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x92')])){throw new db[(_0x8a8a('0x93'))][(_0x8a8a('0x8b'))](_0x8a8a('0x94'));}if(_[_0x8a8a('0x82')](_0x5544fa['body'][_0x8a8a('0x64')])||_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x64')]===''){throw new db[(_0x8a8a('0x93'))][(_0x8a8a('0x8b'))](_0x8a8a('0x95'));}if(_[_0x8a8a('0x82')](_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x96')])){throw new db[(_0x8a8a('0x93'))][(_0x8a8a('0x8b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16b941);}if(!_[_0x8a8a('0x97')](_0x16b941,_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x96')])){throw new db[(_0x8a8a('0x93'))]['ValidationError'](_0x8a8a('0x98')+_0x16b941);}_0x128bb3[_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x96')]]=_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x92')];})[_0x8a8a('0x23')](function(){return db['ChatWebsite'][_0x8a8a('0x62')]({'where':{'id':_0x5544fa[_0x8a8a('0x5b')]['id']},'include':[{'model':db[_0x8a8a('0x99')],'as':_0x8a8a('0x9a'),'include':[{'model':db[_0x8a8a('0x8a')],'as':_0x8a8a('0x9b'),'where':_0x128bb3,'limit':0x1,'order':[[_0x8a8a('0x8f'),_0x8a8a('0x9c')]]}]},{'model':db['ChatApplication'],'as':_0x8a8a('0x9d')}]});})[_0x8a8a('0x23')](handleEntityNotFound(_0x83f17d,null))[_0x8a8a('0x23')](function(_0x60df5e){if(_0x60df5e&&_0x60df5e[_0x8a8a('0x9a')]){_0xe65a6d[_0x8a8a('0x9e')]=_0x60df5e;_0xe65a6d[_0x8a8a('0x9f')]=_0x60df5e[_0x8a8a('0x9d')];_0xe65a6d[_0x8a8a('0xa0')]=_0x60df5e['List'];_0xe65a6d[_0x8a8a('0x9f')]=_[_0x8a8a('0xa1')](_0xe65a6d[_0x8a8a('0x9f')],[_0x8a8a('0xa2')],[_0x8a8a('0xa3')]);if(_0xe65a6d['account'][_0x8a8a('0x9d')]){delete _0xe65a6d[_0x8a8a('0x9e')][_0x8a8a('0x9d')];}if(_0xe65a6d[_0x8a8a('0x9e')][_0x8a8a('0x9a')]&&_0xe65a6d['account']['List']['Contacts'][_0x8a8a('0x4b')]){return _0xe65a6d[_0x8a8a('0x9e')][_0x8a8a('0x9a')][_0x8a8a('0x9b')][0x0];}var _0x3bf9a3=_[_0x8a8a('0x1b')](_0x5544fa['body'],{'firstName':_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x92')],'ListId':_0x60df5e[_0x8a8a('0x91')]});_0x3bf9a3[_0x5544fa['body'][_0x8a8a('0x96')]]=_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x92')];return db['CmContact'][_0x8a8a('0x5d')](_0x3bf9a3,{'fields':_0x32eb6b,'raw':!![]});}})[_0x8a8a('0x23')](handleEntityNotFound(_0x83f17d,null))['then'](function(_0x4f1f13){_0xe65a6d[_0x8a8a('0xa4')]=_0x4f1f13;var _0x5887fe=_0x5544fa['body']['customerIp'];if(_0x5544fa[_0x8a8a('0xa5')][_0x8a8a('0xa6')]){_0x5887fe=_0x5544fa[_0x8a8a('0xa5')][_0x8a8a('0xa6')];}else if(_0x5544fa['headers'][_0x8a8a('0xa7')]){_0x5887fe=_['first'](_0x5544fa[_0x8a8a('0xa5')][_0x8a8a('0xa7')]['split'](','));}if(_0x4f1f13){var _0x423270={'ContactId':_0x4f1f13['id'],'ChatWebsiteId':_0x5544fa[_0x8a8a('0x5b')]['id'],'from':(_0x4f1f13['firstName']||'')+'\x20'+(_0x4f1f13[_0x8a8a('0xa8')]||''),'customerIp':_0x5887fe,'customerPort':_0x5544fa[_0x8a8a('0xa5')]['x-real-port']?_0x5544fa[_0x8a8a('0xa5')][_0x8a8a('0xa9')]:null,'referer':_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0xaa')],'browserName':_0x545e06[_0x8a8a('0xab')]['name']&&_0x545e06['browser'][_0x8a8a('0xac')]?util[_0x8a8a('0xad')]('%s\x20%s',_0x545e06[_0x8a8a('0xab')][_0x8a8a('0x3d')],_0x545e06[_0x8a8a('0xab')][_0x8a8a('0xac')]):_0x8a8a('0xae'),'browserVersion':_0x545e06[_0x8a8a('0xab')][_0x8a8a('0xac')]||_0x8a8a('0xae'),'osName':util[_0x8a8a('0xad')](_0x8a8a('0xaf'),_0x545e06['os'][_0x8a8a('0x3d')],_0x545e06['os'][_0x8a8a('0xac')]),'osVersion':_0x545e06['os'][_0x8a8a('0xac')],'deviceModel':_0x545e06['device'][_0x8a8a('0x45')]&&_0x545e06[_0x8a8a('0xb0')][_0x8a8a('0xb1')]?util['format'](_0x8a8a('0xb2'),_0x545e06[_0x8a8a('0xb0')][_0x8a8a('0x45')],_0x545e06[_0x8a8a('0xb0')][_0x8a8a('0xb1')],_0x545e06[_0x8a8a('0xb0')][_0x8a8a('0x44')]):null,'deviceVendor':_0x545e06[_0x8a8a('0xb0')][_0x8a8a('0xb1')],'deviceType':_0x545e06[_0x8a8a('0xb0')][_0x8a8a('0x44')],'formData':JSON['stringify'](_0x5544fa[_0x8a8a('0x64')])};var _0x35d518={'ChatWebsiteId':_0x5544fa[_0x8a8a('0x5b')]['id'],'closed':![]};if(_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0xb3')]){_0x35d518[_0x8a8a('0xb3')]=_0x5544fa[_0x8a8a('0x64')]['threadId'];return db[_0x8a8a('0xb4')][_0x8a8a('0x62')]({'where':_0x35d518})['then'](function(_0x2a9c1d){if(_0x2a9c1d){return[_0x2a9c1d,![]];}_0x423270['threadId']=_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0xb3')];_0x423270['externalUrl']=_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0xb5')];return db['ChatInteraction'][_0x8a8a('0x5d')](_0x423270)[_0x8a8a('0x23')](function(_0x536fdd){return[_0x536fdd,!![]];});});}_0x35d518[_0x8a8a('0xb6')]=_0x4f1f13['id'];if(_0x5544fa['body'][_0x8a8a('0xb7')]&&_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0xb7')]['id']){_0x35d518['id']=_0x5544fa['body']['interaction']['id'];return db[_0x8a8a('0xb4')]['find']({'where':_0x35d518})[_0x8a8a('0x23')](function(_0x5c904c){if(_0x5c904c){return[_0x5c904c,![]];}return db['ChatInteraction'][_0x8a8a('0x5d')](_0x423270)['then'](function(_0x4a837b){return[_0x4a837b,!![]];});});}return db[_0x8a8a('0xb4')][_0x8a8a('0x5d')](_0x423270)[_0x8a8a('0x23')](function(_0x477825){return[_0x477825,!![]];});}})[_0x8a8a('0xb8')](function(_0x4cb1da,_0x3d757a){if(_0x4cb1da){_0x2a8177=_0x3d757a;if(!_0x3d757a){var _0x1d8381={'from':(_0xe65a6d[_0x8a8a('0xa4')]['firstName']||'')+'\x20'+(_0xe65a6d[_0x8a8a('0xa4')]['lastName']||'')};if(_0x5544fa['body']['threadId']&&_0x5544fa[_0x8a8a('0x64')]['messageId']&&_0x5544fa['body']['threadId']!=_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0xb9')]){_0x1d8381[_0x8a8a('0xb3')]=_0x5544fa[_0x8a8a('0x64')]['messageId'];}return _0x4cb1da[_0x8a8a('0x36')](_0x1d8381);}else{return _0x4cb1da;}}})[_0x8a8a('0x23')](function(_0x45e383){_0xe65a6d['interaction']=_0x45e383[_0x8a8a('0x38')]({'plain':!![]});_0xe65a6d['interaction']['created']=_0x2a8177;if(_0xe65a6d[_0x8a8a('0xb7')][_0x8a8a('0xba')]){if(_0xe65a6d[_0x8a8a('0x9e')][_0x8a8a('0xbb')]){_0xe65a6d[_0x8a8a('0x9f')]['push']({'id':0x0,'priority':_0xe65a6d[_0x8a8a('0x9f')][_0x8a8a('0x4b')]+0x1,'app':_0x8a8a('0xbc'),'appdata':_0x8a8a('0xbd'),'interval':_0x8a8a('0xbe')});}}return db[_0x8a8a('0xbf')][_0x8a8a('0x5d')]({'body':_0x5544fa[_0x8a8a('0x64')][_0x8a8a('0x64')],'ChatWebsiteId':_0x5544fa['params']['id'],'ChatInteractionId':_0x45e383['id'],'direction':'in','ContactId':_0xe65a6d[_0x8a8a('0xa4')]['id'],'AttachmentId':_0x5544fa['body'][_0x8a8a('0xc0')]});})[_0x8a8a('0x23')](function(_0x52dac4){_0xe65a6d['message']=_0x52dac4;if(_0xe65a6d[_0x8a8a('0xb7')][_0x8a8a('0xc1')]){return db[_0x8a8a('0xc2')][_0x8a8a('0x62')]({'attributes':['id',_0x8a8a('0x3d')],'where':{'id':_0xe65a6d[_0x8a8a('0xb7')][_0x8a8a('0xc1')]}})[_0x8a8a('0x23')](function(_0x12fa35){if(_0x12fa35){_0xe65a6d[_0x8a8a('0x9f')][_0x8a8a('0xc3')]({'id':0x0,'priority':0x0,'app':_0x8a8a('0xc4'),'appdata':_0x12fa35[_0x8a8a('0x3d')]+','+(_0xe65a6d['account'][_0x8a8a('0xc5')]||0xa),'interval':_0x8a8a('0xbe')});_0xe65a6d[_0x8a8a('0xc6')]=!![];}return respondWithRpcPromise(_0x8a8a('0xc7'),_0x8a8a('0xc8'),_0xe65a6d);});}return respondWithRpcPromise(_0x8a8a('0xc7'),_0x8a8a('0xc8'),_0xe65a6d);})[_0x8a8a('0x23')](function(_0x120aa7){respondWithRpcPromise(_0x8a8a('0xc9'),_0x8a8a('0xc9'),{'event':_0x8a8a('0xca'),'message':_0x120aa7},client9002);return _0x120aa7;})[_0x8a8a('0x23')](respondWithResult(_0x83f17d,null))[_0x8a8a('0x2c')](handleError(_0x83f17d,null));};exports[_0x8a8a('0xcb')]=function(_0x19e4e7,_0x3a97c8,_0x3408e9){var _0x29e08e,_0x183423,_0x206b39;var _0x3e60fa=[];var _0x3dbe8b=[];var _0x433051={};var _0x3f064c=_0x19e4e7[_0x8a8a('0xcc')]||[];var _0x32374c=[];var _0x12ecd7;return db[_0x8a8a('0x8a')][_0x8a8a('0x65')]()[_0x8a8a('0x23')](function(_0x500ad7){if(!_0x500ad7){throw new db['Sequelize'][(_0x8a8a('0x8b'))]('no\x20available\x20attributes');}_0x3dbe8b=_[_0x8a8a('0x8d')](_[_0x8a8a('0x46')](_0x500ad7),[_0x8a8a('0x8e'),_0x8a8a('0x8f')]);_0x3e60fa=_['difference'](_[_0x8a8a('0x46')](_0x500ad7),[_0x8a8a('0x8e'),_0x8a8a('0x8f'),_0x8a8a('0x90'),_0x8a8a('0x91')]);if(_0x19e4e7[_0x8a8a('0x64')]['id']){delete _0x19e4e7[_0x8a8a('0x64')]['id'];}if(_[_0x8a8a('0x82')](_0x19e4e7[_0x8a8a('0x64')][_0x8a8a('0x92')])){throw _0x3a97c8[_0x8a8a('0x2e')](0x1f4)['send'](new db[(_0x8a8a('0x93'))][(_0x8a8a('0x8b'))](_0x8a8a('0x94')));}if(_[_0x8a8a('0x82')](_0x19e4e7[_0x8a8a('0x64')][_0x8a8a('0x64')])||_0x19e4e7[_0x8a8a('0x64')][_0x8a8a('0x64')]===''){throw _0x3a97c8[_0x8a8a('0x2e')](0x1f4)[_0x8a8a('0x3e')](new db[(_0x8a8a('0x93'))]['ValidationError'](_0x8a8a('0x95')));}if(_[_0x8a8a('0x82')](_0x19e4e7[_0x8a8a('0x64')][_0x8a8a('0xcd')])){throw _0x3a97c8[_0x8a8a('0x2e')](0x1f4)['send'](new db['Sequelize'][(_0x8a8a('0x8b'))](_0x8a8a('0xce')+_0x3e60fa));}if(!_[_0x8a8a('0x97')](_0x3e60fa,_0x19e4e7[_0x8a8a('0x64')][_0x8a8a('0xcd')])){throw _0x3a97c8['status'](0x1f4)[_0x8a8a('0x3e')](new db[(_0x8a8a('0x93'))][(_0x8a8a('0x8b'))](_0x8a8a('0xcf')+_0x3e60fa));}_0x433051[_0x19e4e7[_0x8a8a('0x64')][_0x8a8a('0xcd')]]=_0x19e4e7[_0x8a8a('0x64')]['from'];})[_0x8a8a('0x23')](function(){return db[_0x8a8a('0x42')][_0x8a8a('0x62')]({'where':{'id':_0x19e4e7[_0x8a8a('0x5b')]['id']},'include':[{'model':db[_0x8a8a('0x99')],'as':_0x8a8a('0x9a')},{'model':db[_0x8a8a('0xd0')],'as':_0x8a8a('0xd0')}]});})[_0x8a8a('0x23')](handleEntityNotFound(_0x3a97c8,null))[_0x8a8a('0x23')](function(_0x4596c9){if(_0x4596c9&&_0x4596c9['List']){_0x183423=_0x4596c9;var _0x461c49=_[_0x8a8a('0x1b')](_0x19e4e7[_0x8a8a('0x64')],{'firstName':_0x19e4e7[_0x8a8a('0x64')][_0x8a8a('0x92')],'phone':_0x19e4e7['body']['from'],'ListId':_0x4596c9[_0x8a8a('0x91')]});_0x461c49[_0x19e4e7[_0x8a8a('0x64')]['mapKeyOffline']]=_0x19e4e7[_0x8a8a('0x64')][_0x8a8a('0x92')];return db['CmContact'][_0x8a8a('0xd1')]({'where':_0x433051,'defaults':_0x461c49});}})[_0x8a8a('0xb8')](function(_0x460f8c){if(_0x460f8c){_0x206b39=_0x460f8c;var _0x17d76c=fs['readFileSync'](path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],_0x8a8a('0xd2')),_0x8a8a('0xd3'));var _0x4fc860=ejs[_0x8a8a('0xd4')](_0x17d76c,{'body':_[_0x8a8a('0xd5')](_0x19e4e7['body'][_0x8a8a('0x64')]),'bodyTitle':_0x183423[_0x8a8a('0xd6')]});return db[_0x8a8a('0xd7')][_0x8a8a('0x5d')]({'body':_0x4fc860,'ContactId':_0x460f8c['id'],'ChatWebsiteId':_0x183423['id']});}})[_0x8a8a('0x23')](function(_0x93fd84){_0x12ecd7=_0x93fd84;if(_0x3f064c[_0x8a8a('0x4b')]){var _0x2c8a9a=_0x3f064c[_0x8a8a('0x41')](function(_0x30ee47){return{'name':_0x30ee47[_0x8a8a('0xd8')],'basename':_0x30ee47[_0x8a8a('0x74')],'type':_0x30ee47['mimetype'],'ChatOfflineMessageId':_0x93fd84['id']};});_0x32374c=_0x2c8a9a[_0x8a8a('0x41')](_0x4d3ecf=>{var _0x2f1516={'filename':_0x4d3ecf['name'],'path':path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],_0x8a8a('0xd9'),_0x8a8a('0xcc'),'attachments',_0x8a8a('0xda'),_0x4d3ecf['basename'])};return _0x2f1516;});if(!_0x183423[_0x8a8a('0xdb')]){return db[_0x8a8a('0xdc')][_0x8a8a('0xdd')](function(_0x110d8a){return db[_0x8a8a('0xde')][_0x8a8a('0xdf')](_0x2c8a9a,{'transaction':_0x110d8a});});}}})[_0x8a8a('0x23')](function(){if(_0x12ecd7){_0x29e08e=_0x12ecd7;return db[_0x8a8a('0xd0')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8a8a('0xe0'),'raw':!![]}]});}})[_0x8a8a('0x23')](function(_0xb02292){if(_0xb02292&&_0xb02292[_0x8a8a('0xe0')]&&_0x183423[_0x8a8a('0xe1')]&&_0x183423[_0x8a8a('0xe2')]){var _0x2d6c27={'tls':{'rejectUnauthorized':![]}};if(_0xb02292[_0x8a8a('0xe0')][_0x8a8a('0xe3')]){_0x2d6c27[_0x8a8a('0xe3')]=_0xb02292['Smtp']['service'];}else{_0x2d6c27[_0x8a8a('0xe4')]=_0xb02292[_0x8a8a('0xe0')]['host'];_0x2d6c27[_0x8a8a('0xe5')]=_0xb02292[_0x8a8a('0xe0')][_0x8a8a('0xe5')];_0x2d6c27['secure']=_0xb02292[_0x8a8a('0xe0')][_0x8a8a('0xe6')];}if(_0xb02292[_0x8a8a('0xe0')]['authentication']){_0x2d6c27['auth']={'user':_0xb02292[_0x8a8a('0xe0')][_0x8a8a('0x5e')],'pass':_0xb02292[_0x8a8a('0xe0')][_0x8a8a('0xe7')]};}return respondWithRpcPromise(_0x8a8a('0xe8'),_0x8a8a('0xe9'),{'account':_0x2d6c27,'message':{'from':util[_0x8a8a('0xad')]('\x22%s\x22\x20<%s>',_0xb02292['name'],_0xb02292[_0x8a8a('0xea')]||_0xb02292[_0x8a8a('0xe0')]['user']),'to':_0x183423[_0x8a8a('0xe2')],'subject':_0x183423['offlineMessageSubject'],'text':_0x29e08e['body'],'attachments':_0x32374c}},client9003)['then'](function(){return _0x29e08e;})[_0x8a8a('0x2c')](function(_0x3eeb40){console[_0x8a8a('0x26')](_0x3eeb40);});}})[_0x8a8a('0x23')](function(){if(_0x183423&&_0x183423[_0x8a8a('0xdb')]&&_0x183423[_0x8a8a('0xeb')]){var _0x52328d=[];if(_0x3f064c['length']){_0x52328d=_0x3f064c['map'](function(_0x192040){return{'name':_0x192040[_0x8a8a('0xd8')],'basename':_0x192040[_0x8a8a('0x74')],'type':_0x192040['mimetype'],'ChatOfflineMessageId':_0x12ecd7['id']};});}var _0x4de15b;if(!_['isNil'](_0x183423[_0x8a8a('0xec')])){var _0x5168b5=_[_0x8a8a('0x41')](_0x19e4e7[_0x8a8a('0x64')],function(_0x51c6f8){return _0x51c6f8;});var _0x1bea69=_['toPairsIn'](_0x5168b5)[0x0];var _0x51744a=_[_0x8a8a('0xed')](_0x1bea69,function(_0x3f3b09){return _0x3f3b09;});_0x4de15b=_0x51744a[0x1][_0x183423[_0x8a8a('0xec')]];}var _0x4a4566={'from':_0x206b39[_0x8a8a('0xea')],'firstName':_0x206b39[_0x8a8a('0xee')],'lastName':_0x206b39['lastName'],'mapKey':_0x8a8a('0xea'),'message':{'from':_0x206b39[_0x8a8a('0xea')],'to':_0x183423[_0x8a8a('0xd0')][_0x8a8a('0xea')],'cc':'','subject':_[_0x8a8a('0x82')](_0x4de15b)?_0x183423[_0x8a8a('0xef')]:_0x4de15b,'messageId':'','sentAt':new Date(),'attach':_0x52328d['length'],'attachments':_0x52328d,'originChannel':_0x8a8a('0xf0'),'ChatWebsiteId':_0x183423['id'],'ChatOfflineMessageId':_0x29e08e['id'],'originTo':_0x183423[_0x8a8a('0xd0')][_0x8a8a('0xea')]},'body':_0x29e08e[_0x8a8a('0x64')]};var _0x144320={'account':{'id':_0x183423['MailAccountId']},'body':_0x4a4566,'log':_0x8a8a('0xf1')};return respondWithRpcPromise('NotifyMailAccount',_0x8a8a('0xf2'),_0x144320,client9001)[_0x8a8a('0x23')](function(){return _0x29e08e;})[_0x8a8a('0x2c')](function(_0x42c547){console[_0x8a8a('0x26')](_0x42c547);});}return;})[_0x8a8a('0x23')](function(){if(_0x29e08e){return _0x29e08e;}})['then'](respondWithResult(_0x3a97c8,null))['catch'](function(_0x3fa786){console[_0x8a8a('0x26')](_0x8a8a('0x2c'),_0x3fa786);for(var _0x20f945 of _0x3f064c){var _0x1baed2=path[_0x8a8a('0x7f')](config[_0x8a8a('0x7b')],_0x8a8a('0xd9'),_0x8a8a('0xcc'),_0x8a8a('0xf3'),_0x8a8a('0xda'),_0x20f945[_0x8a8a('0x74')]);fs_extra['remove'](_0x1baed2)[_0x8a8a('0x2c')](function(_0x4f31a2){console[_0x8a8a('0x26')](_0x8a8a('0xf4'),_0x1baed2,_0x4f31a2);});}});};exports[_0x8a8a('0xf5')]=function(_0x203707,_0x3cdc0a,_0x1d36eb){return db[_0x8a8a('0xb4')]['find']({'where':{'id':_0x203707[_0x8a8a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3cdc0a,null))[_0x8a8a('0x23')](function(_0x5efce4){if(_0x5efce4){return _0x5efce4[_0x8a8a('0xf5')](_0x203707[_0x8a8a('0x64')][_0x8a8a('0x70')],_[_0x8a8a('0xf6')](_0x203707['body'],['ids','id'])||{});}})[_0x8a8a('0x23')](respondWithResult(_0x3cdc0a,null))[_0x8a8a('0x2c')](handleError(_0x3cdc0a,null));};exports['getInteractions']=function(_0x15b30c,_0x59022b,_0x577662){var _0x24f65a={'raw':![],'where':{}};var _0x44eca1={};var _0x293bf4={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8a8a('0x69')]({'where':{'id':_0x15b30c[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x59022b,null))['then'](function(_0x1be060){if(_0x1be060){_0x44eca1[_0x8a8a('0x45')]=_['keys'](db['ChatInteraction'][_0x8a8a('0x6a')]);_0x44eca1[_0x8a8a('0x47')]=_[_0x8a8a('0x46')](_0x15b30c[_0x8a8a('0x47')]);_0x44eca1[_0x8a8a('0x48')]=_['intersection'](_0x44eca1[_0x8a8a('0x45')],_0x44eca1['query']);_0x24f65a['attributes']=_[_0x8a8a('0x49')](_0x44eca1[_0x8a8a('0x45')],qs[_0x8a8a('0x4a')](_0x15b30c[_0x8a8a('0x47')][_0x8a8a('0x4a')]));_0x24f65a[_0x8a8a('0x4c')]=_0x24f65a['attributes'][_0x8a8a('0x4b')]?_0x24f65a[_0x8a8a('0x4c')]:_0x44eca1[_0x8a8a('0x45')];if(!_0x15b30c[_0x8a8a('0x47')][_0x8a8a('0x6e')]('nolimit')){_0x24f65a[_0x8a8a('0x4e')]=qs['limit'](_0x15b30c[_0x8a8a('0x47')]['limit']);_0x24f65a['offset']=qs[_0x8a8a('0x31')](_0x15b30c[_0x8a8a('0x47')][_0x8a8a('0x31')]);}_0x24f65a['order']=qs[_0x8a8a('0x50')](_0x15b30c['query'][_0x8a8a('0x50')]);_0x24f65a[_0x8a8a('0x53')]=qs[_0x8a8a('0x48')](_[_0x8a8a('0x51')](_0x15b30c[_0x8a8a('0x47')],_0x44eca1[_0x8a8a('0x48')]));_0x24f65a[_0x8a8a('0x53')][_0x8a8a('0x67')]=_0x1be060['id'];if(_0x15b30c[_0x8a8a('0x47')][_0x8a8a('0x52')]){_0x24f65a[_0x8a8a('0x53')]=_['merge'](_0x24f65a['where'],{'$or':_[_0x8a8a('0x41')](_0x24f65a[_0x8a8a('0x4c')],function(_0x2e6741){var _0x50b445={};_0x50b445[_0x2e6741]={'$like':'%'+_0x15b30c['query'][_0x8a8a('0x52')]+'%'};return _0x50b445;})});}_0x24f65a=_[_0x8a8a('0x54')]({},_0x24f65a,_0x15b30c['options']);return db['ChatInteraction'][_0x8a8a('0x30')]({'where':_0x24f65a[_0x8a8a('0x53')]})['then'](function(_0x5e618d){_0x293bf4[_0x8a8a('0x30')]=_0x5e618d;if(_0x15b30c['query'][_0x8a8a('0x5c')]){_0x24f65a['include']=[{'model':db[_0x8a8a('0x8a')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8a8a('0x3d'),'fullname',_0x8a8a('0xf7')],'required':![]},{'model':db[_0x8a8a('0xf8')],'as':_0x8a8a('0xf9'),'attributes':['id','name','color'],'where':_0x15b30c[_0x8a8a('0x47')][_0x8a8a('0xfa')]?{'id':_0x15b30c[_0x8a8a('0x47')]['tag']}:undefined,'required':_0x15b30c[_0x8a8a('0x47')][_0x8a8a('0xfa')]?!![]:![]}];}return db[_0x8a8a('0xb4')]['findAll'](_0x24f65a);})['then'](function(_0x4a68f4){_0x293bf4['rows']=_0x4a68f4;return _0x293bf4;});}})[_0x8a8a('0x23')](respondWithFilteredResult(_0x59022b,_0x24f65a))[_0x8a8a('0x2c')](handleError(_0x59022b,null));};function iftimePromise(_0x3fd5b2,_0x6120b4){return respondWithRpcPromise(_0x8a8a('0xfb'),_0x8a8a('0xfc'),{'command':_0x6120b4[_0x8a8a('0xfd')]?util['format'](_0x8a8a('0xfe'),_0x3fd5b2[_0x8a8a('0xff')],_0x6120b4[_0x8a8a('0xfd')]):util['format'](_0x8a8a('0x100'),_0x3fd5b2[_0x8a8a('0xff')])},client9002)[_0x8a8a('0x23')](function(_0x5174f0){var _0x36eadb=_0x5174f0&&_0x5174f0[_0x8a8a('0x101')](_0x8a8a('0x102'))>=0x0?!![]:![];logger[_0x8a8a('0x2a')](_0x8a8a('0x103'),_0x6120b4['id'],_0x3fd5b2['id'],_0x3fd5b2[_0x8a8a('0xff')],_0x36eadb?'ONLINE':_0x8a8a('0x104'),_0x6120b4[_0x8a8a('0xfd')]?_0x6120b4[_0x8a8a('0xfd')]:_0x8a8a('0x105'));return _0x36eadb;})[_0x8a8a('0x2c')](function(_0x3138f3){logger[_0x8a8a('0x26')](_0x8a8a('0x103'),_0x6120b4['id'],_0x3fd5b2['id'],_0x3fd5b2[_0x8a8a('0xff')],util[_0x8a8a('0x106')](_0x3138f3,{'showHidden':![],'depth':null}),_0x6120b4[_0x8a8a('0xfd')]?_0x6120b4[_0x8a8a('0xfd')]:_0x8a8a('0x105'));return![];});}exports[_0x8a8a('0xfc')]=function(_0x3a60dc,_0x289424,_0x2d39a8){var _0x1f882e=0x0;var _0x2e7ad3=0x0;var _0x270117=![];var _0x6b0f5e;var _0x90b1cb;return db[_0x8a8a('0x42')][_0x8a8a('0x62')]({'where':{'id':_0x3a60dc['params']['id']},'include':[{'model':db['Interval'],'as':_0x8a8a('0x107'),'include':[{'model':db[_0x8a8a('0x107')],'as':_0x8a8a('0x108'),'attributes':['id',_0x8a8a('0xff')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x289424,null))[_0x8a8a('0x23')](function(_0x3265d7){if(_0x3265d7){_0x6b0f5e=_0x3265d7;return _0x3265d7['getProactiveActions']({'raw':!![]});}})[_0x8a8a('0x23')](function(_0x6a2caf){if(_0x6b0f5e){if(_0x6a2caf){_0x90b1cb=_0x6a2caf;}}return require(_0x8a8a('0x18'))[_0x8a8a('0x7d')]();})['then'](function(_0x3fe97e){if(_0x3fe97e){_0x2e7ad3=_0x3fe97e[_0x8a8a('0x109')];_0x270117=_0x3fe97e[_0x8a8a('0x7e')];}})[_0x8a8a('0x23')](function(){return db[_0x8a8a('0xb4')][_0x8a8a('0x30')]({'where':{'closed':![]}});})[_0x8a8a('0x23')](function(_0x1db5e4){_0x1f882e=_0x1db5e4;if(_0x2e7ad3&&_0x1db5e4>_0x2e7ad3){return db[_0x8a8a('0x10a')][_0x8a8a('0x69')]({'where':{'id':0x1}})[_0x8a8a('0x23')](function(_0x4f2cbb){if(_0x4f2cbb){_0x4f2cbb[_0x8a8a('0x10b')](_0x8a8a('0x10c'));}});}})[_0x8a8a('0x23')](function(){if(_0x6b0f5e['Interval']&&_0x6b0f5e[_0x8a8a('0x107')][_0x8a8a('0x108')]){var _0x2501de=[];for(var _0x2badfa=0x0;_0x2badfa<_0x6b0f5e[_0x8a8a('0x107')]['Intervals'][_0x8a8a('0x4b')];_0x2badfa++){var _0x54314d=_0x6b0f5e[_0x8a8a('0x107')][_0x8a8a('0x108')][_0x2badfa][_0x8a8a('0x38')]({'plain':!![]});_0x2501de[_0x8a8a('0x10d')](iftimePromise(_0x54314d,_0x6b0f5e));}return BPromise[_0x8a8a('0x10e')](_0x2501de)[_0x8a8a('0x23')](function(_0x15b524){return _[_0x8a8a('0x10f')](_0x15b524);});}else{return!![];}})[_0x8a8a('0x23')](function(_0x3f51dc){var _0x17fa4c=fs[_0x8a8a('0x110')](path[_0x8a8a('0x7f')](config['root'],_0x8a8a('0x111')),_0x8a8a('0xd3'));var _0x35a036={'remote':_0x6b0f5e['remote'],'query':querystring[_0x8a8a('0x25')](_[_0x8a8a('0x54')](_0x6b0f5e[_0x8a8a('0x38')]({'plain':!![]}),{'customerIp':_0x3a60dc[_0x8a8a('0xa5')]['x-forwarded-for']||_0x3a60dc['headers'][_0x8a8a('0x112')]||_0x3a60dc[_0x8a8a('0x113')]['remoteAddress']||_0x3a60dc['ip'],'referer':_0x3a60dc[_0x8a8a('0xa5')][_0x8a8a('0xaa')],'openedInteractions':_0x1f882e,'maxInteractions':_0x2e7ad3,'virtual':_0x270117[_0x8a8a('0x109')],'online':_0x3f51dc,'custom':_0x270117}))[_0x8a8a('0x114')](/'/g,'\x5c\x27')};_0x289424['send'](ejs[_0x8a8a('0xd4')](Mustache[_0x8a8a('0xd4')](_0x17fa4c,_0x35a036),{'proactiveActions':_0x90b1cb,'alignment':_0x6b0f5e[_0x8a8a('0x115')],'verticalAlignment':_0x6b0f5e['verticalAlignment'],'div_color':_0x6b0f5e[_0x8a8a('0x116')],'text_color':_0x6b0f5e['textColor'],'button_color':_0x6b0f5e[_0x8a8a('0x117')],'background_color':_0x6b0f5e['backgroundColor']}));})['catch'](handleError(_0x289424,null));};exports[_0x8a8a('0x118')]=function(_0x487ac2,_0x11b8e5,_0x300627){return db[_0x8a8a('0x42')][_0x8a8a('0x69')]({'where':{'id':_0x487ac2[_0x8a8a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x11b8e5,null))[_0x8a8a('0x23')](function(_0x3c5d4d){if(_0x3c5d4d){return db[_0x8a8a('0xdc')][_0x8a8a('0xdd')](function(_0x2b3f58){return db[_0x8a8a('0x119')]['destroy']({'where':{'ChatWebsiteId':_0x487ac2[_0x8a8a('0x5b')]['id']},'transaction':_0x2b3f58})[_0x8a8a('0x23')](function(_0x450d64){var _0x30fe79=_[_0x8a8a('0x41')](_0x487ac2[_0x8a8a('0x64')],function(_0x38c688){_0x38c688[_0x8a8a('0x67')]=_0x487ac2[_0x8a8a('0x5b')]['id'];return _0x38c688;});return db[_0x8a8a('0x119')][_0x8a8a('0xdf')](_0x30fe79,{'transaction':_0x2b3f58});});})['then'](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x487ac2[_0x8a8a('0x5b')]['id']},'order':_0x8a8a('0xa2')});});}})[_0x8a8a('0x23')](respondWithResult(_0x11b8e5,null))['catch'](handleError(_0x11b8e5,null));};exports['getApplications']=function(_0x2211a0,_0x54c285,_0x4b93b2){var _0x4f6f49={};var _0x2e2ffb={};var _0x4f9afe;var _0x1bd107;return db[_0x8a8a('0x42')][_0x8a8a('0x69')]({'where':{'id':_0x2211a0[_0x8a8a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x54c285,null))[_0x8a8a('0x23')](function(_0x4262ff){if(_0x4262ff){_0x4f9afe=_0x4262ff;_0x2e2ffb['model']=_['keys'](db[_0x8a8a('0x119')][_0x8a8a('0x6a')]);_0x2e2ffb[_0x8a8a('0x47')]=_['keys'](_0x2211a0[_0x8a8a('0x47')]);_0x2e2ffb[_0x8a8a('0x48')]=_[_0x8a8a('0x49')](_0x2e2ffb[_0x8a8a('0x45')],_0x2e2ffb[_0x8a8a('0x47')]);_0x4f6f49[_0x8a8a('0x4c')]=_[_0x8a8a('0x49')](_0x2e2ffb[_0x8a8a('0x45')],qs[_0x8a8a('0x4a')](_0x2211a0[_0x8a8a('0x47')][_0x8a8a('0x4a')]));_0x4f6f49['attributes']=_0x4f6f49[_0x8a8a('0x4c')]['length']?_0x4f6f49[_0x8a8a('0x4c')]:_0x2e2ffb['model'];_0x4f6f49['order']=qs[_0x8a8a('0x50')](_0x2211a0['query']['sort']);_0x4f6f49['where']=qs['filters'](_[_0x8a8a('0x51')](_0x2211a0[_0x8a8a('0x47')],_0x2e2ffb[_0x8a8a('0x48')]));if(_0x2211a0[_0x8a8a('0x47')][_0x8a8a('0x52')]){_0x4f6f49[_0x8a8a('0x53')]=_[_0x8a8a('0x54')](_0x4f6f49[_0x8a8a('0x53')],{'$or':_[_0x8a8a('0x41')](_0x4f6f49[_0x8a8a('0x4c')],function(_0x366e2f){var _0x5b09ff={};_0x5b09ff[_0x366e2f]={'$like':'%'+_0x2211a0[_0x8a8a('0x47')]['filter']+'%'};return _0x5b09ff;})});}_0x4f6f49=_[_0x8a8a('0x54')]({},_0x4f6f49,_0x2211a0[_0x8a8a('0x56')]);return _0x4f9afe[_0x8a8a('0x11a')](_0x4f6f49);}})[_0x8a8a('0x23')](function(_0x2a13fc){if(_0x2a13fc){_0x1bd107=_0x2a13fc[_0x8a8a('0x4b')];if(!_0x2211a0[_0x8a8a('0x47')][_0x8a8a('0x6e')](_0x8a8a('0x4d'))){_0x4f6f49[_0x8a8a('0x4e')]=qs[_0x8a8a('0x4e')](_0x2211a0['query']['limit']);_0x4f6f49['offset']=qs[_0x8a8a('0x31')](_0x2211a0['query'][_0x8a8a('0x31')]);}return _0x4f9afe[_0x8a8a('0x11a')](_0x4f6f49);}})[_0x8a8a('0x23')](function(_0xcd7d40){if(_0xcd7d40){return _0xcd7d40?{'count':_0x1bd107,'rows':_0xcd7d40}:null;}})[_0x8a8a('0x23')](respondWithResult(_0x54c285,null))['catch'](handleError(_0x54c285,null));};exports[_0x8a8a('0x11b')]=function(_0x5e7499,_0x1684dc,_0x47ee6b){return db[_0x8a8a('0x11c')][_0x8a8a('0x62')]({'where':{'id':_0x5e7499[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x1684dc,null))[_0x8a8a('0x23')](function(_0x43bfeb){if(_0x43bfeb){return _0x43bfeb[_0x8a8a('0x11b')](_0x5e7499['body'][_0x8a8a('0x70')],_['omit'](_0x5e7499['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1684dc,null))['catch'](handleError(_0x1684dc,null));};exports[_0x8a8a('0x11d')]=function(_0x3cff27,_0x374b3f,_0x1ba68b){var _0x3bb91f={};var _0x86982b={};var _0x247ad7;var _0x4c512b;return db['ChatWebsite']['findOne']({'where':{'id':_0x3cff27[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x374b3f,null))[_0x8a8a('0x23')](function(_0x5204d2){if(_0x5204d2){_0x247ad7=_0x5204d2;_0x86982b[_0x8a8a('0x45')]=_[_0x8a8a('0x46')](db['ChatProactiveAction'][_0x8a8a('0x6a')]);_0x86982b[_0x8a8a('0x47')]=_[_0x8a8a('0x46')](_0x3cff27['query']);_0x86982b[_0x8a8a('0x48')]=_[_0x8a8a('0x49')](_0x86982b[_0x8a8a('0x45')],_0x86982b['query']);_0x3bb91f[_0x8a8a('0x4c')]=_[_0x8a8a('0x49')](_0x86982b[_0x8a8a('0x45')],qs[_0x8a8a('0x4a')](_0x3cff27[_0x8a8a('0x47')][_0x8a8a('0x4a')]));_0x3bb91f[_0x8a8a('0x4c')]=_0x3bb91f[_0x8a8a('0x4c')]['length']?_0x3bb91f['attributes']:_0x86982b[_0x8a8a('0x45')];_0x3bb91f['order']=qs['sort'](_0x3cff27['query']['sort']);_0x3bb91f['where']=qs['filters'](_['pick'](_0x3cff27[_0x8a8a('0x47')],_0x86982b['filters']));if(_0x3cff27[_0x8a8a('0x47')][_0x8a8a('0x52')]){_0x3bb91f[_0x8a8a('0x53')]=_['merge'](_0x3bb91f[_0x8a8a('0x53')],{'$or':_[_0x8a8a('0x41')](_0x3bb91f[_0x8a8a('0x4c')],function(_0x204077){var _0x52ec71={};_0x52ec71[_0x204077]={'$like':'%'+_0x3cff27['query'][_0x8a8a('0x52')]+'%'};return _0x52ec71;})});}_0x3bb91f=_[_0x8a8a('0x54')]({},_0x3bb91f,_0x3cff27['options']);return _0x247ad7[_0x8a8a('0x11d')](_0x3bb91f);}})['then'](function(_0x1a403e){if(_0x1a403e){_0x4c512b=_0x1a403e[_0x8a8a('0x4b')];if(!_0x3cff27['query'][_0x8a8a('0x6e')]('nolimit')){_0x3bb91f[_0x8a8a('0x4e')]=qs[_0x8a8a('0x4e')](_0x3cff27[_0x8a8a('0x47')][_0x8a8a('0x4e')]);_0x3bb91f[_0x8a8a('0x31')]=qs['offset'](_0x3cff27[_0x8a8a('0x47')][_0x8a8a('0x31')]);}return _0x247ad7[_0x8a8a('0x11d')](_0x3bb91f);}})[_0x8a8a('0x23')](function(_0x3826f6){if(_0x3826f6){return _0x3826f6?{'count':_0x4c512b,'rows':_0x3826f6}:null;}})[_0x8a8a('0x23')](respondWithResult(_0x374b3f,null))[_0x8a8a('0x2c')](handleError(_0x374b3f,null));};exports[_0x8a8a('0x11e')]=function(_0x246301,_0x59f9a2,_0x2810fc){var _0x3e8ddf=_0x246301[_0x8a8a('0x47')][_0x8a8a('0x11f')]===_0x8a8a('0x120')?_0x8a8a('0x121'):'onlineForm';return db[_0x8a8a('0x42')][_0x8a8a('0x62')]({'attributes':['id',_0x3e8ddf],'where':{'id':_0x246301['params']['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x59f9a2,null))[_0x8a8a('0x23')](function(_0x2f5102){if(_0x2f5102){var _0x51dc09=_0x2f5102[_0x3e8ddf];var _0x48676a=_0x51dc09&&_0x51dc09['items']?_0x51dc09[_0x8a8a('0x122')]:[];_0x59f9a2[_0x8a8a('0x3e')]({'fromKey':_[_0x8a8a('0x82')](_0x51dc09['fromKey'])?undefined:_0x51dc09['fromKey'],'count':_0x48676a[_0x8a8a('0x4b')],'rows':_0x48676a});}})[_0x8a8a('0x2c')](handleError(_0x59f9a2,null));};exports['getOfflineMessages']=function(_0xdf8449,_0x43668c,_0x32d1bc){var _0x25f94c={'raw':![],'where':{}};var _0x44c9da={};var _0x5c3f9b={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xdf8449[_0x8a8a('0x5b')]['id']}})['then'](handleEntityNotFound(_0x43668c,null))[_0x8a8a('0x23')](function(_0x368bcc){if(_0x368bcc){_0x44c9da[_0x8a8a('0x45')]=_[_0x8a8a('0x46')](db[_0x8a8a('0xd7')]['rawAttributes']);_0x44c9da[_0x8a8a('0x47')]=_[_0x8a8a('0x46')](_0xdf8449['query']);_0x44c9da[_0x8a8a('0x48')]=_[_0x8a8a('0x49')](_0x44c9da[_0x8a8a('0x45')],_0x44c9da[_0x8a8a('0x47')]);_0x25f94c[_0x8a8a('0x4c')]=_[_0x8a8a('0x49')](_0x44c9da['model'],qs['fields'](_0xdf8449[_0x8a8a('0x47')][_0x8a8a('0x4a')]));_0x25f94c['attributes']=_0x25f94c[_0x8a8a('0x4c')][_0x8a8a('0x4b')]?_0x25f94c[_0x8a8a('0x4c')]:_0x44c9da[_0x8a8a('0x45')];if(!_0xdf8449[_0x8a8a('0x47')][_0x8a8a('0x6e')](_0x8a8a('0x4d'))){_0x25f94c[_0x8a8a('0x4e')]=qs['limit'](_0xdf8449['query']['limit']);_0x25f94c[_0x8a8a('0x31')]=qs[_0x8a8a('0x31')](_0xdf8449[_0x8a8a('0x47')][_0x8a8a('0x31')]);}_0x25f94c[_0x8a8a('0x4f')]=qs['sort'](_0xdf8449[_0x8a8a('0x47')][_0x8a8a('0x50')]);_0x25f94c['where']=qs[_0x8a8a('0x48')](_[_0x8a8a('0x51')](_0xdf8449[_0x8a8a('0x47')],_0x44c9da[_0x8a8a('0x48')]));_0x25f94c[_0x8a8a('0x53')]['ChatWebsiteId']=_0x368bcc['id'];if(_0xdf8449[_0x8a8a('0x47')][_0x8a8a('0x52')]){_0x25f94c[_0x8a8a('0x53')]=_[_0x8a8a('0x54')](_0x25f94c['where'],{'$or':_[_0x8a8a('0x41')](_0x25f94c['attributes'],function(_0x3807c8){var _0x32d528={};_0x32d528[_0x3807c8]={'$like':'%'+_0xdf8449[_0x8a8a('0x47')][_0x8a8a('0x52')]+'%'};return _0x32d528;})});}_0x25f94c=_[_0x8a8a('0x54')]({},_0x25f94c,_0xdf8449['options']);return db[_0x8a8a('0xd7')]['count']({'where':_0x25f94c[_0x8a8a('0x53')]})['then'](function(_0x4b44b9){_0x5c3f9b[_0x8a8a('0x30')]=_0x4b44b9;if(_0xdf8449[_0x8a8a('0x47')][_0x8a8a('0x5c')]){_0x25f94c[_0x8a8a('0x57')]=[{'all':!![]}];}else{_0x25f94c[_0x8a8a('0x57')]=[{'model':db[_0x8a8a('0x8a')],'as':_0x8a8a('0x123'),'required':![]},{'model':db[_0x8a8a('0xde')],'as':_0x8a8a('0x124'),'required':![]}];}return db[_0x8a8a('0xd7')][_0x8a8a('0x58')](_0x25f94c);})[_0x8a8a('0x23')](function(_0x11cf94){_0x5c3f9b[_0x8a8a('0x59')]=_0x11cf94;return _0x5c3f9b;});}})[_0x8a8a('0x23')](respondWithFilteredResult(_0x43668c,_0x25f94c))[_0x8a8a('0x2c')](handleError(_0x43668c,null));};exports[_0x8a8a('0x125')]=function(_0x3436c8,_0x2e7c3a,_0x4447dc){return db[_0x8a8a('0x42')][_0x8a8a('0x62')]({'where':{'id':_0x3436c8['params']['id']}})['then'](handleEntityNotFound(_0x2e7c3a,null))[_0x8a8a('0x23')](function(_0x156ebd){if(_0x156ebd){return _0x156ebd[_0x8a8a('0x125')](_0x3436c8[_0x8a8a('0x64')]['ids'],_[_0x8a8a('0xf6')](_0x3436c8['body'],[_0x8a8a('0x70'),'id'])||{})[_0x8a8a('0xb8')](function(_0x1d221f){for(var _0x37cc3b=0x0;_0x37cc3b<_0x3436c8[_0x8a8a('0x64')][_0x8a8a('0x70')][_0x8a8a('0x4b')];_0x37cc3b+=0x1){socket[_0x8a8a('0x126')](_0x8a8a('0x127'),{'UserId':_0x3436c8[_0x8a8a('0x64')][_0x8a8a('0x70')][_0x37cc3b],'ChatWebsiteId':_0x3436c8['params']['id']});}return _0x1d221f;});}})[_0x8a8a('0x23')](respondWithResult(_0x2e7c3a,null))[_0x8a8a('0x2c')](handleError(_0x2e7c3a,null));};exports['removeAgents']=function(_0x469830,_0x4676bb,_0x537af6){return db[_0x8a8a('0x42')][_0x8a8a('0x62')]({'where':{'id':_0x469830['params']['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x4676bb,null))[_0x8a8a('0x23')](function(_0x3d62d4){if(_0x3d62d4){return _0x3d62d4['removeAgents'](_0x469830['query']['ids'])['then'](function(){if(_[_0x8a8a('0x128')](_0x469830[_0x8a8a('0x47')][_0x8a8a('0x70')])){for(var _0x2a1e52=0x0;_0x2a1e52<_0x469830['query'][_0x8a8a('0x70')][_0x8a8a('0x4b')];_0x2a1e52+=0x1){socket[_0x8a8a('0x126')](_0x8a8a('0x129'),{'UserId':Number(_0x469830[_0x8a8a('0x47')][_0x8a8a('0x70')][_0x2a1e52]),'ChatWebsiteId':Number(_0x469830[_0x8a8a('0x5b')]['id'])});}}else{socket[_0x8a8a('0x126')](_0x8a8a('0x129'),{'UserId':Number(_0x469830[_0x8a8a('0x47')][_0x8a8a('0x70')]),'ChatWebsiteId':Number(_0x469830[_0x8a8a('0x5b')]['id'])});}});}})[_0x8a8a('0x23')](respondWithStatusCode(_0x4676bb,null))[_0x8a8a('0x2c')](handleError(_0x4676bb,null));};exports['getAgents']=function(_0x14c83f,_0x3c38ca,_0x2fdf21){var _0x67ad3d={};var _0x45aad5={};var _0x221ac6;var _0x3a3c70;return db[_0x8a8a('0x42')]['findOne']({'where':{'id':_0x14c83f[_0x8a8a('0x5b')]['id']}})[_0x8a8a('0x23')](handleEntityNotFound(_0x3c38ca,null))['then'](function(_0x541289){if(_0x541289){_0x221ac6=_0x541289;_0x45aad5['model']=_['keys'](db[_0x8a8a('0xc2')]['rawAttributes']);_0x45aad5[_0x8a8a('0x47')]=_[_0x8a8a('0x46')](_0x14c83f[_0x8a8a('0x47')]);_0x45aad5['filters']=_[_0x8a8a('0x49')](_0x45aad5['model'],_0x45aad5['query']);_0x67ad3d[_0x8a8a('0x4c')]=_['intersection'](_0x45aad5[_0x8a8a('0x45')],qs[_0x8a8a('0x4a')](_0x14c83f[_0x8a8a('0x47')]['fields']));_0x67ad3d['attributes']=_0x67ad3d[_0x8a8a('0x4c')][_0x8a8a('0x4b')]?_0x67ad3d['attributes']:_0x45aad5[_0x8a8a('0x45')];_0x67ad3d['order']=qs[_0x8a8a('0x50')](_0x14c83f[_0x8a8a('0x47')]['sort']);_0x67ad3d['where']=qs[_0x8a8a('0x48')](_[_0x8a8a('0x51')](_0x14c83f[_0x8a8a('0x47')],_0x45aad5[_0x8a8a('0x48')]));if(_0x14c83f[_0x8a8a('0x47')][_0x8a8a('0x52')]){_0x67ad3d[_0x8a8a('0x53')]=_['merge'](_0x67ad3d[_0x8a8a('0x53')],{'$or':_[_0x8a8a('0x41')](_0x67ad3d['attributes'],function(_0x48112d){var _0x34df1f={};_0x34df1f[_0x48112d]={'$like':'%'+_0x14c83f[_0x8a8a('0x47')]['filter']+'%'};return _0x34df1f;})});}_0x67ad3d=_[_0x8a8a('0x54')]({},_0x67ad3d,_0x14c83f[_0x8a8a('0x56')]);return _0x221ac6['getAgents'](_0x67ad3d);}})[_0x8a8a('0x23')](function(_0x543cf4){if(_0x543cf4){_0x3a3c70=_0x543cf4[_0x8a8a('0x4b')];if(!_0x14c83f[_0x8a8a('0x47')][_0x8a8a('0x6e')]('nolimit')){_0x67ad3d[_0x8a8a('0x4e')]=qs['limit'](_0x14c83f[_0x8a8a('0x47')][_0x8a8a('0x4e')]);_0x67ad3d[_0x8a8a('0x31')]=qs['offset'](_0x14c83f['query'][_0x8a8a('0x31')]);}return _0x221ac6['getAgents'](_0x67ad3d);}})['then'](function(_0x5ef38d){if(_0x5ef38d){return _0x5ef38d?{'count':_0x3a3c70,'rows':_0x5ef38d}:null;}})[_0x8a8a('0x23')](respondWithResult(_0x3c38ca,null))[_0x8a8a('0x2c')](handleError(_0x3c38ca,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 6038819..ce8e415 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 _0xe14d=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0xad9d4d,_0x5bf432){var _0x195e72=function(_0x1d2e78){while(--_0x1d2e78){_0xad9d4d['push'](_0xad9d4d['shift']());}};_0x195e72(++_0x5bf432);}(_0xe14d,0x1ee));var _0xde14=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xe14d[_0x20c9b2];return _0x2c6030;};'use strict';var EventEmitter=require(_0xde14('0x0'));var ChatWebsite=require(_0xde14('0x1'))['db'][_0xde14('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xde14('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde14('0x4'),'afterDestroy':_0xde14('0x5')};function emitEvent(_0x4b20e2){return function(_0x1c3e94,_0x13c24e,_0x3280b9){ChatWebsiteEvents[_0xde14('0x6')](_0x4b20e2+':'+_0x1c3e94['id'],_0x1c3e94);ChatWebsiteEvents[_0xde14('0x6')](_0x4b20e2,_0x1c3e94);_0x3280b9(null);};}for(var e in events){if(events[_0xde14('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x5f10=['emit','hasOwnProperty','hook','events','../../mysqldb','update','remove'];(function(_0x9620ac,_0x1dd664){var _0x561bd9=function(_0xfd8ffb){while(--_0xfd8ffb){_0x9620ac['push'](_0x9620ac['shift']());}};_0x561bd9(++_0x1dd664);}(_0x5f10,0xd5));var _0x05f1=function(_0x2c40bf,_0x5ce37a){_0x2c40bf=_0x2c40bf-0x0;var _0x31ab19=_0x5f10[_0x2c40bf];return _0x31ab19;};'use strict';var EventEmitter=require(_0x05f1('0x0'));var ChatWebsite=require(_0x05f1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x05f1('0x2'),'afterDestroy':_0x05f1('0x3')};function emitEvent(_0x2eaff1){return function(_0xcb88e1,_0xa8d3b9,_0x23747b){ChatWebsiteEvents['emit'](_0x2eaff1+':'+_0xcb88e1['id'],_0xcb88e1);ChatWebsiteEvents[_0x05f1('0x4')](_0x2eaff1,_0xcb88e1);_0x23747b(null);};}for(var e in events){if(events[_0x05f1('0x5')](e)){var event=events[e];ChatWebsite[_0x05f1('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 36ef22d..9d6e87c 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 _0x4746=['rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','util','api','bluebird','request-promise','path'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x4746,0xc6));var _0x6474=function(_0x32db1b,_0x141891){_0x32db1b=_0x32db1b-0x0;var _0x2d461f=_0x4746[_0x32db1b];return _0x2d461f;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var logger=require('../../config/logger')(_0x6474('0x2'));var moment=require('moment');var BPromise=require(_0x6474('0x3'));var rp=require(_0x6474('0x4'));var fs=require('fs');var path=require(_0x6474('0x5'));var rimraf=require(_0x6474('0x6'));var config=require(_0x6474('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x6474('0x8')]=function(_0x2bcf7c,_0x4cadd7){return _0x2bcf7c[_0x6474('0x9')](_0x6474('0xa'),attributes,{'tableName':_0x6474('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f2f=['chat_websites','lodash','util','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite'];(function(_0x44f88c,_0x2d8439){var _0x43998a=function(_0x4b4389){while(--_0x4b4389){_0x44f88c['push'](_0x44f88c['shift']());}};_0x43998a(++_0x2d8439);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x6f2f[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf6f2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf6f2('0x3'));var config=require(_0xf6f2('0x4'));var attributes=require(_0xf6f2('0x5'));module['exports']=function(_0x5c540a,_0x1123bb){return _0x5c540a[_0xf6f2('0x6')](_0xf6f2('0x7'),attributes,{'tableName':_0xf6f2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index db79a7b..303709c 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 _0xd943=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x198ef9,_0x5927bf){var _0x561a00=function(_0x332e5e){while(--_0x332e5e){_0x198ef9['push'](_0x198ef9['shift']());}};_0x561a00(++_0x5927bf);}(_0xd943,0x15d));var _0x3d94=function(_0x32d586,_0x216783){_0x32d586=_0x32d586-0x0;var _0xdecece=_0xd943[_0x32d586];return _0xdecece;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d94('0xa')],{'host':_0x3d94('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3d94('0xc'))[_0x3d94('0xd')](socket);function respondWithRpcPromise(_0x1cc58c,_0x5908a7,_0x182066){return new BPromise(function(_0x4ac968,_0x39e2fa){return client[_0x3d94('0xe')](_0x1cc58c,_0x182066)['then'](function(_0x1897de){logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));logger[_0x3d94('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5908a7,_0x3d94('0x11'),JSON[_0x3d94('0x13')](_0x1897de));if(_0x1897de[_0x3d94('0x14')]){if(_0x1897de['error'][_0x3d94('0x15')]===0x1f4){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de['error'][_0x3d94('0x16')]);return _0x39e2fa(_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);}logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);return _0x4ac968(_0x1897de[_0x3d94('0x14')]['message']);}else{logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));_0x4ac968(_0x1897de[_0x3d94('0x17')][_0x3d94('0x16')]);}})[_0x3d94('0x18')](function(_0xef8b3){logger['error'](_0x3d94('0x10'),_0x5908a7,_0xef8b3);_0x39e2fa(_0xef8b3);});});}
\ No newline at end of file
+var _0x7880=['defaults','localhost','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7880,0x1f4));var _0x0788=function(_0x4ca796,_0x10dc47){_0x4ca796=_0x4ca796-0x0;var _0x171f87=_0x7880[_0x4ca796];return _0x171f87;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});config[_0x0788('0xc')]=_[_0x0788('0xd')](config[_0x0788('0xc')],{'host':_0x0788('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0788('0xc')]));require('./chatWebsite.socket')[_0x0788('0xf')](socket);function respondWithRpcPromise(_0x53b2f2,_0x433c26,_0x3c6d18){return new BPromise(function(_0x1f9ff6,_0xee8670){return client[_0x0788('0x10')](_0x53b2f2,_0x3c6d18)['then'](function(_0x1920b3){logger[_0x0788('0x11')](_0x0788('0x12'),_0x433c26,_0x0788('0x13'));logger[_0x0788('0x14')](_0x0788('0x15'),_0x433c26,_0x0788('0x13'),JSON['stringify'](_0x1920b3));if(_0x1920b3[_0x0788('0x16')]){if(_0x1920b3[_0x0788('0x16')][_0x0788('0x17')]===0x1f4){logger[_0x0788('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x433c26,_0x1920b3[_0x0788('0x16')]['message']);return _0xee8670(_0x1920b3[_0x0788('0x16')][_0x0788('0x18')]);}logger[_0x0788('0x16')](_0x0788('0x12'),_0x433c26,_0x1920b3[_0x0788('0x16')][_0x0788('0x18')]);return _0x1f9ff6(_0x1920b3['error']['message']);}else{logger[_0x0788('0x11')](_0x0788('0x12'),_0x433c26,'request\x20sent');_0x1f9ff6(_0x1920b3[_0x0788('0x19')][_0x0788('0x18')]);}})[_0x0788('0x1a')](function(_0x52c339){logger[_0x0788('0x16')](_0x0788('0x12'),_0x433c26,_0x52c339);_0xee8670(_0x52c339);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index cd9e8d8..64d1290 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 _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0xe70371,_0x50e364){var _0xe65a58=function(_0x254c44){while(--_0x254c44){_0xe70371['push'](_0xe70371['shift']());}};_0xe65a58(++_0x50e364);}(_0x7a54,0x106));var _0x47a5=function(_0x3a4b7e,_0x2383e0){_0x3a4b7e=_0x3a4b7e-0x0;var _0x138384=_0x7a54[_0x3a4b7e];return _0x138384;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
+var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x40602e,_0x2e735f){var _0x2544c3=function(_0x108654){while(--_0x108654){_0x40602e['push'](_0x40602e['shift']());}};_0x2544c3(++_0x2e735f);}(_0x7a54,0x106));var _0x47a5=function(_0xfdabc9,_0x5dba88){_0xfdabc9=_0xfdabc9-0x0;var _0x1f64f2=_0x7a54[_0xfdabc9];return _0x1f64f2;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 55ef877..f5781ea 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 _0xa9e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','format','%s-%s','originalname','file','addLogo','now','single','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','attachments','offline-chat','extname','replace','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeAnswers','removeAgents','multer'];(function(_0x29375a,_0x301c00){var _0x5082ad=function(_0x59e522){while(--_0x59e522){_0x29375a['push'](_0x29375a['shift']());}};_0x5082ad(++_0x301c00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x8')]('/:id/customer_avatar',controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x8')](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['get'](_0x0a9e('0x18'),controller['getSnippet']);router[_0x0a9e('0x8')](_0x0a9e('0x19'),auth['isAuthenticated'](),controller[_0x0a9e('0x1a')]);router['get'](_0x0a9e('0x1b'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x8')](_0x0a9e('0x1d'),controller[_0x0a9e('0x1e')]);router[_0x0a9e('0x8')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x8')](_0x0a9e('0x21'),auth['isAuthenticated'](),controller[_0x0a9e('0x22')]);router[_0x0a9e('0x23')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['post']('/:id/dispositions',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x23')](_0x0a9e('0x26'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x3b45bc,_0x4d00e6,_0x370d86){_0x370d86(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],'server/files/images/logos/'));},'filename':function(_0x59181e,_0x197ec0,_0x3a8e58){_0x3a8e58(null,util[_0x0a9e('0x2b')](_0x0a9e('0x2c'),Date['now'](),_0x197ec0[_0x0a9e('0x2d')]));}})});router['post'](_0x0a9e('0xf'),upload['single'](_0x0a9e('0x2e')),controller[_0x0a9e('0x2f')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x14433c,_0x140511,_0x1538a4){_0x1538a4(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,util[_0x0a9e('0x2b')]('%s-%s',Date[_0x0a9e('0x30')](),_0x468813[_0x0a9e('0x2d')]));}})});router[_0x0a9e('0x23')](_0x0a9e('0x11'),upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x32')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x1dbde2,_0x540530,_0x426950){_0x426950(null,path['join'](config[_0x0a9e('0x2a')],_0x0a9e('0x33')));},'filename':function(_0x1122db,_0x33bdb7,_0x25ce3a){_0x25ce3a(null,util['format'](_0x0a9e('0x2c'),Date[_0x0a9e('0x30')](),_0x33bdb7[_0x0a9e('0x2d')]));}})});router[_0x0a9e('0x23')](_0x0a9e('0x34'),upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44295a,_0x5e7238,_0x2cc7a0){_0x2cc7a0(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],_0x0a9e('0x33')));},'filename':function(_0x567193,_0x191e91,_0xd1836d){_0xd1836d(null,util[_0x0a9e('0x2b')](_0x0a9e('0x2c'),Date['now'](),_0x191e91['originalname']));}})});router[_0x0a9e('0x23')]('/:id/system_avatar',upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x36')]);router[_0x0a9e('0x23')]('/:id/notify',controller[_0x0a9e('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x3cae,_0x533942,_0x1dbf74){const _0x1a180b=path[_0x0a9e('0x29')](config['root'],'server/files',_0x0a9e('0x38'),_0x0a9e('0x39'));fs_extra['ensureDir'](_0x1a180b,function(){_0x1dbf74(null,_0x1a180b);});},'filename':function(_0x2b814e,_0x419125,_0x2e1b3a){const _0x148f55=_0x419125['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x15e37d=path[_0x0a9e('0x3a')](_0x148f55);const _0x53f3ee=Date[_0x0a9e('0x30')]()+'-'+_0x148f55[_0x0a9e('0x3b')](_0x15e37d,'')+_0x15e37d;_0x2e1b3a(null,_0x53f3ee);}})});router[_0x0a9e('0x23')]('/:id/offline',offlineUploadMulter[_0x0a9e('0x3c')](),controller[_0x0a9e('0x3d')]);router[_0x0a9e('0x23')](_0x0a9e('0x16'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x3e')]);router[_0x0a9e('0x23')](_0x0a9e('0x19'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x3f')]);router[_0x0a9e('0x23')](_0x0a9e('0x1b'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x40')]);router[_0x0a9e('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x0a9e('0x41')]);router[_0x0a9e('0x42')](_0x0a9e('0x43'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x44')]);router[_0x0a9e('0x45')](_0x0a9e('0x43'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x46')]);router[_0x0a9e('0x45')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller['removeDispositions']);router[_0x0a9e('0x45')](_0x0a9e('0x26'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x47')]);router[_0x0a9e('0x45')](_0x0a9e('0x21'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x48')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','format','%s-%s','originalname','file','addLogo','now','single','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','attachments','offline-chat','extname','replace','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeAnswers','removeAgents','multer'];(function(_0x14b484,_0x4a7c9b){var _0x5c977d=function(_0x26b180){while(--_0x26b180){_0x14b484['push'](_0x14b484['shift']());}};_0x5c977d(++_0x4a7c9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x8')]('/:id/customer_avatar',controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x8')](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['get'](_0x0a9e('0x18'),controller['getSnippet']);router[_0x0a9e('0x8')](_0x0a9e('0x19'),auth['isAuthenticated'](),controller[_0x0a9e('0x1a')]);router['get'](_0x0a9e('0x1b'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x8')](_0x0a9e('0x1d'),controller[_0x0a9e('0x1e')]);router[_0x0a9e('0x8')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x8')](_0x0a9e('0x21'),auth['isAuthenticated'](),controller[_0x0a9e('0x22')]);router[_0x0a9e('0x23')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['post']('/:id/dispositions',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x23')](_0x0a9e('0x26'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x3b45bc,_0x4d00e6,_0x370d86){_0x370d86(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],'server/files/images/logos/'));},'filename':function(_0x59181e,_0x197ec0,_0x3a8e58){_0x3a8e58(null,util[_0x0a9e('0x2b')](_0x0a9e('0x2c'),Date['now'](),_0x197ec0[_0x0a9e('0x2d')]));}})});router['post'](_0x0a9e('0xf'),upload['single'](_0x0a9e('0x2e')),controller[_0x0a9e('0x2f')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x14433c,_0x140511,_0x1538a4){_0x1538a4(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,util[_0x0a9e('0x2b')]('%s-%s',Date[_0x0a9e('0x30')](),_0x468813[_0x0a9e('0x2d')]));}})});router[_0x0a9e('0x23')](_0x0a9e('0x11'),upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x32')]);var upload=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x1dbde2,_0x540530,_0x426950){_0x426950(null,path['join'](config[_0x0a9e('0x2a')],_0x0a9e('0x33')));},'filename':function(_0x1122db,_0x33bdb7,_0x25ce3a){_0x25ce3a(null,util['format'](_0x0a9e('0x2c'),Date[_0x0a9e('0x30')](),_0x33bdb7[_0x0a9e('0x2d')]));}})});router[_0x0a9e('0x23')](_0x0a9e('0x34'),upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44295a,_0x5e7238,_0x2cc7a0){_0x2cc7a0(null,path[_0x0a9e('0x29')](config[_0x0a9e('0x2a')],_0x0a9e('0x33')));},'filename':function(_0x567193,_0x191e91,_0xd1836d){_0xd1836d(null,util[_0x0a9e('0x2b')](_0x0a9e('0x2c'),Date['now'](),_0x191e91['originalname']));}})});router[_0x0a9e('0x23')]('/:id/system_avatar',upload[_0x0a9e('0x31')](_0x0a9e('0x2e')),controller[_0x0a9e('0x36')]);router[_0x0a9e('0x23')]('/:id/notify',controller[_0x0a9e('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x0a9e('0x28')]({'destination':function(_0x3cae,_0x533942,_0x1dbf74){const _0x1a180b=path[_0x0a9e('0x29')](config['root'],'server/files',_0x0a9e('0x38'),_0x0a9e('0x39'));fs_extra['ensureDir'](_0x1a180b,function(){_0x1dbf74(null,_0x1a180b);});},'filename':function(_0x2b814e,_0x419125,_0x2e1b3a){const _0x148f55=_0x419125['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x15e37d=path[_0x0a9e('0x3a')](_0x148f55);const _0x53f3ee=Date[_0x0a9e('0x30')]()+'-'+_0x148f55[_0x0a9e('0x3b')](_0x15e37d,'')+_0x15e37d;_0x2e1b3a(null,_0x53f3ee);}})});router[_0x0a9e('0x23')]('/:id/offline',offlineUploadMulter[_0x0a9e('0x3c')](),controller[_0x0a9e('0x3d')]);router[_0x0a9e('0x23')](_0x0a9e('0x16'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x3e')]);router[_0x0a9e('0x23')](_0x0a9e('0x19'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x3f')]);router[_0x0a9e('0x23')](_0x0a9e('0x1b'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x40')]);router[_0x0a9e('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x0a9e('0x41')]);router[_0x0a9e('0x42')](_0x0a9e('0x43'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x44')]);router[_0x0a9e('0x45')](_0x0a9e('0x43'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x46')]);router[_0x0a9e('0x45')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller['removeDispositions']);router[_0x0a9e('0x45')](_0x0a9e('0x26'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x47')]);router[_0x0a9e('0x45')](_0x0a9e('0x21'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x48')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index b2ac574..546aebb 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 _0x326f=['ENUM','AmazonAWS','Google','STRING','sequelize'];(function(_0x4641a5,_0x4a0da6){var _0x5de47d=function(_0x52bdc7){while(--_0x52bdc7){_0x4641a5['push'](_0x4641a5['shift']());}};_0x5de47d(++_0x4a0da6);}(_0x326f,0xd1));var _0xf326=function(_0x38f6f2,_0x5279a5){_0x38f6f2=_0x38f6f2-0x0;var _0x8b7e32=_0x326f[_0x38f6f2];return _0x8b7e32;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf326('0x1')](_0xf326('0x2'),_0xf326('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf326('0x4')]},'data2':{'type':Sequelize[_0xf326('0x4')]}};
\ No newline at end of file
+var _0x0a6b=['AmazonAWS','STRING','sequelize'];(function(_0x2e26eb,_0x49afba){var _0x432e15=function(_0x30fcec){while(--_0x30fcec){_0x2e26eb['push'](_0x2e26eb['shift']());}};_0x432e15(++_0x49afba);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x1b6c2d,_0xf82360){_0x1b6c2d=_0x1b6c2d-0x0;var _0x513c25=_0x0a6b[_0x1b6c2d];return _0x513c25;};'use strict';var Sequelize=require(_0xb0a6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xb0a6('0x1'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xb0a6('0x2')]},'data2':{'type':Sequelize[_0xb0a6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 9fef5fe..6571245 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 _0xd675=['../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x44d37e,_0x3596a1){var _0x2f6e50=function(_0x1fdf8e){while(--_0x1fdf8e){_0x44d37e['push'](_0x44d37e['shift']());}};_0x2f6e50(++_0x3596a1);}(_0xd675,0xbd));var _0x5d67=function(_0x26dd05,_0x135f80){_0x26dd05=_0x26dd05-0x0;var _0x5da547=_0xd675[_0x26dd05];return _0x5da547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d67('0x0'));var zipdir=require(_0x5d67('0x1'));var jsonpatch=require(_0x5d67('0x2'));var rp=require(_0x5d67('0x3'));var moment=require(_0x5d67('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5d67('0x5'));var util=require(_0x5d67('0x6'));var path=require(_0x5d67('0x7'));var sox=require(_0x5d67('0x8'));var csv=require(_0x5d67('0x9'));var ejs=require(_0x5d67('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d67('0xb'));var squel=require(_0x5d67('0xc'));var crypto=require(_0x5d67('0xd'));var jsforce=require(_0x5d67('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d67('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5d67('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5d67('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d67('0x11'))(_0x5d67('0x12'));var utils=require(_0x5d67('0x13'));var config=require(_0x5d67('0x14'));var licenseUtil=require(_0x5d67('0x15'));var db=require(_0x5d67('0x16'))['db'];function respondWithStatusCode(_0x328257,_0x1b970a){_0x1b970a=_0x1b970a||0xcc;return function(_0x2975fa){if(_0x2975fa){return _0x328257[_0x5d67('0x17')](_0x1b970a);}return _0x328257[_0x5d67('0x18')](_0x1b970a)['end']();};}function respondWithResult(_0x7de609,_0x106821){_0x106821=_0x106821||0xc8;return function(_0x3e16e4){if(_0x3e16e4){return _0x7de609[_0x5d67('0x18')](_0x106821)[_0x5d67('0x19')](_0x3e16e4);}};}function respondWithFilteredResult(_0x584e09,_0x2851ad){return function(_0x3e72eb){if(_0x3e72eb){var _0x40aba9=_0x3e72eb[_0x5d67('0x1a')],_0x2d79cb=_0x2851ad[_0x5d67('0x1b')],_0x2c8f82=_0x2851ad['offset']+_0x2851ad[_0x5d67('0x1c')],_0x41820e;if(_0x2c8f82>=_0x40aba9){_0x2c8f82=_0x40aba9;_0x41820e=0xc8;}else{_0x41820e=0xce;}_0x584e09[_0x5d67('0x18')](_0x41820e);return _0x584e09[_0x5d67('0x1d')](_0x5d67('0x1e'),_0x2d79cb+'-'+_0x2c8f82+'/'+_0x40aba9)[_0x5d67('0x19')](_0x3e72eb);}return null;};}function patchUpdates(_0x3ccd1c){return function(_0x1c9074){try{jsonpatch['apply'](_0x1c9074,_0x3ccd1c,!![]);}catch(_0x40297b){return BPromise[_0x5d67('0x1f')](_0x40297b);}return _0x1c9074[_0x5d67('0x20')]();};}function saveUpdates(_0x573904,_0x340637){return function(_0x2ffb13){if(_0x2ffb13){return _0x2ffb13['update'](_0x573904)[_0x5d67('0x21')](function(_0x57c6d0){return _0x57c6d0;});}return null;};}function removeEntity(_0x4312f7,_0x21f151){return function(_0x1d8e3d){if(_0x1d8e3d){return _0x1d8e3d[_0x5d67('0x22')]()[_0x5d67('0x21')](function(){_0x4312f7[_0x5d67('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46cf97,_0x47936c){return function(_0x46a099){if(!_0x46a099){_0x46cf97[_0x5d67('0x17')](0x194);}return _0x46a099;};}function handleError(_0x57b484,_0x494279){_0x494279=_0x494279||0x1f4;return function(_0x2a65f2){logger[_0x5d67('0x23')](_0x2a65f2[_0x5d67('0x24')]);if(_0x2a65f2[_0x5d67('0x25')]){delete _0x2a65f2['name'];}_0x57b484[_0x5d67('0x18')](_0x494279)[_0x5d67('0x26')](_0x2a65f2);};}exports['index']=function(_0x61f176,_0xf8f999){var _0x527d35={},_0x31ab45={},_0x11417e={'count':0x0,'rows':[]};var _0x2e9959=_['map'](db['CloudProvider'][_0x5d67('0x27')],function(_0x75e92b){return{'name':_0x75e92b[_0x5d67('0x28')],'type':_0x75e92b['type']['key']};});_0x31ab45[_0x5d67('0x29')]=_[_0x5d67('0x2a')](_0x2e9959,_0x5d67('0x25'));_0x31ab45['query']=_[_0x5d67('0x2b')](_0x61f176[_0x5d67('0x2c')]);_0x31ab45[_0x5d67('0x2d')]=_[_0x5d67('0x2e')](_0x31ab45[_0x5d67('0x29')],_0x31ab45['query']);_0x527d35[_0x5d67('0x2f')]=_[_0x5d67('0x2e')](_0x31ab45[_0x5d67('0x29')],qs[_0x5d67('0x30')](_0x61f176[_0x5d67('0x2c')][_0x5d67('0x30')]));_0x527d35['attributes']=_0x527d35['attributes'][_0x5d67('0x31')]?_0x527d35[_0x5d67('0x2f')]:_0x31ab45[_0x5d67('0x29')];if(!_0x61f176[_0x5d67('0x2c')]['hasOwnProperty'](_0x5d67('0x32'))){_0x527d35[_0x5d67('0x1c')]=qs['limit'](_0x61f176['query'][_0x5d67('0x1c')]);_0x527d35[_0x5d67('0x1b')]=qs['offset'](_0x61f176[_0x5d67('0x2c')][_0x5d67('0x1b')]);}_0x527d35[_0x5d67('0x33')]=qs[_0x5d67('0x34')](_0x61f176['query']['sort']);_0x527d35[_0x5d67('0x35')]=qs['filters'](_[_0x5d67('0x36')](_0x61f176[_0x5d67('0x2c')],_0x31ab45[_0x5d67('0x2d')]),_0x2e9959);if(_0x61f176['query'][_0x5d67('0x37')]){_0x527d35[_0x5d67('0x35')]=_['merge'](_0x527d35[_0x5d67('0x35')],{'$or':_['map'](_0x2e9959,function(_0x72027d){if(_0x72027d[_0x5d67('0x38')]!==_0x5d67('0x39')){var _0x35aa60={};_0x35aa60[_0x72027d[_0x5d67('0x25')]]={'$like':'%'+_0x61f176[_0x5d67('0x2c')][_0x5d67('0x37')]+'%'};return _0x35aa60;}})});}_0x527d35=_['merge']({},_0x527d35,_0x61f176[_0x5d67('0x3a')]);var _0x5cd829={'where':_0x527d35[_0x5d67('0x35')]};return db[_0x5d67('0x3b')][_0x5d67('0x1a')](_0x5cd829)[_0x5d67('0x21')](function(_0x48f8c7){_0x11417e[_0x5d67('0x1a')]=_0x48f8c7;if(_0x61f176[_0x5d67('0x2c')][_0x5d67('0x3c')]){_0x527d35[_0x5d67('0x3d')]=[{'all':!![]}];}return db[_0x5d67('0x3b')][_0x5d67('0x3e')](_0x527d35);})[_0x5d67('0x21')](function(_0x240d0e){_0x11417e[_0x5d67('0x3f')]=_0x240d0e;return _0x11417e;})[_0x5d67('0x21')](respondWithFilteredResult(_0xf8f999,_0x527d35))[_0x5d67('0x40')](handleError(_0xf8f999,null));};exports[_0x5d67('0x41')]=function(_0x477f2f,_0x11b5b3){var _0x387c4b={'raw':!![],'where':{'id':_0x477f2f['params']['id']}},_0xae732f={};_0xae732f[_0x5d67('0x29')]=_[_0x5d67('0x2b')](db['CloudProvider'][_0x5d67('0x27')]);_0xae732f['query']=_[_0x5d67('0x2b')](_0x477f2f[_0x5d67('0x2c')]);_0xae732f['filters']=_[_0x5d67('0x2e')](_0xae732f[_0x5d67('0x29')],_0xae732f[_0x5d67('0x2c')]);_0x387c4b['attributes']=_[_0x5d67('0x2e')](_0xae732f[_0x5d67('0x29')],qs[_0x5d67('0x30')](_0x477f2f[_0x5d67('0x2c')][_0x5d67('0x30')]));_0x387c4b[_0x5d67('0x2f')]=_0x387c4b[_0x5d67('0x2f')][_0x5d67('0x31')]?_0x387c4b[_0x5d67('0x2f')]:_0xae732f[_0x5d67('0x29')];if(_0x477f2f[_0x5d67('0x2c')]['includeAll']){_0x387c4b[_0x5d67('0x3d')]=[{'all':!![]}];}_0x387c4b=_['merge']({},_0x387c4b,_0x477f2f[_0x5d67('0x3a')]);return db[_0x5d67('0x3b')][_0x5d67('0x42')](_0x387c4b)['then'](handleEntityNotFound(_0x11b5b3,null))[_0x5d67('0x21')](respondWithResult(_0x11b5b3,null))[_0x5d67('0x40')](handleError(_0x11b5b3,null));};exports[_0x5d67('0x43')]=function(_0x5a37ce,_0x467ce8){return db[_0x5d67('0x3b')][_0x5d67('0x43')](_0x5a37ce[_0x5d67('0x44')],{})[_0x5d67('0x21')](respondWithResult(_0x467ce8,0xc9))['catch'](handleError(_0x467ce8,null));};exports['update']=function(_0x371d32,_0x3b92cb){if(_0x371d32[_0x5d67('0x44')]['id']){delete _0x371d32[_0x5d67('0x44')]['id'];}return db[_0x5d67('0x3b')]['find']({'where':{'id':_0x371d32['params']['id']}})[_0x5d67('0x21')](handleEntityNotFound(_0x3b92cb,null))['then'](saveUpdates(_0x371d32[_0x5d67('0x44')],null))[_0x5d67('0x21')](respondWithResult(_0x3b92cb,null))[_0x5d67('0x40')](handleError(_0x3b92cb,null));};exports[_0x5d67('0x22')]=function(_0x2fe821,_0x4947f1){return db['CloudProvider'][_0x5d67('0x42')]({'where':{'id':_0x2fe821[_0x5d67('0x45')]['id']}})[_0x5d67('0x21')](handleEntityNotFound(_0x4947f1,null))[_0x5d67('0x21')](removeEntity(_0x4947f1,null))[_0x5d67('0x40')](handleError(_0x4947f1,null));};
\ No newline at end of file
+var _0x5a1a=['count','offset','limit','set','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filter','merge','options','CloudProvider','includeAll','include','findAll','catch','params','length','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x5a1a,0x6f));var _0xa5a1=function(_0x58952f,_0xeed25f){_0x58952f=_0x58952f-0x0;var _0x3217ca=_0x5a1a[_0x58952f];return _0x3217ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5a1('0x0'));var zipdir=require(_0xa5a1('0x1'));var jsonpatch=require(_0xa5a1('0x2'));var rp=require(_0xa5a1('0x3'));var moment=require(_0xa5a1('0x4'));var BPromise=require(_0xa5a1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa5a1('0x6'));var csv=require('to-csv');var ejs=require(_0xa5a1('0x7'));var fs=require('fs');var fs_extra=require(_0xa5a1('0x8'));var _=require(_0xa5a1('0x9'));var squel=require(_0xa5a1('0xa'));var crypto=require(_0xa5a1('0xb'));var jsforce=require(_0xa5a1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa5a1('0xd'));var querystring=require(_0xa5a1('0xe'));var Papa=require(_0xa5a1('0xf'));var Redis=require(_0xa5a1('0x10'));var authService=require(_0xa5a1('0x11'));var qs=require(_0xa5a1('0x12'));var as=require(_0xa5a1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5a1('0x14'))(_0xa5a1('0x15'));var utils=require(_0xa5a1('0x16'));var config=require(_0xa5a1('0x17'));var licenseUtil=require(_0xa5a1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2456d2,_0x384f5b){_0x384f5b=_0x384f5b||0xcc;return function(_0x3000c8){if(_0x3000c8){return _0x2456d2[_0xa5a1('0x19')](_0x384f5b);}return _0x2456d2[_0xa5a1('0x1a')](_0x384f5b)[_0xa5a1('0x1b')]();};}function respondWithResult(_0x31e31a,_0x2f7295){_0x2f7295=_0x2f7295||0xc8;return function(_0x10bd92){if(_0x10bd92){return _0x31e31a['status'](_0x2f7295)[_0xa5a1('0x1c')](_0x10bd92);}};}function respondWithFilteredResult(_0x35ceea,_0x1369ab){return function(_0x1711ca){if(_0x1711ca){var _0xda3387=_0x1711ca[_0xa5a1('0x1d')],_0x19bd00=_0x1369ab[_0xa5a1('0x1e')],_0x454c1c=_0x1369ab[_0xa5a1('0x1e')]+_0x1369ab[_0xa5a1('0x1f')],_0x36bbf6;if(_0x454c1c>=_0xda3387){_0x454c1c=_0xda3387;_0x36bbf6=0xc8;}else{_0x36bbf6=0xce;}_0x35ceea['status'](_0x36bbf6);return _0x35ceea[_0xa5a1('0x20')]('Content-Range',_0x19bd00+'-'+_0x454c1c+'/'+_0xda3387)['json'](_0x1711ca);}return null;};}function patchUpdates(_0x492447){return function(_0x2bdd52){try{jsonpatch[_0xa5a1('0x21')](_0x2bdd52,_0x492447,!![]);}catch(_0x4790b5){return BPromise[_0xa5a1('0x22')](_0x4790b5);}return _0x2bdd52['save']();};}function saveUpdates(_0x3837e9,_0x3d056e){return function(_0x4e24c2){if(_0x4e24c2){return _0x4e24c2['update'](_0x3837e9)[_0xa5a1('0x23')](function(_0x4b1e30){return _0x4b1e30;});}return null;};}function removeEntity(_0x261112,_0x344e66){return function(_0x3692ac){if(_0x3692ac){return _0x3692ac[_0xa5a1('0x24')]()['then'](function(){_0x261112[_0xa5a1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1676d3,_0x362d09){return function(_0x1b06ad){if(!_0x1b06ad){_0x1676d3[_0xa5a1('0x19')](0x194);}return _0x1b06ad;};}function handleError(_0x4ea899,_0x3b9bd3){_0x3b9bd3=_0x3b9bd3||0x1f4;return function(_0xe7b5de){logger[_0xa5a1('0x25')](_0xe7b5de['stack']);if(_0xe7b5de[_0xa5a1('0x26')]){delete _0xe7b5de[_0xa5a1('0x26')];}_0x4ea899['status'](_0x3b9bd3)[_0xa5a1('0x27')](_0xe7b5de);};}exports[_0xa5a1('0x28')]=function(_0x4c5e10,_0x48f9a6){var _0x3f3652={},_0x5f456b={},_0x392581={'count':0x0,'rows':[]};var _0x487528=_[_0xa5a1('0x29')](db['CloudProvider'][_0xa5a1('0x2a')],function(_0x272dc0){return{'name':_0x272dc0[_0xa5a1('0x2b')],'type':_0x272dc0[_0xa5a1('0x2c')][_0xa5a1('0x2d')]};});_0x5f456b[_0xa5a1('0x2e')]=_['map'](_0x487528,_0xa5a1('0x26'));_0x5f456b[_0xa5a1('0x2f')]=_[_0xa5a1('0x30')](_0x4c5e10[_0xa5a1('0x2f')]);_0x5f456b[_0xa5a1('0x31')]=_[_0xa5a1('0x32')](_0x5f456b[_0xa5a1('0x2e')],_0x5f456b[_0xa5a1('0x2f')]);_0x3f3652[_0xa5a1('0x33')]=_['intersection'](_0x5f456b['model'],qs[_0xa5a1('0x34')](_0x4c5e10[_0xa5a1('0x2f')][_0xa5a1('0x34')]));_0x3f3652[_0xa5a1('0x33')]=_0x3f3652['attributes']['length']?_0x3f3652[_0xa5a1('0x33')]:_0x5f456b[_0xa5a1('0x2e')];if(!_0x4c5e10['query'][_0xa5a1('0x35')](_0xa5a1('0x36'))){_0x3f3652[_0xa5a1('0x1f')]=qs['limit'](_0x4c5e10[_0xa5a1('0x2f')][_0xa5a1('0x1f')]);_0x3f3652[_0xa5a1('0x1e')]=qs[_0xa5a1('0x1e')](_0x4c5e10['query'][_0xa5a1('0x1e')]);}_0x3f3652[_0xa5a1('0x37')]=qs['sort'](_0x4c5e10[_0xa5a1('0x2f')]['sort']);_0x3f3652[_0xa5a1('0x38')]=qs[_0xa5a1('0x31')](_['pick'](_0x4c5e10[_0xa5a1('0x2f')],_0x5f456b[_0xa5a1('0x31')]),_0x487528);if(_0x4c5e10[_0xa5a1('0x2f')][_0xa5a1('0x39')]){_0x3f3652[_0xa5a1('0x38')]=_['merge'](_0x3f3652[_0xa5a1('0x38')],{'$or':_[_0xa5a1('0x29')](_0x487528,function(_0x2436e5){if(_0x2436e5[_0xa5a1('0x2c')]!=='VIRTUAL'){var _0x392d6b={};_0x392d6b[_0x2436e5[_0xa5a1('0x26')]]={'$like':'%'+_0x4c5e10['query'][_0xa5a1('0x39')]+'%'};return _0x392d6b;}})});}_0x3f3652=_[_0xa5a1('0x3a')]({},_0x3f3652,_0x4c5e10[_0xa5a1('0x3b')]);var _0x550cc9={'where':_0x3f3652[_0xa5a1('0x38')]};return db[_0xa5a1('0x3c')][_0xa5a1('0x1d')](_0x550cc9)['then'](function(_0x2d0520){_0x392581[_0xa5a1('0x1d')]=_0x2d0520;if(_0x4c5e10[_0xa5a1('0x2f')][_0xa5a1('0x3d')]){_0x3f3652[_0xa5a1('0x3e')]=[{'all':!![]}];}return db['CloudProvider'][_0xa5a1('0x3f')](_0x3f3652);})[_0xa5a1('0x23')](function(_0x29a1a9){_0x392581['rows']=_0x29a1a9;return _0x392581;})[_0xa5a1('0x23')](respondWithFilteredResult(_0x48f9a6,_0x3f3652))[_0xa5a1('0x40')](handleError(_0x48f9a6,null));};exports['show']=function(_0x3c1c4b,_0x2de5ec){var _0x4ef97c={'raw':!![],'where':{'id':_0x3c1c4b[_0xa5a1('0x41')]['id']}},_0x5b93a6={};_0x5b93a6['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x5b93a6[_0xa5a1('0x2f')]=_[_0xa5a1('0x30')](_0x3c1c4b['query']);_0x5b93a6[_0xa5a1('0x31')]=_[_0xa5a1('0x32')](_0x5b93a6[_0xa5a1('0x2e')],_0x5b93a6['query']);_0x4ef97c[_0xa5a1('0x33')]=_[_0xa5a1('0x32')](_0x5b93a6[_0xa5a1('0x2e')],qs['fields'](_0x3c1c4b[_0xa5a1('0x2f')][_0xa5a1('0x34')]));_0x4ef97c[_0xa5a1('0x33')]=_0x4ef97c[_0xa5a1('0x33')][_0xa5a1('0x42')]?_0x4ef97c[_0xa5a1('0x33')]:_0x5b93a6[_0xa5a1('0x2e')];if(_0x3c1c4b[_0xa5a1('0x2f')]['includeAll']){_0x4ef97c[_0xa5a1('0x3e')]=[{'all':!![]}];}_0x4ef97c=_['merge']({},_0x4ef97c,_0x3c1c4b[_0xa5a1('0x3b')]);return db['CloudProvider']['find'](_0x4ef97c)[_0xa5a1('0x23')](handleEntityNotFound(_0x2de5ec,null))[_0xa5a1('0x23')](respondWithResult(_0x2de5ec,null))[_0xa5a1('0x40')](handleError(_0x2de5ec,null));};exports[_0xa5a1('0x43')]=function(_0xeeb38b,_0x3d44a0){return db[_0xa5a1('0x3c')][_0xa5a1('0x43')](_0xeeb38b['body'],{})[_0xa5a1('0x23')](respondWithResult(_0x3d44a0,0xc9))['catch'](handleError(_0x3d44a0,null));};exports['update']=function(_0x4f0041,_0x21e4b1){if(_0x4f0041[_0xa5a1('0x44')]['id']){delete _0x4f0041['body']['id'];}return db[_0xa5a1('0x3c')]['find']({'where':{'id':_0x4f0041['params']['id']}})[_0xa5a1('0x23')](handleEntityNotFound(_0x21e4b1,null))[_0xa5a1('0x23')](saveUpdates(_0x4f0041['body'],null))[_0xa5a1('0x23')](respondWithResult(_0x21e4b1,null))[_0xa5a1('0x40')](handleError(_0x21e4b1,null));};exports[_0xa5a1('0x24')]=function(_0xfb161a,_0x273025){return db[_0xa5a1('0x3c')][_0xa5a1('0x45')]({'where':{'id':_0xfb161a[_0xa5a1('0x41')]['id']}})[_0xa5a1('0x23')](handleEntityNotFound(_0x273025,null))['then'](removeEntity(_0x273025,null))[_0xa5a1('0x40')](handleError(_0x273025,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 7163112..29a6848 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 _0xbfea=['CloudProvider','cloud_providers','api','moment','path','rimraf','../../config/environment','./cloudProvider.attributes','define'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0xbfea,0x77));var _0xabfe=function(_0x428553,_0x3411b6){_0x428553=_0x428553-0x0;var _0x2a3fc7=_0xbfea[_0x428553];return _0x2a3fc7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xabfe('0x0'));var moment=require(_0xabfe('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xabfe('0x2'));var rimraf=require(_0xabfe('0x3'));var config=require(_0xabfe('0x4'));var attributes=require(_0xabfe('0x5'));module['exports']=function(_0x5555d7,_0x19eb7a){return _0x5555d7[_0xabfe('0x6')](_0xabfe('0x7'),attributes,{'tableName':_0xabfe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x71a9=['define','CloudProvider','cloud_providers','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x47c958,_0x3cfe09){var _0x573eab=function(_0x380ec6){while(--_0x380ec6){_0x47c958['push'](_0x47c958['shift']());}};_0x573eab(++_0x3cfe09);}(_0x71a9,0x1b3));var _0x971a=function(_0x59400c,_0x364897){_0x59400c=_0x59400c-0x0;var _0x51508d=_0x71a9[_0x59400c];return _0x51508d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x971a('0x0'))(_0x971a('0x1'));var moment=require(_0x971a('0x2'));var BPromise=require(_0x971a('0x3'));var rp=require(_0x971a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x971a('0x5'));var config=require(_0x971a('0x6'));var attributes=require(_0x971a('0x7'));module[_0x971a('0x8')]=function(_0x7fe8e3,_0xec8c9f){return _0x7fe8e3[_0x971a('0x9')](_0x971a('0xa'),attributes,{'tableName':_0x971a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 6ea48f3..abced48 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 _0x7584=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','request\x20sent','error','code','message','CloudProvider,\x20%s,\x20%s','result','catch'];(function(_0x2a1ff8,_0x1e6efe){var _0x5dadad=function(_0x50d293){while(--_0x50d293){_0x2a1ff8['push'](_0x2a1ff8['shift']());}};_0x5dadad(++_0x1e6efe);}(_0x7584,0xd1));var _0x4758=function(_0x22434b,_0x4f0f71){_0x22434b=_0x22434b-0x0;var _0x23b28d=_0x7584[_0x22434b];return _0x23b28d;};'use strict';var _=require(_0x4758('0x0'));var util=require(_0x4758('0x1'));var moment=require(_0x4758('0x2'));var BPromise=require(_0x4758('0x3'));var rs=require(_0x4758('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4758('0x5'))['db'];var utils=require(_0x4758('0x6'));var logger=require(_0x4758('0x7'))(_0x4758('0x8'));var config=require('../../config/environment');var jayson=require(_0x4758('0x9'));var client=jayson[_0x4758('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5086c0,_0x263990,_0xed9855){return new BPromise(function(_0x4491a6,_0x1b6d0f){return client['request'](_0x5086c0,_0xed9855)['then'](function(_0xf0b91){logger[_0x4758('0xb')]('CloudProvider,\x20%s,\x20%s',_0x263990,_0x4758('0xc'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x263990,'request\x20sent',JSON['stringify'](_0xf0b91));if(_0xf0b91[_0x4758('0xd')]){if(_0xf0b91[_0x4758('0xd')][_0x4758('0xe')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x263990,_0xf0b91[_0x4758('0xd')][_0x4758('0xf')]);return _0x1b6d0f(_0xf0b91['error']['message']);}logger[_0x4758('0xd')](_0x4758('0x10'),_0x263990,_0xf0b91['error']['message']);return _0x4491a6(_0xf0b91['error'][_0x4758('0xf')]);}else{logger[_0x4758('0xb')]('CloudProvider,\x20%s,\x20%s',_0x263990,_0x4758('0xc'));_0x4491a6(_0xf0b91[_0x4758('0x11')][_0x4758('0xf')]);}})[_0x4758('0x12')](function(_0x2bdb59){logger[_0x4758('0xd')](_0x4758('0x10'),_0x263990,_0x2bdb59);_0x1b6d0f(_0x2bdb59);});});}
\ No newline at end of file
+var _0x41a7=['message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x1ab245,_0x51dc80){var _0x41c28e=function(_0xcc1dc1){while(--_0xcc1dc1){_0x1ab245['push'](_0x1ab245['shift']());}};_0x41c28e(++_0x51dc80);}(_0x41a7,0x13e));var _0x741a=function(_0x40a8a8,_0x1b7a07){_0x40a8a8=_0x40a8a8-0x0;var _0x343249=_0x41a7[_0x40a8a8];return _0x343249;};'use strict';var _=require('lodash');var util=require(_0x741a('0x0'));var moment=require('moment');var BPromise=require(_0x741a('0x1'));var rs=require(_0x741a('0x2'));var fs=require('fs');var Redis=require(_0x741a('0x3'));var db=require(_0x741a('0x4'))['db'];var utils=require(_0x741a('0x5'));var logger=require(_0x741a('0x6'))(_0x741a('0x7'));var config=require(_0x741a('0x8'));var jayson=require(_0x741a('0x9'));var client=jayson[_0x741a('0xa')][_0x741a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x229fb7,_0x1d2646,_0xb805a5){return new BPromise(function(_0x16cea6,_0x71063a){return client['request'](_0x229fb7,_0xb805a5)[_0x741a('0xc')](function(_0x56dc13){logger[_0x741a('0xd')](_0x741a('0xe'),_0x1d2646,_0x741a('0xf'));logger[_0x741a('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1d2646,_0x741a('0xf'),JSON['stringify'](_0x56dc13));if(_0x56dc13['error']){if(_0x56dc13[_0x741a('0x11')]['code']===0x1f4){logger[_0x741a('0x11')](_0x741a('0xe'),_0x1d2646,_0x56dc13['error'][_0x741a('0x12')]);return _0x71063a(_0x56dc13['error'][_0x741a('0x12')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x1d2646,_0x56dc13[_0x741a('0x11')]['message']);return _0x16cea6(_0x56dc13[_0x741a('0x11')][_0x741a('0x12')]);}else{logger[_0x741a('0xd')](_0x741a('0xe'),_0x1d2646,_0x741a('0xf'));_0x16cea6(_0x56dc13[_0x741a('0x13')][_0x741a('0x12')]);}})[_0x741a('0x14')](function(_0x2f915d){logger[_0x741a('0x11')](_0x741a('0xe'),_0x1d2646,_0x2f915d);_0x71063a(_0x2f915d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 39b80dd..daf1ce5 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 _0x2bf4=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','create','put','delete','destroy','exports','multer','path'];(function(_0x56f01f,_0x2fc484){var _0x589fde=function(_0x295527){while(--_0x295527){_0x56f01f['push'](_0x56f01f['shift']());}};_0x589fde(++_0x2fc484);}(_0x2bf4,0x1da));var _0x42bf=function(_0x28ad8b,_0x47975a){_0x28ad8b=_0x28ad8b-0x0;var _0x30d0b9=_0x2bf4[_0x28ad8b];return _0x30d0b9;};'use strict';var multer=require(_0x42bf('0x0'));var util=require('util');var path=require(_0x42bf('0x1'));var timeout=require('connect-timeout');var express=require(_0x42bf('0x2'));var router=express[_0x42bf('0x3')]();var fs_extra=require(_0x42bf('0x4'));var auth=require(_0x42bf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42bf('0x6'));var controller=require(_0x42bf('0x7'));router[_0x42bf('0x8')]('/',auth[_0x42bf('0x9')](),controller[_0x42bf('0xa')]);router[_0x42bf('0x8')](_0x42bf('0xb'),auth[_0x42bf('0x9')](),controller['show']);router['post']('/',auth[_0x42bf('0x9')](),controller[_0x42bf('0xc')]);router[_0x42bf('0xd')]('/:id',auth[_0x42bf('0x9')](),controller['update']);router[_0x42bf('0xe')](_0x42bf('0xb'),auth[_0x42bf('0x9')](),controller[_0x42bf('0xf')]);module[_0x42bf('0x10')]=router;
\ No newline at end of file
+var _0x3e1d=['delete','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index','/:id','show','post','put','isAuthenticated'];(function(_0x4f38b4,_0x757c26){var _0x137f2c=function(_0x387b05){while(--_0x387b05){_0x4f38b4['push'](_0x4f38b4['shift']());}};_0x137f2c(++_0x757c26);}(_0x3e1d,0x91));var _0xd3e1=function(_0x55f122,_0x56edaf){_0x55f122=_0x55f122-0x0;var _0x1a28d6=_0x3e1d[_0x55f122];return _0x1a28d6;};'use strict';var multer=require(_0xd3e1('0x0'));var util=require(_0xd3e1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd3e1('0x2'));var router=express[_0xd3e1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd3e1('0x4'));var interaction=require(_0xd3e1('0x5'));var config=require(_0xd3e1('0x6'));var controller=require(_0xd3e1('0x7'));router[_0xd3e1('0x8')]('/',auth['isAuthenticated'](),controller[_0xd3e1('0x9')]);router[_0xd3e1('0x8')](_0xd3e1('0xa'),auth['isAuthenticated'](),controller[_0xd3e1('0xb')]);router[_0xd3e1('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd3e1('0xd')]('/:id',auth[_0xd3e1('0xe')](),controller['update']);router[_0xd3e1('0xf')](_0xd3e1('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index d461e09..3933fdd 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 _0x430c=['name','sequelize','STRING'];(function(_0x29aa2b,_0xc881f8){var _0x119039=function(_0x1cbf22){while(--_0x1cbf22){_0x29aa2b['push'](_0x29aa2b['shift']());}};_0x119039(++_0xc881f8);}(_0x430c,0x1de));var _0xc430=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0x430c[_0x562faa];return _0xc70f59;};'use strict';var Sequelize=require(_0xc430('0x0'));module['exports']={'name':{'type':Sequelize[_0xc430('0x1')],'unique':_0xc430('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc430('0x1')]},'companyId':{'type':Sequelize[_0xc430('0x1')]},'website':{'type':Sequelize[_0xc430('0x1')]},'phone':{'type':Sequelize[_0xc430('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc430('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc430('0x1')]},'country':{'type':Sequelize[_0xc430('0x1')]},'email':{'type':Sequelize[_0xc430('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc430('0x1')]},'sStreet':{'type':Sequelize[_0xc430('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc430('0x1')]},'sCountry':{'type':Sequelize[_0xc430('0x1')]},'description':{'type':Sequelize[_0xc430('0x1')]}};
\ No newline at end of file
+var _0xa2b3=['name','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2b3,0x1c5));var _0x3a2b=function(_0x3d1b4a,_0x5d749){_0x3d1b4a=_0x3d1b4a-0x0;var _0x6f80bc=_0xa2b3[_0x3d1b4a];return _0x6f80bc;};'use strict';var Sequelize=require(_0x3a2b('0x0'));module[_0x3a2b('0x1')]={'name':{'type':Sequelize[_0x3a2b('0x2')],'unique':_0x3a2b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x3a2b('0x2')]},'website':{'type':Sequelize[_0x3a2b('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3a2b('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3a2b('0x2')]},'city':{'type':Sequelize[_0x3a2b('0x2')]},'country':{'type':Sequelize[_0x3a2b('0x2')]},'email':{'type':Sequelize[_0x3a2b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3a2b('0x2')]},'sStreet':{'type':Sequelize[_0x3a2b('0x2')]},'sPostalCode':{'type':Sequelize[_0x3a2b('0x2')]},'sCity':{'type':Sequelize[_0x3a2b('0x2')]},'sCountry':{'type':Sequelize[_0x3a2b('0x2')]},'description':{'type':Sequelize[_0x3a2b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 8582acb..0062894 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 _0xba0d=['request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','sendStatus','error','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','options','count','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','rawAttributes','rimraf','zip-dir','fast-json-patch'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xba0d,0x1a1));var _0xdba0=function(_0x2571f3,_0x117742){_0x2571f3=_0x2571f3-0x0;var _0xeddb4a=_0xba0d[_0x2571f3];return _0xeddb4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdba0('0x0'));var zipdir=require(_0xdba0('0x1'));var jsonpatch=require(_0xdba0('0x2'));var rp=require(_0xdba0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdba0('0x4'));var util=require(_0xdba0('0x5'));var path=require(_0xdba0('0x6'));var sox=require(_0xdba0('0x7'));var csv=require('to-csv');var ejs=require(_0xdba0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdba0('0x9'));var squel=require(_0xdba0('0xa'));var crypto=require(_0xdba0('0xb'));var jsforce=require(_0xdba0('0xc'));var deskjs=require(_0xdba0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdba0('0xe'));var Papa=require(_0xdba0('0xf'));var Redis=require(_0xdba0('0x10'));var authService=require(_0xdba0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdba0('0x12'));var hardwareService=require(_0xdba0('0x13'));var logger=require(_0xdba0('0x14'))('api');var utils=require(_0xdba0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdba0('0x16'));var db=require(_0xdba0('0x17'))['db'];function respondWithStatusCode(_0xe1eabb,_0x3d36d9){_0x3d36d9=_0x3d36d9||0xcc;return function(_0x380694){if(_0x380694){return _0xe1eabb['sendStatus'](_0x3d36d9);}return _0xe1eabb[_0xdba0('0x18')](_0x3d36d9)[_0xdba0('0x19')]();};}function respondWithResult(_0x34c271,_0x1ea4f2){_0x1ea4f2=_0x1ea4f2||0xc8;return function(_0x261c2c){if(_0x261c2c){return _0x34c271[_0xdba0('0x18')](_0x1ea4f2)[_0xdba0('0x1a')](_0x261c2c);}};}function respondWithFilteredResult(_0x36ff52,_0x176c8c){return function(_0x1942a9){if(_0x1942a9){var _0x25ce54=_0x1942a9['count'],_0x5d6b58=_0x176c8c[_0xdba0('0x1b')],_0x5e078=_0x176c8c[_0xdba0('0x1b')]+_0x176c8c[_0xdba0('0x1c')],_0x129cff;if(_0x5e078>=_0x25ce54){_0x5e078=_0x25ce54;_0x129cff=0xc8;}else{_0x129cff=0xce;}_0x36ff52['status'](_0x129cff);return _0x36ff52[_0xdba0('0x1d')]('Content-Range',_0x5d6b58+'-'+_0x5e078+'/'+_0x25ce54)['json'](_0x1942a9);}return null;};}function patchUpdates(_0x2b03dd){return function(_0x20fd27){try{jsonpatch[_0xdba0('0x1e')](_0x20fd27,_0x2b03dd,!![]);}catch(_0x58ea85){return BPromise[_0xdba0('0x1f')](_0x58ea85);}return _0x20fd27[_0xdba0('0x20')]();};}function saveUpdates(_0x481fef,_0x226ac5){return function(_0x9424d8){if(_0x9424d8){return _0x9424d8[_0xdba0('0x21')](_0x481fef)[_0xdba0('0x22')](function(_0x142f95){return _0x142f95;});}return null;};}function removeEntity(_0x319302,_0x5ed621){return function(_0x1d7ebf){if(_0x1d7ebf){return _0x1d7ebf['destroy']()[_0xdba0('0x22')](function(){var _0x43233f=_0x1d7ebf[_0xdba0('0x23')]({'plain':!![]});var _0x4d0d56=_0xdba0('0x24');return db[_0xdba0('0x25')][_0xdba0('0x26')]({'where':{'type':_0x4d0d56,'resourceId':_0x43233f['id']}})[_0xdba0('0x22')](function(){return _0x1d7ebf;});})[_0xdba0('0x22')](function(){_0x319302[_0xdba0('0x18')](0xcc)[_0xdba0('0x19')]();});}};}function handleEntityNotFound(_0x25248e,_0x230a80){return function(_0x2aafb2){if(!_0x2aafb2){_0x25248e[_0xdba0('0x27')](0x194);}return _0x2aafb2;};}function handleError(_0x1431de,_0x234af4){_0x234af4=_0x234af4||0x1f4;return function(_0x45155f){logger[_0xdba0('0x28')](_0x45155f['stack']);if(_0x45155f[_0xdba0('0x29')]){delete _0x45155f[_0xdba0('0x29')];}_0x1431de[_0xdba0('0x18')](_0x234af4)['send'](_0x45155f);};}exports[_0xdba0('0x2a')]=function(_0xedd271,_0x1591b0){var _0x3bc196={},_0x1d15ba={},_0x5c6a30={'count':0x0,'rows':[]};return db[_0xdba0('0x2b')][_0xdba0('0x2c')]()['then'](function(_0x5636b){_0x1d15ba[_0xdba0('0x2d')]=_[_0xdba0('0x2e')](_0x5636b);_0x1d15ba['query']=_['keys'](_0xedd271[_0xdba0('0x2f')]);_0x1d15ba[_0xdba0('0x30')]=_[_0xdba0('0x31')](_0x1d15ba[_0xdba0('0x2d')],_0x1d15ba[_0xdba0('0x2f')]);_0x3bc196[_0xdba0('0x32')]=_['intersection'](_0x1d15ba[_0xdba0('0x2d')],qs[_0xdba0('0x33')](_0xedd271[_0xdba0('0x2f')][_0xdba0('0x33')]));_0x3bc196[_0xdba0('0x32')]=_0x3bc196[_0xdba0('0x32')][_0xdba0('0x34')]?_0x3bc196[_0xdba0('0x32')]:_0x1d15ba[_0xdba0('0x2d')];if(!_0xedd271[_0xdba0('0x2f')][_0xdba0('0x35')](_0xdba0('0x36'))){_0x3bc196[_0xdba0('0x1c')]=qs[_0xdba0('0x1c')](_0xedd271[_0xdba0('0x2f')][_0xdba0('0x1c')]);_0x3bc196[_0xdba0('0x1b')]=qs['offset'](_0xedd271[_0xdba0('0x2f')][_0xdba0('0x1b')]);}_0x3bc196[_0xdba0('0x37')]=qs[_0xdba0('0x38')](_0xedd271[_0xdba0('0x2f')][_0xdba0('0x38')]);_0x3bc196['where']=qs[_0xdba0('0x30')](_[_0xdba0('0x39')](_0xedd271[_0xdba0('0x2f')],_0x1d15ba[_0xdba0('0x30')]),_0x5636b);if(_0xedd271[_0xdba0('0x2f')][_0xdba0('0x3a')]){_0x3bc196['where']=_[_0xdba0('0x3b')](_0x3bc196[_0xdba0('0x3c')],{'$or':_[_0xdba0('0x3d')](_0x3bc196[_0xdba0('0x32')],function(_0x55a05b){var _0x3558dd={};_0x3558dd[_0x55a05b]={'$like':'%'+_0xedd271[_0xdba0('0x2f')][_0xdba0('0x3a')]+'%'};return _0x3558dd;})});}_0x3bc196=_[_0xdba0('0x3b')]({},_0x3bc196,_0xedd271[_0xdba0('0x3e')]);var _0x1d74ca={'where':_0x3bc196['where']};return db['CmCompany']['count'](_0x1d74ca)[_0xdba0('0x22')](function(_0x304d93){_0x5c6a30[_0xdba0('0x3f')]=_0x304d93;if(_0xedd271['query'][_0xdba0('0x40')]){_0x3bc196[_0xdba0('0x41')]=[{'all':!![]}];}return db['CmCompany'][_0xdba0('0x42')](_0x3bc196);})[_0xdba0('0x22')](function(_0xf07d4f){_0x5c6a30['rows']=_0xf07d4f;return _0x5c6a30;})['then'](respondWithFilteredResult(_0x1591b0,_0x3bc196))[_0xdba0('0x43')](handleError(_0x1591b0,null));})[_0xdba0('0x43')](handleError(_0x1591b0,null));};exports['show']=function(_0xfc6bce,_0x6758f3){var _0x42eeb6={'raw':![],'where':{'id':_0xfc6bce[_0xdba0('0x44')]['id']}},_0x2083c6={};_0x2083c6[_0xdba0('0x2d')]=_[_0xdba0('0x2e')](db['CmCompany']['rawAttributes']);_0x2083c6['query']=_['keys'](_0xfc6bce[_0xdba0('0x2f')]);_0x2083c6[_0xdba0('0x30')]=_['intersection'](_0x2083c6[_0xdba0('0x2d')],_0x2083c6['query']);_0x42eeb6[_0xdba0('0x32')]=_[_0xdba0('0x31')](_0x2083c6[_0xdba0('0x2d')],qs['fields'](_0xfc6bce[_0xdba0('0x2f')][_0xdba0('0x33')]));_0x42eeb6['attributes']=_0x42eeb6['attributes']['length']?_0x42eeb6[_0xdba0('0x32')]:_0x2083c6[_0xdba0('0x2d')];if(_0xfc6bce['query'][_0xdba0('0x40')]){_0x42eeb6[_0xdba0('0x41')]=[{'all':!![]}];}_0x42eeb6=_[_0xdba0('0x3b')]({},_0x42eeb6,_0xfc6bce[_0xdba0('0x3e')]);return db[_0xdba0('0x2b')][_0xdba0('0x45')](_0x42eeb6)[_0xdba0('0x22')](handleEntityNotFound(_0x6758f3,null))[_0xdba0('0x22')](respondWithResult(_0x6758f3,null))['catch'](handleError(_0x6758f3,null));};exports['create']=function(_0x163414,_0x1532b7){return db[_0xdba0('0x2b')][_0xdba0('0x46')](_0x163414[_0xdba0('0x47')],{})['then'](function(_0x26aeb2){var _0x321f7a=_0x163414[_0xdba0('0x48')]['get']({'plain':!![]});if(!_0x321f7a)throw new Error(_0xdba0('0x49'));if(_0x321f7a[_0xdba0('0x4a')]===_0xdba0('0x48')){var _0xcfd732=_0x26aeb2['get']({'plain':!![]});var _0x1be591='Companies';return db[_0xdba0('0x4b')][_0xdba0('0x45')]({'where':{'name':_0x1be591,'userProfileId':_0x321f7a[_0xdba0('0x4c')]},'raw':!![]})['then'](function(_0x2f737c){if(_0x2f737c&&_0x2f737c[_0xdba0('0x4d')]===0x0){return db[_0xdba0('0x25')][_0xdba0('0x46')]({'name':_0xcfd732[_0xdba0('0x29')],'resourceId':_0xcfd732['id'],'type':_0x2f737c[_0xdba0('0x29')],'sectionId':_0x2f737c['id']},{})[_0xdba0('0x22')](function(){return _0x26aeb2;});}else{return _0x26aeb2;}})['catch'](function(_0x1ca4fd){logger[_0xdba0('0x28')](_0xdba0('0x4e'),_0x1ca4fd);throw _0x1ca4fd;});}return _0x26aeb2;})[_0xdba0('0x22')](respondWithResult(_0x1532b7,0xc9))[_0xdba0('0x43')](handleError(_0x1532b7,null));};exports[_0xdba0('0x21')]=function(_0x4170e6,_0x3dec92){if(_0x4170e6[_0xdba0('0x47')]['id']){delete _0x4170e6[_0xdba0('0x47')]['id'];}return db['CmCompany'][_0xdba0('0x45')]({'where':{'id':_0x4170e6[_0xdba0('0x44')]['id']}})[_0xdba0('0x22')](handleEntityNotFound(_0x3dec92,null))[_0xdba0('0x22')](saveUpdates(_0x4170e6[_0xdba0('0x47')],null))[_0xdba0('0x22')](respondWithResult(_0x3dec92,null))['catch'](handleError(_0x3dec92,null));};exports[_0xdba0('0x26')]=function(_0x5dfd0b,_0x5ef4a9){return db[_0xdba0('0x2b')][_0xdba0('0x45')]({'where':{'id':_0x5dfd0b[_0xdba0('0x44')]['id']}})[_0xdba0('0x22')](handleEntityNotFound(_0x5ef4a9,null))[_0xdba0('0x22')](removeEntity(_0x5ef4a9,null))[_0xdba0('0x43')](handleError(_0x5ef4a9,null));};exports[_0xdba0('0x2c')]=function(_0x2370ec,_0x1f0d7f){return db[_0xdba0('0x2b')][_0xdba0('0x2c')]()[_0xdba0('0x22')](respondWithResult(_0x1f0d7f,null))['catch'](handleError(_0x1f0d7f,null));};exports[_0xdba0('0x4f')]=function(_0x3acff5,_0x4573ef,_0x595f11){return db['CmContact'][_0xdba0('0x45')]({'where':{'id':_0x3acff5[_0xdba0('0x44')]['id']}})[_0xdba0('0x22')](handleEntityNotFound(_0x4573ef,null))[_0xdba0('0x22')](function(_0x2ba5de){if(_0x2ba5de){return _0x2ba5de[_0xdba0('0x4f')](_0x3acff5[_0xdba0('0x47')][_0xdba0('0x50')],_[_0xdba0('0x51')](_0x3acff5[_0xdba0('0x47')],['ids','id'])||{});}})[_0xdba0('0x22')](respondWithResult(_0x4573ef,null))[_0xdba0('0x43')](handleError(_0x4573ef,null));};exports[_0xdba0('0x52')]=function(_0x3c5088,_0xf8aa8,_0x4f7d90){var _0x64166c={};var _0x39beb8={};var _0x5e1425;var _0x49af0f;return db[_0xdba0('0x2b')]['findOne']({'where':{'id':_0x3c5088['params']['id']}})[_0xdba0('0x22')](handleEntityNotFound(_0xf8aa8,null))[_0xdba0('0x22')](function(_0x4b2163){if(_0x4b2163){_0x5e1425=_0x4b2163;_0x39beb8[_0xdba0('0x2d')]=_[_0xdba0('0x2e')](db['CmContact'][_0xdba0('0x53')]);_0x39beb8['query']=_[_0xdba0('0x2e')](_0x3c5088[_0xdba0('0x2f')]);_0x39beb8['filters']=_[_0xdba0('0x31')](_0x39beb8[_0xdba0('0x2d')],_0x39beb8['query']);_0x64166c[_0xdba0('0x32')]=_[_0xdba0('0x31')](_0x39beb8[_0xdba0('0x2d')],qs[_0xdba0('0x33')](_0x3c5088[_0xdba0('0x2f')][_0xdba0('0x33')]));_0x64166c['attributes']=_0x64166c['attributes'][_0xdba0('0x34')]?_0x64166c[_0xdba0('0x32')]:_0x39beb8[_0xdba0('0x2d')];_0x64166c['order']=qs[_0xdba0('0x38')](_0x3c5088[_0xdba0('0x2f')]['sort']);_0x64166c[_0xdba0('0x3c')]=qs[_0xdba0('0x30')](_[_0xdba0('0x39')](_0x3c5088[_0xdba0('0x2f')],_0x39beb8[_0xdba0('0x30')]));if(_0x3c5088[_0xdba0('0x2f')]['filter']){_0x64166c['where']=_[_0xdba0('0x3b')](_0x64166c[_0xdba0('0x3c')],{'$or':_[_0xdba0('0x3d')](_0x64166c[_0xdba0('0x32')],function(_0x57246a){var _0x858254={};_0x858254[_0x57246a]={'$like':'%'+_0x3c5088[_0xdba0('0x2f')][_0xdba0('0x3a')]+'%'};return _0x858254;})});}_0x64166c=_[_0xdba0('0x3b')]({},_0x64166c,_0x3c5088[_0xdba0('0x3e')]);return _0x5e1425[_0xdba0('0x52')](_0x64166c);}})[_0xdba0('0x22')](function(_0x1c647f){if(_0x1c647f){_0x49af0f=_0x1c647f['length'];if(!_0x3c5088[_0xdba0('0x2f')]['hasOwnProperty'](_0xdba0('0x36'))){_0x64166c['limit']=qs[_0xdba0('0x1c')](_0x3c5088[_0xdba0('0x2f')]['limit']);_0x64166c['offset']=qs[_0xdba0('0x1b')](_0x3c5088[_0xdba0('0x2f')][_0xdba0('0x1b')]);}return _0x5e1425['getContacts'](_0x64166c);}})['then'](function(_0x137e7c){if(_0x137e7c){return _0x137e7c?{'count':_0x49af0f,'rows':_0x137e7c}:null;}})[_0xdba0('0x22')](respondWithResult(_0xf8aa8,null))[_0xdba0('0x43')](handleError(_0xf8aa8,null));};
\ No newline at end of file
+var _0x6c21=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','set','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','omit','ids','getContacts','findOne','CmContact','where','pick','map','options','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x6c21,0x1b2));var _0x16c2=function(_0x3783f3,_0x12ba60){_0x3783f3=_0x3783f3-0x0;var _0xaf8ccd=_0x6c21[_0x3783f3];return _0xaf8ccd;};'use strict';var emlformat=require(_0x16c2('0x0'));var rimraf=require(_0x16c2('0x1'));var zipdir=require(_0x16c2('0x2'));var jsonpatch=require(_0x16c2('0x3'));var rp=require('request-promise');var moment=require(_0x16c2('0x4'));var BPromise=require(_0x16c2('0x5'));var Mustache=require(_0x16c2('0x6'));var util=require(_0x16c2('0x7'));var path=require(_0x16c2('0x8'));var sox=require('sox');var csv=require(_0x16c2('0x9'));var ejs=require(_0x16c2('0xa'));var fs=require('fs');var fs_extra=require(_0x16c2('0xb'));var _=require(_0x16c2('0xc'));var squel=require(_0x16c2('0xd'));var crypto=require(_0x16c2('0xe'));var jsforce=require(_0x16c2('0xf'));var deskjs=require(_0x16c2('0x10'));var toCsv=require(_0x16c2('0x9'));var querystring=require(_0x16c2('0x11'));var Papa=require(_0x16c2('0x12'));var Redis=require(_0x16c2('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x16c2('0x14'));var as=require(_0x16c2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16c2('0x16'))(_0x16c2('0x17'));var utils=require(_0x16c2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x16c2('0x19'));var db=require(_0x16c2('0x1a'))['db'];function respondWithStatusCode(_0x4f1417,_0x21fa12){_0x21fa12=_0x21fa12||0xcc;return function(_0x1eaad4){if(_0x1eaad4){return _0x4f1417[_0x16c2('0x1b')](_0x21fa12);}return _0x4f1417['status'](_0x21fa12)[_0x16c2('0x1c')]();};}function respondWithResult(_0xd1de9e,_0x394eac){_0x394eac=_0x394eac||0xc8;return function(_0x49ab49){if(_0x49ab49){return _0xd1de9e[_0x16c2('0x1d')](_0x394eac)[_0x16c2('0x1e')](_0x49ab49);}};}function respondWithFilteredResult(_0x33bf40,_0x4f5d6b){return function(_0x5e21e4){if(_0x5e21e4){var _0x37e54f=_0x5e21e4['count'],_0x44bfba=_0x4f5d6b[_0x16c2('0x1f')],_0x48fdd1=_0x4f5d6b[_0x16c2('0x1f')]+_0x4f5d6b[_0x16c2('0x20')],_0x3a7fd1;if(_0x48fdd1>=_0x37e54f){_0x48fdd1=_0x37e54f;_0x3a7fd1=0xc8;}else{_0x3a7fd1=0xce;}_0x33bf40[_0x16c2('0x1d')](_0x3a7fd1);return _0x33bf40[_0x16c2('0x21')]('Content-Range',_0x44bfba+'-'+_0x48fdd1+'/'+_0x37e54f)[_0x16c2('0x1e')](_0x5e21e4);}return null;};}function patchUpdates(_0x14bdf9){return function(_0x1c19e6){try{jsonpatch['apply'](_0x1c19e6,_0x14bdf9,!![]);}catch(_0x334b82){return BPromise['reject'](_0x334b82);}return _0x1c19e6[_0x16c2('0x22')]();};}function saveUpdates(_0x49b0c7,_0x451360){return function(_0x4bef48){if(_0x4bef48){return _0x4bef48[_0x16c2('0x23')](_0x49b0c7)[_0x16c2('0x24')](function(_0x32deaf){return _0x32deaf;});}return null;};}function removeEntity(_0x1ad9b5,_0x5a28a5){return function(_0x1e193e){if(_0x1e193e){return _0x1e193e[_0x16c2('0x25')]()[_0x16c2('0x24')](function(){var _0x3c3f4c=_0x1e193e[_0x16c2('0x26')]({'plain':!![]});var _0x41b63d=_0x16c2('0x27');return db[_0x16c2('0x28')]['destroy']({'where':{'type':_0x41b63d,'resourceId':_0x3c3f4c['id']}})[_0x16c2('0x24')](function(){return _0x1e193e;});})[_0x16c2('0x24')](function(){_0x1ad9b5[_0x16c2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38787c,_0x4ab0dc){return function(_0x39374a){if(!_0x39374a){_0x38787c[_0x16c2('0x1b')](0x194);}return _0x39374a;};}function handleError(_0x5024f2,_0x41935b){_0x41935b=_0x41935b||0x1f4;return function(_0x293e32){logger[_0x16c2('0x29')](_0x293e32[_0x16c2('0x2a')]);if(_0x293e32[_0x16c2('0x2b')]){delete _0x293e32[_0x16c2('0x2b')];}_0x5024f2[_0x16c2('0x1d')](_0x41935b)[_0x16c2('0x2c')](_0x293e32);};}exports[_0x16c2('0x2d')]=function(_0x219196,_0x17b00e){var _0x3f0beb={},_0x46b362={},_0x2287f7={'count':0x0,'rows':[]};return db[_0x16c2('0x2e')]['describe']()[_0x16c2('0x24')](function(_0x319a91){_0x46b362[_0x16c2('0x2f')]=_['keys'](_0x319a91);_0x46b362[_0x16c2('0x30')]=_[_0x16c2('0x31')](_0x219196[_0x16c2('0x30')]);_0x46b362['filters']=_['intersection'](_0x46b362[_0x16c2('0x2f')],_0x46b362[_0x16c2('0x30')]);_0x3f0beb[_0x16c2('0x32')]=_[_0x16c2('0x33')](_0x46b362['model'],qs['fields'](_0x219196['query'][_0x16c2('0x34')]));_0x3f0beb[_0x16c2('0x32')]=_0x3f0beb['attributes'][_0x16c2('0x35')]?_0x3f0beb[_0x16c2('0x32')]:_0x46b362['model'];if(!_0x219196[_0x16c2('0x30')][_0x16c2('0x36')](_0x16c2('0x37'))){_0x3f0beb[_0x16c2('0x20')]=qs[_0x16c2('0x20')](_0x219196['query']['limit']);_0x3f0beb[_0x16c2('0x1f')]=qs[_0x16c2('0x1f')](_0x219196[_0x16c2('0x30')][_0x16c2('0x1f')]);}_0x3f0beb[_0x16c2('0x38')]=qs[_0x16c2('0x39')](_0x219196[_0x16c2('0x30')][_0x16c2('0x39')]);_0x3f0beb['where']=qs[_0x16c2('0x3a')](_['pick'](_0x219196[_0x16c2('0x30')],_0x46b362['filters']),_0x319a91);if(_0x219196[_0x16c2('0x30')][_0x16c2('0x3b')]){_0x3f0beb['where']=_['merge'](_0x3f0beb['where'],{'$or':_['map'](_0x3f0beb[_0x16c2('0x32')],function(_0x4af1a5){var _0x4578ff={};_0x4578ff[_0x4af1a5]={'$like':'%'+_0x219196[_0x16c2('0x30')]['filter']+'%'};return _0x4578ff;})});}_0x3f0beb=_[_0x16c2('0x3c')]({},_0x3f0beb,_0x219196['options']);var _0x3897e2={'where':_0x3f0beb['where']};return db['CmCompany'][_0x16c2('0x3d')](_0x3897e2)[_0x16c2('0x24')](function(_0x62d523){_0x2287f7[_0x16c2('0x3d')]=_0x62d523;if(_0x219196[_0x16c2('0x30')][_0x16c2('0x3e')]){_0x3f0beb[_0x16c2('0x3f')]=[{'all':!![]}];}return db[_0x16c2('0x2e')][_0x16c2('0x40')](_0x3f0beb);})[_0x16c2('0x24')](function(_0x2e9dec){_0x2287f7[_0x16c2('0x41')]=_0x2e9dec;return _0x2287f7;})[_0x16c2('0x24')](respondWithFilteredResult(_0x17b00e,_0x3f0beb))[_0x16c2('0x42')](handleError(_0x17b00e,null));})[_0x16c2('0x42')](handleError(_0x17b00e,null));};exports[_0x16c2('0x43')]=function(_0x4b6ee4,_0x5d840c){var _0x5177d8={'raw':![],'where':{'id':_0x4b6ee4[_0x16c2('0x44')]['id']}},_0x3961af={};_0x3961af[_0x16c2('0x2f')]=_[_0x16c2('0x31')](db[_0x16c2('0x2e')][_0x16c2('0x45')]);_0x3961af['query']=_['keys'](_0x4b6ee4[_0x16c2('0x30')]);_0x3961af[_0x16c2('0x3a')]=_[_0x16c2('0x33')](_0x3961af[_0x16c2('0x2f')],_0x3961af[_0x16c2('0x30')]);_0x5177d8['attributes']=_[_0x16c2('0x33')](_0x3961af[_0x16c2('0x2f')],qs['fields'](_0x4b6ee4[_0x16c2('0x30')][_0x16c2('0x34')]));_0x5177d8[_0x16c2('0x32')]=_0x5177d8[_0x16c2('0x32')][_0x16c2('0x35')]?_0x5177d8[_0x16c2('0x32')]:_0x3961af['model'];if(_0x4b6ee4[_0x16c2('0x30')][_0x16c2('0x3e')]){_0x5177d8[_0x16c2('0x3f')]=[{'all':!![]}];}_0x5177d8=_[_0x16c2('0x3c')]({},_0x5177d8,_0x4b6ee4['options']);return db[_0x16c2('0x2e')][_0x16c2('0x46')](_0x5177d8)[_0x16c2('0x24')](handleEntityNotFound(_0x5d840c,null))[_0x16c2('0x24')](respondWithResult(_0x5d840c,null))[_0x16c2('0x42')](handleError(_0x5d840c,null));};exports[_0x16c2('0x47')]=function(_0x1a0fdb,_0x54f8c1){return db[_0x16c2('0x2e')]['create'](_0x1a0fdb[_0x16c2('0x48')],{})[_0x16c2('0x24')](function(_0xd6c660){var _0x5926bc=_0x1a0fdb[_0x16c2('0x49')][_0x16c2('0x26')]({'plain':!![]});if(!_0x5926bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5926bc['role']==='user'){var _0x3e02e3=_0xd6c660[_0x16c2('0x26')]({'plain':!![]});var _0x4940b5=_0x16c2('0x27');return db[_0x16c2('0x4a')]['find']({'where':{'name':_0x4940b5,'userProfileId':_0x5926bc['userProfileId']},'raw':!![]})[_0x16c2('0x24')](function(_0x3bb07e){if(_0x3bb07e&&_0x3bb07e[_0x16c2('0x4b')]===0x0){return db[_0x16c2('0x28')]['create']({'name':_0x3e02e3[_0x16c2('0x2b')],'resourceId':_0x3e02e3['id'],'type':_0x3bb07e['name'],'sectionId':_0x3bb07e['id']},{})[_0x16c2('0x24')](function(){return _0xd6c660;});}else{return _0xd6c660;}})[_0x16c2('0x42')](function(_0x3feabb){logger[_0x16c2('0x29')](_0x16c2('0x4c'),_0x3feabb);throw _0x3feabb;});}return _0xd6c660;})[_0x16c2('0x24')](respondWithResult(_0x54f8c1,0xc9))[_0x16c2('0x42')](handleError(_0x54f8c1,null));};exports[_0x16c2('0x23')]=function(_0x422039,_0x2be596){if(_0x422039[_0x16c2('0x48')]['id']){delete _0x422039[_0x16c2('0x48')]['id'];}return db[_0x16c2('0x2e')][_0x16c2('0x46')]({'where':{'id':_0x422039[_0x16c2('0x44')]['id']}})[_0x16c2('0x24')](handleEntityNotFound(_0x2be596,null))[_0x16c2('0x24')](saveUpdates(_0x422039[_0x16c2('0x48')],null))['then'](respondWithResult(_0x2be596,null))['catch'](handleError(_0x2be596,null));};exports[_0x16c2('0x25')]=function(_0x6ffab8,_0x2cb5c4){return db[_0x16c2('0x2e')][_0x16c2('0x46')]({'where':{'id':_0x6ffab8['params']['id']}})[_0x16c2('0x24')](handleEntityNotFound(_0x2cb5c4,null))[_0x16c2('0x24')](removeEntity(_0x2cb5c4,null))[_0x16c2('0x42')](handleError(_0x2cb5c4,null));};exports['describe']=function(_0x44ea07,_0x55c281){return db[_0x16c2('0x2e')][_0x16c2('0x4d')]()[_0x16c2('0x24')](respondWithResult(_0x55c281,null))['catch'](handleError(_0x55c281,null));};exports[_0x16c2('0x4e')]=function(_0x2f214d,_0x239ae6,_0x510e61){return db['CmContact'][_0x16c2('0x46')]({'where':{'id':_0x2f214d[_0x16c2('0x44')]['id']}})[_0x16c2('0x24')](handleEntityNotFound(_0x239ae6,null))[_0x16c2('0x24')](function(_0x29c7d8){if(_0x29c7d8){return _0x29c7d8[_0x16c2('0x4e')](_0x2f214d[_0x16c2('0x48')]['ids'],_[_0x16c2('0x4f')](_0x2f214d[_0x16c2('0x48')],[_0x16c2('0x50'),'id'])||{});}})[_0x16c2('0x24')](respondWithResult(_0x239ae6,null))[_0x16c2('0x42')](handleError(_0x239ae6,null));};exports[_0x16c2('0x51')]=function(_0x4aba08,_0x1da5ce,_0x37044e){var _0x450019={};var _0x4c472b={};var _0x4aab7b;var _0x52cac5;return db['CmCompany'][_0x16c2('0x52')]({'where':{'id':_0x4aba08['params']['id']}})['then'](handleEntityNotFound(_0x1da5ce,null))[_0x16c2('0x24')](function(_0x22d9c6){if(_0x22d9c6){_0x4aab7b=_0x22d9c6;_0x4c472b[_0x16c2('0x2f')]=_['keys'](db[_0x16c2('0x53')][_0x16c2('0x45')]);_0x4c472b['query']=_['keys'](_0x4aba08[_0x16c2('0x30')]);_0x4c472b[_0x16c2('0x3a')]=_[_0x16c2('0x33')](_0x4c472b[_0x16c2('0x2f')],_0x4c472b['query']);_0x450019[_0x16c2('0x32')]=_[_0x16c2('0x33')](_0x4c472b[_0x16c2('0x2f')],qs[_0x16c2('0x34')](_0x4aba08[_0x16c2('0x30')][_0x16c2('0x34')]));_0x450019[_0x16c2('0x32')]=_0x450019[_0x16c2('0x32')][_0x16c2('0x35')]?_0x450019['attributes']:_0x4c472b[_0x16c2('0x2f')];_0x450019[_0x16c2('0x38')]=qs[_0x16c2('0x39')](_0x4aba08[_0x16c2('0x30')][_0x16c2('0x39')]);_0x450019[_0x16c2('0x54')]=qs[_0x16c2('0x3a')](_[_0x16c2('0x55')](_0x4aba08['query'],_0x4c472b[_0x16c2('0x3a')]));if(_0x4aba08[_0x16c2('0x30')][_0x16c2('0x3b')]){_0x450019[_0x16c2('0x54')]=_[_0x16c2('0x3c')](_0x450019[_0x16c2('0x54')],{'$or':_[_0x16c2('0x56')](_0x450019[_0x16c2('0x32')],function(_0x136e4b){var _0x40953d={};_0x40953d[_0x136e4b]={'$like':'%'+_0x4aba08[_0x16c2('0x30')][_0x16c2('0x3b')]+'%'};return _0x40953d;})});}_0x450019=_[_0x16c2('0x3c')]({},_0x450019,_0x4aba08[_0x16c2('0x57')]);return _0x4aab7b[_0x16c2('0x51')](_0x450019);}})[_0x16c2('0x24')](function(_0x48be53){if(_0x48be53){_0x52cac5=_0x48be53[_0x16c2('0x35')];if(!_0x4aba08[_0x16c2('0x30')][_0x16c2('0x36')](_0x16c2('0x37'))){_0x450019[_0x16c2('0x20')]=qs['limit'](_0x4aba08[_0x16c2('0x30')][_0x16c2('0x20')]);_0x450019[_0x16c2('0x1f')]=qs[_0x16c2('0x1f')](_0x4aba08[_0x16c2('0x30')]['offset']);}return _0x4aab7b['getContacts'](_0x450019);}})[_0x16c2('0x24')](function(_0x439ffd){if(_0x439ffd){return _0x439ffd?{'count':_0x52cac5,'rows':_0x439ffd}:null;}})[_0x16c2('0x24')](respondWithResult(_0x1da5ce,null))[_0x16c2('0x42')](handleError(_0x1da5ce,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index b9e21fb..00615b8 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 _0x0689=['define','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x0689,0x161));var _0x9068=function(_0x4eb8e1,_0x52fb85){_0x4eb8e1=_0x4eb8e1-0x0;var _0x3a9f0a=_0x0689[_0x4eb8e1];return _0x3a9f0a;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7aaf=['./cmCompany.attributes','exports','CmCompany','lodash','../../config/logger','api','request-promise','rimraf'];(function(_0x2cb4d2,_0x395aea){var _0x17f6f4=function(_0x51e03e){while(--_0x51e03e){_0x2cb4d2['push'](_0x2cb4d2['shift']());}};_0x17f6f4(++_0x395aea);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0x167307,_0x182379){_0x167307=_0x167307-0x0;var _0x44911a=_0x7aaf[_0x167307];return _0x44911a;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var logger=require(_0xf7aa('0x1'))(_0xf7aa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7aa('0x4'));var config=require('../../config/environment');var attributes=require(_0xf7aa('0x5'));module[_0xf7aa('0x6')]=function(_0x1babcd,_0xf02ed5){return _0x1babcd['define'](_0xf7aa('0x7'),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 b4e3581..9cafc39 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 _0x9839=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9839,0xa0));var _0x9983=function(_0x1140e5,_0x56a491){_0x1140e5=_0x1140e5-0x0;var _0x1a9a62=_0x9839[_0x1140e5];return _0x1a9a62;};'use strict';var _=require(_0x9983('0x0'));var util=require(_0x9983('0x1'));var moment=require(_0x9983('0x2'));var BPromise=require(_0x9983('0x3'));var rs=require(_0x9983('0x4'));var fs=require('fs');var Redis=require(_0x9983('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9983('0x6'));var logger=require(_0x9983('0x7'))(_0x9983('0x8'));var config=require(_0x9983('0x9'));var jayson=require(_0x9983('0xa'));var client=jayson[_0x9983('0xb')][_0x9983('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c4e44,_0x28b5f4,_0x56b3c5){return new BPromise(function(_0x9f562e,_0x2957d6){return client[_0x9983('0xd')](_0x1c4e44,_0x56b3c5)[_0x9983('0xe')](function(_0x2a3f92){logger[_0x9983('0xf')](_0x9983('0x10'),_0x28b5f4,_0x9983('0x11'));logger[_0x9983('0x12')](_0x9983('0x13'),_0x28b5f4,_0x9983('0x11'),JSON[_0x9983('0x14')](_0x2a3f92));if(_0x2a3f92[_0x9983('0x15')]){if(_0x2a3f92[_0x9983('0x15')][_0x9983('0x16')]===0x1f4){logger[_0x9983('0x15')](_0x9983('0x10'),_0x28b5f4,_0x2a3f92[_0x9983('0x15')][_0x9983('0x17')]);return _0x2957d6(_0x2a3f92[_0x9983('0x15')][_0x9983('0x17')]);}logger[_0x9983('0x15')]('CmCompany,\x20%s,\x20%s',_0x28b5f4,_0x2a3f92[_0x9983('0x15')]['message']);return _0x9f562e(_0x2a3f92[_0x9983('0x15')][_0x9983('0x17')]);}else{logger[_0x9983('0xf')]('CmCompany,\x20%s,\x20%s',_0x28b5f4,_0x9983('0x11'));_0x9f562e(_0x2a3f92[_0x9983('0x18')][_0x9983('0x17')]);}})[_0x9983('0x19')](function(_0x14b1e8){logger[_0x9983('0x15')](_0x9983('0x10'),_0x28b5f4,_0x14b1e8);_0x2957d6(_0x14b1e8);});});}
\ No newline at end of file
+var _0xa8bb=['request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x22cd75,_0x3bc137){var _0x1db0cc=function(_0x429a4a){while(--_0x429a4a){_0x22cd75['push'](_0x22cd75['shift']());}};_0x1db0cc(++_0x3bc137);}(_0xa8bb,0x131));var _0xba8b=function(_0x34fee5,_0x1de058){_0x34fee5=_0x34fee5-0x0;var _0x4993b2=_0xa8bb[_0x34fee5];return _0x4993b2;};'use strict';var _=require(_0xba8b('0x0'));var util=require(_0xba8b('0x1'));var moment=require(_0xba8b('0x2'));var BPromise=require(_0xba8b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba8b('0x4'));var db=require(_0xba8b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xba8b('0x6'));var config=require(_0xba8b('0x7'));var jayson=require(_0xba8b('0x8'));var client=jayson[_0xba8b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25566e,_0x1ef0e7,_0x3c462e){return new BPromise(function(_0x529d19,_0xddc0cc){return client[_0xba8b('0xa')](_0x25566e,_0x3c462e)[_0xba8b('0xb')](function(_0x20c793){logger[_0xba8b('0xc')](_0xba8b('0xd'),_0x1ef0e7,_0xba8b('0xe'));logger[_0xba8b('0xf')](_0xba8b('0x10'),_0x1ef0e7,'request\x20sent',JSON[_0xba8b('0x11')](_0x20c793));if(_0x20c793[_0xba8b('0x12')]){if(_0x20c793[_0xba8b('0x12')]['code']===0x1f4){logger[_0xba8b('0x12')](_0xba8b('0xd'),_0x1ef0e7,_0x20c793[_0xba8b('0x12')]['message']);return _0xddc0cc(_0x20c793['error'][_0xba8b('0x13')]);}logger[_0xba8b('0x12')](_0xba8b('0xd'),_0x1ef0e7,_0x20c793[_0xba8b('0x12')][_0xba8b('0x13')]);return _0x529d19(_0x20c793['error']['message']);}else{logger[_0xba8b('0xc')]('CmCompany,\x20%s,\x20%s',_0x1ef0e7,_0xba8b('0xe'));_0x529d19(_0x20c793['result'][_0xba8b('0x13')]);}})[_0xba8b('0x14')](function(_0x38bc83){logger[_0xba8b('0x12')](_0xba8b('0xd'),_0x1ef0e7,_0x38bc83);_0xddc0cc(_0x38bc83);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 2b4af13..f749c6d 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 _0x0d99=['show','/:id/contacts','isAuthenticated','getContacts','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','describe','/:id'];(function(_0x2cba48,_0x72499){var _0x11db2e=function(_0x351e9a){while(--_0x351e9a){_0x2cba48['push'](_0x2cba48['shift']());}};_0x11db2e(++_0x72499);}(_0x0d99,0x1a7));var _0x90d9=function(_0x2ba271,_0x459df0){_0x2ba271=_0x2ba271-0x0;var _0x21e60d=_0x0d99[_0x2ba271];return _0x21e60d;};'use strict';var multer=require(_0x90d9('0x0'));var util=require(_0x90d9('0x1'));var path=require(_0x90d9('0x2'));var timeout=require(_0x90d9('0x3'));var express=require(_0x90d9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90d9('0x5'));var interaction=require(_0x90d9('0x6'));var config=require(_0x90d9('0x7'));var controller=require(_0x90d9('0x8'));router[_0x90d9('0x9')]('/',auth['isAuthenticated'](),controller[_0x90d9('0xa')]);router[_0x90d9('0x9')](_0x90d9('0xb'),auth['isAuthenticated'](),controller[_0x90d9('0xc')]);router[_0x90d9('0x9')](_0x90d9('0xd'),auth['isAuthenticated'](),controller[_0x90d9('0xe')]);router[_0x90d9('0x9')](_0x90d9('0xf'),auth[_0x90d9('0x10')](),controller[_0x90d9('0x11')]);router[_0x90d9('0x12')]('/',auth[_0x90d9('0x10')](),controller['create']);router['post'](_0x90d9('0xf'),auth['isAuthenticated'](),controller['addContacts']);router[_0x90d9('0x13')]('/:id',auth[_0x90d9('0x10')](),controller[_0x90d9('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x90d9('0x15')]);module[_0x90d9('0x16')]=router;
\ No newline at end of file
+var _0x647d=['/:id','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','post','create','addContacts','put'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x647d,0x101));var _0xd647=function(_0x400cfc,_0x5c7111){_0x400cfc=_0x400cfc-0x0;var _0x12bf74=_0x647d[_0x400cfc];return _0x12bf74;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd647('0x0'));var express=require('express');var router=express[_0xd647('0x1')]();var fs_extra=require(_0xd647('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd647('0x3'));var controller=require(_0xd647('0x4'));router[_0xd647('0x5')]('/',auth[_0xd647('0x6')](),controller[_0xd647('0x7')]);router[_0xd647('0x5')](_0xd647('0x8'),auth['isAuthenticated'](),controller[_0xd647('0x9')]);router[_0xd647('0x5')]('/:id',auth[_0xd647('0x6')](),controller[_0xd647('0xa')]);router[_0xd647('0x5')](_0xd647('0xb'),auth[_0xd647('0x6')](),controller['getContacts']);router[_0xd647('0xc')]('/',auth['isAuthenticated'](),controller[_0xd647('0xd')]);router[_0xd647('0xc')](_0xd647('0xb'),auth[_0xd647('0x6')](),controller[_0xd647('0xe')]);router[_0xd647('0xf')](_0xd647('0x10'),auth[_0xd647('0x6')](),controller[_0xd647('0x11')]);router[_0xd647('0x12')](_0xd647('0x10'),auth['isAuthenticated'](),controller[_0xd647('0x13')]);module[_0xd647('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 11a20b2..813f8ca 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 _0x72ce=['NOW','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x32512c,_0x4957b3){var _0x2778c1=function(_0x17445f){while(--_0x17445f){_0x32512c['push'](_0x32512c['shift']());}};_0x2778c1(++_0x4957b3);}(_0x72ce,0x1f1));var _0xe72c=function(_0x18a30c,_0x362d2e){_0x18a30c=_0x18a30c-0x0;var _0x16b964=_0x72ce[_0x18a30c];return _0x16b964;};'use strict';var _=require(_0xe72c('0x0'));var Sequelize=require(_0xe72c('0x1'));module[_0xe72c('0x2')]={'firstName':{'type':Sequelize[_0xe72c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xe72c('0x3')]},'street':{'type':Sequelize[_0xe72c('0x3')]},'postalCode':{'type':Sequelize[_0xe72c('0x3')]},'city':{'type':Sequelize[_0xe72c('0x3')]},'country':{'type':Sequelize[_0xe72c('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xe72c('0x3')]},'mobile':{'type':Sequelize[_0xe72c('0x3')]},'fax':{'type':Sequelize[_0xe72c('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xe72c('0x3')]},'fb_data':{'type':Sequelize[_0xe72c('0x3')]},'twitter':{'type':Sequelize[_0xe72c('0x3')]},'skype':{'type':Sequelize[_0xe72c('0x3')]},'teams':{'type':Sequelize[_0xe72c('0x3')]},'viber':{'type':Sequelize[_0xe72c('0x3')]},'line':{'type':Sequelize[_0xe72c('0x3')]},'wechat':{'type':Sequelize[_0xe72c('0x3')]},'telegram':{'type':Sequelize[_0xe72c('0x3')]},'UserId':{'type':Sequelize[_0xe72c('0x4')]},'priority':{'type':Sequelize[_0xe72c('0x4')](0x2)[_0xe72c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe72c('0x6')],'defaultValue':Sequelize[_0xe72c('0x7')]}};
\ No newline at end of file
+var _0xce33=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x5918e7,_0xe7ea50){var _0x167b79=function(_0x5a5bb5){while(--_0x5a5bb5){_0x5918e7['push'](_0x5918e7['shift']());}};_0x167b79(++_0xe7ea50);}(_0xce33,0x171));var _0x3ce3=function(_0x16ce60,_0x1fb180){_0x16ce60=_0x16ce60-0x0;var _0x2c7947=_0xce33[_0x16ce60];return _0x2c7947;};'use strict';var _=require(_0x3ce3('0x0'));var Sequelize=require(_0x3ce3('0x1'));module[_0x3ce3('0x2')]={'firstName':{'type':Sequelize[_0x3ce3('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3ce3('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3ce3('0x3')]},'country':{'type':Sequelize[_0x3ce3('0x3')]},'dateOfBirth':{'type':Sequelize[_0x3ce3('0x3')]},'description':{'type':Sequelize[_0x3ce3('0x4')]},'phone':{'type':Sequelize[_0x3ce3('0x3')]},'mobile':{'type':Sequelize[_0x3ce3('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3ce3('0x3')]},'url':{'type':Sequelize[_0x3ce3('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x3ce3('0x3')]},'twitter':{'type':Sequelize[_0x3ce3('0x3')]},'skype':{'type':Sequelize[_0x3ce3('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x3ce3('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x3ce3('0x3')]},'telegram':{'type':Sequelize[_0x3ce3('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x3ce3('0x5')](0x2)[_0x3ce3('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3ce3('0x7')],'defaultValue':Sequelize[_0x3ce3('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index e93631a..44566fe 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 _0x7b83=['castTo','DATE','buildExpression','text','start','hasOwnProperty','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','\x20=\x20?','tag','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','order','DESC','having','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','c.firstName','c.lastName','c.phone','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','findAll','displayName','alias','custom','columnName','body','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','error','color','$and','omit','format','cf_%d','cm_contacts','setFields','phone','rawAttributes','options','getTags','nolimit','setTags','ids','includeAll','include','ContactId','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','path','meta','import','binding','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','exit','error\x20child\x20process','mail','chat','fax','whatsapp','voice','-createdAt','toLowerCase','Invalid\x20channel','channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','User','fullname','startCase','Account','closed','closedAt','secondDisposition','thirdDisposition','Owner','browserName','deviceModel','ratingType','ratingValue','referer','substatus','openchannel','externalUrl','threadId','Interaction','findAndCountAll','flatten','reverse','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','CmContact','describe','length','keys','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','attributes','intersection','fields','sort','where','filters','pick','field','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','expr','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','dateOfBirth','datetime'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7b83,0x1e7));var _0x37b8=function(_0x512e41,_0x4a7db2){_0x512e41=_0x512e41-0x0;var _0x5aa4c0=_0x7b83[_0x512e41];return _0x5aa4c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37b8('0x0'));var zipdir=require(_0x37b8('0x1'));var jsonpatch=require(_0x37b8('0x2'));var rp=require(_0x37b8('0x3'));var moment=require('moment');var BPromise=require(_0x37b8('0x4'));var Mustache=require('mustache');var util=require(_0x37b8('0x5'));var path=require('path');var sox=require(_0x37b8('0x6'));var csv=require(_0x37b8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37b8('0x8'));var _=require(_0x37b8('0x9'));var squel=require('squel');var crypto=require(_0x37b8('0xa'));var jsforce=require(_0x37b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x37b8('0x7'));var querystring=require('querystring');var Papa=require(_0x37b8('0xc'));var Redis=require(_0x37b8('0xd'));var authService=require(_0x37b8('0xe'));var qs=require(_0x37b8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x37b8('0x10'))(_0x37b8('0x11'));var utils=require('../../config/utils');var config=require(_0x37b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x37b8('0x13'))['db'];config[_0x37b8('0x14')]=_['defaults'](config[_0x37b8('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x37b8('0x15'))(new Redis(config[_0x37b8('0x14')]));require(_0x37b8('0x16'))[_0x37b8('0x17')](socket);function respondWithStatusCode(_0x3e9f60,_0x5552ea){_0x5552ea=_0x5552ea||0xcc;return function(_0x19d3b8){if(_0x19d3b8){return _0x3e9f60[_0x37b8('0x18')](_0x5552ea);}return _0x3e9f60[_0x37b8('0x19')](_0x5552ea)['end']();};}function respondWithResult(_0x4cc55b,_0x30831f){_0x30831f=_0x30831f||0xc8;return function(_0x5db765){if(_0x5db765){return _0x4cc55b['status'](_0x30831f)[_0x37b8('0x1a')](_0x5db765);}};}function respondWithFilteredResult(_0x1ac6ea,_0x1d0a04){return function(_0x312427){if(_0x312427){var _0x2eda04=_0x312427['count'],_0x2d09ad=_0x1d0a04[_0x37b8('0x1b')],_0x27adb4=_0x1d0a04[_0x37b8('0x1b')]+_0x1d0a04[_0x37b8('0x1c')],_0x47c462;if(_0x27adb4>=_0x2eda04){_0x27adb4=_0x2eda04;_0x47c462=0xc8;}else{_0x47c462=0xce;}_0x1ac6ea[_0x37b8('0x19')](_0x47c462);return _0x1ac6ea[_0x37b8('0x1d')](_0x37b8('0x1e'),_0x2d09ad+'-'+_0x27adb4+'/'+_0x2eda04)[_0x37b8('0x1a')](_0x312427);}return null;};}function patchUpdates(_0x2f3408){return function(_0x272d50){try{jsonpatch[_0x37b8('0x1f')](_0x272d50,_0x2f3408,!![]);}catch(_0x433db9){return BPromise[_0x37b8('0x20')](_0x433db9);}return _0x272d50[_0x37b8('0x21')]();};}function saveUpdates(_0x41cff9,_0x2d1ce8){return function(_0x497a8e){if(_0x497a8e){return _0x497a8e[_0x37b8('0x22')](_0x41cff9)[_0x37b8('0x23')](function(_0x1f3e3b){return _0x1f3e3b;});}return null;};}function removeEntity(_0x1e609f,_0x572b5e){return function(_0x354a2f){if(_0x354a2f){return _0x354a2f[_0x37b8('0x24')]()['then'](function(){_0x1e609f[_0x37b8('0x19')](0xcc)[_0x37b8('0x25')]();});}};}function handleEntityNotFound(_0x4c070b,_0x132d96){return function(_0x314aa7){if(!_0x314aa7){_0x4c070b['sendStatus'](0x194);}return _0x314aa7;};}function handleError(_0xe11957,_0x166e7c){_0x166e7c=_0x166e7c||0x1f4;return function(_0x1a06fc){logger['error'](_0x1a06fc[_0x37b8('0x26')]);if(_0x1a06fc[_0x37b8('0x27')]){delete _0x1a06fc[_0x37b8('0x27')];}_0xe11957[_0x37b8('0x19')](_0x166e7c)['send'](_0x1a06fc);};}exports['index']=function(_0x1060c8,_0x26a1d0){var _0x3ecf87={},_0x4750c7={},_0x105c36={'count':0x0,'rows':[]};return db[_0x37b8('0x28')][_0x37b8('0x29')]()['then'](function(_0xfec98e){var _0x32f8d5=[];for(var _0x27a779=0x0;_0x27a779
','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','127.0.0.1','moment','randomstring','util','node-tnef','../../../config/logger','address','anonymous','generate','@xcally.com','head','name','split','length','slice','value','pop'];(function(_0x29a5b4,_0xd53d0c){var _0x46bae0=function(_0x156743){while(--_0x156743){_0x29a5b4['push'](_0x29a5b4['shift']());}};_0x46bae0(++_0xd53d0c);}(_0x7a17,0x194));var _0x77a1=function(_0x1e6728,_0x40df2b){_0x1e6728=_0x1e6728-0x0;var _0x4be508=_0x7a17[_0x1e6728];return _0x4be508;};'use strict';var _=require('lodash');var moment=require(_0x77a1('0x0'));var random=require(_0x77a1('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x77a1('0x2'));var tnef=require(_0x77a1('0x3'));var logger=require(_0x77a1('0x4'))('email');var config=require('../../../config/environment');function getAddress(_0x1dc077){var _0x19b900=_['head'](_0x1dc077['value']);return _0x19b900&&_0x19b900[_0x77a1('0x5')]?_0x19b900[_0x77a1('0x5')]:_0x77a1('0x6')+random[_0x77a1('0x7')](0x6)+_0x77a1('0x8');}function getFirstName(_0x151c15){var _0x3752e6=_[_0x77a1('0x9')](_0x151c15['value']);if(_0x3752e6&&_0x3752e6[_0x77a1('0xa')]){var _0x4bc588=_0x3752e6['name'][_0x77a1('0xb')](/\s+/);return _0x4bc588[_0x77a1('0xc')]?_0x4bc588[_0x77a1('0xd')](0x0,-0x1)['join']('\x20'):_0x3752e6[_0x77a1('0xa')];}return'Anonymous';}function getLastName(_0x4ffd1c){var _0x2687fc=_['head'](_0x4ffd1c[_0x77a1('0xe')]);if(_0x2687fc&&_0x2687fc[_0x77a1('0xa')]){var _0x30f4fd=_0x2687fc[_0x77a1('0xa')]['split'](/\s+/);return _0x30f4fd[_0x77a1('0xc')]>0x1?_0x30f4fd[_0x77a1('0xf')]():'';}return'';}function getMails(_0x306f71,_0x5d783c){var _0x33d6d5='';for(var _0x555cdc=0x0;_0x555cdc<_0x5d783c[_0x77a1('0xe')][_0x77a1('0xc')];_0x555cdc+=0x1){if(_0x5d783c[_0x77a1('0xe')][_0x555cdc][_0x77a1('0x5')]!==_0x306f71){if(!_[_0x77a1('0x10')](_0x33d6d5)){_0x33d6d5+=',';}_0x33d6d5+=_0x5d783c[_0x77a1('0xe')][_0x555cdc][_0x77a1('0xa')]||_0x5d783c['value'][_0x555cdc]['address']||'';_0x33d6d5+='\x20<';_0x33d6d5+=_0x5d783c[_0x77a1('0xe')][_0x555cdc][_0x77a1('0x5')]?_0x5d783c[_0x77a1('0xe')][_0x555cdc][_0x77a1('0x5')]:_0x77a1('0x6')+random['generate'](0x6)+_0x77a1('0x8');_0x33d6d5+='>';}}return _0x33d6d5;}function parseEmail(_0x7afdd8,_0x413e7f,_0x16bb2b){if(_0x413e7f[_0x77a1('0x11')]){var _0x200791=/